/* Valkyn REVO Wiki. Brand tokens follow the website's REVO design system (themes/loki-web/src/styles/revo-tokens.css).
   Layout: forest brand bar on top; guide index | article | on-this-page; drawer + one column on phones. */
@font-face { font-family: "Revo Barlow Semi Condensed"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/revo/barlow-semi-condensed-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Revo Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/revo/barlow-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Revo Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/revo/barlow-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Revo Kaushan Script"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/revo/kaushan-script-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Revo Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/source/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #F8F5EC; --surface: #FFFCF2; --sunk: #EFEADB; --ink: #0F2E25; --muted: rgba(15,46,37,.74);
  --line: rgba(15,46,37,.14); --brand: #0E4A38; --brand-soft: rgba(14,74,56,.08);
  --gold: #E9B44C; --gold-ink: #8A5A12; --gold-soft: rgba(233,180,76,.18);
  --danger: #A63D2A; --danger-soft: rgba(166,61,42,.09); --ok: #1F7A57;
  --bar: #0F2E25; --bar-ink: #FFFCF2; --bar-muted: rgba(255,252,242,.72);
  --shadow: 0 18px 34px -18px rgba(15,46,37,.45);
  --font-display: "Revo Barlow Semi Condensed", "Barlow Semi Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --font-body: "Revo Barlow", "Barlow", "Segoe UI", system-ui, sans-serif;
  --font-script: "Revo Kaushan Script", "Brush Script MT", cursive;
  --font-mono: "Revo Mono", ui-monospace, Consolas, monospace;
  --r-sm: 8px; --r-md: 14px; --top: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A1D17; --surface: #0F2A22; --sunk: #0C231C; --ink: #F3EEDF; --muted: rgba(243,238,223,.72);
  --line: rgba(243,238,223,.12); --brand: #7CCBA8; --brand-soft: rgba(124,203,168,.1); --gold-ink: #E9B44C;
  --gold-soft: rgba(233,180,76,.14); --danger: #E58B72; --danger-soft: rgba(229,139,114,.1); --ok: #7CCBA8;
  --bar: #071510; --shadow: 0 18px 34px -18px rgba(0,0,0,.7); color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 20px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
code, kbd { font-family: var(--font-mono); font-size: .84em; background: var(--sunk); border: 1px solid var(--line); border-radius: 5px; padding: .08em .38em; }
code { overflow-wrap: anywhere; }
pre { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; overflow-x: auto; }
pre code { border: 0; padding: 0; background: none; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #0F2E25; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--bar); color: var(--bar-ink); border-bottom: 1px solid rgba(233,180,76,.35); padding-top: env(safe-area-inset-top, 0px); }
.topbar-in { max-width: 1440px; margin: 0 auto; height: var(--top); display: flex; align-items: center; gap: 14px; }
.icon-btn { flex: none; display: grid; place-items: center; background: none; border: 1px solid rgba(255,252,242,.25); color: var(--bar-ink); border-radius: var(--r-sm); width: 40px; height: 40px; cursor: pointer; }
.icon-btn:hover { background: rgba(255,252,242,.1); }
.menu-btn { display: none; }
.logo { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--bar-ink); white-space: nowrap; }
.logo b { font: 800 22px/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.logo b span { color: var(--gold); }
.logo i { font: 400 20px/1 var(--font-script); color: var(--gold); transform: rotate(-4deg); display: inline-block; }
.search-btn { flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,252,242,.22); background: rgba(255,252,242,.07); color: var(--bar-muted); font: 500 15px var(--font-body); cursor: pointer; text-align: left; }
.search-btn:hover { background: rgba(255,252,242,.12); }
.search-btn span { flex: 1; }
.search-btn kbd { background: transparent; color: var(--bar-muted); border-color: rgba(255,252,242,.25); }
.top-links { display: flex; align-items: center; gap: 4px; }
.top-links a { color: var(--bar-ink); text-decoration: none; font: 600 14px var(--font-body); padding: 8px 10px; border-radius: var(--r-sm); white-space: nowrap; }
.top-links a:hover { background: rgba(255,252,242,.1); }
.top-links .play { background: var(--gold); color: #0F2E25; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 8px 14px; margin-left: 4px; }
.top-links .play:hover { background: #F2C766; }

/* ---------- shell ---------- */
.shell { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 272px minmax(0,1fr) 232px; gap: 40px; align-items: start; }
.shell.home { grid-template-columns: 272px minmax(0,1fr); }
.side { position: sticky; top: calc(var(--top) + env(safe-area-inset-top, 0px)); max-height: calc(100vh - var(--top) - env(safe-area-inset-top, 0px)); overflow-y: auto; padding-block: 24px 40px; scrollbar-width: thin; }
.side-close { display: none; }
.side-home { display: flex; gap: 8px; align-items: center; padding: 8px 10px; margin-bottom: 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 600; }
.side-home.active, .side-home:hover { background: var(--brand-soft); }
.side-group { margin-bottom: 4px; }
.side-group > button { width: 100%; display: flex; align-items: center; justify-content: space-between; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 8px 10px; border-radius: var(--r-sm); font: 800 13px var(--font-display); text-transform: uppercase; letter-spacing: .12em; text-align: left; }
.side-group > button:hover { background: var(--brand-soft); }
.side-group > button svg { transition: transform .2s; opacity: .6; flex: none; }
.side-group.closed > button svg { transform: rotate(-90deg); }
.side-group.closed ul { display: none; }
.side ul { list-style: none; margin: 2px 0 8px 10px; padding: 0 0 0 10px; border-left: 1px solid var(--line); }
.side li a { display: block; padding: 5px 10px; margin-left: -11px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 15px; line-height: 1.35; }
.side li a:hover { color: var(--ink); }
.side li a.active { color: var(--brand); border-left-color: var(--gold); font-weight: 600; background: linear-gradient(90deg, var(--gold-soft), transparent); }
.scrim { display: none; }

main { min-width: 0; padding-block: 28px 80px; }
.rail { position: sticky; top: calc(var(--top) + env(safe-area-inset-top, 0px)); padding-block: 28px; font-size: 14px; max-height: calc(100vh - var(--top)); overflow-y: auto; scrollbar-width: thin; }
.rail h2, .toc-mobile summary { font: 800 12px var(--font-display); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 10px; padding: 0; }
.rail ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.rail li a { display: block; padding: 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.rail li a:hover { color: var(--ink); }
.rail li a.on { color: var(--ink); border-left-color: var(--gold); }
.rail li.sub a { padding-left: 24px; font-size: 13px; }
.rail-box { margin-top: 24px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.rail-box p { margin: 0 0 8px; color: var(--muted); }
.toc-mobile { display: none; }

/* ---------- article ---------- */
.article { max-width: 800px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 800 12px var(--font-display); text-transform: uppercase; letter-spacing: .16em; color: var(--gold-ink); }
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; text-wrap: balance; letter-spacing: .005em; }
h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.02; text-transform: uppercase; margin: 10px 0 14px; }
.article h2 { font-size: 28px; line-height: 1.1; text-transform: uppercase; margin: 56px 0 14px; }
.article h3 { font-size: 21px; line-height: 1.2; margin: 32px 0 10px; }
.article h4 { font-size: 17px; margin: 22px 0 8px; }
.h-anchor { margin-left: 8px; color: var(--gold-ink); text-decoration: none; opacity: 0; font-size: .7em; vertical-align: middle; }
h2:hover .h-anchor, h3:hover .h-anchor, .h-anchor:focus { opacity: 1; }
.lead { font-size: 20px; line-height: 1.5; color: var(--muted); max-width: 64ch; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.meta b { color: var(--ink); font-weight: 600; }
.article p, .article li { max-width: 70ch; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin: 4px 0; }
.article li::marker { color: var(--gold-ink); }
.article blockquote { margin: 16px 0; padding: 10px 16px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.article blockquote p { margin: 0; }
.article hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); margin: 14px 0 18px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
thead th { font: 800 12px var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--sunk); }
tbody tr:hover td { background: var(--brand-soft); }
td p { margin: 0; }
.rate { display: inline-block; min-width: 52px; text-align: center; padding: 3px 6px; border-radius: 6px; font-weight: 600; }
.rate.hi { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.rate.mid { background: color-mix(in srgb, var(--gold) 26%, transparent); }
.rate.lo { background: color-mix(in srgb, var(--gold) 44%, transparent); }
.rate.risk { background: color-mix(in srgb, var(--danger) 22%, transparent); color: var(--danger); }
.loc { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }
.loc svg { color: var(--gold-ink); flex: none; }
.copy { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 6px; font: 600 12px var(--font-body); padding: 1px 8px; cursor: pointer; margin-left: 6px; vertical-align: 1px; }
.copy:hover { color: var(--brand); border-color: var(--brand); }
.cmp td:last-child { font-weight: 600; }
.cmp thead th:last-child { color: var(--gold-ink); }

/* glance card: an "At a glance" two-column table */
.table-wrap.glance { box-shadow: var(--shadow); }
.glance thead th { background: var(--bar); color: var(--gold); font-size: 14px; letter-spacing: .16em; padding: 12px 18px; }
.glance tbody td { padding: 11px 18px; }
.glance tbody td:first-child { width: 32%; min-width: 130px; font: 800 13px/1.6 var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--sunk); }
.glance tbody td:first-child strong { font-weight: 800; }
.glance.nohead thead { display: none; }
.glance tbody tr:hover td { background: inherit; }
.glance tbody tr:hover td:first-child { background: var(--sunk); }

/* hints */
.hint { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 12px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid; margin: 18px 0; }
.hint-body > :first-child { margin-top: 0; }
.shot { margin: 18px 0 24px; }
.shot a { display: inline-block; max-width: 100%; vertical-align: top; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--sunk); cursor: zoom-in; }
.shot img { display: block; width: auto; max-width: 100%; height: auto; }
.shot figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
li .shot { margin: 12px 0 16px; }
.hint-body > :last-child { margin-bottom: 0; }
.hint svg { margin-top: 3px; }
.hint.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.hint.danger svg { color: var(--danger); }
.hint.warn { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.hint.warn svg { color: var(--gold-ink); }
.hint.info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.hint.info svg, .hint.ok svg { color: var(--brand); }
.hint.ok { background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }

/* numbered steps (only under "Start here") */
ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
ol.steps > li { counter-increment: s; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 14px; align-items: start; max-width: none; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
ol.steps > li::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--bar); color: var(--gold); font: 800 17px var(--font-display); }
ol.steps > li > div { padding-top: 4px; min-width: 0; }
ol.steps > li > div > :last-child { margin-bottom: 0; }
ol.steps ul, ol.steps ol { margin: 6px 0 0; }

/* FAQ */
.faq { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; margin: 14px 0; }
.faq details { border-top: 1px solid var(--line); }
.faq details:first-child { border-top: 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 14px; padding: 14px 18px; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 800 22px/1 var(--font-display); color: var(--gold-ink); transition: transform .2s; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { background: var(--brand-soft); }
.faq .ans { padding: 0 18px 16px; color: var(--muted); }
.faq .ans > :first-child { margin-top: 0; }
.faq .ans > :last-child { margin-bottom: 0; }

/* kinds (patch notes) */
.kind { display: inline-block; font: 800 11px/1.6 var(--font-display); text-transform: uppercase; letter-spacing: .1em; padding: 0 7px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; }
.kind.new { background: var(--brand-soft); color: var(--brand); }
.kind.changed { background: var(--gold-soft); color: var(--gold-ink); }
.kind.fixed { background: var(--sunk); color: var(--ink); border: 1px solid var(--line); }
.kind.removed { background: var(--danger-soft); color: var(--danger); }

/* related + footer */
.related-h { margin-top: 56px; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 14px; }
.related a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink); background: var(--surface); }
.related a:hover { border-color: var(--gold); }
.related a small { display: block; color: var(--muted); font-size: 12px; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.related a b { font-weight: 600; }
.page-foot { margin-top: 40px; padding: 16px 18px; border-radius: var(--r-md); background: var(--sunk); display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; }
.page-foot b { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.page-foot > div { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.pager a { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink); background: var(--surface); min-width: 0; }
.pager a:hover { border-color: var(--gold); }
.pager a small { display: block; color: var(--muted); font: 800 12px var(--font-display); text-transform: uppercase; letter-spacing: .12em; }
.pager a.next { text-align: right; grid-column: 2; }
.site-foot { border-top: 1px solid var(--line); margin-top: 20px; }
.site-foot-in { max-width: 1440px; margin: 0 auto; padding-block: 22px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: 14px; color: var(--muted); }
.site-foot a { color: var(--muted); }

/* ---------- widgets ---------- */
.calc { border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); border-radius: var(--r-md); background: var(--surface); padding: 18px; margin: 18px 0 8px; }
.calc-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-bottom: 12px; }
.calc-h strong { font: 800 18px var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.calc-h small { color: var(--muted); }
.calc-row { display: flex; flex-wrap: wrap; gap: 12px; }
.calc label { display: grid; gap: 4px; font: 800 12px var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); flex: 1 1 140px; }
.calc select { font: 500 16px var(--font-body); padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.calc-out { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 18px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.calc-big { font: 800 48px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.calc-big small { display: block; font: 400 14px var(--font-body); color: var(--muted); margin-top: 6px; max-width: 30ch; }
.ladder { display: flex; gap: 4px; align-items: flex-end; height: 74px; min-width: 0; }
.ladder div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; height: 100%; }
.ladder i { display: block; width: 100%; border-radius: 4px 4px 2px 2px; background: var(--brand); opacity: .85; }
.ladder i.low { background: var(--danger); }
.ladder span { font: 500 11px var(--font-mono); color: var(--muted); }

/* ---------- home ---------- */
.live { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin: 18px 0 8px; }
.live-cell { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 14px 16px; min-width: 0; }
.live-cell small { display: block; font: 800 11px var(--font-display); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.live-cell b { display: block; font: 800 24px/1.15 var(--font-display); margin-top: 4px; font-variant-numeric: tabular-nums; }
.live-cell span { font-size: 14px; color: var(--muted); }
.live-cell.now { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-soft), var(--surface)); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: middle; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.home-body { max-width: 1040px; }
.home-body > h2 { font-size: 28px; text-transform: uppercase; margin: 52px 0 14px; }
.start { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; counter-reset: st; margin: 14px 0; }
.start a { counter-increment: st; display: grid; align-content: start; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-decoration: none; color: var(--ink); }
.start a:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.start a::before { content: "Step " counter(st); font: 800 12px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.start b { font: 800 22px/1.1 var(--font-display); text-transform: uppercase; }
.start span { color: var(--muted); font-size: 15px; }
.library { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.shelf { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 16px 18px; min-width: 0; }
.shelf h3 { margin: 0 0 8px; font-size: 19px; text-transform: uppercase; letter-spacing: .03em; }
.shelf ul { list-style: none; padding: 0; margin: 0; }
.shelf li { margin: 0; border-top: 1px solid var(--line); max-width: none; }
.shelf li a { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 10px; padding: 9px 0; text-decoration: none; color: var(--ink); }
.shelf li a b { font-weight: 600; }
.shelf li a small { grid-column: 1; color: var(--muted); font-size: 14px; line-height: 1.4; }
.shelf li a::after { content: "→"; color: var(--gold-ink); grid-column: 2; grid-row: 1; }
.shelf li a:hover b { color: var(--brand); }

/* ---------- patch notes ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 26px; }
.filters button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: 600 14px var(--font-body); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--bar); color: var(--gold); border-color: var(--bar); }
.release { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 24px; padding-bottom: 30px; }
.release-when { position: sticky; top: calc(var(--top) + 24px); align-self: start; }
.release-when time { display: block; font: 800 20px/1.1 var(--font-display); text-transform: uppercase; }
.badge { display: inline-block; font: 800 11px var(--font-display); text-transform: uppercase; letter-spacing: .12em; padding: 3px 8px; border-radius: 999px; margin-top: 8px; background: var(--gold-soft); color: var(--gold-ink); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); }
.badge.latest { background: var(--bar); color: var(--gold); border-color: var(--bar); }
.release-body { border-left: 2px solid var(--line); padding-left: 24px; min-width: 0; }
.article .release-body > h2 { margin-top: 0; font-size: 26px; }
.change-group { border-top: 1px solid var(--line); padding-top: 4px; }
.article .change-group > h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 14px 0 6px; }

/* ---------- search ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(5,15,12,.55); display: grid; justify-items: center; align-items: start; padding: calc(10vh + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
.modal-box { width: min(640px, 100%); background: var(--surface); border-radius: var(--r-md); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); overflow: hidden; border: 1px solid var(--line); }
.modal-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.modal-in input { flex: 1; height: 56px; border: 0; background: transparent; color: var(--ink); font: 500 18px var(--font-body); outline: none; min-width: 0; }
.results { max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; }
.results a { display: block; padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); }
.results a small { display: block; color: var(--muted); font-size: 13px; }
.results mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.results a.sel { background: var(--brand-soft); outline: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.results .grp { font: 800 11px var(--font-display); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); padding: 10px 12px 4px; }
.results .empty { padding: 20px 12px; color: var(--muted); }
.modal-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--sunk); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--bar); color: var(--bar-ink); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 70; box-shadow: var(--shadow); }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .shell { grid-template-columns: 252px minmax(0,1fr); gap: 32px; }
  .rail { display: none; }
  .toc-mobile { display: block; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 12px 16px; margin: 0 0 22px; }
  .toc-mobile summary { margin: 0; cursor: pointer; }
  .toc-mobile ol { margin: 10px 0 0; padding-left: 18px; }
  .toc-mobile li.sub { margin-left: 14px; list-style: circle; }
  .toc-mobile a { text-decoration: none; }
}
@media (max-width: 900px) {
  .shell, .shell.home { grid-template-columns: minmax(0,1fr); }
  .menu-btn { display: grid; }
  .side { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); max-height: none; background: var(--bg); padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 40px max(16px, env(safe-area-inset-left, 0px)); transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow); visibility: hidden; }
  .side.open { transform: none; visibility: visible; }
  .side-close { display: flex; justify-content: flex-end; }
  .side-close .icon-btn { color: var(--ink); border-color: var(--line); }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(5,15,12,.45); }
  .top-links a:not(.play) { display: none; }
  .search-btn kbd, .search-btn span { display: none; }
  .search-btn { flex: 0 0 40px; width: 40px; padding: 0; justify-content: center; }
  .live { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .start, .library { grid-template-columns: minmax(0,1fr); }
  .release { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .release-when { position: static; display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
  .release-when .badge { margin-top: 0; }
  .release-body { border-left: 0; padding-left: 0; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .logo i { display: none; }
  .logo b { font-size: 19px; }
  .top-links .play { padding: 8px 10px; font-size: 13px; }
  .glance table, .glance thead, .glance thead tr, .glance thead th, .glance tbody, .glance tbody tr, .glance tbody td { display: block; width: 100%; }
  .glance thead th + th { display: none; }
  .glance tbody tr { border-bottom: 1px solid var(--line); }
  .glance tbody tr:last-child { border-bottom: 0; }
  .glance tbody td { border-bottom: 0; }
  .glance tbody td:first-child { width: 100%; padding-bottom: 4px; }
  .calc-out { grid-template-columns: minmax(0,1fr); }
  .pager { grid-template-columns: minmax(0,1fr); }
  .pager a.next { grid-column: 1; }
  .lead { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .topbar, .side, .rail, .scrim, .pager, .toc-mobile { display: none !important; } .shell { display: block; } }

/* Language picker (top bar) */
.lang { position: relative; }
.lang { flex: none; }
.lang > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border: 1px solid rgba(255,252,242,.25); border-radius: var(--r-sm); cursor: pointer; font: 600 14px var(--font-body); color: var(--bar-ink); }
.lang > summary:hover { background: rgba(255,252,242,.1); }
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary:focus-visible { outline: 2px solid var(--gold, #E9B44C); outline-offset: 2px; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 190px; padding: 6px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.18); display: grid; }
.lang-menu a { padding: 9px 12px; border-radius: 8px; text-decoration: none; color: inherit; font-size: 15px; }
.lang-menu a:hover, .lang-menu a:focus-visible { background: var(--brand-soft); }
.lang-menu a[aria-current] { font-weight: 700; color: var(--brand); }
@media (max-width: 520px) { .lang > summary span { display: none; } .lang > summary { width: 40px; padding: 0; justify-content: center; } .topbar-in { gap: 8px; } .lang-menu { right: -48px; } }
/* Phone top bar: menu, logo, search, play, language and theme must fit from 320px up in every language. */
.logo b em { font-style: normal; }
.play .pl-short { display: none; }
@media (max-width: 900px) { .topbar-in { gap: 8px; } .logo { min-width: 0; flex: 0 1 auto; overflow: hidden; } .top-links { flex: none; } }
@media (max-width: 640px) { .logo i { display: none; } }
@media (max-width: 520px) { .play .pl-long { display: none; } .play .pl-short { display: inline; } .logo b { font-size: 18px; } }
@media (max-width: 420px) { .logo b em { display: none; } }
@media (max-width: 340px) { .top-links .play { display: none; } }

/* =====================================================================
   2026-12 redesign: light-first "adventurer's codex" on the REVO key art,
   plus the Ask the Guide chat (Claude Haiku via /api/ask).
   ===================================================================== */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body { background: radial-gradient(1200px 500px at 85% -10%, var(--gold-soft), transparent 60%), var(--bg); }
.topbar { box-shadow: 0 1px 0 rgba(233,180,76,.25), 0 10px 30px -20px rgba(0,0,0,.6); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent); opacity: .55; }

/* Ask button in the top bar */
.ask-top { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 6px; border-radius: 999px; border: 1px solid rgba(233,180,76,.55); background: linear-gradient(180deg, rgba(233,180,76,.22), rgba(233,180,76,.08)); color: var(--bar-ink); font: 700 14px var(--font-body); cursor: pointer; white-space: nowrap; }
.ask-top img { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--gold); object-fit: cover; }
.ask-top:hover { background: rgba(233,180,76,.3); }

/* ---------- home hero on the key art ---------- */
.shell.home main { padding-top: 22px; }
.hero { position: relative; overflow: hidden; border-radius: 22px; min-height: 470px; display: grid; align-items: end; color: #FFFCF2; background: #0F2E25; box-shadow: 0 30px 60px -34px rgba(15,46,37,.75); isolation: isolate; }
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; display: block; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(90deg, rgba(10,32,25,.92) 0%, rgba(10,32,25,.78) 34%, rgba(10,32,25,.25) 62%, rgba(10,32,25,0) 80%),
  linear-gradient(0deg, rgba(10,32,25,.65) 0%, rgba(10,32,25,0) 45%); }
.hero-in { padding: 34px clamp(22px, 4vw, 48px) 32px; max-width: 700px; }
.hero-logo { display: block; width: 168px; height: auto; margin: 0 0 6px -6px; filter: drop-shadow(0 6px 16px rgba(0,0,0,.45)); }
.hero .eyebrow { color: var(--gold); }
.hero h1 { margin: 10px 0 8px; color: #FFFCF2; font-size: clamp(36px, 5vw, 58px); text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.hero h1 em { font: 400 .78em var(--font-script); color: var(--gold); text-transform: none; font-style: normal; display: inline-block; transform: rotate(-4deg); padding: 0 .08em; }
.hero p { color: rgba(255,252,242,.86); font-size: 18px; max-width: 54ch; margin: 0 0 20px; }
.hero p strong { color: #FFFCF2; }
.hero p a { color: var(--gold); }
.hero-ask { display: flex; align-items: center; gap: 10px; max-width: 620px; padding: 6px 6px 6px 8px; background: #FFFCF2; border-radius: 999px; box-shadow: 0 16px 40px -14px rgba(0,0,0,.65), 0 0 0 4px rgba(233,180,76,.28); }
.hero-ask img { width: 44px; height: 44px; border-radius: 50%; flex: none; border: 2px solid var(--gold); object-fit: cover; }
.hero-ask input { flex: 1; min-width: 0; height: 44px; border: 0; outline: none; background: transparent; color: #0F2E25; font: 500 17px var(--font-body); }
.hero-ask input::placeholder { color: rgba(15,46,37,.58); }
.hero-ask button { flex: none; height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: #0E4A38; color: var(--gold); font: 800 16px var(--font-display); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.hero-ask button:hover { background: #0F2E25; }
.hero-asks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 14px; }
.hero-asks span { color: rgba(255,252,242,.7); margin-right: 2px; }
.hero-asks button { border: 1px solid rgba(255,252,242,.3); background: rgba(10,32,25,.35); color: #FFFCF2; border-radius: 999px; padding: 4px 12px; font: 500 14px var(--font-body); cursor: pointer; backdrop-filter: blur(4px); }
.hero-asks button:hover { border-color: var(--gold); color: var(--gold); }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,252,242,.16); }
.hero-search { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; background: rgba(255,252,242,.1); color: #FFFCF2; border: 1px solid rgba(255,252,242,.28); border-radius: 999px; font: 600 14px var(--font-body); cursor: pointer; }
.hero-search kbd { background: transparent; color: rgba(255,252,242,.7); border-color: rgba(255,252,242,.3); }
.hero-search:hover { background: rgba(255,252,242,.18); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { color: rgba(255,252,242,.9); border-radius: 999px; padding: 4px 10px; font-size: 14px; text-decoration: none; }
.chips a::before { content: "→ "; color: var(--gold); }
.chips a:hover { color: var(--gold); }
.live { position: relative; z-index: 2; margin: -28px 18px 8px; }
.live-cell { box-shadow: 0 14px 30px -22px rgba(15,46,37,.55); }

/* home cards */
.home-body > h2 { display: flex; align-items: center; gap: 12px; }
.home-body > h2::before { content: ""; width: 10px; height: 10px; background: var(--gold); transform: rotate(45deg); flex: none; }
.start { counter-reset: st; }
.start a { position: relative; overflow: hidden; border-top: 3px solid var(--gold); padding-top: 20px; transition: transform .18s, box-shadow .18s, border-color .18s; }
.start a:hover { transform: translateY(-2px); }
.start a::after { content: counter(st); position: absolute; right: 12px; top: -8px; font: 800 72px/1 var(--font-display); color: var(--gold-soft); pointer-events: none; }
.shelf { border-top: 3px solid var(--brand); transition: box-shadow .18s; }
.shelf:hover { box-shadow: var(--shadow); }
.shelf h3 { display: flex; align-items: center; gap: 10px; }

/* article header */
.article > h1 { font-size: clamp(34px, 4.6vw, 54px); }
.article .meta { border-bottom: 0; position: relative; }
.article .meta::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: linear-gradient(90deg, var(--gold), var(--line) 30%); }
.article h2 { position: relative; padding-top: 6px; }
.article h2::before { content: ""; position: absolute; left: 0; top: -12px; width: 36px; height: 3px; background: var(--gold); border-radius: 2px; }
.article .release-body > h2::before { display: none; }

/* sidebar: pill style */
.side li a { border-radius: 0 8px 8px 0; }
.side li a.active { background: linear-gradient(90deg, var(--gold-soft), rgba(233,180,76,.04)); }
.rail-box { border-top: 3px solid var(--gold); }
.rail-ask { margin-top: 12px; width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--brand-soft); color: var(--ink); font: 600 14px var(--font-body); cursor: pointer; }

/* ---------- Ask the Guide ---------- */
.ask-fab { position: fixed; z-index: 55; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 10px; padding: 5px 18px 5px 5px; border-radius: 999px; border: 0; background: #0F2E25; color: #FFFCF2; font: 800 15px var(--font-display); letter-spacing: .05em; text-transform: uppercase; cursor: pointer; box-shadow: 0 16px 36px -12px rgba(15,46,37,.7), 0 0 0 3px rgba(233,180,76,.55); transition: transform .18s; }
.ask-fab img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; }
.ask-fab:hover { transform: translateY(-2px); }
.ask-fab[aria-expanded="true"] { display: none; }
.ask { position: fixed; z-index: 58; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: min(420px, calc(100vw - 36px)); height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 40px 90px -30px rgba(5,15,12,.65); overflow: hidden; animation: askIn .22s ease-out; }
@keyframes askIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.ask-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; background: #0F2E25; color: #FFFCF2; border-bottom: 2px solid var(--gold); }
.ask-head img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; flex: none; }
.ask-head div { flex: 1; min-width: 0; }
.ask-head b { display: block; font: 800 18px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.ask-head small { display: block; color: rgba(255,252,242,.7); font-size: 13px; }
.ask-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: #FFFCF2; cursor: pointer; }
.ask-icon:hover { background: rgba(255,252,242,.12); }
.ask-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; background: linear-gradient(180deg, var(--gold-soft), transparent 140px); }
.msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: 4px 0 6px; padding-left: 20px; } .msg li { margin: 2px 0; }
.msg.me { align-self: flex-end; background: #0E4A38; color: #FFFCF2; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.bot a { color: var(--brand); font-weight: 600; }
.msg.note { align-self: center; max-width: 100%; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); font-size: 14px; text-align: center; }
.msg.err { align-self: flex-start; background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.srcs a { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; }
.srcs a::before { content: ""; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
.srcs a:hover { border-color: var(--brand); }
.ask-hello { display: grid; gap: 10px; }
.ask-hello .msg { max-width: 100%; }
.ask-sugs { display: flex; flex-direction: column; gap: 6px; }
.ask-sugs button { text-align: left; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 14px var(--font-body); cursor: pointer; }
.ask-sugs button:hover { border-color: var(--gold); background: var(--gold-soft); }
.typing { display: inline-flex; gap: 4px; padding: 14px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ask-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 6px; border-top: 1px solid var(--line); background: var(--surface); }
.ask-form textarea { overflow-y: hidden; flex: 1; min-width: 0; resize: none; max-height: 120px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 400 16px/1.4 var(--font-body); outline: none; }
.ask-form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ask-form button { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #0E4A38; color: var(--gold); cursor: pointer; }
.ask-form button:disabled { opacity: .45; cursor: default; }
.ask-note { margin: 0; padding: 2px 14px 10px; font-size: 12px; color: var(--muted); background: var(--surface); }
.ask-left { align-self: center; font-size: 12px; color: var(--muted); }

@media (max-width: 1100px) { .ask-top span { display: none; } .ask-top { padding: 0 6px; } }
@media (max-width: 900px) {
  .ask-top { display: none; }
  .hero { min-height: 0; border-radius: 18px; }
  .hero::before { background: linear-gradient(0deg, rgba(10,32,25,.95) 0%, rgba(10,32,25,.82) 55%, rgba(10,32,25,.35) 100%); }
  .hero-in { padding-top: 120px; }
  .live { margin: 14px 0 8px; }
}
@media (max-width: 560px) {
  .hero-logo { width: 128px; }
  .hero-ask { flex-wrap: nowrap; }
  .hero-ask img { display: none; }
  .hero-ask input { padding-left: 10px; font-size: 16px; }
  .hero-ask button { padding: 0 16px; }
  .hero-asks span { width: 100%; }
  .ask-fab span { display: none; }
  .ask-fab { padding: 4px; }
  .ask { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .ask-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .ask-note { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}
body.ask-lock { overflow: hidden; }
@media print { .ask, .ask-fab, .ask-top { display: none !important; } }
