/* Hero's Almanac — layout concept: a night-sky journey. The home page is a quest line
   descending through two ages; chapters are focused, checkable step cards on a timeline rail.
   Dark-first ("night"), with a cool dawn light theme. Element hues (forest, fire, water,
   shadow, spirit, light, power) tint each chapter, boss and dungeon. */
:root {
  --bg: #0b1020;
  --bg-2: #0f1629;
  --surface: #141c32;
  --surface-2: #1b2440;
  --line: #28335a;
  --line-2: #354270;
  --fg: #ede9de;
  --fg-2: #b6bccf;
  --fg-3: #8890aa;
  --gold: #e6bb63;
  --gold-2: #f3d595;
  --on-gold: #1b1404;
  --fairy: #a3dbff;
  --ok: #6fd39b;
  --warn: #f3b552;
  --danger: #f08070;
  --forest: #6bc98b;
  --fire: #f27a5f;
  --water: #5eaaf2;
  --shadow: #ab8fec;
  --spirit: #eea45e;
  --light: #f2d470;
  --power: #e8667e;
  --el: var(--gold);
  --glow: rgba(163, 219, 255, .16);
  --shadow-lg: 0 18px 50px -20px rgba(0, 0, 0, .7);
  --font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-xs: .78rem;
  --fs-sm: .875rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.6rem;
  --fs-xl: clamp(1.9rem, 4.2vw, 2.6rem);
  --fs-2xl: clamp(2.5rem, 7vw, 4.6rem);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1180px;
  --readw: 70ch;
  --header-h: 60px;
  --tabbar-h: 64px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f1f3f9; --bg-2: #e7ebf5; --surface: #ffffff; --surface-2: #f5f7fc;
    --line: #d4daea; --line-2: #c1c9de; --fg: #131a2e; --fg-2: #414d6b; --fg-3: #636e8c;
    --gold: #93650f; --gold-2: #b07c16; --on-gold: #ffffff; --fairy: #1d6aae;
    --ok: #1f8a52; --warn: #a96a00; --danger: #b8382a;
    --forest: #2b8550; --fire: #c2432a; --water: #2768b8; --shadow: #6a4cbc; --spirit: #b0611a; --light: #8d6f00; --power: #b12a47;
    --glow: rgba(29, 106, 174, .10); --shadow-lg: 0 18px 44px -24px rgba(20, 30, 60, .35);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f1f3f9; --bg-2: #e7ebf5; --surface: #ffffff; --surface-2: #f5f7fc;
  --line: #d4daea; --line-2: #c1c9de; --fg: #131a2e; --fg-2: #414d6b; --fg-3: #636e8c;
  --gold: #93650f; --gold-2: #b07c16; --on-gold: #ffffff; --fairy: #1d6aae;
  --ok: #1f8a52; --warn: #a96a00; --danger: #b8382a;
  --forest: #2b8550; --fire: #c2432a; --water: #2768b8; --shadow: #6a4cbc; --spirit: #b0611a; --light: #8d6f00; --power: #b12a47;
  --glow: rgba(29, 106, 174, .10); --shadow-lg: 0 18px 44px -24px rgba(20, 30, 60, .35);
  color-scheme: light;
}

.el-forest { --el: var(--forest); } .el-fire { --el: var(--fire); } .el-water { --el: var(--water); }
.el-shadow { --el: var(--shadow); } .el-spirit { --el: var(--spirit); } .el-light { --el: var(--light); }
.el-power { --el: var(--power); } .el-gold { --el: var(--gold); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 var(--fs-base)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
img, video, svg, canvas { max-width: 100%; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
img, video { height: auto; display: block; }
a { color: var(--fairy); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong { color: var(--fg); font-weight: 650; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; line-height: 1.12; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: var(--fs-md); font-weight: 650; letter-spacing: -.005em; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fairy); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--gold); color: var(--on-gold); padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: calc(10px + env(safe-area-inset-top, 0px)); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 720px) { .wrap { padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); } }
main { flex: 1; }
.stack { display: grid; gap: 16px; }
.eyebrow { font: 500 var(--fs-xs)/1.3 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--el); }
.muted { color: var(--fg-2); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.site-header .wrap { display: flex; align-items: center; gap: 14px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font: 600 1.32rem/1 var(--font-display); letter-spacing: .01em; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font: 500 .62rem/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); margin-top: 3px; }
.nav { display: none; gap: 2px; margin-left: 10px; }
.nav a { color: var(--fg-2); text-decoration: none; padding: 8px 11px; border-radius: 8px; font-size: .95rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); background: var(--surface); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--fg-2); }
.icon-btn:hover { background: var(--surface); color: var(--fg); }
.icon-btn svg { width: 22px; height: 22px; }
.search-trigger { display: none; align-items: center; gap: 10px; height: 42px; padding: 0 12px 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg-3); cursor: pointer; min-width: 220px; font-size: .92rem; }
.search-trigger svg { width: 18px; height: 18px; }
.search-trigger kbd { margin-left: auto; font: 500 .72rem var(--font-mono); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; color: var(--fg-3); }
@media (min-width: 980px) { .nav { display: flex; } .search-trigger { display: inline-flex; } .search-icon-btn { display: none; } }

/* Mobile tab bar (iPhone / iPad portrait) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--bg-2) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.tabbar a, .tabbar button { display: grid; justify-items: center; align-content: center; gap: 3px; height: var(--tabbar-h); color: var(--fg-3); text-decoration: none; font-size: .7rem; font-weight: 600; background: none; border: 0; cursor: pointer; letter-spacing: .01em; }
.tabbar svg { width: 23px; height: 23px; }
.tabbar [aria-current="page"] { color: var(--gold); }
body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 980px) { .tabbar { display: none; } body.has-tabbar { padding-bottom: 0; } }

/* Sheet (More menu, filters on mobile) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(4, 7, 16, .55); z-index: 80; opacity: 0; transition: opacity .2s; }
.sheet-backdrop.open { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; background: var(--surface); border-radius: 20px 20px 0 0; border: 1px solid var(--line); padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); max-height: 85dvh; overflow: auto; overscroll-behavior: contain; transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
.sheet.open { transform: none; }
.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 2px auto 14px; }
.sheet nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet nav a { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); color: var(--fg); text-decoration: none; font-weight: 600; min-height: 52px; }
.sheet nav a svg { width: 20px; height: 20px; color: var(--gold); flex: none; }

/* ---------- Buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); font-weight: 650; text-decoration: none; cursor: pointer; transition: transform .12s, background .2s, border-color .2s; }
.btn:hover { border-color: var(--el); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn svg { width: 19px; height: 19px; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn-primary:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn-el { background: var(--el); border-color: var(--el); color: #0b1020; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .9rem; border-radius: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 600 .74rem/1.4 var(--font-body); letter-spacing: .02em; background: color-mix(in srgb, var(--el) 14%, transparent); color: var(--el); border: 1px solid color-mix(in srgb, var(--el) 35%, transparent); white-space: nowrap; }
.chip svg { width: 13px; height: 13px; }
.chip-plain { background: var(--surface-2); color: var(--fg-2); border-color: var(--line); }
.chip-child { --el: var(--forest); } .chip-adult { --el: var(--water); } .chip-either { --el: var(--fg-3); } .chip-night { --el: var(--shadow); } .chip-both { --el: var(--spirit); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg-2); cursor: pointer; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.toggle-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); border-color: var(--gold); color: var(--fg); }
.toggle-chip svg { width: 15px; height: 15px; }

/* ---------- Hero (home) ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: radial-gradient(120% 90% at 70% 0%, color-mix(in srgb, var(--fairy) 10%, var(--bg)) 0%, var(--bg) 60%); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero .wrap { position: relative; display: grid; gap: 28px; padding-block: 56px 48px; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.25fr .75fr; align-items: center; padding-block: 84px 72px; } }
.hero h1 { font-size: var(--fs-2xl); line-height: .98; letter-spacing: -.02em; }
.hero h1 em { font-style: italic; color: var(--gold); font-weight: 600; }
.hero .lede { font-size: 1.15rem; color: var(--fg-2); max-width: 54ch; margin-top: 18px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.launch-pill { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); font-size: .88rem; color: var(--fg-2); margin-bottom: 20px; }
.launch-pill b { background: var(--gold); color: var(--on-gold); border-radius: 999px; padding: 3px 10px; font: 700 .74rem var(--font-mono); letter-spacing: .06em; }
.hero-panel { background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow-lg); backdrop-filter: blur(6px); }
.hero-panel h2 { font-size: 1.5rem; margin-bottom: 4px; }
.stuck-form { display: flex; gap: 8px; margin-top: 14px; }
.stuck-form input { flex: 1; min-width: 0; height: 50px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg); padding: 0 14px; font-size: 16px; }
.stuck-form input::placeholder { color: var(--fg-3); }
.quick-qs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.quick-qs button { border: 1px solid var(--line); background: transparent; color: var(--fg-2); border-radius: 999px; padding: 7px 12px; font-size: .84rem; cursor: pointer; min-height: 36px; }
.quick-qs button:hover { border-color: var(--gold); color: var(--fg); }

/* ---------- Sections ---------- */
.section { padding-block: 56px; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 26px; }
.section-head h2 { font-size: var(--fs-xl); margin-top: 6px; }
.section-head p { color: var(--fg-2); max-width: 60ch; margin-top: 8px; }

/* Continue card */
.continue { display: none; }
.continue.show { display: flex; }
.continue { align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--fg); margin-top: 18px; }
.continue .ring { flex: none; }
.continue b { display: block; }
.continue span { color: var(--fg-3); font-size: .88rem; }

/* Journey (quest line) */
.era-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.era-tabs button { border: 0; background: none; color: var(--fg-2); padding: 9px 16px; border-radius: 10px; font-weight: 650; cursor: pointer; min-height: 40px; }
.era-tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.journey { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.journey-era { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; margin-top: 18px; color: var(--fg-3); font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.journey-era:first-child { margin-top: 0; }
.journey-era::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.quest { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 8px; padding: 16px 16px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--fg); overflow: hidden; min-height: 148px; transition: transform .18s, border-color .2s; }
.quest::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--el); opacity: .9; }
.quest:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--el) 60%, var(--line)); text-decoration: none; }
.quest .q-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quest .q-num { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .12em; color: var(--el); text-transform: uppercase; }
.quest h3 { font-family: var(--font-display); font-size: 1.42rem; font-weight: 600; }
.quest p { color: var(--fg-2); font-size: .9rem; line-height: 1.45; }
.quest .q-meta { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--fg-3); }
.quest .q-bar { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.quest .q-bar i { display: block; height: 100%; width: 0; background: var(--el); border-radius: 4px; transition: width .4s; }
.quest.done .q-num::after { content: " · Complete"; color: var(--ok); }

/* Feature tiles */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.tile { display: grid; gap: 10px; align-content: start; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--fg); text-decoration: none; }
.tile:hover { border-color: var(--el); text-decoration: none; }
.tile .t-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--el) 16%, transparent); color: var(--el); }
.tile .t-icon svg { width: 22px; height: 22px; }
.tile h3 { font-size: 1.08rem; }
.tile p { color: var(--fg-2); font-size: .92rem; }

/* Progress rings / stats */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.stat { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--fg); }
.stat b { font: 650 1.5rem/1 var(--font-body); font-variant-numeric: tabular-nums; display: block; }
.stat span { color: var(--fg-3); font-size: .85rem; }
.ring { --p: 0; width: 52px; height: 52px; border-radius: 50%; background: conic-gradient(var(--el) calc(var(--p) * 1%), var(--surface-2) 0); display: grid; place-items: center; flex: none; }
.ring::before { content: ""; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); grid-area: 1 / 1; }
.ring svg { grid-area: 1 / 1; width: 20px; height: 20px; color: var(--el); position: relative; }

/* ---------- Page header (inner pages) ---------- */
.page-head { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background:
  radial-gradient(80% 140% at 100% 0%, color-mix(in srgb, var(--el) 22%, transparent) 0%, transparent 60%),
  linear-gradient(180deg, var(--bg-2), var(--bg)); }
.page-head .wrap { padding-block: 34px 30px; display: grid; gap: 14px; }
@media (min-width: 720px) { .page-head .wrap { padding-block: 48px 40px; } }
.page-head h1 { font-size: var(--fs-xl); }
.page-head h1.big { font-size: clamp(2.3rem, 6vw, 3.6rem); }
.page-head .lede { color: var(--fg-2); max-width: 62ch; font-size: 1.08rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .84rem; color: var(--fg-3); }
.crumbs a { color: var(--fg-3); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.crumbs span[aria-hidden] { opacity: .5; }
.head-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.updated { font: 500 .74rem var(--font-mono); color: var(--fg-3); letter-spacing: .05em; }

/* Quick answer box (for readers and AI answer engines) */
.answer { border: 1px solid color-mix(in srgb, var(--el) 40%, var(--line)); background: color-mix(in srgb, var(--el) 7%, var(--surface)); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 10px; }
.answer h2 { font: 600 var(--fs-xs)/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--el); }
.answer p { color: var(--fg); }
.answer dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 4px 0 0; font-size: .95rem; }
.answer dt { color: var(--fg-3); }
.answer dd { margin: 0; }

/* ---------- Chapter layout ---------- */
.chapter-layout { display: grid; gap: 28px; padding-block: 28px 64px; }
@media (min-width: 1040px) { .chapter-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 44px; } }
.chapter-main { min-width: 0; display: grid; gap: 26px; }
.aside { display: grid; gap: 16px; align-content: start; }
@media (min-width: 1040px) { .aside { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 20px); max-height: calc(100vh - 100px); overflow: auto; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel h2, .panel h3 { font: 600 var(--fs-xs)/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 10px; }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; color: var(--fg-2); text-decoration: none; font-size: .92rem; }
.toc a:hover { background: var(--surface-2); color: var(--fg); }
.toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font: 500 .72rem var(--font-mono); color: var(--fg-3); }
.toc a.done { color: var(--fg-3); }
.toc a.done::after { content: "✓"; margin-left: auto; color: var(--ok); }
.guide-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.guide-bar .progress { flex: 1 1 180px; display: grid; gap: 6px; }
.guide-bar .progress span { font-size: .85rem; color: var(--fg-2); }
.bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--el); border-radius: 6px; transition: width .35s; }
.section-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a { flex: none; padding: 8px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--fg-2); text-decoration: none; font-size: .85rem; font-weight: 600; min-height: 38px; display: inline-flex; align-items: center; }

.wt-section { display: grid; gap: 12px; scroll-margin-top: 90px; }
.wt-section > header { display: flex; align-items: baseline; gap: 12px; padding-top: 6px; }
.wt-section > header .n { font: 500 var(--fs-xs) var(--font-mono); color: var(--el); letter-spacing: .1em; }
.wt-section h2 { font-size: 1.75rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; position: relative; }
.step { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding: 12px 40px 12px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); scroll-margin-top: 100px; transition: background .2s, opacity .2s, border-color .2s; }
.step .check { width: 44px; height: 44px; margin: -6px 0; border-radius: 12px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--fg-3); }
.step .check span { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line-2); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.step .check svg { width: 15px; height: 15px; opacity: 0; color: #0b1020; }
.step.done .check span { background: var(--ok); border-color: var(--ok); }
.step.done .check svg { opacity: 1; }
.step.done { opacity: .62; }
.step.done .body p { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--fg-3) 60%, transparent); }
.step .body { display: grid; gap: 8px; min-width: 0; }
.step .body p { line-height: 1.58; }
.step .kind { font: 600 .68rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.step .kind svg { width: 13px; height: 13px; }
.step.k-tip { background: color-mix(in srgb, var(--fairy) 6%, var(--surface)); border-color: color-mix(in srgb, var(--fairy) 22%, var(--line)); }
.step.k-tip .kind { color: var(--fairy); }
.step.k-warn { background: color-mix(in srgb, var(--warn) 7%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.step.k-warn .kind { color: var(--warn); }
.step.k-collectible { background: color-mix(in srgb, var(--gold) 7%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 28%, var(--line)); }
.step.k-collectible .kind { color: var(--gold); }
.step.k-reward { background: color-mix(in srgb, var(--ok) 7%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.step.k-reward .kind { color: var(--ok); }
.step.k-boss { background: color-mix(in srgb, var(--power) 8%, var(--surface)); border-color: color-mix(in srgb, var(--power) 32%, var(--line)); }
.step.k-boss .kind { color: var(--power); }
.step .perma { position: absolute; top: 8px; right: 8px; opacity: 0; font: 500 .7rem var(--font-mono); color: var(--fg-3); text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.step:hover .perma, .step .perma:focus { opacity: 1; }
.step:target { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
.check-flag { color: var(--fg-3); font-size: .78rem; }

/* Media slots */
.media { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.media video, .media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.media figcaption { padding: 8px 12px; font-size: .84rem; color: var(--fg-2); }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; background: #000 center / cover no-repeat; border: 0; cursor: pointer; padding: 0; }
.yt::after { content: ""; position: absolute; inset: 0; margin: auto; width: 68px; height: 48px; border-radius: 12px; background: rgba(0, 0, 0, .7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 28px no-repeat; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Diagrams */
.diagram { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; }
.diagram-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.diagram-head h2, .diagram-head h3 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; color: var(--fg-2); min-height: 40px; padding: 0 14px; border-radius: 9px; font-weight: 650; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--el); color: #0b1020; }
.water-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .water-grid { grid-template-columns: 1fr 1fr; align-items: center; } }
.water-svg { width: 100%; height: auto; display: block; }
.water-svg .lvl { transition: y .9s cubic-bezier(.4, 0, .2, 1), height .9s cubic-bezier(.4, 0, .2, 1); }
.water-info h4 { font-size: 1.1rem; margin-bottom: 6px; }
.water-info ul { margin: 8px 0 0; padding-left: 18px; color: var(--fg-2); display: grid; gap: 6px; }

/* ---------- Collectibles ---------- */
.tracker-top { display: grid; gap: 14px; }
@media (min-width: 900px) { .tracker-top { grid-template-columns: 1fr auto; align-items: end; } }
.token-grid { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; max-width: 520px; }
@media (max-width: 520px) { .token-grid { grid-template-columns: repeat(10, 1fr); } }
.token-grid i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); transition: background .25s; }
.token-grid i.on { background: var(--gold); border-color: var(--gold); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select { height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); padding: 0 12px; font-size: 16px; max-width: 100%; }
.kit { display: grid; gap: 0; }
.kit-groups { padding-top: 12px; }
.kit summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 650; min-height: 44px; }
.kit summary::-webkit-details-marker { display: none; }
.kit summary .chev { margin-left: auto; transition: transform .2s; }
.kit[open] summary .chev { transform: rotate(180deg); }
.kit-groups { display: grid; gap: 12px; margin-top: 6px; }
.kit-group h4 { font: 600 .7rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; }
.kit-preset { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.coll-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.coll-area { margin-top: 18px; display: flex; align-items: baseline; gap: 10px; }
.coll-area h3 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; }
.coll-area span { color: var(--fg-3); font-size: .85rem; font-variant-numeric: tabular-nums; }
.coll { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding: 12px 14px 12px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.coll .check { width: 44px; height: 44px; margin: -6px 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.coll .check span { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; }
.coll .check svg { width: 14px; height: 14px; opacity: 0; color: var(--on-gold); }
.coll.done .check span { background: var(--gold); border-color: var(--gold); }
.coll.done .check svg { opacity: 1; }
.coll.done { opacity: .6; }
.coll h4 { font-size: 1rem; font-weight: 650; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.coll h4 .id { font: 500 .72rem var(--font-mono); color: var(--fg-3); }
.coll p { color: var(--fg-2); font-size: .95rem; margin-top: 6px; }
.coll .chips { margin-top: 8px; }
.coll.locked { border-style: dashed; }
.coll.locked h4::after { content: "Needs more gear"; font: 600 .68rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.empty { padding: 28px; text-align: center; color: var(--fg-3); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------- Reference cards ---------- */
.ref-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.ref { display: grid; gap: 10px; align-content: start; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); scroll-margin-top: 90px; }
.ref h3 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; }
.ref p { color: var(--fg-2); font-size: .95rem; }
.ref dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: .9rem; }
.ref dt { color: var(--fg-3); }
.ref dd { margin: 0; color: var(--fg-2); }
.ref ul { margin: 0; padding-left: 18px; color: var(--fg-2); font-size: .92rem; display: grid; gap: 4px; }
.ref .ref-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.cat-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }

/* Boss pages */
.boss-hero { display: grid; gap: 18px; }
@media (min-width: 860px) { .boss-hero { grid-template-columns: 1fr 280px; align-items: center; } }
.boss-sigil { width: 100%; max-width: 280px; aspect-ratio: 1; justify-self: center; }
.phase-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: ph; }
.phase-list li { counter-increment: ph; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.phase-list li::before { content: counter(ph); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--el) 18%, transparent); color: var(--el); font: 650 .9rem var(--font-mono); }
.kit-row { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-row .chip { font-size: .82rem; padding: 6px 12px; }

/* Trading chain */
.chain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); counter-reset: ch; }
.chain li { counter-increment: ch; position: relative; padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; align-content: start; }
.chain li::before { content: counter(ch, decimal-leading-zero); font: 500 .72rem var(--font-mono); color: var(--el); letter-spacing: .1em; }
.chain h4 { font-size: 1.05rem; }
.chain p { font-size: .88rem; color: var(--fg-2); }
.chain .timer { color: var(--warn); font: 600 .74rem var(--font-mono); }

/* Map */
.map-layout { display: grid; gap: 18px; }
@media (min-width: 980px) { .map-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.map-box { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px; overflow: hidden; }
.map-svg { width: 100%; height: auto; display: block; touch-action: manipulation; }
.map-svg .node { cursor: pointer; }
.map-svg .node circle.halo { transition: r .2s, opacity .2s; }
.map-svg .node:hover circle.halo, .map-svg .node.sel circle.halo { opacity: .55; }
.map-svg .node:focus { outline: none; }
.map-svg .node:focus-visible circle.core { stroke: var(--fairy); stroke-width: 3; }
.region-panel { display: grid; gap: 12px; }
.region-panel h2 { font-family: var(--font-display); font-size: 1.9rem; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mini-list a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--fg); text-decoration: none; font-size: .92rem; }

/* Remake compare */
.compare { display: grid; gap: 10px; }
.cmp { display: grid; gap: 8px; padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
@media (min-width: 760px) { .cmp { grid-template-columns: 200px 1fr 1fr; gap: 18px; align-items: start; } }
.cmp h3 { font-size: 1rem; }
.cmp .was { color: var(--fg-3); font-size: .93rem; }
.cmp .now { color: var(--fg); font-size: .95rem; }
.cmp .lab { display: block; font: 600 .66rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 3px; }
.cmp .was .lab { color: var(--fg-3); }
.cmp .now .lab { color: var(--gold); }
.src { font-size: .78rem; color: var(--fg-3); }
.status { font: 600 .68rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.status.confirmed { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.status.reported { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.status.unknown { color: var(--fg-3); background: var(--surface-2); }

/* Prose & FAQ */
.prose { max-width: var(--readw); display: grid; gap: 14px; color: var(--fg-2); }
.prose h2 { color: var(--fg); font-size: 1.8rem; margin-top: 18px; }
.prose h3 { color: var(--fg); margin-top: 10px; }
.prose ul, .prose ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.faq { display: grid; gap: 8px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 650; list-style: none; display: flex; gap: 12px; align-items: center; min-height: 52px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--gold); font: 400 1.4rem/1 var(--font-body); }
.faq details[open] summary::after { content: "–"; }
.faq .a { padding: 0 18px 16px; color: var(--fg-2); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 .7rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td { color: var(--fg-2); }
td:first-child { color: var(--fg); font-weight: 600; }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--fairy) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--fairy) 25%, var(--line)); color: var(--fg-2); font-size: .93rem; }
.callout svg { width: 20px; height: 20px; flex: none; color: var(--fairy); margin-top: 2px; }
.pager { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.pager a { display: grid; gap: 4px; padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--fg); min-width: 0; }
.pager a:hover { border-color: var(--el); }
.pager .dir { font: 500 .7rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
.pager b { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; overflow-wrap: anywhere; }
.pager .next { text-align: right; }

/* ---------- Guide Mode overlay ---------- */
.guide { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: 100%; height: 100dvh; padding-top: env(safe-area-inset-top, 0px); }
.guide[hidden] { display: none !important; }
.guide-top { display: flex; align-items: center; gap: 12px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); }
.guide-top .t { min-width: 0; flex: 1; }
.guide-top .t b { display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-top .t span { font: 500 .72rem var(--font-mono); color: var(--fg-3); letter-spacing: .08em; }
.guide-progress { height: 3px; background: var(--surface-2); }
.guide-progress i { display: block; height: 100%; width: 0; background: var(--el); transition: width .3s; }
.guide-stage { overflow: auto; overscroll-behavior: contain; display: grid; place-items: center; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px)); touch-action: pan-y; }
.guide-card { width: 100%; max-width: 720px; display: grid; gap: 16px; animation: cardIn .28s cubic-bezier(.2, .8, .2, 1); }
.guide-card .sec { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--el); }
.guide-card .txt { font-size: clamp(1.15rem, 2.6vw, 1.45rem); line-height: 1.55; color: var(--fg); }
.guide-card .kind { font: 600 .74rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.guide-bottom { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 8px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--line); background: var(--bg-2); }
.guide-bottom .btn { min-height: 54px; padding: 0 10px; }
.guide-hint { text-align: center; color: var(--fg-3); font-size: .78rem; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
html.guide-open, html.guide-open body { overflow: hidden; }

/* ---------- Search ---------- */
.search-modal { position: fixed; inset: 0; z-index: 95; display: grid; align-items: start; justify-items: center; background: rgba(4, 7, 16, .6); padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px 8px; }
.search-modal[hidden] { display: none !important; }
.search-box { width: 100%; max-width: 680px; max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px)); display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); }
@media (min-width: 720px) { .search-modal { padding-top: 12vh; } .search-box { max-height: 72vh; } }
.search-input { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.search-input svg { width: 20px; height: 20px; color: var(--fg-3); flex: none; }
.search-input input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; color: var(--fg); font-size: 17px; outline: none; }
.search-results { overflow: auto; overscroll-behavior: contain; padding: 8px; }
.search-results a { display: grid; gap: 3px; padding: 11px 12px; border-radius: 10px; color: var(--fg); text-decoration: none; }
.search-results a:hover, .search-results a.active { background: var(--surface-2); }
.search-results .r-type { font: 600 .66rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.search-results .r-title { font-weight: 650; }
.search-results .r-snip { font-size: .86rem; color: var(--fg-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results mark { background: color-mix(in srgb, var(--gold) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 26px 14px; color: var(--fg-3); text-align: center; font-size: .92rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: auto; }
.site-footer .wrap { padding-block: 40px 36px; display: grid; gap: 28px; }
.foot-cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.foot-cols h2 { font: 600 .7rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 10px; }
.foot-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.foot-cols a { color: var(--fg-2); text-decoration: none; font-size: .92rem; display: inline-block; padding: 4px 0; }
.foot-cols a:hover { color: var(--fg); }
.disclaimer { font-size: .8rem; color: var(--fg-3); max-width: 80ch; line-height: 1.55; }

.toast { white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 650; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 99; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 980px) { .toast { bottom: 28px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media (hover: none) { .step .perma { opacity: .55; } }

/* Theme toggle icon */
[data-theme-toggle] .i-moon { display: none; }
:root[data-theme="light"] [data-theme-toggle] .i-sun { display: none; }
:root[data-theme="light"] [data-theme-toggle] .i-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) [data-theme-toggle] .i-sun { display: none; }
  :root:not([data-theme="dark"]) [data-theme-toggle] .i-moon { display: block; }
}
.water-svg .lvl { transition: transform .9s cubic-bezier(.4, 0, .2, 1); }
.region-panel h3 { font: 600 var(--fs-xs)/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); margin-top: 6px; }

.panel.region-panel h2 { font: 600 2rem/1.1 var(--font-display); text-transform: none; letter-spacing: -.01em; color: var(--fg); margin: 0; }
.panel.region-panel .eyebrow { margin-bottom: -6px; }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.guide-card .big-n { font: 600 clamp(3.2rem, 12vw, 5.5rem)/.9 var(--font-display); color: var(--el); opacity: .9; letter-spacing: -.02em; }
.guide-card .big-n small { font: 500 .8rem var(--font-mono); letter-spacing: .12em; color: var(--fg-3); margin-left: 10px; text-transform: uppercase; vertical-align: middle; }
@media (max-width: 720px) { .guide-stage { place-items: start center; padding-top: 28px; } }
.map-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.map-hint { display: none; font-size: .8rem; color: var(--fg-3); padding: 6px 4px 0; }
@media (max-width: 760px) { .map-hint { display: block; } }
@media (max-width: 979px) { html { scroll-padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px); } }
h1, h2, .quest h3, .pager b, .guide-card .big-n, .coll-area h3, .ref h3 { font-variant-numeric: lining-nums; }

/* ---------- Atlas (painted map) ---------- */
.atlas-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.atlas-bar .seg button { display: inline-flex; align-items: center; gap: 6px; }
.atlas-bar .seg .ic { width: 16px; height: 16px; }
.atlas-layout { display: grid; gap: 18px; }
@media (min-width: 1040px) { .atlas-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.atlas { position: relative; height: clamp(420px, 68vh, 780px); border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); background: #cdbb92; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: var(--shadow-lg); }
.atlas.dragging { cursor: grabbing; }
.atlas-world { position: absolute; left: 0; top: 0; width: 2400px; height: 1600px; transform-origin: 0 0; will-change: transform; }
.atlas-world img { width: 2400px; height: 2400px; height: 1600px; max-width: none; display: block; transition: filter .6s; -webkit-user-drag: none; }
.atlas-tint, .atlas-storm, .atlas-lights { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s; }
.atlas-tint { background: rgba(12, 22, 66, .58); mix-blend-mode: multiply; }
.atlas-storm { background: radial-gradient(560px 380px at 1180px 220px, rgba(110, 16, 36, .62), rgba(60, 10, 30, .28) 55%, transparent 78%); mix-blend-mode: multiply; }
.atlas-lights i { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(255, 205, 120, .9) 0, rgba(255, 170, 80, .35) 35%, rgba(255, 170, 80, 0) 70%); mix-blend-mode: screen; }
.atlas[data-time="night"] .atlas-tint, .atlas[data-time="night"] .atlas-lights, .atlas[data-era="adult"] .atlas-storm { opacity: 1; }
.atlas[data-time="night"] .atlas-world img { filter: saturate(.7) brightness(.86); }
.atlas[data-era="adult"] .atlas-world img { filter: saturate(.8) sepia(.14); }
.atlas[data-era="adult"][data-time="night"] .atlas-world img { filter: saturate(.6) brightness(.8) sepia(.1); }
.atlas-pins { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; background: none; padding: 0; cursor: pointer; display: grid; justify-items: center; gap: 2px; color: #2a1f14; -webkit-tap-highlight-color: transparent; }
.pin:focus-visible { outline: 2px solid #1d6aae; outline-offset: 2px; }
.pin-region { min-height: 36px; align-content: center; }
.pin-name { font: 700 15px/1.1 var(--font-display); letter-spacing: .02em; white-space: nowrap; text-shadow: 0 0 3px #f3e7c8, 0 0 6px #f3e7c8, 0 0 10px rgba(243, 231, 200, .9); }
.pin-region.sel .pin-name { color: #7a3e10; }
.pin-counts { display: flex; gap: 4px; }
.pin-counts span { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 4px; border-radius: 999px; background: rgba(30, 24, 16, .78); color: #f6d98f; font: 600 11px/1.5 var(--font-body); font-variant-numeric: tabular-nums; }
.pin-counts span.h { color: #ff9aa8; }
.pin-counts svg { width: 12px; height: 12px; }
.atlas:not(.show-counts) .pin-counts { display: none; }
.pin-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--el); color: #fff; border: 2px solid #2a1f14; box-shadow: 0 2px 6px rgba(0, 0, 0, .45), 0 0 0 3px rgba(243, 231, 200, .65); transition: transform .15s; }
.pin-dot .ic { width: 18px; height: 18px; color: #1b1206; }
.pin:hover .pin-dot, .pin.sel .pin-dot { transform: scale(1.15); }
.pin-warp .pin-dot { border-radius: 8px; transform: rotate(45deg); width: 28px; height: 28px; background: #2a3b6a; }
.pin-warp .pin-dot .ic { transform: rotate(-45deg); color: #ffe7a6; width: 15px; height: 15px; }
.pin-warp:hover .pin-dot, .pin-warp.sel .pin-dot { transform: rotate(45deg) scale(1.15); }
.pin-fairy .pin-dot { width: 28px; height: 28px; background: #f6c1dc; }
.pin-fairy .pin-dot .ic { color: #6a1f4a; width: 16px; height: 16px; }
.pin-poi .pin-dot { width: 26px; height: 26px; background: #efe1bd; }
.pin-poi .pin-dot .ic { color: #5a4020; width: 14px; height: 14px; }
.pin-label { font: 650 12px/1.2 var(--font-body); white-space: nowrap; padding: 2px 7px; border-radius: 6px; background: rgba(30, 24, 16, .82); color: #f6ecd2; display: none; }
.atlas.z-near .pin-label, .pin:hover .pin-label, .pin.sel .pin-label, .pin:focus-visible .pin-label { display: block; }
.atlas:not(.show-dungeon) .pin-dungeon, .atlas:not(.show-warp) .pin-warp, .atlas:not(.show-fairy) .pin-fairy, .atlas:not(.show-poi) .pin-poi { display: none; }
.atlas[data-era="child"] .pin[data-era="adult"], .atlas[data-era="adult"] .pin[data-era="child"] { display: none; }
.atlas.z-far .pin-counts, .atlas.z-far .pin-poi { display: none; }
.atlas.z-far .pin-name { font-size: 12px; }
.atlas[data-time="night"] .pin-name { color: #f6ecd2; text-shadow: 0 0 3px #0b1020, 0 0 6px #0b1020, 0 0 10px rgba(11, 16, 32, .9); }
.atlas[data-time="night"] .pin-region.sel .pin-name { color: #ffd27a; }
.atlas-zoom { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; }
.atlas-zoom .icon-btn { background: rgba(250, 243, 225, .92); color: #2a1f14; border: 1px solid rgba(42, 31, 20, .35); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.atlas-zoom .icon-btn b { font: 600 22px/1 var(--font-body); }
.atlas-hint { position: absolute; left: 12px; bottom: 10px; margin: 0; font-size: .78rem; color: #3b2f22; background: rgba(250, 243, 225, .85); padding: 4px 10px; border-radius: 999px; pointer-events: none; }
@media (hover: none) { .atlas-hint { display: none; } }
.region-panel .btn { justify-self: start; }

/* ---------- Friendlier shapes ---------- */
:root { --radius: 20px; --radius-sm: 12px; }
.quest, .tile, .stat, .ref, .coll, .step, .panel, .answer, .guide-bar, .chain li, .phase-list li, .pager a, .cmp, .faq details, .diagram { border-radius: var(--radius); }
.btn { border-radius: 999px; }
.btn-big { min-height: 56px; padding: 0 28px; font-size: 1.08rem; box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--gold) 70%, transparent); }
.quest { transition: transform .2s cubic-bezier(.2, .8, .2, 1.4), border-color .2s, box-shadow .2s; }
.quest:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 16px 34px -18px color-mix(in srgb, var(--el) 70%, transparent); }
.tile:hover .t-icon { transform: scale(1.12) rotate(-6deg); }
.tile .t-icon { transition: transform .25s cubic-bezier(.2, .8, .2, 1.6); border-radius: 50%; }
h1, .brand > span { font-family: "Cinzel", var(--font-display); }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.05; letter-spacing: 0; }
.hero h1 em { font-style: normal; }
.page-head h1 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); letter-spacing: .01em; }
.page-head h1.big { font-size: clamp(1.9rem, 5vw, 3rem); }
.brand { font-family: "Cinzel", var(--font-display); font-size: 1.12rem; }
/* "In-game text box" quick answers */
.answer { position: relative; background: color-mix(in srgb, #0a1230 82%, var(--surface)); border: 2px solid color-mix(in srgb, var(--gold) 70%, transparent); box-shadow: inset 0 0 0 4px color-mix(in srgb, #0a1230 82%, var(--surface)), inset 0 0 0 5px color-mix(in srgb, var(--gold) 35%, transparent); color: #eef0f7; }
.answer p, .answer dd, .answer strong { color: #eef0f7; }
.answer dt { color: #a9b2cc; }
.answer h2 { color: var(--gold-2); }
.answer a { color: #a3dbff; }
.answer::after { content: ""; position: absolute; right: 18px; bottom: 12px; border: 7px solid transparent; border-top-color: #e6bb63; animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* Hero with painted map */
.hero { background: var(--bg); }
.hero-map { position: absolute; inset: -4% -2%; width: 104%; height: 108%; max-width: none; object-fit: cover; opacity: .38; filter: saturate(1.1) blur(1px); }
:root:not([data-theme="light"]) .hero-map { opacity: .28; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 8%, color-mix(in srgb, var(--bg) 55%, transparent) 55%, color-mix(in srgb, var(--bg) 30%, transparent)), linear-gradient(0deg, var(--bg), transparent 30%); pointer-events: none; }
.hero .wrap { z-index: 1; }
.phone-demo { justify-self: center; width: min(320px, 86vw); aspect-ratio: 9 / 17; border-radius: 42px; padding: 12px; background: linear-gradient(160deg, #2a3350, #0e1428); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(255, 255, 255, .08); transform: rotate(3deg); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: rotate(2deg) translateY(-8px); } }
.pd-screen { height: 100%; border-radius: 32px; background: #0d1426; padding: 22px 18px; display: flex; flex-direction: column; gap: 12px; color: #eef0f7; overflow: hidden; border: 1px solid #263257; }
.pd-top { display: flex; justify-content: space-between; align-items: center; font: 600 .78rem var(--font-body); color: #a9b2cc; gap: 8px; }
.pd-hearts { display: flex; gap: 2px; }
.pd-hearts i { width: 11px; height: 10px; background: #ff5a6e; clip-path: path('M5.5 10 0.6 5A2.9 2.9 0 0 1 5.5 1.6 2.9 2.9 0 0 1 10.4 5Z'); }
.pd-bar { height: 5px; border-radius: 5px; background: #1f2a4a; } .pd-bar i { display: block; height: 100%; width: 22%; border-radius: 5px; background: #5eaaf2; }
.pd-part { font: 600 .7rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: #5eaaf2; margin-top: 14px; }
.pd-txt { font: 500 1.12rem/1.5 var(--font-body); }
.pd-near { margin-top: auto; display: grid; gap: 6px; font-size: .8rem; color: #f3d595; }
.pd-near span { display: flex; align-items: center; gap: 6px; background: #17213d; border-radius: 12px; padding: 8px 10px; }
.pd-near .ic { width: 16px; height: 16px; }
.pd-btns { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 6px; font: 650 .78rem var(--font-body); text-align: center; }
.pd-btns span { border: 1px solid #2b3963; border-radius: 999px; padding: 10px 4px; }
.pd-btns .go { background: #5eaaf2; color: #0b1020; border-color: #5eaaf2; }
@media (max-width: 899px) { .phone-demo { width: min(270px, 70vw); } }
.stuck-band { padding-block: 28px; }
.map-teaser { position: relative; display: block; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); color: #fff; text-decoration: none; background: #cdbb92; }
.map-teaser img { width: 100%; aspect-ratio: 2.2 / 1; object-fit: cover; transition: transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.map-teaser:hover img { transform: scale(1.04); }
.mt-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 24px 22px; background: linear-gradient(0deg, rgba(8, 12, 26, .88), transparent); display: grid; gap: 4px; }
.mt-cap b { font: 700 clamp(1.5rem, 4vw, 2.4rem)/1.1 "Cinzel", var(--font-display); }
.mt-cap span:last-child { color: #dfe3ef; max-width: 60ch; }
@media (max-width: 600px) { .map-teaser img { aspect-ratio: 4 / 3; } }

/* Mini-map cards */
.minimap { display: grid; gap: 0; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); text-decoration: none; background: var(--surface); }
.mm-frame { position: relative; display: block; height: 170px; overflow: hidden; background: #cdbb92; }
.mm-frame img { position: absolute; width: 1200px; height: 800px; max-width: none; }
.mm-pin { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--el, var(--gold)); border: 3px solid #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--el, var(--gold)) 35%, transparent); animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--el, var(--gold)) 60%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }
.mm-cap { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: .86rem; font-weight: 600; color: var(--fg-2); }
.mm-cap .ic { color: var(--el, var(--gold)); width: 18px; height: 18px; }

/* Tab bar play button */
.tabbar .tab-play { position: relative; }
.tabbar .tab-play .tp { width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--on-gold); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--gold) 80%, transparent); border: 4px solid var(--bg-2); }
.tabbar .tab-play .tp .ic { width: 22px; height: 22px; }
.tabbar .tab-play[aria-current="page"] { color: var(--gold); }

/* ---------- Play Companion ---------- */
.companion { padding-block: 18px 40px; background: radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--el) 14%, transparent), transparent 70%); }
.cp-wrap { display: grid; gap: 16px; }
.cp-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.cp-title { display: grid; gap: 6px; min-width: 0; }
.cp-title select { font: 700 clamp(1.1rem, 3.4vw, 1.5rem) "Cinzel", var(--font-display); color: var(--fg); background: transparent; border: 0; border-bottom: 2px dashed var(--line-2); padding: 4px 26px 6px 0; max-width: 100%; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--el) 50%), linear-gradient(135deg, var(--el) 50%, transparent 50%); background-position: right 8px center, right 2px center; background-size: 6px 6px; background-repeat: no-repeat; cursor: pointer; }
.cp-title select option { color: #131a2e; }
.cp-meter { display: flex; flex-wrap: wrap; gap: 3px; max-width: 260px; }
.cp-meter i { width: 20px; height: 18px; background: #ff5a6e; clip-path: path('M10 18 1.2 9.2A5 5 0 0 1 10 2.9 5 5 0 0 1 18.8 9.2Z'); filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); }
.cp-meter i.q1 { background: linear-gradient(90deg, #ff5a6e 25%, var(--surface-2) 25%); }
.cp-meter i.q2 { background: linear-gradient(90deg, #ff5a6e 50%, var(--surface-2) 50%); }
.cp-meter i.q3 { background: linear-gradient(90deg, #ff5a6e 75%, var(--surface-2) 75%); }
.cp-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .cp-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.cp-card { display: grid; gap: 14px; padding: 22px; border-radius: 28px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--el) 40%, var(--line)); box-shadow: 0 24px 50px -30px color-mix(in srgb, var(--el) 60%, transparent); touch-action: pan-y; }
.cp-card-top { display: flex; justify-content: space-between; gap: 10px; font: 600 .74rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--el); }
.cp-count { color: var(--fg-3); }
.cp-bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.cp-bar i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--el), color-mix(in srgb, var(--el) 60%, #fff)); transition: width .35s; }
.cp-step { min-height: 190px; display: grid; align-content: start; gap: 10px; padding: 18px; border-radius: 20px; background: var(--bg-2); animation: cardIn .28s cubic-bezier(.2, .8, .2, 1); }
.cp-txt { font-size: clamp(1.15rem, 2.8vw, 1.4rem); line-height: 1.55; color: var(--fg); }
.cp-kind { justify-self: start; font: 650 .72rem var(--font-body); letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--fairy) 16%, transparent); color: var(--fairy); }
.cp-step.k-warn .cp-kind { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.cp-step.k-reward .cp-kind { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.cp-step.k-collectible .cp-kind { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.cp-step.k-boss .cp-kind { background: color-mix(in srgb, var(--power) 16%, transparent); color: var(--power); }
.cp-done-badge { justify-self: start; color: var(--ok); font-weight: 700; font-size: .9rem; }
.cp-actions { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 8px; }
.cp-actions .btn { min-height: 56px; padding: 0 10px; }
.cp-hint { text-align: center; color: var(--fg-3); font-size: .8rem; }
.cp-side { display: grid; gap: 14px; }
.cp-coll { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.cp-coll button { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; min-height: 48px; }
.cp-coll b { display: block; font-size: .92rem; } .cp-coll small { color: var(--fg-3); font-size: .78rem; }
.cp-coll .dot { width: 16px; height: 16px; border-radius: 50%; flex: none; border: 2px solid var(--gold); }
.cp-coll .dot.hp { border-color: #ff5a6e; }
.cp-coll li.on .dot.gs { background: var(--gold); } .cp-coll li.on .dot.hp { background: #ff5a6e; }
.cp-coll li.on b { text-decoration: line-through; color: var(--fg-3); }
.cp-stat-row { display: flex; gap: 14px; flex-wrap: wrap; font-variant-numeric: tabular-nums; color: var(--fg-2); }
.cp-stat-row span { display: inline-flex; align-items: center; gap: 6px; } .cp-stat-row b { color: var(--fg); font-size: 1.15rem; }
.cp-map .mm-frame { height: 150px; }
.nav a { white-space: nowrap; }
.cp-grid > *, .cp-head > *, .cp-wrap > * { min-width: 0; }
.cp-title select { width: 100%; text-overflow: ellipsis; }
.cp-step { overflow-wrap: anywhere; }
.atlas.z-far .pin-warp, .atlas.z-far .pin-fairy { display: none; }
.atlas.z-far .pin-dot { width: 26px; height: 26px; }
.atlas.z-far .pin-dot .ic { width: 14px; height: 14px; }
.pin:not(.pin-region) { padding: 6px; }
.cp-actions .btn { white-space: nowrap; font-size: clamp(.86rem, 3.6vw, 1rem); }
@media (max-width: 700px) {
  .atlas-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .atlas-bar::-webkit-scrollbar { display: none; }
  .atlas-bar .chips { flex-wrap: nowrap; }
  .atlas-bar .toggle-chip, .atlas-bar .seg { flex: none; }
  .atlas { height: 64vh; height: 64dvh; }
  main:has([data-atlas]) .page-head .lede { display: none; }
  main:has([data-atlas]) .page-head .wrap { padding-block: 20px 16px; }
}
.aside { grid-auto-rows: max-content; }
/* Map art has its own labels: region pins become invisible tap targets over them, with count badges below */
.pin-region { min-width: 120px; min-height: 40px; }
.pin-region .pin-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pin-region .pin-counts { transform: translateY(28px); }
.pin-region.sel::before { content: ""; position: absolute; inset: -6px -10px; border-radius: 12px; border: 3px solid #ffd27a; box-shadow: 0 0 0 3px rgba(42, 31, 20, .5), 0 0 20px rgba(255, 210, 122, .8); }
.atlas-storm { background: radial-gradient(520px 340px at 1160px 170px, rgba(110, 16, 36, .62), rgba(60, 10, 30, .28) 55%, transparent 78%); }
/* Wide, roomy map page */
.wrap-wide { max-width: 1720px; }
.atlas-layout { position: relative; display: block; }
.atlas { height: calc(100vh - var(--header-h) - 150px); height: calc(100dvh - var(--header-h) - 150px); min-height: 460px; max-height: 1100px; }
.region-panel { margin-top: 16px; }
.panel-close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; }
.region-panel { position: relative; }
.region-panel.collapsed { display: none; }
.atlas-zoom { right: 12px; top: 12px; }
@media (min-width: 1040px) {
  .region-panel { position: absolute; margin: 0; top: 14px; left: 14px; width: 330px; max-height: calc(100% - 28px); overflow: auto; z-index: 3; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: var(--shadow-lg); }
}
.atlas-layout.is-full { position: fixed; inset: 0; z-index: 92; background: #0b1020; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.atlas-layout.is-full .atlas { height: 100%; max-height: none; border-radius: 0; border: 0; }
.atlas-layout.is-full .region-panel { position: absolute; z-index: 3; }
@media (max-width: 1039px) { .atlas-layout.is-full .region-panel { left: 10px; right: 10px; bottom: 10px; top: auto; max-height: 45%; overflow: auto; margin: 0; } }
@media (max-width: 700px) { .atlas { height: 70vh; height: 70dvh; } }
main:has([data-atlas]) .page-head .lede { display: none; }
main:has([data-atlas]) .page-head .wrap { padding-block: 18px 14px; gap: 6px; }
main:has([data-atlas]) .page-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
main:has([data-atlas]) .page-head .crumbs, main:has([data-atlas]) .page-head .head-meta { display: none; }
.atlas { height: calc(100vh - var(--header-h) - 190px); height: calc(100dvh - var(--header-h) - 190px); }
@media (max-width: 979px) { .atlas { height: calc(100dvh - var(--header-h) - var(--tabbar-h) - 200px); min-height: 420px; } }
@media (max-width: 1039px) { .region-panel.collapsed { display: block; } .region-panel .panel-close { display: none; } }
@media (max-width: 700px) { .atlas-zoom { top: auto; bottom: 12px; right: 10px; grid-auto-flow: row; gap: 4px; } .atlas-zoom .icon-btn { width: 40px; height: 40px; } }
/* Layers you switch on always show, at any zoom */
.atlas.z-far.show-counts .pin-counts { display: flex; }
.atlas.z-far.show-poi .pin-poi, .atlas.z-far.show-warp .pin-warp, .atlas.z-far.show-fairy .pin-fairy { display: grid; }
.atlas[data-era="child"] .pin[data-era="adult"], .atlas[data-era="adult"] .pin[data-era="child"] { display: none !important; }
.atlas.z-far .pin-counts span { font-size: 10px; padding: 0 5px 0 3px; }
.atlas.z-far .pin-region .pin-counts { transform: translateY(22px); }
