:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --paper-2: #eceae2;
  --card: #ffffff;
  --ink: #111815;
  --ink-2: #3d4a44;
  --muted: #64746d;
  --line: rgba(17, 24, 21, 0.18);
  --rule: rgba(17, 24, 21, 0.09);
  --border: #1c2420;
  --accent: #15803d;
  --accent-2: #166534;
  --accent-ink: #ffffff;
  --accent-soft: #dcfce7;
  --danger: #dc2626;
  --gold: #b45309;
  --shadow-hard: rgba(17, 24, 21, 0.12);
  --shadow: 3px 3px 0 var(--shadow-hard);
  --serif: "Baskerville", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --viewport-height: 100dvh;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #111418;
    --paper-2: #1c222a;
    --card: #181d23;
    --ink: #f4f6f8;
    --ink-2: #c2cbd4;
    --muted: #8896a4;
    --line: rgba(244, 246, 248, 0.16);
    --rule: rgba(244, 246, 248, 0.08);
    --border: #323c46;
    --accent: #22c55e;
    --accent-2: #16a34a;
    --accent-ink: #052010;
    --accent-soft: rgba(34, 197, 94, 0.15);
    --danger: #f87171;
    --gold: #eab308;
    --shadow-hard: rgba(0, 0, 0, 0.48);
    --shadow: 3px 3px 0 var(--shadow-hard);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111418; --paper-2: #1c222a; --card: #181d23; --ink: #f4f6f8; --ink-2: #c2cbd4;
  --muted: #8896a4; --line: rgba(244, 246, 248, 0.16); --rule: rgba(244, 246, 248, 0.08);
  --border: #323c46; --accent: #22c55e; --accent-2: #16a34a;
  --accent-ink: #052010; --accent-soft: rgba(34, 197, 94, 0.15); --danger: #f87171;
  --gold: #eab308; --shadow-hard: rgba(0, 0, 0, 0.48); --shadow: 3px 3px 0 var(--shadow-hard);
}
:root.colorblind { --accent: #0284c7; --accent-2: #0369a1; --accent-soft: color-mix(in srgb, #0284c7 16%, var(--paper)); --gold: #ca8a04; --danger: #db2777; }
[data-world="cells-molecules"] { --accent: #1d4ed8; }
[data-world="genetics-evolution"] { --accent: #7c3aed; }
[data-world="human-body"] { --accent: #dc2626; }
[data-world="microbes-medicine"] { --accent: #4f46e5; }
:root[data-theme="dark"] [data-world="cells-molecules"] { --accent: #60a5fa; }
:root[data-theme="dark"] [data-world="genetics-evolution"] { --accent: #c084fc; }
:root[data-theme="dark"] [data-world="human-body"] { --accent: #f87171; }
:root[data-theme="dark"] [data-world="microbes-medicine"] { --accent: #818cf8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-world="cells-molecules"] { --accent: #60a5fa; }
  :root:not([data-theme="light"]) [data-world="genetics-evolution"] { --accent: #c084fc; }
  :root:not([data-theme="light"]) [data-world="human-body"] { --accent: #f87171; }
  :root:not([data-theme="light"]) [data-world="microbes-medicine"] { --accent: #818cf8; }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
em { font-family: var(--serif); font-style: italic; }

/* Deep Time stratigraphic backdrop */
#game { position: relative; min-height: var(--viewport-height); display: flex; flex-direction: column; overflow-x: hidden; }
.paper { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--paper); }
.field-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.topbar {
  position: relative; z-index: 3; width: min(1100px, calc(100% - 40px)); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 0 12px; border-bottom: 1px solid var(--line);
}
.wordmark { display: flex; align-items: center; gap: 9px; border: 0; background: none; padding: 0; font: 600 34px/1 var(--serif); letter-spacing: -.065em; color: var(--ink); }
.wordmark img { border-radius: 8px; }
.top-actions { display: flex; gap: 6px; align-items: center; }
.corner, .header-help { min-height: 44px; border: 1px solid transparent; background: none; color: var(--ink-2); border-radius: 8px; }
.corner { width: 44px; display: grid; place-items: center; }
.corner svg { width: 20px; height: 20px; }
.header-help { padding: 0 12px; font-size: 14px; font-weight: 600; }
.corner:hover, .header-help:hover { background: var(--card); border-color: var(--line); }

#hud { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr auto; align-items: stretch; gap: 10px; width: min(680px, calc(100% - 32px)); margin: 6px auto 0; }
.hud-pod { padding: 8px 16px; border-radius: 4px; border: 1.5px solid var(--border); background: var(--card); box-shadow: 2px 2px 0 var(--shadow-hard); min-width: 112px; }
.hud-pod small { display: block; font: 600 10px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hud-pod strong { display: block; font: 600 22px/1.15 var(--serif); font-variant-numeric: tabular-nums; }
.hud-pod.right { text-align: right; }
.hud-pod.right strong { color: var(--accent); }
.progress { padding: 8px 16px; border-radius: 4px; border: 1.5px solid var(--border); background: var(--card); box-shadow: 2px 2px 0 var(--shadow-hard); display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
#dots { display: flex; gap: 7px; justify-content: flex-start; }
#dots i { width: 11px; height: 11px; border-radius: 2px; border: 1.5px solid var(--line); background: transparent; }
#dots i.done { background: var(--dot); border-color: var(--dot); }
#dots i.current { border-color: var(--ink); background: var(--paper-2); }
#vials { display: flex; gap: 6px; justify-content: flex-start; align-items: center; }
.vial-svg { width: 22px; height: 22px; color: var(--accent); transition: transform .25s, opacity .25s; }
.vial-svg .vial-liquid { fill: color-mix(in srgb, var(--accent) 36%, transparent); stroke: none; }
.vial-svg.spent { color: var(--muted); opacity: .35; transform: scale(.88); }
.vial-svg.spent .vial-liquid { fill: none; }
#round { display: block; margin-top: 0; font: 600 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
@media (max-width: 520px) {
  .progress { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; padding: 8px 12px; }
}

/* Calibrated deep-time stratigraphic gauge: engraved YOU -> LUCA track */
#ladder { position: fixed; z-index: 2; left: max(16px, calc(50% - 578px)); top: 50%; transform: translateY(-50%); width: 204px; padding: 16px 14px 16px 18px; border-radius: 4px; border: 1.5px solid var(--border); background: var(--card); box-shadow: 3px 3px 0 var(--shadow-hard); }
.era-short { display: none; }
#ladder ol { list-style: none; margin: 0; padding: 0 0 0 30px; position: relative; display: grid; gap: 20px; z-index: 1; }
#ladder li { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--muted); transition: color .25s; }
#ladder li::before { content: ""; position: absolute; left: -24px; top: 50%; transform: translate(-50%, -50%); width: 8px; height: 8px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--line); transition: all .25s; z-index: 1; }
#ladder li b { font: 600 11px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
#ladder li small { font: 10px/1 var(--mono); color: var(--muted); opacity: .78; font-variant-numeric: tabular-nums; }
#ladder li.passed { color: var(--ink-2); }
#ladder li.passed::before { background: var(--accent); border-color: var(--accent); }
#ladder li.here { color: var(--ink); }
#ladder li.here::before { background: var(--gold); border-color: var(--ink); }
#ladder li.goal-rank b { color: var(--gold); }
#ladder li.goal-rank::before { border-color: var(--gold); background: var(--paper-2); width: 10px; height: 10px; }
.ladder-track { position: absolute; left: 24px; top: 24px; bottom: 24px; width: 2px; background: var(--line); z-index: 2; }
.ladder-fill { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(var(--fill, 0)); }
.ladder-self { position: absolute; left: 50%; top: calc(var(--fill, 0) * 100%); transform: translate(-50%, -50%); z-index: 4; border: 0; padding: 0; background: none; display: grid; justify-items: center; color: var(--self-color, var(--accent)); }
.ladder-self .self-orb { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2px solid var(--border); box-shadow: 2px 2px 0 var(--shadow-hard); transition: transform .15s; }
.ladder-self:hover .self-orb { transform: scale(1.08); }
.ladder-self .self-orb svg { width: 22px; height: 22px; }
.ladder-self .self-tag { position: relative; z-index: 2; margin-top: -5px; padding: 1.5px 4px; border-radius: 2px; background: var(--ink); color: var(--paper); font: 700 8px/1 var(--mono); letter-spacing: .08em; }
.expedition-descending .ladder-self .self-orb { border-color: var(--gold); animation: self-sink .7s ease-in-out infinite; }
@keyframes self-sink { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@media (max-width: 1140px) {
  #ladder { position: relative; left: auto; top: auto; transform: none; width: min(680px, calc(100% - 32px)); margin: 8px auto 0; padding: 26px 12px 10px; border-radius: 4px; overflow: visible; }
  #ladder ol { grid-template-columns: repeat(8, 1fr); gap: 0; padding: 0; border: 0; }
  #ladder li { display: block; text-align: center; padding-top: 10px; }
  #ladder li::before { left: 50%; top: -8px; transform: translate(-50%, -50%); width: 8px; height: 8px; }
  #ladder li small { display: none; }
  #ladder li b { font-size: 9px; letter-spacing: .03em; }
  .ladder-track { left: calc(12px + 6.25%); right: calc(12px + 6.25%); top: 18px; bottom: auto; width: auto; height: 2px; }
  .ladder-fill { transform-origin: left; background: var(--accent); transform: scaleX(var(--fill, 0)); }
  .ladder-self { top: 50%; left: calc(var(--fill, 0) * 100%); }
  .ladder-self .self-orb { width: 24px; height: 24px; }
  .ladder-self .self-orb svg { width: 16px; height: 16px; }
  .ladder-self .self-tag, .goal-star { display: none; }
}
@media (max-width: 640px) {
  .era-full { display: none; }
  .era-short { display: inline; }
  #ladder li b { font-size: 9px; letter-spacing: .04em; }
}

#content { position: relative; z-index: 1; flex: 1; width: min(680px, calc(100% - 32px)); margin: 0 auto; padding: 18px 0 max(28px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.loading, .load-error { margin: auto; text-align: center; color: var(--ink-2); }
.loading-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 8px; animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .25; } }

.eyebrow { font: 600 11px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.eyebrow b { color: var(--ink); }

/* Tactile letterpress buttons */
.primary, .cmd { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 4px; font-weight: 650; letter-spacing: .03em; transition: transform .1s, box-shadow .1s, background .15s; }
.primary { border: 1.5px solid var(--border); background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 var(--border); }
.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--border); }
.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
.cmd { border: 1.5px solid var(--border); background: var(--card); box-shadow: 2px 2px 0 var(--shadow-hard); }
.cmd:hover { background: var(--paper-2); }
.cmd:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--shadow-hard); }
.link { border: 0; background: none; padding: 4px 2px; color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.link:hover { text-decoration-thickness: 2px; }

.challenge-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 4px; border: 1.5px solid var(--gold); background: var(--card); box-shadow: 3px 3px 0 var(--shadow-hard); }
.challenge-card .eyebrow { display: block; color: var(--gold); }
.challenge-card strong { font: 600 15px/1.3 var(--serif); }
.challenge-actions { display: flex; align-items: center; gap: 12px; }
.small-btn { min-height: 40px; padding: 0 18px; font-size: 14px; }
/* Daily cover and alternate modes */
#game[data-phase="intro"] #content { width: min(1000px, calc(100% - 40px)); padding-block: clamp(22px, 5vh, 56px); }
#game[data-phase="intro"] .field-canvas { opacity: .12; }
.cover { display: grid; gap: 16px; }
.daily-cover { isolation: isolate; position: relative; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); align-items: center; overflow: hidden; border-radius: 18px; color: #fff9ea;
  background: radial-gradient(ellipse at 84% 42%, #31584a, transparent 60%), #112f28; border: 1px solid #416052; }
.cover-head { z-index: 1; padding: clamp(28px, 4.5vw, 56px); padding-right: 0; }
.issue-date { display: flex; gap: 12px; align-items: center; margin: 0; color: #d6e1d5; font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.issue-date span { padding-right: 12px; border-right: 1px solid #728c79; }
.title { margin: 24px 0 16px; font: 400 clamp(62px, 7.9vw, 98px)/.89 var(--serif); letter-spacing: -.052em; }
.title em { display: block; color: #d4dfaf; font-weight: 400; }
.lede { max-width: 35ch; margin: 0; color: #e0e8df; font: 400 16px/1.55 var(--sans); text-wrap: pretty; }
.cover-head .primary { margin-top: 24px; gap: 24px; background: #eff2de; color: #15392d; border: 0; }
.cover-head .primary:hover { background: white; }
.daily-finished { margin-bottom: 0; }
.cover-specimen { position: relative; margin: 0; align-self: stretch; display: grid; place-items: center; padding: 24px 32px 42px 8px; }
.cover-specimen::before { content: ""; position: absolute; width: 76%; aspect-ratio: 1; border: 1px solid #b3c49c35; border-radius: 50%; }
.cover-specimen img { position: absolute; left: 48%; top: 47%; width: min(62%, 258px); height: auto; transform: translate(-50%, -50%) rotate(11deg); filter: drop-shadow(0 14px 12px #081d1980); }
.cover-specimen figcaption { position: absolute; bottom: 22px; text-align: center; color: #d6e0cf; font: italic 15px var(--serif); }
.cover-specimen figcaption span { font: 11px var(--mono); }
.quick-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode-pill { display: flex; align-items: center; gap: 16px; min-width: 0; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 19px 22px; }
.mode-pill:hover { border-color: var(--accent); }
.mode-symbol { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 31px/1 var(--serif); }
.mode-pill b { display: block; font: 600 23px/1.1 var(--serif); letter-spacing: -.02em; }
.mode-pill small { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.mode-arrow { margin-left: auto; font: 20px var(--sans); color: var(--muted); }
.cover-footer, .cover-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 18px; color: var(--ink-2); font-size: 13px; }
.mode-links { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.mode-links .link { min-height: 44px; color: var(--ink-2); font-size: 14px; text-decoration: none; }
.mode-links .link:hover { text-decoration: underline; }
.catalog { margin: 0; color: var(--muted); font: 11px/1.4 var(--mono); }
@media (max-width: 640px) {
  .topbar { width: calc(100% - 32px); padding-block: max(6px, env(safe-area-inset-top)) 6px; }
  #game[data-phase="intro"] #content { width: calc(100% - 28px); padding-block: 16px 24px; }
  .cover { gap: 12px; }
  .daily-cover { display: block; border-radius: 14px; }
  .cover-head { position: relative; padding: 24px 20px; }
  .title { width: 60%; margin: 28px 0 23px; font-size: clamp(50px, 13vw, 76px); }
  .lede { max-width: 34ch; font-size: 15px; }
  .cover-head .primary { margin-top: 18px; }
  .cover-specimen { position: absolute; right: 1%; top: 50px; width: 38%; height: clamp(110px, 29vw, 166px); padding: 0; }
  .cover-specimen img { top: 50%; left: 50%; width: 76%; max-width: 150px; height: auto; }
  .cover-specimen figcaption { display: none; }
  .quick-modes { grid-template-columns: 1fr; gap: 8px; }
  .mode-pill { padding: 13px 16px; gap: 12px; }
  .mode-pill b { font-size: 21px; }
  .cover-footer { justify-content: center; flex-direction: column; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* Prompt specimen card & answer dock */
.card { background: var(--card); border: 1.5px solid var(--border); border-radius: 5px; padding: 22px 24px; box-shadow: 4px 4px 0 var(--shadow-hard); }
.prompt-card { position: relative; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.category { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.theme-glyph { width: 16px; height: 16px; }
.prompt-card h2 { margin: 14px 0 8px; font: 600 clamp(26px, 5.8vw, 35px)/1.18 var(--serif); text-wrap: balance; }
.hint { margin: 0; font: italic 14px var(--serif); color: var(--muted); }
[data-phase="preview"] .prompt-card { animation: rise .4s both; }

.dock { background: var(--card); border: 1.5px solid var(--border); border-radius: 5px; padding: 18px; box-shadow: 4px 4px 0 var(--shadow-hard); }
.preview-dock { text-align: center; }
.preview-dock p { margin: 0; color: var(--ink-2); font-size: 14px; }
.countdown { font: 600 62px/1.1 var(--serif); color: var(--accent); font-variant-numeric: tabular-nums; }
.dock-inner { display: grid; gap: 10px; }
.reject { min-height: 0; color: var(--danger); font-weight: 600; font-size: 14px; }
.reject.misconception { padding: 7px 11px; border-radius: 3px; background: color-mix(in srgb, var(--danger) 10%, var(--paper)); border-left: 3px solid var(--danger); }
.reject:empty { display: none; }
.answer-shake .entry { animation: shake .32s; }
.answer-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.answer-choices[hidden] { display: none; }
.answer-choice { border: 1.5px solid var(--accent); background: var(--accent-soft); border-radius: 3px; padding: 6px 12px; font-weight: 600; }
.answer-form { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.answer-form.shake { animation: shake .32s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.timer { --remaining: 360deg; width: 54px; height: 54px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--card) 78%, transparent 80%), conic-gradient(var(--accent) var(--remaining), var(--line) 0); }
.timer span { font: 600 19px/1 var(--serif); font-variant-numeric: tabular-nums; }
.timer small { font: 8.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hot .timer { background: radial-gradient(closest-side, var(--card) 78%, transparent 80%), conic-gradient(var(--danger) var(--remaining), var(--line) 0); }
.hot .timer span { color: var(--danger); }
.entry { position: relative; }
#answer { width: 100%; min-height: 50px; border: 0; border-bottom: 2px solid var(--border); background: transparent; padding: 8px 2px; font: 22px var(--serif); outline: none; border-radius: 0; }
#answer::placeholder { color: var(--muted); font-style: italic; }
#answer:focus { border-bottom-color: var(--accent); }
.fuse-track { position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; overflow: hidden; }
.fuse { height: 100%; background: var(--accent); transform-origin: left; }
.hot .fuse { background: var(--danger); }
.submit { min-height: 46px; padding: 0 20px; border: 1.5px solid var(--border); border-radius: 4px; background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: 0 3px 0 var(--border); transition: transform .1s, box-shadow .1s; }
.submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 0 var(--border); }
.submit:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
.submit:disabled { opacity: .42; box-shadow: none; }
.dock-foot .link { white-space: nowrap; }
.dock-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 520px) {
  .answer-form { grid-template-columns: auto 1fr; }
  .submit { grid-column: 1 / -1; }
  .card { padding: 18px; }
}

/* Feedback: Museum holotype specimen plate & mechanical plumb-line descent */
.specimen { position: relative; margin-top: 8px; }
.specimen-label { position: relative; background: var(--card); border: 1.5px solid var(--border); border-top: 4px solid var(--tier); border-radius: 5px; padding: 24px 26px 22px; text-align: center; box-shadow: 4px 4px 0 var(--shadow-hard); outline: 1px solid var(--rule); outline-offset: -8px; }
.specimen-prompt { margin: 6px 0 0; font: 15px/1.35 var(--serif); color: var(--ink-2); text-wrap: balance; }
.reveal-emblem { position: relative; width: 58px; height: 58px; margin: 16px auto 12px; border-radius: 50%; display: grid; place-items: center; color: var(--tier); border: 1.5px solid var(--tier); background: var(--paper); }
.reveal-emblem .tier-icon { width: 28px; height: 28px; position: relative; z-index: 1; }
.reveal-emblem .empty-catch { font-size: 28px; line-height: 1; color: var(--muted); position: relative; z-index: 1; }
.reveal-emblem i { display: none; }
.reveal-tier { display: inline-block; padding: 4px 11px; border: 1px solid var(--tier); border-radius: 2px; background: color-mix(in srgb, var(--tier) 10%, var(--card)); font: 700 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--tier); }
.missed .reveal-tier { color: var(--muted); border-color: var(--line); background: var(--paper); }
.specimen-name { margin: 12px 0 0; font: italic 600 clamp(28px, 7vw, 44px)/1.12 var(--serif); overflow-wrap: anywhere; text-wrap: balance; }
.missed .specimen-name { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.specimen-score { display: inline-flex; justify-content: center; align-items: center; gap: 18px; margin-top: 16px; padding: 10px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.specimen-score strong { font: 600 32px/1 var(--serif); color: var(--tier); font-variant-numeric: tabular-nums; }
.specimen-score strong small { font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-left: 5px; }
.score-taxon { border-left: 1px solid var(--line); padding-left: 18px; font: 600 21px/1.1 var(--serif); color: var(--ink); }
.score-taxon.descended { color: var(--gold); animation: drop-in .4s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.quip { margin: 14px auto 0; max-width: 46ch; color: var(--ink-2); font: 16px/1.45 var(--serif); text-wrap: pretty; }
.saved-at-buzzer { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--muted); }
.vial-badge { display: inline-block; margin-top: 10px; padding: 3px 10px; border-radius: 3px; font: 600 12px var(--mono); }
.vial-badge.lost { background: color-mix(in srgb, var(--danger) 12%, var(--paper)); color: var(--danger); border: 1px solid var(--danger); }
.vial-badge.gained { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }

/* Center-stage plumb-line specimen descent */
.dive-ticket, .climb-ticket { position: absolute; left: 50%; top: 16px; z-index: 3; pointer-events: none; display: none; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 16px); background: none; border: 0; box-shadow: none; padding: 0; margin: 0; }
.sink-wake { width: 0; height: 52px; border-left: 1.5px dashed var(--tier); }
.sink-avatar { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; color: var(--self-color, var(--tier)); background: var(--card); border: 2px solid var(--tier); box-shadow: 3px 3px 0 var(--shadow-hard); animation: sink-bob .75s ease-in-out infinite; }
.sink-avatar svg { width: 42px; height: 42px; }
@keyframes sink-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
.sink-pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 3px; background: var(--card); border: 1.5px solid var(--tier); color: var(--tier); font: 600 13.5px var(--mono); box-shadow: 3px 3px 0 var(--shadow-hard); }
.sink-pill .tier-icon { width: 17px; height: 17px; }
.sink-pill span { color: var(--ink); font-family: var(--serif); font-style: italic; font-size: 16px; }
.sink-target { padding: 3px 8px; border-radius: 2px; background: var(--card); border: 1px solid var(--line); font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.expedition-descending .dive-ticket,
.expedition-descending .climb-ticket,
.expedition-climbing .dive-ticket,
.expedition-climbing .climb-ticket { display: flex; opacity: clamp(0, calc((.80 - var(--descent-progress, var(--climb-progress, 0))) * 4.5), 1); transform: translate(-50%, calc(var(--descent-progress, var(--climb-progress, 0)) * 115px)); }
.expedition-descending .specimen,
.expedition-climbing .specimen { opacity: clamp(0, calc((var(--descent-progress, var(--climb-progress, 0)) - .56) * 2.5), 1); transform: translateY(calc((1 - var(--descent-progress, var(--climb-progress, 0))) * 24px)); }
.expedition-descending .reveal-dock { opacity: .65; transition: opacity .3s; }
.expedition-landed .specimen-label { animation: catch-land .38s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes catch-land { from { transform: translateY(-6px); } to { transform: translateY(0); } }
.reveal-dock { text-align: center; display: grid; justify-items: center; gap: 6px; }
.keyboard-hint { margin: 0; font-size: 12px; color: var(--muted); }
@media (hover: none) { .keyboard-hint { display: none; } }
.specimen.animate .specimen-label { animation: drop .4s cubic-bezier(.2, .9, .3, 1.1) both; }
.specimen.animate .reveal-emblem { animation: rise .35s .12s both; }
.specimen.animate .specimen-score strong { animation: rise .35s .28s both; }
@keyframes drop { from { opacity: 0; transform: translateY(14px); } }

/* Results */
.sheet { display: grid; gap: 16px; text-align: center; }
.sheet-summary { display: grid; gap: 14px; background: var(--card); border: 1.5px solid var(--border); border-radius: 5px; padding: 24px 20px; box-shadow: 4px 4px 0 var(--shadow-hard); }
.result-emblem { width: 68px; height: 68px; margin: 2px auto 0; border-radius: 50%; display: grid; place-items: center; color: var(--tier); border: 1.5px solid var(--tier); background: var(--paper); }
.result-emblem .tier-icon { width: 34px; height: 34px; }
.sheet h2 { margin: 0; font: 600 34px/1.1 var(--serif); }
.sheet h2 em { color: var(--accent); }
.personal-best { justify-self: center; padding: 4px 11px; border-radius: 2px; background: var(--gold); color: #161411; font: 700 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.total { font: 600 66px/1 var(--serif); font-variant-numeric: tabular-nums; }
.total span { font-size: 22px; color: var(--muted); margin-left: 6px; }
.result-meta { margin: 0; color: var(--ink-2); }
.result-meta i { font-style: normal; color: var(--muted); margin: 0 6px; }
.sheet > .primary, .share-row { justify-self: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.duel-section { background: var(--card); border: 1.5px solid var(--gold); border-radius: 5px; padding: 18px; text-align: left; box-shadow: 4px 4px 0 var(--shadow-hard); display: grid; gap: 12px; }
.duel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.duel-head h3 { margin: 0; font: 600 19px var(--serif); }
.duel-verdict { font: 700 13px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.duel-verdict.win { color: var(--accent); }
.duel-verdict.loss { color: var(--danger); }
.duel-verdict.tie { color: var(--gold); }
.duel-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; }
.duel-totals div { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 10px; }
.duel-totals small { display: block; font: 600 11px var(--mono); text-transform: uppercase; color: var(--muted); }
.duel-totals strong { font: 600 28px var(--serif); }
.duel-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.duel-rows li { display: grid; grid-template-columns: 20px 1fr 1fr; gap: 8px; align-items: center; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--line); }
.duel-idx { font: 11px var(--mono); color: var(--muted); }
.duel-pick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-pick b { font-weight: 700; font-size: 12px; font-family: var(--mono); color: var(--tier); margin-right: 4px; }
.duel-pick.opp { text-align: right; color: var(--ink-2); }
.journey-section, .catches { background: var(--card); border: 1.5px solid var(--border); border-radius: 5px; padding: 18px; text-align: left; box-shadow: 4px 4px 0 var(--shadow-hard); }
.journey-section h3, .catches h3 { margin: 0; font: 600 19px var(--serif); }
.journey { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 150px; }
.journey.scroll { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
.journey.scroll li { flex: 0 0 42px; }
.journey li { min-width: 0; height: 100%; }
.journey-btn { width: 100%; height: 100%; border: 0; background: none; padding: 0; display: grid; grid-template-rows: auto 1fr auto; text-align: center; }
.journey-btn:hover .journey-label { color: var(--accent); }
.journey-label { font: 11px var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.result-lineage { margin: -8px 0 0; font: italic 18px/1.2 var(--serif); color: var(--ink-2); }
.result-taxa { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 6px; font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.result-taxa span { padding: 3px 8px; border-radius: 2px; border: 1px solid var(--line); background: var(--paper); }
.result-taxa span.reached { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.result-taxa span.current-taxon { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 20%, var(--card)); color: var(--ink); }
.journey-track { position: relative; background: repeating-linear-gradient(0deg, var(--paper-2) 0 1px, transparent 1px 14.28%); border-radius: 2px; }
.journey-track span { position: absolute; left: 18%; right: 18%; top: 0; height: var(--bar); background: var(--tier); border-radius: 0 0 2px 2px; animation: grow .6s both; }
@keyframes grow { from { height: 0; } }
.journey small { font: 11px var(--mono); color: var(--muted); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.section-heading span { font-size: 12.5px; color: var(--muted); }
.catch { border-top: 1px solid var(--line); }
.catch summary { list-style: none; display: grid; grid-template-columns: 24px 30px 1fr auto 16px; align-items: center; gap: 10px; padding: 12px 2px; cursor: pointer; }
.catch summary::-webkit-details-marker { display: none; }
.catch-number { font: 12px var(--mono); color: var(--muted); }
.catch-icon { color: var(--tier); display: grid; }
.catch-icon .tier-icon { width: 24px; height: 24px; }
.catch-miss { color: var(--muted); font-size: 20px; text-align: center; }
.catch summary small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catch summary strong { display: block; font: italic 600 18px/1.25 var(--serif); overflow-wrap: anywhere; }
.catch summary div { min-width: 0; }
.catch summary b { font: 600 16px var(--mono); font-variant-numeric: tabular-nums; }
.chevron { color: var(--muted); transition: transform .2s; }
.catch[open] .chevron { transform: rotate(180deg); }
.choices { padding: 4px 0 16px; display: grid; gap: 10px; }
.answer-search input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); padding: 0 12px; }
.sheet-note { margin: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sources summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.sources p { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.tier-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tier-pill { border: 1px solid var(--line); background: var(--paper); border-radius: 3px; padding: 4px 9px; font: 600 11.5px var(--mono); color: var(--ink-2); }
.tier-pill.active { border-color: var(--tier, var(--accent)); background: color-mix(in srgb, var(--tier, var(--accent)) 14%, var(--card)); color: var(--ink); }
.quip-callout { padding: 10px 12px; border-radius: 3px; background: var(--paper); border-left: 3px solid var(--gold); font: 14px/1.4 var(--serif); color: var(--ink); }
.answer-group { margin-top: 6px; }
.answer-group-title { display: flex; align-items: center; gap: 8px; color: var(--tier); }
.answer-group-title .tier-icon { width: 20px; height: 20px; }
.answer-group-title strong { font-size: 14px; }
.answer-group-title span { font: 11px var(--mono); color: var(--muted); }
.answer-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 3px; padding: 4px 9px; font-size: 13.5px; text-align: left; }
.chip.has-quip { border-style: dashed; border-color: color-mix(in srgb, var(--gold) 65%, var(--line)); }
.chip.has-quip i { font-style: normal; color: var(--gold); margin-left: 5px; font-size: 11px; }
.chip.your-answer { border: 1.5px solid var(--accent); background: var(--accent-soft); font-weight: 650; }
.chip small { margin-left: 6px; font: 700 9px var(--mono); text-transform: uppercase; color: var(--accent); }
.sheet-status { margin: 0; font-size: 12.5px; color: var(--muted); }
.sheet-pagination { display: flex; gap: 16px; }
.no-matches { color: var(--muted); }
.results-footer { display: grid; justify-items: center; gap: 10px; padding-bottom: 12px; }
.footer-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.results-footer p { margin: 0; font-size: 13px; color: var(--ink-2); padding: 5px 12px; border-radius: 3px; background: var(--card); border: 1px solid var(--line); }
.results-footer b { color: var(--ink); font-variant-numeric: tabular-nums; }
.links { display: flex; gap: 18px; padding: 6px 14px; border-radius: 3px; background: var(--card); border: 1px solid var(--line); }

/* Dialogs */
dialog { width: min(460px, calc(100% - 24px)); max-height: calc(var(--viewport-height) - 32px); border: 1.5px solid var(--border); border-radius: 6px; background: var(--card); color: var(--ink); padding: 0; box-shadow: 6px 6px 0 var(--shadow-hard); }
dialog.wide { width: min(640px, calc(100% - 24px)); }
dialog::backdrop { background: rgba(16, 15, 12, 0.58); }
#dialog-body { padding: 18px 20px 22px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--rule); }
.dialog-head h2 { margin: 0; font: 600 24px var(--serif); }
.close { width: 34px; height: 34px; border-radius: 4px; border: 1px solid var(--line); background: var(--paper); font-size: 20px; line-height: 1; }
.close:hover { border-color: var(--border); }
.dialog-intro { margin: 0 0 14px; color: var(--ink-2); }
.timer-warning { margin: 0 0 12px; padding: 10px 12px; border-radius: 4px; background: color-mix(in srgb, var(--danger) 10%, var(--paper)); color: var(--danger); border-left: 3px solid var(--danger); font-size: 14px; }
.list { display: grid; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; }
.row:hover { color: var(--accent); }
.row span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.list-title { margin: 18px 0 4px; font: 600 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats div { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 10px 6px; text-align: center; }
.stats strong { display: block; font: 600 20px/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.stats span { font-size: 11px; color: var(--muted); }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.tier-breakdown { margin-top: 12px; display: grid; gap: 8px; }
.tier-bar { display: flex; height: 10px; border-radius: 2px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); }
.tier-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; color: var(--ink-2); }
.tier-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tier-legend i { width: 8px; height: 8px; border-radius: 1px; background: var(--tier); }
.tier-legend b { font-family: var(--mono); color: var(--ink); }
.history-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.history-head .list-title { margin: 0; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-pill { border: 1px solid var(--line); background: var(--paper); border-radius: 3px; padding: 3px 9px; font: 600 11px var(--mono); color: var(--ink-2); }
.filter-pill.active { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.companions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.companion-card { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 14px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); transition: border-color .15s, background .15s; }
.companion-card:not(:disabled):hover { border-color: var(--border); background: var(--paper-2); }
.companion-card.active { border: 2px solid var(--accent); background: var(--accent-soft); }
.companion-card.locked { opacity: .62; }
.companion-thumb { width: 54px; height: 54px; }
.companion-thumb svg { width: 100%; height: 100%; }
.companion-card strong { font: 600 15px var(--serif); }
.companion-card i { font: italic 12px var(--serif); color: var(--muted); }
.companion-card span { font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.seg-group { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--paper); }
.seg-btn { border: 0; background: none; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.seg-btn.active { background: var(--accent); color: var(--accent-ink); }
.empty-log { display: grid; justify-items: center; gap: 8px; padding: 20px 0; text-align: center; color: var(--ink-2); }
.empty-log .tier-icon { width: 40px; height: 40px; color: var(--accent); }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.pack-card { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); transition: border-color .15s, background .15s; }
.pack-card:hover { border-color: var(--border); background: var(--paper-2); }
.pack-card .theme-glyph { width: 26px; height: 26px; color: var(--accent); }
.pack-card h3 { margin: 4px 0 0; font: 600 18px var(--serif); }
.pack-card p { margin: 0; font-size: 13px; color: var(--ink-2); }
.pack-card span { margin-top: 6px; font: 11px var(--mono); color: var(--muted); }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.setting strong { display: block; }
.setting span { font-size: 13px; color: var(--muted); }
.setting input { width: 20px; height: 20px; accent-color: var(--accent); }
.how-rules p { margin: 0 0 12px; color: var(--ink-2); }
.how-rules strong { color: var(--ink); }
.tier-guide { display: grid; gap: 6px; margin: 6px 0 12px; }
.tier-guide div { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 3px; background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--tier); }
.tier-guide .tier-icon { width: 22px; height: 22px; color: var(--tier); }
.tier-guide span { font-weight: 650; }
.tier-guide span small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.tier-guide b { font: 600 14px var(--mono); }
.tier-guide b small { font-size: 10px; color: var(--muted); }
.help-foot { margin: 0; font-size: 13px; color: var(--muted); }
.calendar-header { display: flex; justify-content: space-between; align-items: center; }
.calendar-header h3 { margin: 0; font: 600 18px var(--serif); }
.icon-btn { width: 34px; height: 34px; border-radius: 4px; border: 1px solid var(--line); background: var(--paper); font-size: 20px; }
.icon-btn:disabled { opacity: .35; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-week { margin: 12px 0 4px; text-align: center; font: 11px var(--mono); color: var(--muted); }
.calendar-day { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); display: grid; place-content: center; padding: 0; }
.calendar-day span { font-weight: 650; }
.calendar-day small { font: 9.5px var(--mono); color: var(--muted); }
.calendar-day:disabled { opacity: .3; }
.calendar-day.today { border-color: var(--border); }
.calendar-day.completed { background: var(--accent-soft); border-color: var(--accent); }
.calendar-day.completed small { color: var(--accent); font-weight: 700; }
.calendar-day.started { border-style: dashed; border-color: var(--gold); }
.calendar-key { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.calendar-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--accent-soft); border: 1px solid var(--accent); vertical-align: -1px; }
.calendar-key span + span i { background: transparent; border: 1px dashed var(--gold); }
.share-copy { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); padding: 10px; font: 14px var(--mono); }

#notice { position: fixed; z-index: 10; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px); }
#notice:not(:empty) { padding: 10px 16px; border-radius: 4px; background: var(--ink); color: var(--paper); font-size: 14px; box-shadow: 3px 3px 0 var(--shadow-hard); }

.compact .cover-ladder, .compact #ladder { display: none; }
.compact #content { padding-top: 8px; gap: 10px; }
.compact .prompt-card h2 { font-size: 24px; }

/* Shared surfaces and controls */
:root { --surface-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 5%, transparent); }
.card, .dock, .specimen-label, .sheet-summary, .journey-section, .catches, .duel-section, .challenge-card {
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--surface-shadow);
}
.primary, .submit, .cmd { border-radius: 8px; letter-spacing: 0; border: 1px solid var(--line); box-shadow: none; }
.primary:hover, .submit:hover:not(:disabled), .cmd:hover { box-shadow: none; }
.primary:active, .submit:active:not(:disabled), .cmd:active { transform: translateY(1px); box-shadow: none; }
#hud { margin-top: clamp(16px, 4vh, 42px); gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 11px; }
.progress, .hud-pod { border: 0; background: none; box-shadow: none; }
.hud-pod { min-width: 84px; }
.hud-pod.right { border-left: 1px solid var(--rule); border-radius: 0; }
#dots i { width: 13px; height: 6px; border-radius: 3px; }
#dots i.current { background: var(--accent); border-color: var(--accent); }
#ladder { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--surface-shadow); }
.prompt-card { padding: clamp(20px, 3.5vw, 38px); }
.card-heading { border-bottom: 0; padding-bottom: 0; }
.category { gap: 8px; font-size: 11px; }
.prompt-card h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; margin: 17px 0 0; }
#answer { border: 1px solid var(--line); background: var(--paper); border-radius: 7px; padding-inline: 13px; }
#answer:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.fuse-track { left: 7px; right: 7px; bottom: 0; }
.specimen-label { padding: clamp(20px, 3.5vw, 36px); border-top: 3px solid var(--tier); outline: none; }
.reveal-tier { border-radius: 20px; color: var(--ink); }
.sheet-summary { padding: clamp(22px, 4vw, 42px); gap: 12px; }
.sheet-summary h2 { font-weight: 500; letter-spacing: -.025em; }
.total { letter-spacing: -.045em; }
dialog { border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 60px #10191540; }
#dialog-body { padding: clamp(18px, 3vw, 28px); }
dialog::backdrop { background: #0a1612a3; }
.close { border-radius: 50%; min-height: 40px; min-width: 40px; }
@media (min-width: 1141px) and (min-height: 640px) {
  .playing #hud { margin-top: clamp(28px, 9vh, 100px); }
}
@media (max-width: 520px) {
  #hud { margin-top: 10px; }
  .playing #content { gap: 10px; padding-top: 12px; }
  .dock { padding: 14px; }
}
.compact #hud { margin-top: 4px; }
.compact .prompt-card { padding: 12px 16px; }
.compact .prompt-card h2 { margin-top: 6px; }
.compact.playing #content { gap: 6px; }

/* Answer feedback lives under the field so the input never jumps while you type. */
.dock-foot .reject { font-size: 13.5px; text-align: left; }
.dock-foot .reject.misconception { padding: 5px 9px; }
.dock-foot .link { margin-left: auto; }
.answer-choices { margin-top: 2px; }

/* Every non-Species reveal teaches the designated Species answer. */
.gem-line { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 6px; margin: 12px auto 0; padding: 6px 12px; border: 1px dashed color-mix(in srgb, var(--gold) 60%, var(--line)); border-radius: 3px; font-size: 14px; color: var(--ink-2); }
.gem-line span { font: 700 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.gem-line b { font: italic 600 16px var(--serif); color: var(--ink); }
.catch-gem { display: block; margin-top: 2px; font: 12.5px var(--sans); font-style: normal; color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Answer-sheet previews: one short row per tier with a jump to the full list. */
.chip.show-all { border-style: dashed; color: var(--accent); font-weight: 600; background: transparent; }
.chip.show-all:hover { border-color: var(--accent); }

/* First-run explainer */
.onboard-steps { list-style: none; margin: 4px 0 16px; padding: 0; display: grid; gap: 14px; }
.onboard-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.onboard-steps li > b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 700 14px var(--mono); }
.onboard-steps strong { display: block; color: var(--ink); }
.onboard-steps span { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.onboard-tiers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 18px; }
.onboard-tiers span { display: grid; justify-items: center; gap: 3px; padding: 8px 2px; border: 1px solid var(--line); border-top: 3px solid var(--tier); border-radius: 3px; color: var(--tier); }
.onboard-tiers .tier-icon { width: 18px; height: 18px; }
.onboard-tiers b { font: 600 10.5px var(--mono); color: var(--ink); letter-spacing: .02em; }
.onboard-tiers small { font: 11px var(--mono); color: var(--muted); }
.onboard-actions { display: flex; justify-content: center; }
@media (max-width: 420px) { .onboard-tiers { grid-template-columns: repeat(3, 1fr); } }

/* Family-tree descent: Human at the top, LUCA at the root. */
.ladder-body { position: relative; }
#ladder { width: 224px; }
#ladder .ladder-track { top: 8px; bottom: 8px; left: 5px; }
.ladder-head { margin: 0 0 12px; font: 700 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ladder-head span { color: var(--accent); }
#ladder li { align-items: center; justify-content: flex-start; }
#ladder li b { flex: 1; }
#ladder .ancestor-icon { width: 17px; height: 17px; flex: none; color: var(--muted); opacity: .75; transition: color .25s, transform .25s; }
#ladder li.passed .ancestor-icon { color: var(--accent); opacity: 1; }
#ladder li.here .ancestor-icon { color: var(--gold); opacity: 1; transform: scale(1.18); }
#ladder li.goal-rank .ancestor-icon { color: var(--gold); opacity: .9; }
.ladder-next { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 12px; line-height: 1.35; color: var(--ink-2); }
.ladder-next b { color: var(--gold); font-variant-numeric: tabular-nums; }
[data-phase="complete"] .ladder-next { display: none; }
@media (max-width: 1140px) {
  #ladder { width: min(680px, calc(100% - 32px)); }
  #ladder .ladder-track { top: -9px; bottom: auto; left: 6.25%; right: 6.25%; }
  .ladder-head { display: none; }
  #ladder li { display: grid; justify-items: center; gap: 4px; }
  #ladder .ancestor-icon { width: 18px; height: 18px; }
  .ladder-next { margin-top: 8px; padding-top: 7px; text-align: center; font-size: 11.5px; }
}

.descent-banner { display: flex; align-items: center; gap: 14px; max-width: 440px; margin: 16px auto 0; padding: 12px 16px; text-align: left; border: 1.5px solid var(--gold); border-radius: 10px; background: color-mix(in srgb, var(--gold) 10%, var(--card)); }
.descent-icon { width: 40px; height: 40px; flex: none; padding: 7px; border-radius: 50%; border: 1.5px solid var(--gold); color: var(--gold); background: var(--card); }
.descent-banner small { display: block; font: 700 10px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.descent-banner strong { display: block; margin-top: 2px; font: 600 21px/1.15 var(--serif); color: var(--ink); }
.descent-banner span { display: block; margin-top: 3px; font-size: 13px; color: var(--ink-2); }
.specimen.animate .descent-banner, .expedition-landed .descent-banner { animation: drop-in .45s .2s cubic-bezier(.2, .9, .3, 1.2) both; }

/* The descent banner carries the moment, so the tier emblem steps aside to keep Descend on screen. */
.specimen.promoted .reveal-emblem { display: none; }
.specimen.promoted .reveal-tier { margin-top: 6px; }
.result-era { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-size: 14px; color: var(--ink-2); }
.result-era-icon { width: 22px; height: 22px; color: var(--gold); flex: none; }
.result-taxa .strip-icon { width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; }

.motion-off *, .motion-off *::before, .motion-off *::after { animation: none !important; transition: none !important; }
.motion-off .expedition-descending .dive-ticket, .motion-off .expedition-climbing .dive-ticket { display: none !important; }
.motion-off .expedition-descending .specimen, .motion-off .expedition-climbing .specimen { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .expedition-descending .dive-ticket, .expedition-climbing .dive-ticket { display: none !important; }
  .expedition-descending .specimen, .expedition-climbing .specimen { opacity: 1; transform: none; }
}
