/* ==========================================================================
   NOOB.WIKI — core stylesheet
   Modern "Roblox-like" wiki theme. Section accent colors are overridable via
   the data-game attribute on <body> so each game can have its own palette.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
  /* Base surfaces */
  --bg:          #0a0e1a;
  --bg-grad-1:   #0d1326;
  --bg-grad-2:   #0a0e1a;
  --surface:     #121a30;
  --surface-2:   #18223e;
  --surface-3:   #1f2c4d;
  --border:      rgba(255, 255, 255, 0.08);
  --border-str:  rgba(255, 255, 255, 0.16);

  /* Text */
  --text:        #eaf0ff;
  --text-dim:    #aab4d4;
  --text-faint:  #6b769a;

  /* Brand (noob.wiki) */
  --brand:       #6c5ce7;
  --brand-2:     #a55eea;

  /* Default accent (overridden per game) */
  --accent:      #2aa4ff;
  --accent-2:    #0a6fd6;
  --gold:        #fdd30b;
  --gold-2:      #ff8c1a;

  /* Rarity colors */
  --r-common:    #9aa6c0;
  --r-uncommon:  #4ad991;
  --r-rare:      #3aa0ff;
  --r-legendary: #b46bff;
  --r-mythical:  #ff5d73;

  /* Shape + motion */
  --radius:      16px;
  --radius-sm:   10px;
  --radius-lg:   24px;
  --shadow:      0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 60px -12px var(--accent);
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);

  --maxw:        1180px;
  --header-h:    64px;
}

/* Blox Fruits palette — blue + gold, matching the logo */
body[data-game="blox-fruits"] {
  --accent:   #2aa4ff;
  --accent-2: #0a6fd6;
  --gold:     #fdd30b;
  --gold-2:   #ff8c1a;
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }  /* ensure the hidden attr beats display:flex etc. */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); scrollbar-gutter: stable; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Safety net against accidental horizontal overflow. `clip` (not `hidden`)
     so it doesn't create a scroll container that would break the sticky header. */
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--gold); }
h1, h2, h3, h4 {
  font-family: "Baloo 2", "Inter", sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 80% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    radial-gradient(800px 500px at 0% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 65%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
}

/* ---- Layout helpers ------------------------------------------------------ */
.wrap { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }

/* ---- Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; width: min(100% - 40px, var(--maxw)); }

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}
.logo:hover { color: var(--text); }
.logo .mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  object-fit: contain;
  flex: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}
.logo .tld { color: var(--gold); }
/* Per-game brand: game name prominent, "noob.wiki" subtle beneath it */
.logo .brand { display: flex; flex-direction: column; justify-content: center; line-height: 1.05; }
.logo .brand-name { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--text); }
.logo .brand-sub { font-family: "Inter", sans-serif; font-weight: 600; font-size: 0.66rem; letter-spacing: 0.06em; color: var(--text-faint); margin-top: 1px; }
.logo .brand-sub .tld { color: var(--gold); }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.main-nav a {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.active { color: var(--text); background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* Categories dropdown / mega-menu */
.has-dropdown { position: relative; }
.dd-toggle {
  font: inherit; font-weight: 600; font-size: 0.92rem;
  color: var(--text-dim); background: none; border: 0; cursor: pointer;
  padding: 8px 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.dd-toggle:hover, .has-dropdown:hover .dd-toggle, .has-dropdown.open .dd-toggle {
  color: var(--text); background: var(--surface-2);
}
.dd-caret { font-size: 0.7em; transition: transform 0.15s var(--ease); }
.has-dropdown:hover .dd-caret, .has-dropdown.open .dd-caret { transform: rotate(180deg); }
.dd-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(6, auto);
  grid-auto-columns: minmax(168px, 1fr); gap: 2px;
  background: var(--surface); border: 1px solid var(--border-str);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px; z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease), visibility 0.15s;
}
.has-dropdown:hover .dd-panel, .has-dropdown.open .dd-panel, .dd-panel:focus-within {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dd-panel a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: 9px; margin: 0;
  color: var(--text-dim); font-size: 0.9rem; font-weight: 500; white-space: nowrap;
}
.dd-panel a:hover { background: var(--surface-2); color: var(--text); }
.dd-panel a .dd-ico { font-size: 1.05rem; width: 1.3em; text-align: center; }
.dd-panel a.dd-mobile-only { display: none; }  /* Codes lives in the top nav on desktop */
.main-nav .nav-search-mobile { display: none; }  /* mobile-only search; desktop uses the header search */

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--text-faint);
  font-size: 0.88rem;
  /* Fixed width so the box size never depends on font metrics. A text input
     auto-sizes to a font-dependent default; without this the box width (and
     its position) shifts between the web font and the system fallback during
     font load (FOUT), making pages look inconsistent. */
  width: 280px;
  cursor: text;
  transition: border-color 0.15s var(--ease);
}
.search input { min-width: 0; }  /* let the input shrink inside the fixed-width box */
.search:hover { border-color: var(--border-str); }
.search input {
  border: 0; background: none; outline: none;
  color: var(--text); font: inherit; width: 100%;
}
.search kbd {
  font-family: inherit; font-size: 0.72rem;
  background: var(--surface-3); color: var(--text-dim);
  padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border);
}

/* Search results dropdown */
.search { position: relative; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  min-width: 240px;
  background: var(--surface); border: 1px solid var(--border-str);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  z-index: 70; max-height: 64vh; overflow-y: auto; padding: 6px;
}
.search-hit {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; border-radius: 8px; color: var(--text);
}
.search-hit:hover, .search-hit.active { background: var(--surface-2); color: var(--text); }
.sh-title { font-weight: 600; font-size: 0.9rem; line-height: 1.2; }
.sh-cat { flex: none; color: var(--text-faint); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
.search-empty { padding: 12px; color: var(--text-faint); font-size: 0.88rem; text-align: center; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 42px; height: 42px;
  border-radius: 12px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---- Breadcrumb ---------------------------------------------------------- */
.breadcrumb {
  padding: 16px 0 4px;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.breadcrumb li { display: flex; align-items: center; gap: 8px; }
.breadcrumb li:not(:last-child)::after { content: "›"; color: var(--text-faint); }
.breadcrumb a { color: var(--text-dim); font-weight: 500; }
.breadcrumb [aria-current] { color: var(--text); }

/* ---- Page hero ----------------------------------------------------------- */
.hero {
  position: relative;
  padding: 34px;
  min-height: 200px;
  display: flex;
  align-items: flex-end;
  border-radius: var(--radius-lg);
  /* Overlay (for text contrast) + optional banner image + base fallback */
  background:
    linear-gradient(135deg,
      rgba(10, 22, 52, 0.95),
      rgba(13, 28, 64, 0.78) 55%,
      rgba(8, 16, 42, 0.94)),
    var(--hero-img, none) center / cover no-repeat,
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), var(--surface) 55%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* Subtle accent tint so the banner reads as part of the theme */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 85% 0%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 60%);
  mix-blend-mode: screen;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; width: 100%; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: var(--gold);
}
.hero .subtitle { margin-top: 14px; color: var(--text-dim); font-size: 1.05rem; max-width: 60ch; }
/* Hero with a wordmark/logo on the right: text left, art right */
.hero.has-art { align-items: center; gap: 30px; }
.hero.has-art .hero-inner { width: auto; flex: 1 1 auto; min-width: 0; }
.hero-art { position: relative; z-index: 1; flex: none; }
.hero-art img { display: block; width: clamp(190px, 24vw, 320px); height: auto; filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.5)); }
@media (max-width: 760px) { .hero-art { display: none; } }

/* ---- Outlined / "game UI" heading style --------------------------------- */
/* Roblox-style chunky outline + drop shadow. Use sparingly: big titles,
   keycaps, callouts — not body headings, where it hurts readability. */
.text-outline {
  -webkit-text-stroke: 3px var(--outline-col, #1a0f2e);
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 color-mix(in srgb, var(--outline-col, #1a0f2e) 80%, #000),
    0 7px 14px rgba(0, 0, 0, 0.5);
}

/* ---- Badges / tags ------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-dim);
  border: 1px solid var(--border);
  letter-spacing: 0.02em; text-transform: uppercase;
}
.badge.rarity-mythical  { color: #fff; background: linear-gradient(135deg, var(--r-mythical), #c1387a); border-color: transparent; box-shadow: 0 4px 14px -4px var(--r-mythical); }
.badge.rarity-legendary { color: #fff; background: linear-gradient(135deg, var(--r-legendary), #7b3ff2); border-color: transparent; }
.badge.rarity-rare      { color: #fff; background: linear-gradient(135deg, var(--r-rare), var(--accent-2)); border-color: transparent; }
.badge.rarity-uncommon  { color: #04221a; background: linear-gradient(135deg, var(--r-uncommon), #2fb574); border-color: transparent; }
.badge.rarity-common    { color: #0a0e1a; background: linear-gradient(135deg, var(--r-common), #7a85a3); border-color: transparent; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---- Main content grid --------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
  margin: 24px 0 64px;
}

/* Left column stacks the hero on top of the article */
.main-col { display: grid; gap: 28px; min-width: 0; align-content: start; }
/* min-width:0 lets the column shrink so the wide moveset table scrolls
   inside its own wrapper instead of inflating the whole page width */
.article { min-width: 0; }

/* ---- Article ------------------------------------------------------------- */
.article > section { scroll-margin-top: calc(var(--header-h) + 20px); }
/* Space between sections (not before the first one) */
.article > section + section { margin-top: 48px; }
.article h2 {
  font-size: 1.6rem;
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 12px;
}
.article h2::before {
  content: "";
  width: 5px; height: 1.1em;
  border-radius: 4px;
  background: linear-gradient(var(--accent), var(--gold));
}
.article h3 { font-size: 1.2rem; margin: 26px 0 10px; color: var(--text); }
.article p { color: var(--text-dim); margin: 0 0 14px; }
.article strong { color: var(--text); }
.article ul, .article ol { color: var(--text-dim); padding-left: 22px; margin: 0 0 16px; }
.article li { margin-bottom: 7px; }
.article li::marker { color: var(--accent); }

/* Callout box */
.callout {
  display: flex; gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  margin: 20px 0;
}
.callout .ico { font-size: 1.4rem; line-height: 1.4; }
.callout p { margin: 0; color: var(--text); font-size: 0.95rem; }
.callout strong { color: var(--gold); }

/* Cards row (e.g. how to obtain) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 18px 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--border-str); }
.card .card-ico { font-size: 1.8rem; margin-bottom: 8px; }
.card h3 { font-size: 1rem; margin: 0 0 4px; }
.card p { font-size: 0.88rem; margin: 0; }

/* Moveset table */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); margin: 18px 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 520px; }
table.data thead th {
  text-align: left;
  background: var(--surface-2);
  color: var(--text);
  font-family: "Baloo 2", sans-serif;
  padding: 13px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text-dim); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background 0.12s var(--ease); }
table.data tbody tr:hover { background: var(--surface); }
table.data td strong { color: var(--text); }
.keycap {
  display: inline-grid; place-items: center;
  min-width: 30px; height: 30px; padding: 0 8px;
  font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 0.9rem;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 8px;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--accent-2) 70%, #000);
}

/* Stat bars */
.stats { display: grid; gap: 14px; margin: 18px 0; }
.stat .stat-head { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 5px; }
.stat .stat-head span:first-child { color: var(--text); font-weight: 600; }
.stat .stat-head span:last-child { color: var(--text-dim); }
.stat .bar { height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.stat .bar > i {
  display: block; height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

/* Buff list (accessories) — positive stat boosts */
.buff-list {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.buff-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--r-uncommon) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--r-uncommon) 28%, transparent);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}
.buff-list li::before {
  content: "▲";
  color: var(--r-uncommon);
  font-size: 0.7rem;
}

/* ---- Sidebar (infobox + TOC) -------------------------------------------- */
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 24px; }

.infobox {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.infobox-figure {
  position: relative;
  display: grid; place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 65%),
    var(--surface-2);
  border-bottom: 1px solid var(--border);
}
/* Static glow behind the image — rendered once, not per animation frame */
.infobox-figure::after {
  content: "";
  position: absolute;
  bottom: 26px;
  width: 130px; height: 26px;
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--accent) 65%, transparent), transparent 72%);
  filter: blur(9px);
  z-index: 0;
}
.infobox-figure img {
  position: relative;
  z-index: 1;
  width: 170px; height: 170px; object-fit: contain;
  /* Compositor-only animation: cheap, no per-frame repaint */
  will-change: transform;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -9px, 0); }
}
.infobox-title { padding: 16px 18px 6px; }
.infobox-title h2 { font-size: 1.4rem; }
.infobox-title .tag { color: var(--text-faint); font-size: 0.82rem; font-weight: 600; }
.infobox dl { margin: 8px 0 0; padding: 8px 18px 18px; display: grid; gap: 0; }
.infobox dl > div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.infobox dt { color: var(--text-faint); font-weight: 500; }
.infobox dd { margin: 0; color: var(--text); font-weight: 600; text-align: right; }

/* Table of contents */
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.toc h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a {
  display: block; color: var(--text-dim);
  font-size: 0.9rem; font-weight: 500;
  padding: 7px 12px; border-radius: 8px;
  border-left: 2px solid transparent;
}
.toc a:hover { color: var(--text); background: var(--surface-2); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ---- Hub / category index ----------------------------------------------- */
.hub-tools {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin: 24px 0 20px;
}
.hub-search {
  flex: 1 1 240px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 9px 16px; color: var(--text-faint);
}
.hub-search input { border: 0; background: none; outline: none; color: var(--text); font: inherit; width: 100%; }
.hub-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn {
  font: inherit; font-size: 0.85rem; font-weight: 600;
  color: var(--text-dim); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 15px; cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.filter-btn:hover { color: var(--text); border-color: var(--border-str); }
.filter-btn.active { color: var(--bg); background: var(--accent); border-color: transparent; }

.hub-count { color: var(--text-faint); font-size: 0.9rem; margin: 0 0 16px; }

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 56px;
}
.entity-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 10px; padding: 20px 14px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.entity-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--surface-2);
  color: var(--text);
}
.entity-card .thumb {
  width: 92px; height: 92px; object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.4));
}
.entity-card .thumb-emoji {
  display: grid; place-items: center;
  width: 92px; height: 92px; font-size: 2.6rem;
  filter: none;
}
.entity-card .name { font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.entity-card .meta {
  display: flex; flex-wrap: nowrap; gap: 6px; justify-content: center;
  max-width: 100%; overflow: hidden;
}
.entity-card .meta .badge { font-size: 0.64rem; padding: 3px 8px; flex: 0 0 auto; }
.entity-empty { color: var(--text-faint); padding: 40px 0; text-align: center; }

.hub-about {
  border-top: 1px solid var(--border);
  padding-top: 36px;
  margin-bottom: 56px;
  max-width: 820px;
}
.hub-about h2 { margin-top: 38px; }
.hub-about h2:first-child { margin-top: 0; }

/* ---- Home: category grid ------------------------------------------------ */
.home-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.home-stats .chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  border: 1px solid var(--border-str); border-radius: 999px;
  padding: 7px 14px; font-weight: 600; font-size: 0.9rem; color: var(--text);
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 44px 0 16px; }
.section-head h2 { font-size: 1.55rem; }
.section-head a { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
}
.cat-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.cat-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--surface-2); color: var(--text); }
.cat-card .cat-ico {
  flex: none; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 12px; font-size: 1.6rem;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
  border: 1px solid var(--border);
}
.cat-card .cat-text { min-width: 0; }
.cat-card .cat-name { display: block; font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.cat-card .cat-blurb { display: block; color: var(--text-dim); font-size: 0.84rem; margin-top: 2px; }
.cat-card .cat-count { display: block; color: var(--text-faint); font-size: 0.78rem; font-weight: 600; }

/* Hero CTA buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 0.98rem;
  transition: transform 0.15s var(--ease), filter 0.15s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04121f; }
.btn-primary:hover { color: #04121f; filter: brightness(1.07); }
.btn-ghost { background: color-mix(in srgb, var(--bg) 45%, transparent); border: 1px solid var(--border-str); color: var(--text); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

/* FAQ accordion */
.faq { max-width: 820px; margin-bottom: 24px; }
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 15px 18px; list-style: none;
  font-family: "Baloo 2", sans-serif; font-weight: 700; color: var(--text);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { padding: 0 18px 16px; margin: 0; color: var(--text-dim); }
.faq details p a { font-weight: 600; }

/* ---- Codes page --------------------------------------------------------- */
.code-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px; margin: 18px 0 8px;
}
.code-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 15px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.code-card .code-info { min-width: 0; }
.code-value {
  display: block; font-family: "Baloo 2", sans-serif; font-weight: 800;
  font-size: 1.06rem; color: var(--gold); letter-spacing: 0.02em; word-break: break-word;
}
.code-reward { color: var(--text-dim); font-size: 0.84rem; }
.code-copy {
  flex: none; font: inherit; font-weight: 700; font-size: 0.82rem;
  padding: 8px 15px; border-radius: 8px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04121f;
  transition: filter 0.15s var(--ease);
}
.code-copy:hover { filter: brightness(1.08); }
.code-copy.copied { background: var(--r-uncommon); color: #042; }

/* ---- Related (bottom of entity pages) ----------------------------------- */
.related {
  border-top: 1px solid var(--border);
  margin: 8px 0 56px;
  padding-top: 34px;
}
.related-title {
  font-family: "Baloo 2", sans-serif;
  font-size: 1.5rem;
  margin: 0 0 18px;
}

/* ---- Sitemap page ------------------------------------------------------- */
.sitemap-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px 24px; margin: 28px 0 56px;
}
.sitemap-section h2 { font-size: 1.2rem; margin: 0 0 10px; }
.sitemap-section h2 a { color: var(--text); }
.sitemap-section h2 a:hover { color: var(--gold); }
.sitemap-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 16px; }
.sitemap-list li { break-inside: avoid; }
.sitemap-list a { color: var(--text-dim); font-size: 0.86rem; display: block; padding: 2px 0; }
.sitemap-list a:hover { color: var(--text); }

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 60%, #000);
  padding: 48px 0 28px;
  margin-top: 56px;
}
.footer-cols {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-col .footer-h {
  display: block;
  font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 0.95rem; color: var(--text);
  margin: 0 0 12px;
}
.footer-col a { display: block; color: var(--text-dim); font-size: 0.9rem; font-weight: 500; padding: 4px 0; }
.footer-col a:hover { color: var(--text); }
.footer-brand .logo { font-size: 1.2rem; margin-bottom: 12px; }
.footer-brand p { color: var(--text-faint); font-size: 0.86rem; margin: 0; max-width: 30ch; line-height: 1.6; }
.footer-bottom {
  margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 0.82rem;
}
@media (max-width: 720px) {
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .footer-cols { grid-template-columns: 1fr; }
}

/* ---- Edited / meta line -------------------------------------------------- */
.page-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  color: var(--text-faint); font-size: 0.82rem;
  padding: 16px 0; margin-top: 8px;
  border-top: 1px solid var(--border);
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  /* Dissolve the wrapper so hero + article become direct grid items,
     letting us slot the infobox between them: hero → infobox → article */
  .main-col { display: contents; }
  .hero    { order: 1; }
  .sidebar { order: 2; position: static; }
  .article { order: 3; }
  .toc { display: none; }
}
@media (max-width: 680px) {
  .search { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px; margin: 0;
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
  }
  .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .main-nav a { padding: 12px 14px; }
  /* Mobile: open straight into the categories grid (no Home, no toggle).
     Hide the top-level links (Home + Codes) and the Categories toggle. */
  .main-nav > a { display: none; }
  .dd-toggle { display: none; }
  /* show the search at the top of the burger menu */
  .main-nav .nav-search-mobile { display: flex; width: 100%; margin-bottom: 10px; }
  .has-dropdown { width: 100%; }
  .dd-panel {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; background: none; padding: 4px 0;
    grid-auto-flow: row; grid-template-rows: none; grid-template-columns: 1fr 1fr;
    min-width: 0; display: grid;
  }
  .dd-panel a { white-space: normal; font-size: 0.86rem; padding: 10px 8px; }
  .dd-panel a.dd-mobile-only { display: flex; }  /* show Codes inside the grid on mobile */
  .hero { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto; }
}

/* ===== Apex network site (noob.wiki) ===================================== */
/* "Wikis" dropdown: anchor left & flow as a simple vertical list */
@media (min-width: 681px) {
  .apex-nav .dd-panel {
    left: 0; right: auto;
    grid-auto-flow: row; grid-template-rows: none; grid-auto-columns: auto;
    min-width: 210px;
  }
}
/* Mobile: re-show apex's plain links in the burger (game nav hides them) */
@media (max-width: 680px) {
  .main-nav.apex-nav > a { display: block; }
  .apex-nav .dd-panel { grid-template-columns: 1fr; }
}

/* Feature / "why us" cards */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 22px;
}
.feature-card .f-ico {
  font-size: 1.7rem; display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: 14px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
  border: 1px solid var(--border);
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.feature-card p { color: var(--text-dim); font-size: 0.9rem; margin: 0; }

/* "Coming soon" wiki tile + small tag on wiki cards */
.cat-card.is-soon { opacity: 0.55; border-style: dashed; cursor: default; }
.cat-card.is-soon:hover { transform: none; border-color: var(--border); background: var(--surface); }
.cat-card .cat-tag {
  display: inline-block; margin-top: 4px;
  font-size: 0.72rem; font-weight: 700; color: var(--gold);
}

/* CTA band */
.cta-band {
  margin-top: 48px; padding: 34px 28px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.cta-band h2 { font-size: 1.5rem; margin-bottom: 8px; }
.cta-band p { color: var(--text-dim); margin: 0 auto 18px; max-width: 54ch; }
.cta-band .btn-row { justify-content: center; }
