/* Arion2 Wiki - modern theme.
   Dark neutral surfaces, one warm gold accent taken from the Arion2 logo,
   rounded cards, glass top bar. Game icons, class faces and monster portraits
   carry the Metin2 flavour; the tooltip keeps the client's exact colours. */

:root {
  --bg: #0b0c10;
  --bg-2: #0f1117;
  --surface: #14161d;
  --surface-2: #1a1d26;
  --surface-3: #222633;
  --border: #262a36;
  --border-hi: #353a4a;
  --text: #e9e7e3;
  --text-2: #b9b6b0;
  --muted: #8b8f9a;
  --accent: #e8b460;
  --accent-2: #f5cf8a;
  --accent-soft: #e8b4601f;
  --red: #ef5a45;
  --green: #5fcf8a;
  --blue: #6aa8ff;
  --violet: #a996ff;

  /* in-game tooltip colours (uiToolTip.py) */
  --tt-title: #f2e7c1;
  --tt-pos: #8ab98e;
  --tt-cond: #beb47d;
  --tt-text: #c2c2c2;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 #ffffff08 inset, 0 12px 32px -16px #000d;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Cinzel", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  color: var(--text);
  font: 15px/1.6 var(--font);
  background:
    radial-gradient(900px 480px at 85% -10%, #e8b4601a, transparent 60%),
    radial-gradient(700px 420px at 0% 0%, #ef5a4512, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #fff; }
::selection { background: var(--accent); color: #1a1206; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* --------------------------------------------------- Backdrop (hype layer) */

/* Fixed behind everything: a giant outlined ARION2, two heroes rendered from
   the game's armour models fading out of the dark, and rising embers. */
.bg-fx { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
body > :not(.bg-fx) { position: relative; z-index: 1; }
body > .topbar { position: sticky; z-index: 50; }

.bg-word {
  position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%);
  font: 700 clamp(9rem, 24vw, 26rem)/1 var(--display); letter-spacing: .02em;
  color: transparent;
  -webkit-text-stroke: 1px #e8b46017;
  background: linear-gradient(180deg, #e8b46010, transparent 70%);
  -webkit-background-clip: text; background-clip: text;
  white-space: nowrap; user-select: none;
}

.bg-hero {
  position: absolute; bottom: -4vh;
  height: min(96vh, 980px); width: auto;
  opacity: .42;
  filter: saturate(.9) contrast(1.05) drop-shadow(0 0 40px #e8b46033);
  -webkit-mask-image: linear-gradient(0deg, transparent 0%, #000 32%, #000 70%, transparent 100%);
  mask-image: linear-gradient(0deg, transparent 0%, #000 32%, #000 70%, transparent 100%);
  animation: hero-in 1.4s ease-out both;
}
/* the renders look left; mirror the left one so both face the page */
.bg-hero-left { left: max(-12vw, calc(50% - 1150px)); transform: scaleX(-1); }
.bg-hero-right { right: max(-12vw, calc(50% - 1150px)); }
@keyframes hero-in { from { opacity: 0; translate: 0 30px; } }

.bg-embers { position: absolute; inset: 0; width: 100%; height: 100%; }

/* keep the reading area calm: a soft vignette behind the content column */
.bg-fx::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 620px 115% at 50% 40%, #0b0c10d9 0%, #0b0c1099 60%, transparent 100%),
    linear-gradient(0deg, #0b0c10 0%, transparent 22%);
}

@media (max-width: 860px) {
  .bg-hero { opacity: .12; height: 70vh; }
  .bg-hero-left { left: -38vw; }
  .bg-hero-right { right: -38vw; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-hero { animation: none; }
  .bg-embers { display: none; }
}

/* --------------------------------------------------------------- Top bar */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: #0b0c10cc;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; filter: drop-shadow(0 2px 6px #e8b46055); }
.brand b { color: var(--accent); font-weight: 700; }
.menu { display: flex; gap: 2px; }
.menu a { padding: 8px 14px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: .93rem; transition: color .15s, background .15s; }
.menu a:hover { color: var(--text); background: #ffffff0a; }
.menu a.active { color: var(--text); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-hi); }

.lang-switch { display: flex; margin-left: auto; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.lang-switch a { padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.lang-switch a:hover { color: var(--text); }
.lang-switch a.active { color: #1b1206; background: var(--accent); }
.lang-switch + .search { margin-left: 0; }
.search { position: relative; margin-left: auto; width: 340px; }
.search > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 40px 0 38px;
  font: 14px var(--font); color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  padding: 1px 7px; font: 600 11px var(--font); color: var(--muted);
  border: 1px solid var(--border-hi); border-radius: 6px; background: var(--surface-2);
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px -12px #000e;
}
.search-results a { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a:focus { background: var(--surface-3); }
.search-results .sr-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--bg-2); }
.search-results .sr-icon img { max-width: 26px; max-height: 26px; }
.search-results .sr-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.search-results .sr-kind { font-size: .72rem; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.search-results .empty { padding: 10px; color: var(--muted); }

/* ------------------------------------------------- Forum index (home) */

/* Board groups like a forum index: a header bar per group, one row per
   section with icon, description, sub-links, counts and a featured entry. */
.forum-head {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); align-items: center; gap: 28px;
  margin-top: 24px; padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
}
.forum-head:focus-within { overflow: visible; z-index: 3; }
.forum-head-bg {
  position: absolute; inset: 0; z-index: 0; border-radius: inherit; overflow: hidden;
  background: url("/static/img/banner.webp") center 35% / cover;
  filter: blur(40px) saturate(1.3) brightness(.35);
}
.forum-banner { position: relative; z-index: 1; display: block; border-radius: 12px; overflow: hidden; border: 1px solid #ffffff1f; box-shadow: 0 20px 40px -20px #000; }
.forum-banner img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.forum-head-text { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 10px; }
.forum-head-text h1 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; }
.forum-head-text h1 span { color: var(--accent); }
.forum-head-text p { margin: 0; color: var(--text-2); max-width: 560px; }
.search-hero { width: 100%; max-width: 560px; margin: 6px 0 0; }
.search-hero input { height: 52px; padding: 0 20px 0 48px; font-size: 1rem; background: var(--bg-2); border: 1px solid #e8b46055; }
.search-hero > svg { left: 18px; font-size: 18px; color: var(--accent); }
.search-hero .search-results { z-index: 5; }
.home .bg-hero { display: none; }

.forum { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.forum-group { margin-bottom: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.forum-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 18px;
  background: linear-gradient(90deg, #e8b4601f, transparent 70%), var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.forum-group-head h2 { margin: 0; font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2); }
.forum-group-head h2::before { display: none; }

.board {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 150px 230px; align-items: center; gap: 16px;
  padding: 14px 18px;
}
.board + .board { border-top: 1px solid var(--border); }
.board:hover { background: #ffffff04; }
.board-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px; background: var(--bg-2); color: var(--accent); }
.board-icon .slot { --cell: 44px; background: none; box-shadow: none; }
.board-icon .slot-h2, .board-icon .slot-h3 { height: 50px; }
.board-icon .slot img { max-height: 46px; }
.board-icon .mob-big { width: 50px; height: 50px; }
.board-icon .side-ico { width: 56px; height: 56px; background: none; font-size: 26px; }
.board-art { width: 56px; height: 56px; object-fit: cover; object-position: 50% 10%; border-radius: 12px; }
.board-main { min-width: 0; }
.board-title { font-size: 1.02rem; font-weight: 700; color: var(--text); }
.board-title:hover { color: var(--accent-2); }
.board-main p { margin: 2px 0 0; font-size: .86rem; color: var(--muted); }
.board-subs { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.board-subs a { position: relative; padding-left: 12px; font-size: .8rem; color: var(--text-2); }
.board-subs a::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 1px; transform: rotate(45deg); background: var(--accent); opacity: .7; }
.board-subs a:hover { color: var(--accent-2); }
.board-stats { display: flex; gap: 14px; justify-content: flex-end; text-align: right; }
.board-stats div { display: flex; flex-direction: column; }
.board-stats b { font-size: 1rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.board-stats span { font-size: .72rem; color: var(--muted); }
.board-last { display: flex; align-items: center; gap: 10px; min-width: 0; padding-left: 16px; border-left: 1px solid var(--border); color: var(--text); }
.board-last:hover { color: var(--accent-2); }
.board-last > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.board-last b { font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-last em { font-style: normal; font-size: .74rem; color: var(--muted); }
.board-last .slot, .board-last .mob-badge, .board-last .face { --cell: 32px; width: 32px; height: 32px; flex: none; }
.board-last .slot-big img { width: auto; max-height: 28px; }
.board-last .side-ico { flex: none; }
.board-last .ev-prize { flex: none; font-size: .7rem; }

.forum-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.side-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.side-box h3 { margin: 0; padding: 11px 16px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2);
  background: var(--surface-2); border-bottom: 1px solid var(--border); }
.side-stats div { display: flex; justify-content: space-between; padding: 8px 16px; font-size: .88rem; }
.side-stats div + div { border-top: 1px solid var(--border); }
.side-stats span { color: var(--muted); }
.side-stats b { font-weight: 700; font-variant-numeric: tabular-nums; }
.side-classes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 12px; }
.side-classes a { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; color: var(--text-2); font-size: .86rem; font-weight: 600; }
.side-classes a:hover { background: var(--surface-2); color: var(--text); }
.side-list a { display: flex; align-items: center; gap: 10px; padding: 8px 14px; color: var(--text); font-size: .86rem; }
.side-list a + a { border-top: 1px solid var(--border); }
.side-list a:hover { background: var(--surface-2); }
.side-list .side-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-list b { font-size: .74rem; color: #ffb2a6; }

/* ---------------------------------------------------------------- Layout */

.page { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 32px; padding-top: 28px; padding-bottom: 72px; align-items: start; }
.page-portal { grid-template-columns: minmax(0, 1fr); padding-top: 12px; }

.sidebar { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; }
.side-nav h3 { margin: 18px 10px 6px; font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.side-nav h3:first-child { margin-top: 0; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px; border-radius: 8px;
  color: var(--text-2); font-size: .9rem; font-weight: 500;
  transition: background .12s, color .12s;
}
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav .slot, .side-nav .mob-badge { --cell: 24px; width: 24px; height: 24px; border-radius: 6px; }
.side-nav .mob-badge { border-radius: 50%; }
.side-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 6px; background: var(--surface-2); color: var(--accent); font-size: 14px; }

.content { min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); margin: 0 0 10px; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--accent-2); }
.crumbs .sep { color: var(--border-hi); }

.window > h1:first-child {
  margin: 0 0 22px;
  font: 800 clamp(1.7rem, 3vw, 2.3rem)/1.15 var(--font); letter-spacing: -.025em;
  color: var(--text);
}

h2 {
  display: flex; align-items: center; gap: 10px;
  margin: 36px 0 14px;
  font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; color: var(--text);
}
h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); flex: none; }
h3 { margin: 18px 0 8px; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.lead { font-size: 1.02rem; color: var(--text-2); margin-top: 0; }
.muted { color: var(--muted); }
.note { margin: -6px 0 12px; font-size: .85rem; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }

/* ------------------------------------------------------------ Home sections */

.section { margin-top: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 1.3rem; }
.section-more { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--text-2); }
.section-more:hover { color: var(--accent-2); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 132px; padding: 16px;
  color: var(--text);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .18s, border-color .18s, box-shadow .18s;
  overflow: hidden;
}
.tile::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, #e8b46022, transparent 70%); transition: opacity .2s; opacity: .6; }
.tile:hover { color: var(--text); transform: translateY(-3px); border-color: #e8b46066; box-shadow: 0 18px 36px -18px #000; }
.tile:hover::after { opacity: 1; }
.tile .slot { margin-bottom: auto; }
.tile strong { margin-top: 12px; font-weight: 700; font-size: .95rem; }
.tile span { font-size: .8rem; color: var(--muted); }

.class-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.class-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 20px 14px 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
}
.class-head { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text); }
.class-head strong { font-weight: 700; }
.class-head:hover { color: var(--accent-2); }
.class-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.class-links a {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 3px; border-radius: 999px;
  font-size: .76rem; font-weight: 500; color: var(--text-2);
  background: var(--bg-2); border: 1px solid var(--border);
}
.class-links a:hover { color: var(--text); border-color: var(--border-hi); }
.class-links .slot { --cell: 20px; width: 20px; height: 20px; border-radius: 50%; }

.bento { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; }
.bento > .section { margin-top: 36px; }

.boss-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.boss-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 18px 10px 14px; text-align: center; color: var(--text);
  background: radial-gradient(120% 90% at 50% 0%, #ef5a4524, transparent 60%), var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .18s, border-color .18s;
}
.boss-card:hover { color: var(--text); transform: translateY(-3px); border-color: #ef5a4566; }
.boss-card .mob-badge { margin-bottom: 10px; }
.boss-card strong { font-size: .9rem; font-weight: 700; line-height: 1.3; }
.boss-card span { font-size: .75rem; color: var(--muted); }
.boss-card b { margin-top: 6px; padding: 2px 10px; border-radius: 999px; font-size: .72rem; color: #ffb2a6; background: #ef5a451f; }

.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.guide-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .18s, transform .18s;
}
.guide-card:hover { color: var(--text); border-color: #e8b46066; transform: translateY(-2px); }
.guide-card strong { font-size: 1rem; }
.guide-icon { margin-bottom: 8px; }
.guide-icon:empty { display: none; }
.guide-icon .slot-big, .guide-icon .mob-big, .guide-icon .face-big { --cell: 48px; width: 48px; height: 48px; }
.guide-icon .slot-big.slot-h2, .guide-icon .slot-big.slot-h3 { height: 48px; }
.guide-icon .slot-big img { width: auto; max-height: 42px; }

/* data tables inside guides */
.guide-block { margin: 16px 0 22px; font-size: .92rem; }
.guide-block td { color: var(--text-2); white-space: normal; }
.guide-block th, .guide-block td { padding: 8px 10px; }
.guide-block th { white-space: normal; }
.guide-block .entity { gap: 8px; }
.guide-block td b { color: var(--accent-2); }
.guide-block .mob-badge + .mob-badge { margin-left: 4px; }
.prose h2 { color: var(--text); }
.prose h3 { color: var(--muted); }
.guide-card span { font-size: .88rem; color: var(--text-2); }
.guide-card em { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-style: normal; font-size: .82rem; font-weight: 600; color: var(--accent); }

/* ------------------------------------------------------------- Events */

.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.event-card {
  display: flex; flex-direction: column; overflow: hidden;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.event-card:hover { color: var(--text); transform: translateY(-3px); border-color: #e8b46066; box-shadow: 0 20px 40px -20px #000; }
.event-card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.event-card-body strong { font-size: 1.05rem; font-weight: 700; }
.event-card-body > span { font-size: .87rem; color: var(--text-2); }
.event-card-body em { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-style: normal; font-size: .82rem; font-weight: 600; color: var(--accent); }
.ev-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-badge, .ev-prize { padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.ev-badge { color: var(--text-2); background: var(--surface-3); }
.ev-prize { color: #1b1206; background: linear-gradient(180deg, #f6cf87, #e3a94f); }

/* the stage: two figures face to face over a coloured glow */
.stage {
  --glow: #ef5a45; --glow-2: #e8b460;
  position: relative; overflow: hidden;
  height: 180px;
  background:
    radial-gradient(60% 70% at 50% 100%, color-mix(in srgb, var(--glow) 55%, transparent), transparent 70%),
    radial-gradient(40% 60% at 50% 30%, color-mix(in srgb, var(--glow-2) 25%, transparent), transparent 70%),
    linear-gradient(180deg, #101218, #07080b);
}
.stage::after {
  /* floor */
  content: ""; position: absolute; left: 10%; right: 10%; bottom: -30px; height: 60px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--glow) 45%, transparent), transparent);
}
.stage-big { height: 340px; border-radius: 20px; border: 1px solid var(--border); }
.stage-red { --glow: #ef5a45; --glow-2: #e8b460; }
.stage-blue { --glow: #3f7fe0; --glow-2: #8fc4ff; }
.stage-orange { --glow: #ff7a1a; --glow-2: #8a3cff; }
.stage-green { --glow: #25a35f; --glow-2: #e84b3c; }
.stage-pink { --glow: #ff6fae; --glow-2: #ffd36b; }
.fighter { position: absolute; z-index: 1; bottom: 0; height: 100%; width: auto; filter: drop-shadow(0 0 18px #000c); }
.fighter-left { left: 2%; transform: scaleX(-1); }
.fighter-right { right: 2%; }
.event-card .fighter-left { left: -9%; }
.event-card .fighter-right { right: -9%; }
.vs {
  position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%) skewX(-8deg);
  font: 900 2.6rem/1 var(--font); letter-spacing: -.04em;
  background: linear-gradient(180deg, #fff6dc, #f5c46a 50%, #c9742a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--glow) 80%, transparent)) drop-shadow(0 2px 0 #000);
}
.stage-big .vs { font-size: 5rem; }

.event-hero { display: grid; gap: 22px; margin-bottom: 8px; }
.event-hero-text h1 { margin: 0 0 8px; font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; }
.ev-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 16px; }
.ev-fact { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ev-fact span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.ev-fact b { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.ev-note { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; font-size: .86rem; color: var(--text-2); background: var(--accent-soft); border: 1px solid #e8b46033; }

/* maps panel (home card + maps page) */
.kingdoms { width: 100%; border-collapse: separate; border-spacing: 6px; margin: -6px; width: calc(100% + 12px); font-size: .86rem; }
.kingdoms th, .kingdoms td { padding: 8px 6px; text-align: center; white-space: normal; border-radius: 8px; background: var(--bg-2); border: 0; }
.kingdoms tbody th { font-size: .72rem; font-weight: 600; color: var(--muted); background: none; text-transform: none; letter-spacing: 0; }
.kingdoms thead th:first-child { background: none; }
.kingdoms td a { font-weight: 500; }
.emp { font-size: .72rem !important; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff !important; }
.emp-red { background: linear-gradient(180deg, #e2553f, #a8301f) !important; }
.emp-yellow { background: linear-gradient(180deg, #e2ae3f, #a67512) !important; }
.emp-blue { background: linear-gradient(180deg, #4f8ae0, #2a58a8) !important; }
.psub { margin: 18px 0 8px; }
.map-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.map-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: .9rem; }
.map-list li:hover { background: var(--surface-2); }
.map-list span { font-size: .75rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.guide-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.guide-list li { display: flex; flex-direction: column; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.guide-list a { font-weight: 700; color: var(--text); }
.guide-list a:hover { color: var(--accent-2); }
.guide-list span { color: var(--muted); font-size: .88rem; }

/* ---------------------------------------------------------------- Tables */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; white-space: nowrap; }
th {
  position: sticky; top: 0;
  font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
tbody tr + tr { border-top: 1px solid var(--border); }
tbody tr { transition: background .1s; }
tbody tr:hover { background: #ffffff05; }
td { font-variant-numeric: tabular-nums; color: var(--text-2); }
td a { font-weight: 600; color: var(--text); }
td a:hover { color: var(--accent-2); }

.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.filter {
  flex: 1; max-width: 360px; height: 40px; padding: 0 14px;
  font: 14px var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.filter::placeholder { color: var(--muted); }
.filter:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.count { margin-left: auto; font-size: .82rem; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip, .plus-picker button {
  height: 32px; padding: 0 14px;
  font: 500 .84rem var(--font); color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; transition: all .12s;
}
.chip:hover, .plus-picker button:hover { color: var(--text); border-color: var(--border-hi); background: var(--surface-2); }
.chip.active, .plus-picker button.active { color: #1b1206; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.chips-sub .chip { height: 28px; font-size: .8rem; }

/* ----------------------------------------------------- Icons & badges */

.entity { display: inline-flex; align-items: center; gap: 10px; }

.slot {
  --cell: 36px;
  position: relative;
  display: inline-grid; place-items: center;
  width: var(--cell); height: var(--cell); flex: none;
  border-radius: 9px;
  background: radial-gradient(circle at 50% 35%, #2a2e3b, #12141a 80%);
  box-shadow: inset 0 0 0 1px #ffffff12, 0 2px 6px -2px #000;
}
.slot img { display: block; max-width: calc(var(--cell) - 6px); max-height: calc(var(--cell) - 6px); width: auto; height: auto; }
.slot-empty { font-weight: 700; font-size: .9rem; color: var(--muted); }
.slot-big { --cell: 56px; border-radius: 14px; }
.slot-big.slot-h2 { height: calc(var(--cell) * 1.7); }
.slot-big.slot-h3 { height: calc(var(--cell) * 2.3); }
.slot-big img { width: calc(var(--cell) - 14px); max-height: calc(100% - 10px); max-width: none; height: auto; object-fit: contain; }
.tile .slot-big { --cell: 48px; }

.mob-badge {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px;
  font-weight: 700; font-size: .9rem; color: var(--text);
  border-radius: 50%;
  background: var(--surface-3);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px #5fcf8a66;
}
.mob-boss { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--red), 0 0 16px -2px #ef5a4588; }
.mob-stone { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--violet), 0 0 16px -2px #a996ff77; }
.mob-badge.mob-map { border-radius: 8px; box-shadow: none; }
.mob-big { width: 76px; height: 76px; font-size: 1.8rem; }
.mob-badge.has-portrait { overflow: hidden; background: radial-gradient(circle at 50% 40%, #3b3f4d, #16181f 75%); }
.mob-badge.has-portrait img { width: 110%; height: 110%; margin-top: 8%; object-fit: contain; }
.mob-boss.has-portrait { background: radial-gradient(circle at 50% 40%, #5a2a24, #1a0f0e 75%); }
.mob-stone.has-portrait { background: radial-gradient(circle at 50% 40%, #3e3760, #14121f 75%); }
.infobox .mob-big { width: 108px; height: 108px; }

.face { display: inline-block; flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--surface-3); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px #e8b46088; }
.face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.face-big { width: 64px; height: 64px; }

.rank { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.rank-monster { color: #8ee6ad; background: #5fcf8a1f; }
.rank-boss { color: #ffb2a6; background: #ef5a4526; }
.rank-stone { color: #cfc3ff; background: #a996ff24; }

.plus { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; color: var(--accent-2); background: var(--accent-soft); white-space: nowrap; }
.jobs { font-size: .82rem; color: var(--muted); white-space: normal; }

/* --------------------------------------------- Article + game tooltip */

.article { display: flex; flex-direction: row-reverse; gap: 28px; align-items: flex-start; }
.article-body { flex: 1; min-width: 0; }
.article-body > :first-child { margin-top: 0; }

.infobox {
  position: sticky; top: 84px;
  width: 310px; flex: none;
  padding: 20px 16px 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow);
}
.infobox-icon { display: grid; place-items: center; margin-bottom: 14px; }
.plus-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 12px; }
.plus-picker button { height: 30px; padding: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* The item tooltip keeps the client's own look and colours */
.tooltip {
  padding: 12px 14px;
  text-align: center;
  font: 12.5px/1.6 Tahoma, Verdana, sans-serif;
  background: #050507;
  border: 1px solid #2d2f38;
  border-radius: 10px;
}
.tt-name { margin-bottom: 4px; font-weight: 700; font-size: 13.5px; color: var(--tt-title); }
.tt-cond { color: var(--tt-cond); }
.tt-pos { color: var(--tt-pos); }
.tt-jobs { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; margin-top: 6px; color: var(--tt-text); }
.tt-jobs span::before { content: "["; }
.tt-jobs span::after { content: "]"; }
.tt-desc { margin-top: 8px; padding-top: 8px; border-top: 1px solid #ffffff14; color: var(--tt-text); white-space: pre-line; }
.tooltip .rank { margin-top: 8px; }

.infobox .meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 14px 4px 0; font-size: .85rem; }
.infobox .meta dt { color: var(--muted); }
.infobox .meta dd { margin: 0; color: var(--text); text-align: right; font-weight: 500; }
.infobox .restrict { margin: 12px 4px 0; padding: 8px 10px; border-radius: 8px; font-size: .8rem; color: #ffb2a6; background: #ef5a4514; }
.infobox h3 { text-align: center; margin-top: 16px; }

.summary h2 { margin-top: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.facts dt, .facts dd { margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { font-weight: 600; color: var(--text); text-align: right; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }

/* ---------------------------------------------------------- Blacksmith */

.step { font-weight: 700; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.step i { font-style: normal; color: var(--muted); margin: 0 6px; }
.step-evolve { display: inline-flex; align-items: center; }
.step-evolve .entity span { font-weight: 600; }

.chance { display: inline-flex; align-items: center; gap: 10px; }
.chance-bar { position: relative; width: 70px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.chance-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.chance b { font-size: .86rem; font-weight: 600; min-width: 42px; }
.chance-hi i { background: var(--green); }
.chance-hi b { color: #8ee6ad; }
.chance-mid i { background: var(--accent); }
.chance-mid b { color: var(--accent-2); }
.chance-lo i { background: var(--red); }
.chance-lo b { color: #ff9a8a; }
.chance-drop i { background: linear-gradient(90deg, #b88437, var(--accent-2)); }
.chance-drop b { color: var(--text); }

.yang { font-weight: 600; color: var(--text); white-space: nowrap; }
.yang::after {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 6px; vertical-align: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff2b8, #e0a92e 55%, #8a5a12);
}
.yang.muted { font-weight: 400; color: var(--muted); }

.mats { display: flex; flex-wrap: wrap; gap: 6px; }
.mat {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px 2px 2px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
}
.mat:hover { border-color: #e8b46066; color: var(--text); }
.mat span { font-size: .8rem; font-weight: 500; }
.mat b { font-size: .8rem; color: var(--accent-2); font-weight: 700; }
.mat .slot { --cell: 26px; border-radius: 50%; }
.summary .mats { margin-top: 4px; }

.refine-table td, .stats-table td { vertical-align: middle; }
.refine-table td:has(.mats) { white-space: normal; min-width: 240px; }
.stats-table td:last-child { white-space: normal; color: #9fd6a6; font-weight: 500; }

.entity-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 20px; }

/* --------------------------------------------------------------- Guides */

.prose { font-size: 1rem; color: var(--text-2); }
.prose > p, .prose > ul, .prose > h2, .prose > h3 { max-width: 760px; }
.prose p { margin: 0 0 14px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); }
.prose code { padding: 1px 6px; border-radius: 6px; font: .88em ui-monospace, Consolas, monospace; color: var(--accent-2); background: var(--surface-2); border: 1px solid var(--border); }

/* --------------------------------------------------------------- Footer */

.foot { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: .85rem; }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.foot .brand { font-size: .95rem; }
.foot .brand img { width: 24px; height: 24px; }

/* ----------------------------------------------------------- Responsive */

@media (max-width: 1100px) {
  .class-grid { grid-template-columns: repeat(3, 1fr); }
  .bento { grid-template-columns: 1fr; gap: 0; }
  .forum { grid-template-columns: 1fr; }
  .forum-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .board { grid-template-columns: 56px minmax(0, 1fr) 130px; }
  .board-last { display: none; }
}

@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; height: auto; gap: 8px 14px; padding: 10px 0; }
  .menu { order: 3; width: 100%; overflow-x: auto; }
  .menu a { padding: 6px 12px; font-size: .88rem; }
  .topbar .search { width: auto; flex: 1; }
  .search kbd { display: none; }
  .forum-head { grid-template-columns: 1fr; gap: 16px; margin-top: 14px; padding: 12px; }
  .board { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
  .board-icon { width: 48px; height: 48px; }
  .board-stats { grid-column: 2; justify-content: flex-start; text-align: left; }
  .board-stats div { flex-direction: row; gap: 5px; align-items: baseline; }
  .page { grid-template-columns: 1fr; gap: 20px; }
  .sidebar { position: static; max-height: none; order: 2; }
  .side-nav ul { display: grid; grid-template-columns: 1fr 1fr; }
  .class-grid { grid-template-columns: repeat(2, 1fr); }
  .boss-grid { grid-template-columns: repeat(2, 1fr); }
  .article { flex-direction: column; }
  .infobox { position: static; width: 100%; }
  .stage-big { height: 220px; }
  .stage-big .vs { font-size: 3.2rem; }
  .toolbar { flex-wrap: wrap; }
  .filter { max-width: none; }
}
