/* CertLenze — mixed design system
   Atlas: the light explorer palette and the island world map.
   Console: the dark theme and the mono game HUD.
   Arcade: chunky pressable buttons, the region path and boss battles. */

:root {
  --bg: #E7EEEA;
  --surface: #F8FAF7;
  --surface-2: #FFFFFF;
  --sunken: #DDE6E1;
  --ink: #1B2F2B;
  --muted: #4C635D;
  --line: #D3DED9;
  --accent: #C4421D;
  --accent-press: #93300F;
  --accent-ink: #FFFFFF;
  --accent-soft: #FBE6DF;
  --cyan: #0E7C93;
  --good: #1F7A5C;
  --good-press: #145440;
  --good-soft: #E1F0EB;
  --bad: #B3261E;
  --bad-soft: #FCE5E2;
  --gold: #E9A21B;
  --gold-press: #B87C0C;
  --boss: #C2185B;
  --boss-press: #8E1042;
  --sea: #BDD7DB;
  --sea-line: #A9CACF;
  --land: #F8FAF7;
  --land-line: #1B2F2B;
  --locked: #D9E6E3;
  --locked-line: #8EA7A1;
  --panel-dark: #1B2F2B;
  --panel-dark-ink: #F8FAF7;
  --panel-dark-muted: #B9CBC6;
  --focus: #0E7C93;
  --shadow: 0 10px 30px rgba(27, 47, 43, 0.12);

  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1020; --surface: #111A2E; --surface-2: #17233F; --sunken: #0E1528; --ink: #E6EDF7; --muted: #93A2BE;
    --line: #23314F; --accent: #FF8A5B; --accent-press: #C45A30; --accent-ink: #1A0B04; --accent-soft: #3A1E14;
    --cyan: #36D6F0; --good: #3DDC97; --good-press: #1F8F5E; --good-soft: #0F2A22; --bad: #FF6B7F; --bad-soft: #2E1520;
    --gold: #FFB547; --gold-press: #B97B17; --boss: #FF5C9A; --boss-press: #A8305E; --sea: #0F1A33; --sea-line: #1C2A4D;
    --land: #16223D; --land-line: #36D6F0; --locked: #141D33; --locked-line: #2E3D62; --panel-dark: #17233F;
    --panel-dark-ink: #E6EDF7; --panel-dark-muted: #93A2BE; --focus: #36D6F0; --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1020; --surface: #111A2E; --surface-2: #17233F; --sunken: #0E1528; --ink: #E6EDF7; --muted: #93A2BE;
  --line: #23314F; --accent: #FF8A5B; --accent-press: #C45A30; --accent-ink: #1A0B04; --accent-soft: #3A1E14;
  --cyan: #36D6F0; --good: #3DDC97; --good-press: #1F8F5E; --good-soft: #0F2A22; --bad: #FF6B7F; --bad-soft: #2E1520;
  --gold: #FFB547; --gold-press: #B97B17; --boss: #FF5C9A; --boss-press: #A8305E; --sea: #0F1A33; --sea-line: #1C2A4D;
  --land: #16223D; --land-line: #36D6F0; --locked: #141D33; --locked-line: #2E3D62; --panel-dark: #17233F;
  --panel-dark-ink: #E6EDF7; --panel-dark-muted: #93A2BE; --focus: #36D6F0; --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--accent); }
a:hover { color: var(--accent-press); }
:root[data-theme="dark"] a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; letter-spacing: -0.015em; text-wrap: balance; line-height: 1.15; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 800; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button[disabled] { cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spacer { flex: 1 1 0; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); }
.narrow { max-width: 860px; }

/* ---------------------------------------------------------- buttons (Arcade) */
.btn {
  --b-bg: var(--surface-2); --b-ink: var(--ink); --b-edge: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 14px; border: 2px solid var(--b-edge); background: var(--b-bg); color: var(--b-ink);
  font-weight: 700; font-size: 0.98rem; text-decoration: none; box-shadow: 0 4px 0 var(--b-edge);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.btn:hover { color: var(--b-ink); filter: brightness(1.03); }
.btn:active:not([disabled]) { transform: translateY(3px); box-shadow: 0 1px 0 var(--b-edge); }
.btn[disabled] { opacity: 0.5; }
.btn.primary { --b-bg: var(--accent); --b-ink: var(--accent-ink); --b-edge: var(--accent-press); }
.btn.good { --b-bg: var(--good); --b-ink: #FFFFFF; --b-edge: var(--good-press); }
:root[data-theme="dark"] .btn.good { --b-ink: #06150F; }
.btn.boss { --b-bg: var(--boss); --b-ink: #FFFFFF; --b-edge: var(--boss-press); }
.btn.ghost { --b-bg: transparent; box-shadow: none; }
.btn.ghost:active { transform: none; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.88rem; border-radius: 11px; box-shadow: 0 3px 0 var(--b-edge); }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------- top bar / HUD */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 21; background: var(--bg); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand b { font-family: var(--f-display); font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; }
.brand small { font-size: 0.72rem; color: var(--muted); display: block; margin-top: -4px; }
.exam-chip { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 0.85rem; }
.exam-chip span { color: var(--muted); font-weight: 500; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; padding: 8px 10px; border-radius: 10px; font-size: 0.93rem; }
.nav a:hover { color: var(--ink); background: var(--sunken); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.hud { display: flex; flex-wrap: wrap; gap: 8px; }
.hud-pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--f-mono); font-size: 0.82rem; }
.hud-pill b { font-weight: 600; }
.hud-pill .lvl { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 0.78rem; }
.xpbar { width: 70px; height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--cyan); }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface-2); font-weight: 700; display: grid; place-items: center; text-decoration: none; color: var(--ink); }
.banner { max-width: 1240px; margin: 12px auto 0; padding: 10px 16px; border-radius: 12px; background: var(--accent-soft); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 0.92rem; }

/* ---------------------------------------------------------- cards and panels */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.card.tight { padding: 16px; }
.panel-dark { background: var(--panel-dark); color: var(--panel-dark-ink); border-radius: var(--r-lg); padding: 22px; }
.panel-dark .eyebrow, .panel-dark .muted { color: var(--panel-dark-muted); }
.grid-main { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.grid-main > .main { flex: 999 1 620px; min-width: 0; }
.grid-main > .side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--sunken); color: var(--muted); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.fog { background: transparent; border: 1.5px dashed var(--locked-line); color: var(--muted); }
.meter { height: 10px; border-radius: 5px; background: var(--sunken); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 5px; background: var(--good); }
.stars { display: inline-flex; gap: 2px; color: var(--gold); letter-spacing: 1px; font-size: 0.95rem; }
.stars .off { color: var(--locked-line); }
.toast-host { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); animation: toast-in 0.25s ease-out; }
.toast.xp { background: var(--cyan); color: #04121A; font-family: var(--f-mono); }
.toast.error { background: var(--bad); color: #FFFFFF; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.loading { padding: 60px 0; text-align: center; color: var(--muted); font-family: var(--f-mono); }

/* ---------------------------------------------------------- landing and auth */
.landing { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; min-height: calc(100vh - 140px); }
.landing .pitch { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.landing .pitch h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.landing .pitch p { font-size: 1.12rem; color: var(--muted); max-width: 52ch; }
.landing .auth { flex: 1 1 340px; min-width: 0; max-width: 440px; }
.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; font-size: 0.92rem; }
.feature b { display: block; font-family: var(--f-display); font-size: 1.02rem; }
.tracks { display: flex; flex-wrap: wrap; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field input, .field select, .field textarea { min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--focus); outline: none; }
.field .hint { font-size: 0.82rem; color: var(--muted); }
.form-error { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 0.92rem; }
.form-ok { background: var(--good-soft); color: var(--good); padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 0.92rem; }
.tabs { display: flex; gap: 6px; background: var(--sunken); padding: 4px; border-radius: 14px; }
.tabs a { flex: 1; text-align: center; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 700; }
.tabs a[aria-current="page"] { background: var(--surface-2); color: var(--ink); box-shadow: 0 1px 0 var(--line); }

/* ---------------------------------------------------------- world map (Atlas) */
.map-frame { position: relative; background: var(--sea); border-radius: 28px; overflow: hidden; }
.map-frame svg { display: block; width: 100%; height: auto; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 2px 0; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.island { cursor: pointer; }
.island .land { fill: var(--land); stroke: var(--land-line); stroke-width: 2.5; transition: transform 0.15s; }
.island:hover .land, .island:focus-visible .land { stroke-width: 4; }
.island.locked .land { fill: var(--locked); stroke: var(--locked-line); stroke-dasharray: 6 6; }
.island .contour { fill: none; stroke: var(--sunken); stroke-width: 1.5; }
.island-name { font-family: var(--f-display); font-weight: 800; font-size: 19px; fill: var(--ink); }
.island-sub { font-family: var(--f-body); font-weight: 600; font-size: 13px; }
.node-cleared { fill: var(--surface-2); stroke: var(--ink); stroke-width: 3; }
.node-open { fill: var(--surface-2); stroke: var(--ink); stroke-width: 3; stroke-dasharray: 4 4; }
.node-current { fill: var(--accent); stroke: var(--surface-2); stroke-width: 4; }
.node-locked { fill: var(--locked); stroke: var(--locked-line); stroke-width: 2; }
.node-num { font-family: var(--f-body); font-weight: 700; font-size: 14px; text-anchor: middle; fill: var(--ink); pointer-events: none; }
.node-num.on-accent { fill: var(--accent-ink); font-size: 16px; }
.boss-node { fill: var(--boss); stroke: var(--surface-2); stroke-width: 3; }
.boss-node.locked { fill: var(--locked); stroke: var(--locked-line); }
.boss-node.defeated { fill: var(--gold); }
.route { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.route.ahead { stroke-dasharray: 2 10; opacity: 0.45; }
.fog-ring { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 3 4; }
.pulse { animation: pulse 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0%, 100% { opacity: 0.55; transform: scale(1); } 50% { opacity: 0; transform: scale(1.6); } }

.continue-card .title { font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; line-height: 1.12; }
.spot-row { display: flex; align-items: center; gap: 10px; }
.spot-row > div { flex: 1 1 0; min-width: 0; }
.spot-row b { display: block; font-size: 0.93rem; }
.spot-row span { font-size: 0.8rem; color: var(--muted); }

/* ---------------------------------------------------------- region path (Arcade) */
.region-head { border-radius: 22px; padding: 20px 22px; color: #FFFFFF; background: var(--ink); box-shadow: 0 6px 0 color-mix(in srgb, var(--ink) 70%, #000); display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
:root[data-theme="dark"] .region-head { background: var(--surface-2); color: var(--ink); box-shadow: 0 6px 0 var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .region-head { background: var(--surface-2); color: var(--ink); box-shadow: 0 6px 0 var(--line); } }
.region-head .eyebrow { color: inherit; opacity: 0.75; }
.region-head h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.path { display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 26px 0 10px; }
.path-step { display: flex; align-items: center; gap: 16px; width: min(100%, 520px); }
.path-node { flex: none; width: 82px; height: 76px; border-radius: 50%; border: 0; display: grid; place-items: center; text-decoration: none; transition: transform 0.06s; }
.path-node:active { transform: translateY(4px); }
.path-node.cleared { background: var(--gold); box-shadow: 0 7px 0 var(--gold-press); }
.path-node.current { background: var(--accent); box-shadow: 0 7px 0 var(--accent-press), 0 0 0 9px var(--accent-soft); width: 94px; height: 88px; }
.path-node.open { background: var(--surface-2); box-shadow: 0 7px 0 var(--line); border: 3px solid var(--line); }
.path-node.locked { background: var(--locked); box-shadow: 0 7px 0 var(--locked-line); cursor: not-allowed; }
.path-node.boss { border-radius: 26px; width: 104px; height: 96px; background: var(--boss); box-shadow: 0 8px 0 var(--boss-press); }
.path-node.boss.locked { background: var(--locked); box-shadow: 0 8px 0 var(--locked-line); }
.path-node.boss.defeated { background: var(--gold); box-shadow: 0 8px 0 var(--gold-press); }
.path-label { min-width: 0; }
.path-label b { display: block; font-family: var(--f-display); font-size: 1.08rem; }
.path-label .row { gap: 6px; margin-top: 4px; }

/* ---------------------------------------------------------- play: level (Atlas) and HUD (Console) */
.play-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 16px; }
.play-head .title { flex: 1 1 240px; min-width: 0; }
.play-head h1 { font-size: 1.45rem; }
.pips { display: flex; gap: 5px; flex-wrap: wrap; }
.pips i { width: 20px; height: 8px; border-radius: 4px; background: var(--sunken); }
.pips i.ok { background: var(--good); }
.pips i.no { background: var(--bad); }
.pips i.now { background: var(--ink); }
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.q-stem { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.15rem, 2.2vw, 1.45rem); line-height: 1.35; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opts.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 13px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface-2); font-size: 1rem; font-weight: 500; box-shadow: 0 3px 0 var(--line); }
.opt:hover:not([disabled]) { border-color: var(--ink); }
.opt .key { flex: none; width: 32px; height: 32px; border-radius: 10px; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--muted); font-family: var(--f-mono); }
.opt .txt { flex: 1 1 0; min-width: 0; }
.opt .tag { font-size: 0.8rem; font-weight: 700; }
.opt[aria-pressed="true"] { border-color: var(--ink); background: var(--sunken); }
.opt[aria-pressed="true"] .key { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.opt.right { border-color: var(--good); background: var(--good-soft); box-shadow: 0 3px 0 var(--good); }
.opt.right .key { background: var(--good); border-color: var(--good); color: #FFFFFF; }
.opt.right .tag { color: var(--good); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 3px 0 var(--bad); }
.opt.wrong .key { background: var(--bad); border-color: var(--bad); color: #FFFFFF; }
.opt.wrong .tag { color: var(--bad); }
.opt[disabled] { cursor: default; }
.feedback { border-radius: var(--r-lg); padding: 22px 24px; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; background: var(--panel-dark); color: var(--panel-dark-ink); animation: toast-in 0.2s ease-out; }
.feedback .body { flex: 999 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.feedback .verdict { font-family: var(--f-display); font-weight: 800; font-size: 1.35rem; }
.feedback.is-right .verdict { color: var(--good); }
.feedback.is-wrong .verdict { color: #FFB59C; }
:root[data-theme="dark"] .feedback.is-wrong .verdict { color: var(--bad); }
.feedback a { color: #9FE0D0; }
:root[data-theme="dark"] .feedback a { color: var(--cyan); }
.feedback .aside { flex: 1 1 200px; min-width: 0; background: rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 12px 14px; font-size: 0.9rem; }
.feedback .actions { flex: 1 1 100%; display: flex; justify-content: flex-end; }
.results { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.big-stars { display: flex; gap: 10px; }
.big-stars svg { width: 64px; height: 64px; }
.big-stars .on { fill: var(--gold); animation: pop 0.4s ease-out backwards; }
.big-stars .off { fill: var(--locked); }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: none; opacity: 1; } }
.missed { display: flex; flex-direction: column; gap: 10px; text-align: left; width: 100%; }
.missed .card { padding: 16px 18px; }
.missed .ans { font-size: 0.92rem; }
.missed .ans .no { color: var(--bad); font-weight: 700; }
.missed .ans .yes { color: var(--good); font-weight: 700; }

/* ---------------------------------------------------------- boss battle (Arcade) */
.boss-bar { display: flex; flex-wrap: wrap; gap: 16px; }
.boss-card { flex: 1 1 320px; min-width: 0; background: var(--boss); color: #FFFFFF; border-radius: 22px; box-shadow: 0 6px 0 var(--boss-press); padding: 18px 20px; display: flex; gap: 16px; align-items: center; }
.boss-card .face { flex: none; width: 72px; height: 72px; border-radius: 22px; background: rgba(255, 255, 255, 0.2); display: grid; place-items: center; }
.boss-card.hit .face { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px) rotate(-4deg); } 40%, 80% { transform: translateX(6px) rotate(4deg); } }
.hp { height: 16px; border-radius: 8px; background: rgba(0, 0, 0, 0.28); overflow: hidden; }
.hp i { display: block; height: 100%; background: var(--gold); transition: width 0.4s ease; }
.shields-card { flex: 0 1 230px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.shield-on { fill: var(--cyan); }
.shield-off { fill: var(--locked); }
.timer { font-family: var(--f-mono); font-weight: 600; padding: 6px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.timer.low { color: var(--bad); border-color: var(--bad); }
.boss-result { border-radius: var(--r-lg); padding: 18px 22px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.boss-result.hit { background: var(--good-soft); }
.boss-result.miss { background: var(--bad-soft); }
.boss-result .verdict { font-family: var(--f-display); font-weight: 800; font-size: 1.35rem; }
.boss-result.hit .verdict { color: var(--good); }
.boss-result.miss .verdict { color: var(--bad); }

/* ---------------------------------------------------------- mock exam (plain) */
.mock-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.progress { height: 4px; background: var(--sunken); border-radius: 2px; overflow: hidden; margin-bottom: 16px; }
.progress i { display: block; height: 100%; background: var(--ink); }
.navgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; margin-top: 18px; }
.navgrid button { font-family: var(--f-mono); font-size: 0.8rem; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); position: relative; }
.navgrid button.answered { background: var(--sunken); }
.navgrid button.current { box-shadow: inset 0 0 0 2px var(--ink); }
.navgrid button.flagged::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.confirm { margin-top: 14px; padding: 16px; border-radius: 14px; border: 2px solid var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.scale { position: relative; height: 38px; margin-top: 8px; }
.scale-track { position: absolute; left: 0; right: 0; top: 14px; height: 10px; border-radius: 5px; background: var(--sunken); overflow: hidden; }
.scale-track i { display: block; height: 100%; }
.scale-pass { position: absolute; top: 8px; width: 2px; height: 22px; background: var(--ink); }
.scale-pass-label { position: absolute; top: -10px; transform: translateX(-50%); font-family: var(--f-mono); font-size: 0.72rem; }
.scale-ends { position: absolute; top: 26px; left: 0; right: 0; display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); }
.score-big { font-family: var(--f-mono); font-size: 3rem; font-weight: 600; line-height: 1; }
.dbar { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 12px; align-items: center; }
.dbar .mono { text-align: right; font-size: 0.88rem; }

/* ---------------------------------------------------------- study notes */
.notes { max-width: 74ch; }
.notes-layout { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.notes-rail { flex: 1 1 220px; max-width: 260px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); display: flex; flex-direction: column; gap: 2px; }
.notes-rail a { text-decoration: none; color: var(--muted); padding: 7px 10px; border-radius: 10px; font-size: 0.92rem; font-weight: 600; }
.notes-rail a:hover, .notes-rail a[aria-current="true"] { background: var(--surface-2); color: var(--ink); }
.notes-body { flex: 999 1 520px; min-width: 0; }
.notes-mnav { display: none; }
.note-sec { padding: 22px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 90px); border-radius: 8px; transition: background 0.6s, box-shadow 0.6s; }
.note-sec.flash { background: var(--accent-soft); box-shadow: 0 0 0 12px var(--accent-soft); }
.note-sec ul, .note-sec ol { padding-left: 22px; }
.note-sec li { margin: 4px 0; }
.note-sec p { margin: 8px 0; }
.note-sec .tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; }
.note-sec table { border-collapse: collapse; width: 100%; font-size: 0.92rem; background: var(--surface-2); }
.note-sec th, .note-sec td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.note-sec tr:first-child th { border-top: 0; background: var(--sunken); }
.note-sec code { font-family: var(--f-mono); font-size: 0.86em; background: var(--sunken); padding: 1px 5px; border-radius: 4px; }
.note-sec pre { font-family: var(--f-mono); font-size: 0.82rem; background: var(--sunken); padding: 12px; border-radius: 12px; overflow-x: auto; }
.note-sec .tip { border-left: 4px solid var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); padding: 8px 12px; border-radius: 0 10px 10px 0; margin: 10px 0; }
.return-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 14px; margin-bottom: 14px; border-radius: 14px; background: var(--accent-soft); }

/* ---------------------------------------------------------- admin */
.admin { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.admin-tree { flex: 1 1 260px; max-width: 320px; min-width: 0; }
.admin-main { flex: 999 1 560px; min-width: 0; }
.tree-region { font-weight: 700; font-size: 0.88rem; margin: 12px 0 4px; }
.tree-topic { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 0.9rem; }
.tree-topic:hover, .tree-topic[aria-current="true"] { background: var(--surface-2); color: var(--ink); }
.tree-topic span { font-family: var(--f-mono); font-size: 0.78rem; color: var(--muted); }
.q-list { display: flex; flex-direction: column; gap: 8px; }
.q-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.q-row:hover { border-color: var(--ink); color: var(--ink); }
.q-row .stem { flex: 1 1 0; min-width: 0; font-size: 0.93rem; }
.opt-edit { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.opt-edit .letter { font-family: var(--f-mono); font-weight: 700; color: var(--muted); text-align: center; }
.opt-edit input[type="text"] { min-height: 42px; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface-2); }
.opt-edit label { display: flex; gap: 6px; align-items: center; font-size: 0.85rem; font-weight: 600; }
.status-draft { background: var(--sunken); color: var(--muted); }
.status-review { background: color-mix(in srgb, var(--gold) 20%, var(--surface)); color: var(--gold-press); }
.status-live { background: var(--good-soft); color: var(--good); }
.status-retired { background: var(--bad-soft); color: var(--bad); }

@media (max-width: 640px) {
  .opts.grid2 { grid-template-columns: 1fr; }
  .brand small, .exam-chip { display: none; }
  .brand b { font-size: 1.2rem; }
  .nav a { padding: 6px 8px; font-size: 0.86rem; }
  .island-name { font-size: 30px; }
  .island-sub { display: none; }
  .map-frame { border-radius: 18px; }
  .hud .xpbar { display: none; }
  .q-card { padding: 18px; border-radius: 22px; }
  .path-step { width: 100%; }
}

/* ---------------------------------------------------------- shared controls */
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); display: grid; place-items: center; flex: none; }
.icon-btn:hover { border-color: var(--ink); }
.nav a.nav-cta { background: var(--accent); color: var(--accent-ink); }
.nav a.nav-cta:hover { background: var(--accent-press); color: var(--accent-ink); }
.small { font-size: 0.88rem; }

/* ---------------------------------------------------------- home page */
.home .wrap { padding-bottom: 24px; }
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; padding-top: 40px; min-height: calc(100vh - 120px); min-height: calc(100svh - 120px); }
.hero-copy { display: flex; flex-direction: column; gap: 18px; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.7rem); line-height: 1.04; }
.hero .hl { background: linear-gradient(transparent 62%, var(--accent-soft) 62%); padding: 0 4px; margin: 0 -4px; }
.hero .lede { font-size: 1.14rem; color: var(--muted); max-width: 50ch; }
.hero-cta .btn { min-height: 52px; padding: 0 24px; font-size: 1.02rem; }
.hero-tour { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tour-video { align-self: flex-start; }
.band { padding-top: 56px; display: flex; flex-direction: column; gap: 22px; }
.band-head { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.demo { max-width: 860px; width: 100%; }
.demo-card { box-shadow: var(--shadow); }
.fb-review { font-size: 0.92rem; opacity: 0.9; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.feat svg { width: 48px; height: 48px; }
.fi-land { fill: var(--sea); stroke: var(--ink); stroke-width: 2.5; }
.fi-accent { fill: var(--accent); }
.fi-ink { fill: var(--ink); }
.fi-good { fill: var(--good); }
.fi-soft { fill: var(--sunken); }
.fi-dash { stroke: var(--muted); }
.fi-boss { fill: var(--boss); }
.fi-gold { fill: var(--gold); }
.fi-num { font-family: var(--f-mono); font-weight: 700; font-size: 15px; fill: var(--ink); }
.join { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 32px; align-items: center; }
.join-copy { display: flex; flex-direction: column; gap: 12px; }
.ticks { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 8px; }
.ticks li { padding-left: 30px; position: relative; font-weight: 600; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--good-soft); color: var(--good); display: grid; place-items: center; font-size: 0.8rem; }
.foot { padding-top: 40px; padding-bottom: 40px; font-size: 0.85rem; border-top: 1px solid var(--line); margin-top: 48px; }

/* ---------------------------------------------------------- tour */
.tour { display: flex; flex-direction: column; gap: 10px; }
.tour-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 24px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--bg); }
.tour-stage > svg { display: block; width: 100%; height: 100%; }
.tour-big { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 6px 0 var(--accent-press), var(--shadow); padding-left: 6px; }
.tour-big:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--accent-press); }
.tour-big[hidden] { display: none; }
.tour-bar { display: flex; align-items: center; gap: 10px; }
.tour-btn { width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; }
.tour-chapters { flex: 1 1 0; display: flex; gap: 4px; min-width: 0; }
.tour-chapters button { flex: 1 1 0; height: 28px; padding: 0; border: 0; border-radius: 3px; display: flex; align-items: center; background: linear-gradient(var(--sunken), var(--sunken)) center / 100% 6px no-repeat; }
.tour-chapters button i { display: block; height: 6px; border-radius: 3px; background: var(--accent); width: 0; }
.tour-time { font-size: 0.8rem; color: var(--muted); width: 36px; text-align: right; }
.tour-caption { min-height: 3.2em; font-size: 1rem; color: var(--ink); font-weight: 500; }
.tour.record .tour-stage { border: 0; border-radius: 0; box-shadow: none; }
.tour-burned { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); max-width: 86%; text-align: center; background: rgba(5, 8, 18, 0.72); color: #FFFFFF; padding: 10px 22px; border-radius: 14px; font-family: var(--f-body); font-weight: 600; font-size: 26px; line-height: 1.35; }
.tour-burned:empty { display: none; }
.tour.record .tour-stage { aspect-ratio: auto; height: 1080px; display: flex; flex-direction: column; }
.tour.record .tour-stage > svg { flex: none; height: 920px; }
.tour.record .tour-burned { position: static; transform: none; max-width: none; flex: 1 1 0; display: grid; place-items: center; padding: 0 160px; border-radius: 0; background: var(--surface); color: var(--ink); border-top: 2px solid var(--line); font-size: 40px; line-height: 1.3; }

.t-bg { fill: var(--bg); }
.t-gridline { fill: none; stroke: var(--line); stroke-width: 1; opacity: 0.55; }
.t-ring { fill: none; stroke: var(--ink); stroke-width: 18; stroke-dasharray: 1; }
.t-handle { fill: none; stroke: var(--ink); stroke-width: 24; stroke-linecap: round; stroke-dasharray: 1; }
.t-display { font-family: var(--f-display); font-weight: 800; fill: var(--ink); letter-spacing: -0.02em; }
.t-body { font-family: var(--f-body); fill: var(--ink); }
.t-mono { font-family: var(--f-mono); fill: var(--ink); }
.t-muted { fill: var(--muted); }
.t-ink { fill: var(--ink); }
.t-sea { fill: var(--sea); }
.t-route { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; opacity: 0.55; }
.t-land { fill: var(--land); stroke: var(--land-line); stroke-width: 4; }
.t-node-done { fill: var(--surface-2); stroke: var(--ink); stroke-width: 5; }
.t-node-open { fill: var(--surface-2); stroke: var(--ink); stroke-width: 4; stroke-dasharray: 6 6; }
.t-node-now { fill: var(--accent); stroke: var(--surface-2); stroke-width: 6; }
.t-nodetxt { font-family: var(--f-body); font-weight: 700; font-size: 24px; fill: var(--ink); }
.t-nodetxt.on { fill: var(--accent-ink); }
.t-card { fill: var(--surface); stroke: var(--line); stroke-width: 3; }
.t-stem { font-family: var(--f-display); font-weight: 600; fill: var(--ink); }
.t-opt { fill: var(--surface-2); stroke: var(--line); stroke-width: 3; transition: none; }
.t-key { fill: none; stroke: var(--line); stroke-width: 3; }
.t-keytxt { font-family: var(--f-mono); font-weight: 700; font-size: 26px; fill: var(--muted); }
.t-opttxt { font-family: var(--f-body); font-weight: 500; font-size: 30px; fill: var(--ink); }
.hover .t-opt { stroke: var(--ink); }
.right .t-opt { fill: var(--good-soft); stroke: var(--good); }
.right .t-key { fill: var(--good); stroke: var(--good); }
.right .t-keytxt { fill: #FFFFFF; }
.wrong .t-opt { fill: var(--bad-soft); stroke: var(--bad); }
.wrong .t-key { fill: var(--bad); stroke: var(--bad); }
.wrong .t-keytxt { fill: #FFFFFF; }
.t-panel { fill: var(--panel-dark); }
.t-panelmuted { font-family: var(--f-body); fill: var(--panel-dark-muted); }
.t-goodtxt { fill: var(--good); }
.t-badtxt { fill: var(--bad); }
.t-goldtxt { fill: var(--gold); }
.t-cyanfill, .t-cyan { fill: var(--cyan); }
.t-xptxt { fill: #04121A; font-weight: 700; }
.t-fog { fill: none; stroke: var(--muted); stroke-width: 4; stroke-dasharray: 6 7; }
.t-pin { fill: var(--accent); }
.t-pintxt { fill: var(--accent-ink); font-weight: 700; }
.t-bossfill, .t-boss { fill: var(--boss); }
.t-face { fill: rgba(255, 255, 255, 0.2); }
.t-white { fill: #FFFFFF; }
.t-hpbg { fill: rgba(0, 0, 0, 0.28); }
.t-shield { fill: var(--cyan); }
.t-shield.off { fill: var(--locked); stroke: var(--locked-line); stroke-width: 0.6; }
.t-goldfill, .t-gold { fill: var(--gold); }
.t-accentfill, .t-accent { fill: var(--accent); }
.t-ctaedge { fill: var(--accent-press); }
.t-ctatxt { fill: var(--accent-ink); }
.t-inkfill { fill: var(--ink); }
.t-sunken { fill: var(--sunken); }
.t-goodfill { fill: var(--good); }
.t-passtxt { fill: #FFFFFF; }
:root[data-theme="dark"] .t-passtxt { fill: #06150F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t-passtxt { fill: #06150F; } }

.video-dlg { border: 0; padding: 12px; border-radius: 20px; background: var(--surface); color: var(--ink); width: min(960px, 94vw); box-shadow: var(--shadow); }
.video-dlg::backdrop { background: rgba(5, 8, 18, 0.7); }
.video-dlg .video-wrap { aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.video-dlg video { width: 100%; height: 100%; display: block; }
.video-dlg form { display: flex; justify-content: flex-end; margin-top: 10px; }

/* ---------------------------------------------------------- celebrations */
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }
.levelup { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; background: rgba(5, 8, 18, 0.55); backdrop-filter: blur(3px); animation: fade-in 0.2s ease-out; padding: 16px; }
.levelup.out { opacity: 0; transition: opacity 0.25s; }
.levelup-card { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 30px 34px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; box-shadow: var(--shadow); animation: pop-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.levelup-badge { width: 110px; height: 110px; border-radius: 50%; background: var(--gold); box-shadow: 0 8px 0 var(--gold-press), 0 0 0 10px color-mix(in srgb, var(--gold) 25%, transparent); display: grid; place-items: center; margin-bottom: 10px; }
.levelup-badge span { font-family: var(--f-display); font-weight: 800; font-size: 3rem; color: #2A1A00; }
.levelup-title { font-family: var(--f-display); font-weight: 800; font-size: 1.7rem; }
.levelup.calm, .levelup.calm .levelup-card { animation: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.boss-card.hit { animation: flash 0.35s; }
@keyframes flash { 30% { filter: brightness(1.35); } }

/* ---------------------------------------------------------- daily challenge */
.daily-card { border: 2px solid color-mix(in srgb, var(--gold) 55%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 14%, var(--surface)), var(--surface) 60%); }
.daily-card.done { border-color: var(--line); background: var(--surface); }
.daily-badge { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 2.8rem; font-weight: 800; }
.daily-badge.ok { background: var(--good); color: #FFFFFF; box-shadow: 0 7px 0 var(--good-press); animation: pop 0.4s ease-out; }
.daily-badge.no { background: var(--bad-soft); color: var(--bad); }

/* ---------------------------------------------------------- left sidebar (tablet and desktop)
   Always dark: deep green ink in the light theme, navy in the dark theme. It runs the full
   height with the logo at the top; the top bar sits beside it over the content. */
:root {
  --side-w: 232px;
  --rail-bg: #1B2F2B; --rail-ink: #F2F6F3; --rail-muted: #A9C0BA; --rail-line: rgba(255, 255, 255, 0.10);
  --rail-hover: rgba(255, 255, 255, 0.07); --rail-active: rgba(255, 255, 255, 0.12); --rail-card: rgba(255, 255, 255, 0.06);
  --rail-accent: #FF9466;
}
:root[data-theme="dark"] { --rail-bg: #0E1528; --rail-ink: #E6EDF7; --rail-muted: #93A2BE; --rail-line: #1E2A45; --rail-accent: #FF8A5B; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --rail-bg: #0E1528; --rail-ink: #E6EDF7; --rail-muted: #93A2BE; --rail-line: #1E2A45; --rail-accent: #FF8A5B; }
}
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 25;
  width: var(--side-w); padding: max(14px, env(safe-area-inset-top, 0px)) 12px max(16px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
  background: var(--rail-bg); color: var(--rail-ink); border-right: 1px solid var(--rail-line);
  color-scheme: dark;
}
.sidebar .side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 16px; color: var(--rail-ink); text-decoration: none; background: none; }
.sidebar .side-brand:hover { background: none; color: var(--rail-ink); }
.sidebar .side-brand svg { width: 34px; height: 34px; }
.sidebar .side-brand circle:last-of-type { fill: var(--rail-accent) !important; }
.sidebar .side-brand b { display: block; font-family: var(--f-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; line-height: 1.1; }
.sidebar .side-brand small { display: block; font-size: 0.72rem; color: var(--rail-muted); }
.sidebar a.side-exam { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 12px; margin-bottom: 10px; border-radius: 14px; background: var(--rail-card); border: 1px solid var(--rail-line); color: var(--rail-ink); }
.sidebar a.side-exam:hover { border-color: var(--rail-muted); background: var(--rail-card); }
.sidebar a.side-exam[aria-current="page"] { border-color: var(--rail-accent); box-shadow: none; }
.side-exam-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.side-exam-code { font-family: var(--f-display); font-weight: 800; font-size: 1.05rem; }
.side-exam-switch { display: inline-flex; align-items: center; gap: 2px; font-size: 0.75rem; font-weight: 700; color: var(--rail-accent); }
.sidebar a.side-exam svg { width: 14px; height: 14px; }
.side-exam-name { font-size: 0.78rem; color: var(--rail-muted); line-height: 1.3; font-weight: 500; }

/* Certifications page */
.cert-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cert-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.cert-card.current { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.cert-card.soon { background: transparent; border-style: dashed; }
.cert-card h3 { font-size: 1.15rem; }
.cert-card .btn { margin-top: auto; }
.cert-code { font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.02em; line-height: 1; }
.sidebar a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--rail-muted); font-weight: 600; font-size: 0.95rem; }
.sidebar a svg { width: 22px; height: 22px; flex: none; }
.sidebar a:hover { background: var(--rail-hover); color: var(--rail-ink); }
.sidebar a[aria-current="page"] { background: var(--rail-active); color: var(--rail-ink); }
.sidebar a[aria-current="page"] svg { color: var(--rail-accent); }
.sidebar a:focus-visible { outline-color: var(--rail-accent); }
.side-sep { height: 1px; background: var(--rail-line); margin: 8px 6px; }
body.has-sidebar main, body.has-sidebar #banner, body.has-sidebar .topbar { margin-left: var(--side-w); }
body.has-sidebar .topbar-in, body.has-sidebar .banner { max-width: none; }
body.has-sidebar .topbar .topbar-brand { display: none; }

/* Focus sounds: music player at the foot of the sidebar, and a pop-up from the top bar on smaller screens. */
.side-focus { margin-top: auto; padding-top: 14px;
  --fp-bg: var(--rail-card); --fp-ink: var(--rail-ink); --fp-muted: var(--rail-muted); --fp-line: var(--rail-line); --fp-accent: var(--rail-accent); --fp-accent-ink: #1A0B04; }
.focus-pop { position: fixed; z-index: 60; top: calc(var(--topbar-h, 60px) + 6px); right: max(12px, env(safe-area-inset-right, 0px)); width: min(300px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 6px;
  --fp-bg: transparent; --fp-ink: var(--ink); --fp-muted: var(--muted); --fp-line: var(--line); --fp-accent: var(--accent); --fp-accent-ink: var(--accent-ink, #fff); }
.focus-panel { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--fp-bg); border: 1px solid var(--fp-line); color: var(--fp-ink); }
.focus-pop .focus-panel { border: 0; }
.focus-head { display: flex; align-items: center; justify-content: space-between; }
.focus-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.82rem; letter-spacing: 0.02em; color: var(--fp-muted); }
.focus-title svg { width: 16px; height: 16px; color: var(--fp-accent); }
.focus-row { display: flex; align-items: center; gap: 8px; }
.focus-play { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--fp-accent); color: var(--fp-accent-ink); cursor: pointer; }
.focus-play svg { width: 18px; height: 18px; }
.focus-play:hover { filter: brightness(1.08); }
.focus-play:focus-visible, .focus-select:focus-visible { outline: 2px solid var(--fp-accent); outline-offset: 2px; }
.focus-select { flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--fp-line); background: transparent; color: var(--fp-ink); font: inherit; font-size: 0.88rem; font-weight: 600; }
.focus-select option { color: #111; }
.focus-now { color: var(--fp-muted); font-size: 0.78rem; line-height: 1.35; min-height: 1.35em; }
.focus-now .link-btn { color: var(--fp-accent); font-size: inherit; }
.focus-vol { display: flex; align-items: center; gap: 8px; color: var(--fp-muted); }
.focus-vol svg { width: 16px; height: 16px; flex: none; }
.focus-vol input { flex: 1; accent-color: var(--fp-accent); min-height: 24px; }
.focus-credit { font-size: 0.7rem; color: var(--fp-muted); opacity: 0.85; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--fp-accent); transform-origin: bottom; animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.4s; } .eq i:nth-child(3) { animation-delay: -0.75s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
.focus-open svg { width: 20px; height: 20px; }
.focus-open.is-playing { color: var(--accent); border-color: var(--accent); }
@media (min-width: 1101px) { .focus-open { display: none; } }
/* Small phones: the logo alone in the top bar, so the music and theme buttons fit. */
@media (max-width: 440px) { body.has-sidebar .topbar .topbar-brand div { display: none; } }

/* Narrower screens: icons only. */
@media (max-width: 1100px) and (min-width: 721px) {
  :root { --side-w: 76px; }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .sidebar .side-brand { justify-content: center; padding: 4px 0 14px; }
  .sidebar .side-brand div { display: none; }
  .sidebar a { justify-content: center; padding: 12px 0; }
  .sidebar a span, .side-exam-name, .side-exam-switch { display: none; }
  .sidebar a.side-exam { align-items: center; padding: 8px 0; }
  .sidebar a.side-exam .side-exam-top, .sidebar a.side-exam .side-exam-code { display: flex; justify-content: center; }
  .side-exam-code { font-size: 0.78rem; }
  .side-focus { display: none; }
}

/* ---------------------------------------------------------- signs of life */
/* Page transition (route changes only) */
#app.page-in > * { animation: page-in 0.28s ease-out both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* World map: drifting waves, passing clouds, fog lifting off a newly opened region, islands that lift */
.wave { fill: none; stroke: var(--sea-line); stroke-width: 2; animation: wave-drift 7s ease-in-out infinite alternate; }
@keyframes wave-drift { from { transform: translateX(-12px); } to { transform: translateX(16px); } }
.clouds ellipse { fill: #FFFFFF; opacity: 0.5; }
:root[data-theme="dark"] .clouds ellipse { fill: #9FB4FF; opacity: 0.05; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .clouds ellipse { fill: #9FB4FF; opacity: 0.05; } }
.cloud { animation: cloud-drift 46s ease-in-out infinite alternate; }
.cloud.c2 { animation-duration: 58s; animation-delay: -20s; }
.cloud.c3 { animation-duration: 52s; animation-delay: -35s; }
@keyframes cloud-drift { from { transform: translateX(-40px); } to { transform: translateX(70px); } }
.fog-lift { opacity: 0; animation: fog-lift 1.8s ease-out 0.35s both; }
.fog-lift ellipse { fill: var(--locked); }
@keyframes fog-lift { from { opacity: 0.97; transform: scale(1); } to { opacity: 0; transform: scale(1.3); } }
.island { transition: transform 0.2s ease, filter 0.2s ease; transform-box: fill-box; }
.island:not(.locked):hover, .island:not(.locked):focus-visible { transform: translateY(-5px); filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.18)); }

/* Cards that lift when you point at them */
.cert-card, .feat, .daily-card, .q-row, .continue-card, .tip-card { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.cert-card:hover, .feat:hover, .daily-card:hover, .q-row:hover, .continue-card:hover, .tip-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* HUD: the XP bar fills smoothly, the streak flame flickers */
.xpbar i { transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hud-pill.streak-on svg { animation: flicker 2.6s ease-in-out infinite; transform-origin: 50% 85%; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.08, 0.95) rotate(-3deg); } 50% { transform: scale(0.96, 1.06) rotate(2deg); } 75% { transform: scale(1.05, 0.97) rotate(-1deg); } }

/* News strip */
.ticker-host:empty { display: none; }
.ticker-host { margin-bottom: 14px; }
.ticker-wrap { padding-bottom: 0; }
.ticker { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 4px 6px 4px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.tk-live { flex: none; display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.tk-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: live-dot 1.6s ease-in-out infinite; }
@keyframes live-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.75); } }
.tk-viewport { flex: 1 1 0; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.tk-track { display: flex; width: max-content; animation: ticker-scroll var(--tk-dur, 60s) linear infinite; }
.ticker.still .tk-track { animation: none; width: auto; }
.ticker:hover .tk-track, .ticker:focus-within .tk-track, .ticker.paused .tk-track { animation-play-state: paused; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk-run { display: flex; gap: 34px; padding-right: 34px; }
.ticker.still .tk-run { padding: 0 6px; }
.tk-item { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--ink); text-decoration: none; font-size: 0.9rem; background: none; border: 0; padding: 6px 2px; }
.ticker.still .tk-item { white-space: normal; }
a.tk-item:hover .tk-text, button.tk-item:hover .tk-text { text-decoration: underline; text-underline-offset: 3px; }
.tk-tag { flex: none; font-family: var(--f-mono); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 6px; background: var(--sunken); color: var(--muted); }
.tk-tag.tk-tip { background: var(--good-soft); color: var(--good); }
.tk-tag.tk-trap { background: var(--bad-soft); color: var(--bad); }
.tk-tag.tk-new, .tk-tag.tk-try { background: var(--accent-soft); color: var(--accent); }
.tk-tag.tk-daily, .tk-tag.tk-streak { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: var(--gold-press); }
:root[data-theme="dark"] .tk-tag.tk-daily, :root[data-theme="dark"] .tk-tag.tk-streak { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tk-tag.tk-daily, :root:not([data-theme="light"]) .tk-tag.tk-streak { color: var(--gold); } }
.tk-tag.tk-soon { background: transparent; border: 1px dashed var(--locked-line); }
.tk-pause { flex: none; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); display: grid; place-items: center; }
.tk-pause:hover { color: var(--ink); border-color: var(--ink); }

/* Tip of the day */
.tip-card .tip-body { min-height: 92px; transition: opacity 0.22s ease, transform 0.22s ease; }
.tip-card .tip-body.out { opacity: 0; transform: translateY(6px); }
.tip-card .tip-text { font-weight: 600; line-height: 1.45; margin: 4px 0 6px; }
.tip-nav { display: flex; gap: 4px; }
.icon-btn.small { width: 30px; height: 30px; border-radius: 9px; font-size: 1.1rem; line-height: 1; }
.tip-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.tip-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.tip-dots i.on { background: var(--accent); }

/* ---------------------------------------------------------- confidence and readiness */
.confidence { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--sunken); }
.confidence .conf-q { font-weight: 700; font-size: 0.95rem; color: var(--muted); }
.confidence.ready .conf-q { color: var(--ink); }
.conf-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.conf.sure { --b-bg: var(--good); --b-ink: #FFFFFF; --b-edge: var(--good-press); }
:root[data-theme="dark"] .btn.conf.sure { --b-ink: #06150F; }
.btn.conf.think { --b-bg: var(--surface-2); }
.btn.conf.guess { --b-bg: color-mix(in srgb, var(--gold) 25%, var(--surface-2)); --b-edge: var(--gold-press); }
.calib { font-weight: 700; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); }
.calib-solid { color: #9FE8C8; }
.calib-lucky { color: #FFD48A; }
.calib-dangerous { color: #FFB0A0; background: rgba(255, 90, 70, 0.16); }
.calib-shaky { color: var(--panel-dark-muted); }
.readiness-score { font-size: 1.6rem; font-weight: 700; color: var(--good); }
.readiness-score::after { content: "%"; font-size: 0.9rem; margin-left: 2px; }
.readiness-row { text-decoration: none; color: inherit; gap: 4px; }
.knowledge-chips { gap: 6px; }

/* Explain my mistake */
.explain { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.explain-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 0.86rem; opacity: 0.92; }
.explain-btn:hover { opacity: 1; }
.feedback .explain-btn { color: #FFD48A; }
.explain-btn[disabled] { opacity: 0.5; }
.explain-box { border-radius: 12px; padding: 10px 12px; font-size: 0.92rem; line-height: 1.5; background: color-mix(in srgb, var(--cyan) 12%, transparent); border-left: 3px solid var(--cyan); }
.feedback .explain-box { background: rgba(255, 255, 255, 0.07); border-left-color: #FFD48A; }
.explain-box.thinking { opacity: 0.8; animation: live-dot 1.6s ease-in-out infinite; }
.explain-label { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; margin-bottom: 4px; }

/* Advisor */
.advisor-card { border-left: 4px solid var(--cyan); }
.advisor-body { white-space: pre-line; font-size: 0.92rem; line-height: 1.5; }
.advisor-body.collapsed { max-height: 6.2em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.adv-facts { gap: 6px 16px; color: var(--muted); }
.adv-facts b { color: var(--ink); }
.bad-text { color: var(--bad); font-weight: 700; }
.adv-draft textarea { font-family: var(--f-body); line-height: 1.5; }
.adv-table { padding: 6px 0; overflow-x: auto; }
.adv-row { display: grid; grid-template-columns: minmax(200px, 2fr) 110px 60px 100px 110px minmax(130px, 1fr) 170px; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); min-width: 900px; }
.adv-row.adv-head { border-top: 0; font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.adv-who { display: flex; flex-direction: column; min-width: 0; }
.adv-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Incident raids: an always-dark on-call console */
.raid { display: flex; flex-direction: column; gap: 16px; }
.raid > .btn { align-self: flex-start; }
.raid-console, .raid-card { background: var(--rail-bg); color: var(--rail-ink); border-radius: var(--r-lg); padding: 20px 22px; border: 1px solid var(--rail-line); }
.raid-console h1 { color: var(--rail-ink); font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 8px 0 6px; }
.raid-brief { color: var(--rail-muted); }
.raid-card .eyebrow { color: var(--rail-muted); }
.raid-card-title { font-family: var(--f-display); font-weight: 800; font-size: 1.25rem; line-height: 1.2; }
.raid-card p { color: var(--rail-muted); }
.pager { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 0.82rem; color: var(--rail-muted); }
.sev { font-family: var(--f-mono); font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #E5484D; color: #fff; animation: live-dot 1.4s ease-in-out infinite; }
.sev.sev-sev2 { background: #F08C2E; color: #1A0B04; }
.sev.sev-sev3 { background: #E9C46A; color: #2A1A00; }
.pager-region { font-weight: 700; color: var(--rail-ink); }
.raid-step { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.raid-text { font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; line-height: 1.4; }
.raid-fb { border-width: 2px; }
.raid-fb-best { border-color: var(--good); }
.raid-fb-ok { border-color: var(--gold); }
.raid-fb-risky { border-color: var(--bad); }
.pts { align-self: flex-start; font-family: var(--f-mono); font-weight: 700; font-size: 0.8rem; padding: 3px 10px; border-radius: 999px; }
.pts-best { background: var(--good-soft); color: var(--good); }
.pts-ok { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: var(--gold-press); }
.pts-risky { background: var(--bad-soft); color: var(--bad); }
.tl-best { font-size: 0.92rem; padding: 8px 12px; border-radius: 10px; background: var(--good-soft); color: var(--ink); }
.raid-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 3px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.raid-timeline li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.raid-timeline li::before { content: ""; position: absolute; left: -27px; top: 16px; width: 13px; height: 13px; border-radius: 50%; background: var(--line); border: 3px solid var(--bg); }
.raid-timeline li.tl-best::before { background: var(--good); }
.raid-timeline li.tl-ok::before { background: var(--gold); }
.raid-timeline li.tl-risky::before { background: var(--bad); }
.tl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tl-action { font-weight: 700; }
.tl-feedback { color: var(--muted); font-size: 0.92rem; }
.raid-end { max-width: 60ch; }

/* Career paths and the practitioner note */
.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.path-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.path-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.path-stp { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.path-stp:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.stp-num { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-family: var(--f-mono); background: var(--sunken); color: var(--muted); }
.path-stp.live .stp-num { background: var(--good); color: #fff; }
.path-stp.current .stp-num { background: var(--accent); color: var(--accent-ink); }
.stp-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stp-code { font-family: var(--f-display); font-size: 1.1rem; }
.stp-name { font-weight: 600; }
.practitioner-card { background: var(--rail-bg); color: var(--rail-ink); border-radius: var(--r-lg); padding: 26px 28px; display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.practitioner-card .eyebrow { color: var(--rail-accent); }
.practitioner-card p { color: var(--rail-muted); max-width: 70ch; }

/* ---------------------------------------------------------- phone tab bar */
.tabbar { display: none; }

@media (max-width: 900px) {
  /* Notes on tablets and phones: a solid topic strip under the top bar instead of the side rail. */
  .notes-rail { display: none; }
  .notes-mnav {
    display: flex; flex-direction: column; gap: 8px; position: sticky; top: calc(var(--topbar-h, 60px) + env(safe-area-inset-top, 0px));
    z-index: 15; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 12px; padding: 10px max(16px, env(safe-area-inset-left, 0px));
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .notes-mnav select { min-height: 42px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); font-weight: 700; }
  .notes-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .notes-chips::-webkit-scrollbar { display: none; }
  .notes-chips a { flex: none; white-space: nowrap; text-decoration: none; padding: 8px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: 0.86rem; }
  .notes-chips a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .note-sec { scroll-margin-top: calc(var(--topbar-h, 60px) + 120px + env(safe-area-inset-top, 0px)); }
  .notes-layout { gap: 0; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 20px; gap: 24px; }
  .join { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  }
  .tabbar a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 52px; border-radius: 12px; text-decoration: none; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
  body.has-tabbar main { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar .toast-host { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar .topbar .nav, body.has-tabbar .topbar .avatar { display: none; }
  .sidebar { display: none; }
  body.has-sidebar main, body.has-sidebar #banner, body.has-sidebar .topbar { margin-left: 0; }
  body.has-sidebar .topbar .topbar-brand { display: flex; }
  .topbar .nav a.nav-cta { display: none; }
  .topbar .nav { flex-wrap: nowrap; }
  .topbar-in { flex-wrap: nowrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .hud { flex-wrap: nowrap; gap: 6px; }
  .hud-pill { padding: 5px 9px; }

  .wrap { padding-top: 16px; }
  .btn { min-height: 50px; }
  .btn.small { min-height: 42px; }
  .opt { min-height: 58px; padding: 12px 14px; font-size: 1.02rem; }
  .q-card { padding: 18px 16px; gap: 14px; border-radius: 22px; }
  .q-stem { font-size: 1.14rem; }
  .play-head { gap: 10px; margin-bottom: 12px; }
  .play-head h1 { font-size: 1.2rem; }
  .play-head .title { flex-basis: calc(100% - 140px); }
  .feedback { padding: 18px; }
  .feedback .actions .btn, .boss-result .btn { width: 100%; }
  .boss-card { padding: 14px; gap: 12px; }
  .boss-card .face { width: 56px; height: 56px; border-radius: 16px; }
  .shields-card { flex: 1 1 100%; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .grid-main { gap: 16px; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .hero-cta .btn { flex: 1 1 100%; }
  .tour-stage { border-radius: 16px; }
  .tour-caption { font-size: 0.95rem; }
  .band { padding-top: 40px; }
  .results h1 { font-size: 1.5rem; }
  .big-stars svg { width: 54px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; }

.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
