@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&display=swap');
/* WarLock Idle site (landing + Wiki): the game's palette, system font, frame.png 9-slice, rounded corners (--radius),
   flat colors, hard shadows only. The landing page blocks come after the Wiki ones. */
:root { color-scheme: dark; --bg: #050505; --panel: #0d0d0d; --panel-2: #141414; --line: #2c2c2c; --text: #e6e6e6; --muted: #8c8c8c;
  --gold: #d9b45a; --ink: #000; --radius: 10px; --bevel: inset 2px 2px 0 #ffffff1f, inset -2px -2px 0 #00000066; --sunk: inset 2px 2px 0 #00000066, inset -2px -2px 0 #ffffff14; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.25 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
a { color: var(--text); text-decoration-color: var(--muted); text-underline-offset: 3px; }
a:hover, a:focus-visible { color: var(--gold); text-decoration-color: var(--gold); }
a[aria-current="page"] { color: var(--gold); }
h1, h2, h3 { font-weight: 700; line-height: 1.25; }
h1, h2 { font-family: 'Cinzel', Georgia, serif; }
h2 { letter-spacing: 0.06em; }
h1 { font-size: 32px; margin: 8px 0 16px; }
h2 { font-size: 16px; margin: 24px 0 8px; color: var(--muted); text-transform: uppercase; }
h3 { font-size: 16px; margin: 16px 0 8px; }
p, li { line-height: 1.5; }
small { color: var(--muted); }
img, .sprite, .map, .portrait, .icon { image-rendering: pixelated; }
input { font: inherit; color: inherit; padding: 10px 12px; border: 1px solid #3a3a3a; background: #0a0a0a; border-radius: var(--radius); }
input:focus-visible { outline: none; border-color: var(--gold); }

/* Top bar (both sites; `.bar-top` below gives it the logo bar look): sticky, full width. */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand small { font-family: 'Cinzel', Georgia, serif; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.play { font-weight: 600; padding: 8px 14px; border: 1px solid #3a3a3a; background: var(--panel-2); text-decoration: none; white-space: nowrap; }
.play:hover, .play:focus-visible { color: var(--bg); background: var(--gold); }
.top .search { flex: 0 1 300px; }

/* Search box (top bar and Wiki home): the result list drops under the input. */
.search { position: relative; }
.search input { width: 100%; }
.search ul { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none; max-height: 60vh; overflow-y: auto;
  background: var(--panel-2); border: 1px solid #3a3a3a; box-shadow: 0 8px 24px #000a; }
.search ul[hidden] { display: none; }
.search li { padding: 6px 12px; line-height: 1.25; }
.search li small { margin-left: 4px; }

/* Two columns: the category index (250 px) and the page. Up to 900 px the index becomes the <details> menu at the top. */
.wiki { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; max-width: 1200px; margin: 0 auto; padding: 24px 16px; align-items: start; }
.side { position: sticky; top: 76px; }
.side nav, .menu nav, main { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.side nav { overflow: hidden; }
.side-head { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.side ul, .menu ul { list-style: none; margin: 0; padding: 6px 0; }
.side li a, .menu li a { display: flex; align-items: center; gap: 10px; padding: 7px 14px; text-decoration: none; }
.side li a:hover, .menu li a:hover, .side li a[aria-current="page"] { background: var(--panel-2); }
.side li span, .menu li span { flex: 1; }
.side li small, .menu li small { padding: 1px 8px; font-size: 12px; background: #1b1b1b; border-radius: 999px; }
.menu { display: none; margin: 16px 16px 0; }
.menu summary { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 10px 14px; font-weight: 600; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--radius); }
.menu nav { margin-top: 8px; }
main { min-width: 0; padding: 20px 28px 28px; overflow-wrap: anywhere; }
.crumbs { color: var(--muted); font-size: 14px; }
.crumbs a { color: var(--muted); }
.foot { max-width: 1200px; margin: 0 auto; padding: 16px 16px 32px; color: var(--muted); }
.wiki-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.wiki-foot > span { display: inline-flex; align-items: center; gap: 8px; }
.note { color: var(--muted); }

/* Wiki home: search hero with counts, category cards, numbered guides. */
.wiki-hero { display: grid; gap: 16px; margin: 0 0 8px; }
.wiki-hero .lead { margin: 0; color: #c8c8c8; }
.home-search { max-width: 640px; }
.home-search input { padding: 14px 16px; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 13px; text-decoration: none; color: #c8c8c8;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; }
.chips a:hover { border-color: var(--gold); }
main h2 { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; list-style: none; margin: 0 0 16px; padding: 0; }
.categories a { display: grid; align-content: start; gap: 6px; height: 100%; padding: 14px; text-decoration: none; background: #0a0a0a;
  border: 1px solid var(--line); border-radius: var(--radius); }
.categories a:hover, .categories a:focus-visible { border-color: var(--gold); }
.cat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cat-top b { color: var(--gold); font-size: 18px; }
.categories strong { font-size: 16px; }
.categories small { font-size: 13px; line-height: 1.4; }
.guides { display: grid; margin: 0 0 16px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.guides li + li { border-top: 1px solid var(--line); }
.guides a { display: flex; gap: 14px; padding: 12px 16px; text-decoration: none; background: #0a0a0a; }
.guides a:hover { background: var(--panel-2); }
.guides .num { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.guides strong { display: block; }
.guides small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; }

/* Data blocks. */
.stats { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0 0 16px; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; }
table { display: block; max-width: 100%; overflow-x: auto; overflow-wrap: normal; border-collapse: collapse; margin: 0 0 16px; }
th, td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--panel-2); color: var(--muted); font-weight: 600; }
td a { white-space: nowrap; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; list-style: none; margin: 0 0 16px; padding: 0; }
.cards li { display: grid; gap: 4px; justify-items: start; align-content: start; padding: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.art { margin: 0 0 16px; }
/* Mob sheets: 4 frames of 32 px side by side; the first one at 2x. */
.sprite { display: inline-block; width: 64px; height: 64px; background-repeat: no-repeat; background-size: 400% auto; background-position: 0 0; }
.sprite.none { display: inline-grid; place-items: center; font-size: 32px; color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.icon { width: 32px; height: 32px; vertical-align: middle; margin-right: 4px; }
.portrait { display: block; width: 128px; height: 160px; margin: 0 0 16px; border: 1px solid var(--line); }
.map { display: block; border: 1px solid var(--line); margin: 0 0 16px; }

@media (max-width: 900px) {
  .wiki { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .side { display: none; }
  .menu { display: block; }
  .top .search ~ .btn { margin-left: auto; }   /* Wiki: the links hide, the button stays on the right */
}
@media (max-width: 600px) {
  .top { flex-wrap: wrap; gap: 8px; }
  .top .search { order: 3; flex-basis: 100%; }
  .wiki { padding: 8px; }
  .menu { margin: 8px 8px 0; }
  main { padding: 12px 14px 18px; }
}

/* Landing page: one column of sections over the 3D scene, fixed behind the whole page and dimmed so the text reads.
   Hairline borders, rounded corners (--radius), the gold kept for calls to action and highlights. */
.bg { position: fixed; inset: 0; z-index: -1; background: var(--bg); }
.bg::after { content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, #05050580, #050505b3 60%, #050505f2), linear-gradient(#05050500 60%, #050505 100%); }
.scene > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.bar-top { gap: 24px; padding: 8px 24px; background: #050505d9; border-bottom: 1px solid var(--line); }
.bar-top .brand img { display: block; height: 48px; width: auto; }
.bar-top .links { display: flex; gap: 20px; margin-left: auto; }
.bar-top .search input { padding: 7px 12px; font-size: 14px; }
.bar-top .links a, .bar-top .enter { color: var(--muted); text-decoration: none; font-size: 14px; }
.bar-top .links a:hover, .bar-top .enter:hover { color: var(--text); }
.btn { display: inline-block; padding: 12px 20px; font-weight: 600; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; color: var(--text); background: #0d0d0de6; border: 1px solid #3a3a3a; }
.btn:hover, .btn:focus-visible { color: var(--text); border-color: var(--muted); background: #141414; }
.btn.primary { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.btn.primary:hover, .btn.primary:focus-visible { color: var(--bg); background: #f0cf7a; border-color: #f0cf7a; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover, .btn.ghost:focus-visible { color: var(--text); background: none; border-color: transparent; text-decoration: underline; }
.bar-top .btn { padding: 8px 14px; }
main.landing { max-width: 1120px; margin: 0 auto; padding: 0 24px; border: 0; background: none; }
.hero { display: grid; justify-items: center; align-content: center; gap: 16px; min-height: calc(100vh - 57px); padding: 48px 0; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(34px, 6vw, 64px); line-height: 1.1; text-shadow: 0 2px 0 var(--ink); }
.hero h1 span, .vip-block h2 span { display: block; color: var(--gold); }
.lead { max-width: 620px; margin: 0; font-size: 18px; color: #c8c8c8; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 8px 0 0; }
.hero .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; width: min(720px, 100%); margin: 32px 0 0; padding: 0;
  list-style: none; background: var(--line); border: 1px solid var(--line); }
.hero .stats li { display: grid; gap: 2px; padding: 14px 8px; background: #0d0d0de6; }
.hero .stats b { font-size: 24px; color: var(--text); }
.hero .stats small { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; }
.section { padding: 64px 0; border-top: 1px solid var(--line); scroll-margin-top: 56px; }
.kicker { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.section h2 { margin: 0 0 24px; font-size: clamp(24px, 3.5vw, 34px); color: var(--text); text-transform: none; letter-spacing: 0; }
.pillars, .vocations, .vip { list-style: none; margin: 0; padding: 0; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.pillars li, .vocations a, .news-item, .card { background: #0d0d0deb; border: 1px solid var(--line); }
.pillars li { display: grid; align-content: start; gap: 8px; padding: 20px; }
.pillars li:hover, .vocations a:hover, .vocations a:focus-visible { border-color: var(--gold); }
.pillars small, .news-item .meta small { letter-spacing: 0.08em; text-transform: uppercase; font-size: 12px; }
.pillars h3, .news-item h3, .card h3 { margin: 0; font-size: 18px; }
.pillars p { margin: 0; color: #c8c8c8; }
.pillars a { color: var(--gold); text-decoration: none; font-size: 14px; }
.vocations { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.vocations a { display: grid; align-content: start; gap: 6px; height: 100%; padding: 16px; text-decoration: none; }
.vocations .portrait { width: 96px; height: 120px; margin: 0 0 6px; border: 1px solid var(--line); }
.vocations strong { font-size: 18px; }
.vocations small { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; }
.vocations p { margin: 0 0 6px; color: #c8c8c8; font-size: 14px; }
.bar { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bar i { display: block; height: 6px; background: linear-gradient(90deg, var(--gold) var(--w), #1f1f1f var(--w)); }
.news { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 0 0 16px; }
.news-item { display: grid; align-content: start; gap: 8px; padding: 18px; }
.news-item .meta { display: flex; justify-content: space-between; gap: 8px; margin: 0; }
.tag { padding: 2px 8px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); border: 1px solid #5a4a24; }
.news-item ul { margin: 0; padding-left: 18px; color: #c8c8c8; font-size: 14px; }
.vip-block { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; align-items: center; }
.vip li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.vip b { color: var(--gold); }
.card { display: grid; gap: 12px; justify-items: start; padding: 24px; }
.card p { margin: 0; color: #c8c8c8; }
.final { text-align: center; }
.final h2 { margin-bottom: 16px; }
.home-foot { text-align: center; line-height: 1.75; max-width: none; background: #050505; border-top: 1px solid var(--line); }

/* Reveal on scroll: hidden only when landing/main.ts runs (html.anim), so the page is whole without JS. */
.anim [data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity 300ms, transform 300ms; }
.anim [data-reveal].on { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .bar-top .links { display: none; }
  .bar-top .enter { margin-left: auto; }
  .vip-block { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .bar-top { gap: 12px; padding: 8px 12px; }
  .bar-top .brand img { height: 32px; }
  main.landing { padding: 0 16px; }
  .hero { min-height: calc(100vh - 49px); }
  .lead { font-size: 16px; }
  .hero .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section { padding: 48px 0; }
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { transition: none; }
}

/* Rounded corners on the boxes. */
input, .play, .search ul, .menu summary, .cards li, .portrait, .map, .btn, .hero .stats, .pillars li, .vocations a,
.news-item, .card, .vocations .portrait { border-radius: var(--radius); }
.hero .stats { overflow: hidden; }   /* the hairline grid behind the cells follows the rounded corners */
.tag, .bar i { border-radius: 999px; }

/* Game icons next to the texts: pixel art, never smoothed. */
.ic { flex: none; image-rendering: pixelated; vertical-align: middle; }
.btn, .kicker, .tag, .vocations small, .card h3 { display: inline-flex; align-items: center; gap: 8px; }
.btn { justify-content: center; }
.tag { gap: 4px; }
.vocations small { gap: 6px; }
.hero .stats li { justify-items: center; }
.hero .stats .ic { margin-bottom: 4px; }
.pillars .ic { margin-bottom: 4px; }
.final .ic { display: block; margin: 0 auto 8px; }
