/* The game's one stylesheet, in three layers:
   1. Base layout + components (originally the dark "Thermal" design; its tokens are overridden in layer 2)
   2. Warm theme: cream / ink / honey, Fredoka + Nunito, matching the island
   3. Game screens: typed answers, score ring, results, egg + hatch, island, hero */



:root {
  color-scheme: dark;
  /* Surfaces + ink */
  --bg: #0A0C0F; --raised: #12161B; --sunk: #07090B;
  --ink: #E8ECF0; --ink-2: #8B95A1; --ink-3: #4A535E; --rule: #1E242B; --rule-2: #2A313A;
  /* Modes: MATCH = heat, DODGE = cold */
  --match: #FFC37D; --match-ink: #1A0F02; --dodge: #9CC2FF; --dodge-ink: #04122B;
  --urgent: #FF9F4A; --error: #FF8A7A;
  /* Heat ramp (monotonic lightness; colorblind-safe, never red-vs-green). Mirrored in js/heat.js. */
  --h0: #16246B; --h1: #2B36A8; --h2: #7D3CC9; --h3: #E0508A; --h4: #FF9F4A; --h5: #FFF4D6;
  /* Score tiers (tiles, pips, share squares: blue · purple · orange · yellow) */
  --t0: #1F2E6E; --t0-ink: #A9B8F0; --t1: #5A3FC6; --t1-ink: #ECE6FF; --t2: #FF9F4A; --t2-ink: #2B1400; --t3: #FFE7B8; --t3-ink: #3A2200;
  /* Map + illustration */
  --land: #1B2129; --land-off: #13171C; --land-line: #333C47;
  --ic-line: #8E9AA7; --ic-fill: #141920; --ic-shade: #222A33; --ic-acc: #FFB257;
  /* Type */
  --font-ui: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  /* Layout */
  --gutter: 20px; --col: 440px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font: 400 15px/1.45 var(--font-ui); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  font-feature-settings: 'tnum' 1; overscroll-behavior: none; }
button { font: inherit; color: inherit; }
a { color: inherit; }
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.label { font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; } /* headings focused by script for screen readers */

/* ── Screen frame ────────────────────────────────────────────────────────────────────── */
.screen { position: relative; display: flex; flex-direction: column; max-width: var(--col); height: 100vh; height: 100dvh; margin: 0 auto;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); overflow: hidden; }
@media (min-width: 600px) { .screen { border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); } }

.top { flex: none; height: 52px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 var(--gutter); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand .mark { width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: radial-gradient(circle, var(--h5) 0 22%, var(--h4) 40%, var(--h2) 70%, var(--h0) 100%); }
.brand .word { font: 600 14px/1 var(--font-mono); letter-spacing: .28em; text-transform: uppercase; }
.top .day { font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.top .slot { justify-self: end; display: flex; align-items: center; gap: 4px; }
.top .total { display: flex; align-items: baseline; gap: 4px; }
.top .total .num { font-size: 17px; font-weight: 600; }
.top .total .label { font-size: 10px; }
.top .total .outof { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--ink-2); }
.iconbtn { width: 44px; height: 44px; margin-right: -12px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--ink-2); cursor: pointer; }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn:hover { color: var(--ink); }

/* Score bar: one segment per round, filled by score tier */
.pips { flex: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 0 var(--gutter); padding: 0; list-style: none; }
.pips li { height: 4px; border-radius: 1px; background: var(--ink-3); opacity: .35; transition: background-color .4s var(--ease), opacity .4s var(--ease); }
.pips li.done, .pips li.now { opacity: 1; }
.pips li.now { background: var(--ink); }
.pips .t0 { background: var(--t0); } .pips .t1 { background: var(--t1); } .pips .t2 { background: var(--t2); } .pips .t3 { background: var(--t3); }

/* ── Prompt + timer ──────────────────────────────────────────────────────────────────── */
.prompt { flex: none; padding: 16px var(--gutter) 0; min-height: 118px; }
.meta { display: flex; align-items: center; gap: 10px; height: 24px; }
.mode { font: 600 11px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; padding: 6px 8px 5px; border-radius: 3px; }
.mode.match { background: var(--match); color: var(--match-ink); }
.mode.dodge { background: var(--dodge); color: var(--dodge-ink); }
.meta .hint { font: 500 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.meta .round { margin-left: auto; font: 500 11px/1 var(--font-mono); letter-spacing: .08em; color: var(--ink-2); }
.prompt h1 { margin: 12px 0 0; font: 500 clamp(23px, 7.2vw, 28px)/1.12 var(--font-ui); letter-spacing: -.02em; text-wrap: balance; }

.timer { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px var(--gutter) 0; height: 34px; }
.timer .track { position: relative; flex: 1; height: 12px; background: linear-gradient(90deg, var(--rule-2) 1px, transparent 1px) 0 0 / 6px 100% repeat-x; }
.timer .fill { position: absolute; left: 0; top: 5px; height: 2px; width: 100%; transform-origin: 0 50%; background: var(--ink); }
.timer .secs { min-width: 3ch; text-align: right; font: 500 22px/1 var(--font-mono); letter-spacing: -.02em; }
.timer.urgent .fill { background: var(--urgent); }
.timer.urgent .secs { color: var(--urgent); }
.timer.paused { opacity: .5; }

/* ── Stage (the surface) ─────────────────────────────────────────────────────────────── */
.stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 10px 12px 0; container-type: size; }
.stage::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle, #1C232B 1px, transparent 1.4px) center / 14px 14px;
  -webkit-mask: linear-gradient(transparent, #000 14%, #000 86%, transparent); mask: linear-gradient(transparent, #000 14%, #000 86%, transparent); }
.stage > * { position: relative; }
.stage.shake { animation: shake .32s var(--ease); }
@keyframes shake { 20% { transform: translateX(-6px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } 100% { transform: none; } }

/* Map viewport: pinch/drag/zoom happen inside; the marker layer stays screen-sized */
.mapview { position: absolute; inset: 10px 0 0; overflow: hidden; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.maplayer { position: absolute; left: 0; top: 0; transform-origin: 0 0; } /* will-change is set only while moving (map.js) */
.maplayer.animate { transition: transform .35s var(--ease); }
.maplayer svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* Map strokes: --px (set by map.js) = SVG units per screen pixel, so `N * var(--px)` is N screen pixels at any zoom. */
.maplayer .r { fill: var(--land); stroke: var(--land-line); stroke-width: calc(.8px * var(--px, 1)); stroke-linejoin: round; }
.maplayer .r.off, .maplayer .c { fill: var(--land-off); stroke: var(--rule-2); stroke-width: calc(.6px * var(--px, 1)); }
.maplayer .lines .r, .maplayer .lines .c { fill: none; }
.maplayer .r.hover { fill: #212833; }
.heat { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.zoom { position: absolute; right: 12px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.zoom button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--rule-2); background: rgba(10,12,15,.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 4px; color: var(--ink); font: 400 22px/1 var(--font-ui); cursor: pointer; }
.zoom button:disabled { opacity: .35; cursor: default; }
.legend { position: absolute; left: 12px; bottom: 10px; z-index: 2; display: flex; align-items: center; gap: 8px; font: 500 10px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); pointer-events: none; }
.legend i { display: block; width: 72px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--h0), var(--h1), var(--h2), var(--h3), var(--h4), var(--h5)); }

/* Crosshair marker (screen-sized at any zoom) */
.marker { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 3; transition: opacity .2s; }
.marker::before { content: ''; position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border: 1.5px solid #fff; border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.35); }
.marker::after { content: ''; position: absolute; left: -25px; top: -25px; width: 50px; height: 50px;
  background: linear-gradient(#fff, #fff) center 0 / 1.5px 8px no-repeat, linear-gradient(#fff, #fff) center 100% / 1.5px 8px no-repeat,
              linear-gradient(#fff, #fff) 0 center / 8px 1.5px no-repeat, linear-gradient(#fff, #fff) 100% center / 8px 1.5px no-repeat;
  filter: drop-shadow(0 0 1px rgba(0,0,0,.8)); }
.marker i { position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.marker.dragging::before { transform: scale(1.18); }
.marker.invalid { opacity: .45; }
.marker.drop { animation: drop .28s var(--ease); }
@keyframes drop { from { transform: scale(1.6); opacity: 0; } }

/* Fields */
.field { position: relative; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.wheel { width: min(300px, calc(100cqw - 24px), calc(100cqh - 34px)); aspect-ratio: 1; }
.wheel canvas.disc { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 1px var(--rule-2); }
.wheel::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from -.5deg, var(--ink-3) 0 1deg, transparent 1deg 10deg);
  -webkit-mask: radial-gradient(circle, transparent calc(70.7% - 8px), #000 calc(70.7% - 7px)); mask: radial-gradient(circle, transparent calc(70.7% - 8px), #000 calc(70.7% - 7px)); }
.wheel .heat { border-radius: 50%; }
.wheel.revealed canvas.disc { filter: saturate(.35) brightness(.28); transition: filter .6s var(--ease); }

.grid { width: min(340px, 100cqw, calc(100cqh - 4px)); padding: 18px 0 0 18px; outline: none; }
.grid svg.cells { display: block; width: 100%; height: 100%; overflow: visible; }
.grid .cell { fill: var(--raised); stroke: var(--bg); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.grid .cell.sel { fill: #26303B; }
.grid .axis { font-family: var(--font-mono); font-weight: 500; fill: var(--ink-3); } /* size set in grid units by field.js */
.grid .board { position: relative; }

.line { width: 100%; height: 160px; padding: 0 18px; }
.line .board { position: absolute; left: 18px; right: 18px; top: 0; bottom: 0; }
.line svg.ticks { position: absolute; left: 0; right: 0; top: 88px; width: 100%; height: 40px; overflow: visible; }
.line .tick { stroke: var(--rule-2); stroke-width: 1; }
.line .tick.major { stroke: var(--ink-3); }
.line .base { stroke: var(--ink-2); stroke-width: 1.5; }
.line .lab { position: absolute; top: 116px; transform: translateX(-50%); font: 500 10px/1 var(--font-mono); color: var(--ink-2); pointer-events: none; }
.line .bubble { position: absolute; top: 18px; transform: translateX(-50%); font: 500 40px/1 var(--font-mono); letter-spacing: -.03em; pointer-events: none; }
.line .heat { top: 62px; height: 26px; bottom: auto; border-radius: 2px; }
.line .marker { top: 97px; }
.line { outline: none; }
.grid:focus-visible .board, .line:focus-visible .board { outline: 1px solid var(--ink-3); outline-offset: 6px; }

.shape { width: min(320px, 100cqw, calc(100cqh - 8px)); aspect-ratio: 1; }
.shape svg { display: block; width: 100%; height: 100%; overflow: visible; }
.shape .body { fill: var(--land); stroke: var(--land-line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* Scenes: illustration paint classes (f body, s shade, a accent, l line) */
.scenewrap { height: 100%; width: 100%; display: grid; place-items: center; }
.scene { display: block; height: 100%; max-height: 460px; width: auto; max-width: 100%; user-select: none; -webkit-user-select: none; }
.ic .f { fill: var(--ic-fill); stroke: var(--ic-line); } .ic .s { fill: var(--ic-shade); stroke: var(--ic-line); }
.ic .a { fill: var(--ic-acc); stroke: var(--ic-line); } .ic .l { fill: none; stroke: var(--ic-line); }
.ic .f, .ic .s, .ic .a, .ic .l { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ic .body { fill: #0F1317; stroke: var(--ic-line); stroke-width: 2; } .ic .cavity { fill: #0C1014; stroke: var(--ic-line); stroke-width: 2; }
.ic .shelf { fill: #1B2129; stroke: var(--ic-line); stroke-width: 1.5; } .ic .drawer { fill: rgba(120,150,180,.08); stroke: var(--ic-line); stroke-width: 2; pointer-events: none; }
.ic .lamp { fill: #CFE0FF; } .ic .lampglow { fill: #CFE0FF; opacity: .05; pointer-events: none; }
.ic .obj { cursor: pointer; transition: opacity .25s var(--ease); }
.ic .obj .hit { fill: transparent; }
.ic .obj:focus { outline: none; }
.ic .obj:focus-visible .hit { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; }
.ic.picking .obj:not(.sel) { opacity: .45; }
.ic .pick { fill: rgba(255,178,87,.06); stroke: var(--ic-acc); stroke-width: 1.5; pointer-events: none; }
.ic .obj.absent { display: none; }
.ic .tint { pointer-events: none; mix-blend-mode: screen; }
.ic .pct { font: 600 13px/1 var(--font-mono); fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; text-anchor: middle; pointer-events: none; }

/* Readout under the surface (what's under the marker; colour names are the colourblind fallback) */
.readout { flex: none; height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 var(--gutter);
  font: 500 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.readout b { color: var(--ink); font-weight: 600; }
.readout .swatch { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); flex: none; }

/* Primary action: same place, same size, every screen */
.cta { flex: none; padding: 0 var(--gutter) 14px; }
.btn { width: 100%; height: 56px; border: 0; border-radius: 6px; background: var(--ink); color: var(--bg); cursor: pointer;
  font: 600 15px/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; box-shadow: 0 0 0 1px #fff inset; transition: opacity .2s, transform .1s; }
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled { opacity: .28; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: 0 0 0 1px var(--rule-2) inset; }
.links { display: flex; justify-content: center; gap: 28px; padding: 6px 0 2px; }
.links button, .links a { background: none; border: 0; padding: 12px 4px; cursor: pointer; text-decoration: none; font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.links button:hover, .links a:hover { color: var(--ink); }

/* ── Reveal ──────────────────────────────────────────────────────────────────────────── */
.result { flex: none; display: flex; align-items: flex-end; gap: 12px; padding: 10px var(--gutter) 0; height: 64px; }
.result .score { font: 500 60px/.82 var(--font-mono); letter-spacing: -.03em; }
.result .of { padding-bottom: 2px; font: 500 12px/1.3 var(--font-mono); color: var(--ink-2); }
.result .temp { margin-left: auto; padding-bottom: 3px; font: 600 12px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.early { display: inline-block; margin-left: 6px; padding: 3px 5px 2px; border: 1px solid var(--rule-2); border-radius: 3px; font: 500 9px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); vertical-align: 1px; }
.verdict { flex: none; min-height: 48px; padding: 8px var(--gutter) 0; text-align: center; text-wrap: balance; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.verdict b { color: var(--ink); font-weight: 600; }

/* ── Start / intro / end / notices ───────────────────────────────────────────────────── */
.home { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 var(--gutter); text-align: center; }
.scope { position: relative; width: 168px; height: 168px; margin-bottom: 34px; }
.scope .glow { position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 54% 46%, var(--h5) 0 6%, var(--h4) 16%, var(--h3) 30%, var(--h2) 46%, var(--h1) 62%, var(--h0) 76%, transparent 77%); filter: blur(.5px); }
.scope::after { content: ''; position: absolute; inset: -14px; border-radius: 50%;
  background: repeating-conic-gradient(from -.5deg, var(--ink-3) 0 1deg, transparent 1deg 10deg);
  -webkit-mask: radial-gradient(circle, transparent calc(70.7% - 8px), #000 calc(70.7% - 7px)); mask: radial-gradient(circle, transparent calc(70.7% - 8px), #000 calc(70.7% - 7px)); }
.scope .marker { left: 54%; top: 46%; }
.home .title { margin: 0; font: 600 34px/1 var(--font-mono); letter-spacing: .32em; text-transform: uppercase; padding-left: .32em; }
.home .date { margin-top: 14px; }
.home .pitch { margin: 22px 0 0; max-width: 300px; font-size: 16px; line-height: 1.5; color: var(--ink-2); text-wrap: balance; }
.home .pitch b { color: var(--ink); font-weight: 500; }
.home .stats { display: flex; gap: 28px; margin-top: 26px; }
.home .stats div { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.home .stats .num { font-size: 20px; font-weight: 500; }

.sheet { flex: 1; min-height: 0; overflow-y: auto; padding: 18px var(--gutter) 24px; -webkit-overflow-scrolling: touch; }
.sheet h2 { margin: 6px 0 0; font: 500 26px/1.15 var(--font-ui); letter-spacing: -.02em; }
.sheet .lede { margin: 10px 0 0; color: var(--ink-2); }
.sheet p { margin: 12px 0 0; color: var(--ink-2); }
.sheet p b { color: var(--ink); font-weight: 500; }
.example { margin-top: 22px; border: 1px solid var(--rule); border-radius: 6px; background: var(--raised); overflow: hidden; }
.example .ex-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 0; }
.example .ex-prompt { padding: 10px 14px 0; font: 500 18px/1.2 var(--font-ui); letter-spacing: -.01em; }
.example .ex-board { position: relative; height: 92px; margin: 12px 14px 0; border-radius: 4px; overflow: hidden; background: var(--sunk); }
.example .ex-board .blob { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); }
.example .ex-board .marker { transform: scale(.8); }
.example .ex-foot { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px 14px; font-size: 13px; color: var(--ink-2); }
.example .ex-foot .num { font-size: 22px; font-weight: 500; color: var(--ink); }
.rules { list-style: none; margin: 22px 0 0; padding: 0; }
.rules li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 14px; }
.rules li:last-child { border-bottom: 1px solid var(--rule); }
.rules .n { font: 500 11px/1.9 var(--font-mono); color: var(--ink-3); }
.rules b { color: var(--ink); font-weight: 500; }

.end { flex: 1; min-height: 0; overflow-y: auto; padding: 18px var(--gutter) 0; }
.end .big { margin-top: 10px; display: flex; align-items: baseline; gap: 8px; }
.end .big .num { margin: 0; font: 500 84px/.9 var(--font-mono); letter-spacing: -.04em; }
.end .big .of { font: 500 14px/1 var(--font-mono); color: var(--ink-2); }
.end .endline { margin: 12px 0 0; font-size: 15px; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 20px 0 0; }
.tiles span { aspect-ratio: 1; border-radius: 3px; display: grid; place-items: center; font: 600 13px/1 var(--font-mono); }
.tiles .t0 { background: var(--t0); color: var(--t0-ink); } .tiles .t1 { background: var(--t1); color: var(--t1-ink); }
.tiles .t2 { background: var(--t2); color: var(--t2-ink); } .tiles .t3 { background: var(--t3); color: var(--t3-ink); }
.rows { list-style: none; padding: 0; margin: 18px 0 0; }
.rows li { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.rows li:last-child { border-bottom: 1px solid var(--rule); }
.rows .n { font: 500 11px/1 var(--font-mono); color: var(--ink-2); }
.rows .m { margin-left: 6px; font: 500 9px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.rows .pts { font: 600 14px/1 var(--font-mono); }
.rows .x2 { margin-left: 4px; font: 500 10px/1 var(--font-mono); color: var(--ink-2); }
.next { padding: 18px 0 14px; text-align: center; font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.next .num { color: var(--ink); font-size: 13px; letter-spacing: .04em; }
.note { margin-top: 10px; text-align: center; font-size: 12px; color: var(--ink-3); }

.notice { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 28px; }
.notice h2 { margin: 16px 0 0; font: 500 24px/1.2 var(--font-ui); letter-spacing: -.02em; }
.notice p { margin: 12px 0 0; color: var(--ink-2); }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  padding: 10px 14px; border-radius: 6px; background: var(--ink); color: var(--bg); font: 600 12px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
  transition: opacity .25s var(--ease), transform .25s var(--ease); z-index: 10; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Screen-to-screen: one quiet fade */
.screen.enter { animation: enter .35s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

@media (max-height: 640px) {
  .prompt { min-height: 96px; padding-top: 10px; }
  .prompt h1 { font-size: 22px; margin-top: 8px; }
  .scope { width: 120px; height: 120px; margin-bottom: 24px; }
  .result { height: 54px; } .result .score { font-size: 48px; }
  .end .big .num { font-size: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .stage.shake { animation: none; outline: 1px solid var(--error); outline-offset: -1px; }
}
.notice .next { text-align: left; padding-top: 22px; }

/* ── Desktop ─────────────────────────────────────────────────────────────────────────────
   Round + reveal screens become two columns: the prompt, timer, readout and primary button on the left,
   a large surface on the right. Header and score bar run across the top. Other screens: a wider centred column. */
.kbd-hint { display: none; }
kbd { font: 500 10px/1 var(--font-mono); padding: 3px 5px 2px; border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 3px; color: var(--ink); }

@media (min-width: 960px) and (min-height: 600px) {
  /* Page screens: full desktop width, real two-column compositions. */
  .screen.page { max-width: 1180px; border: 0; }
  .screen.page .top { height: 64px; padding: 0 28px; }
  .screen.page .pips { margin: 0 28px; }
  .screen.page .cta { width: 100%; max-width: 360px; padding: 0 0 28px; }

  /* Home: copy + Play on the left, the thermal scope large on the right */
  .screen.s-home { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; padding: 0 0 0;
    grid-template-rows: auto auto 1fr auto auto auto auto auto auto 1.2fr;
    grid-template-areas: 'top top' 'pips pips' '. art' 'title art' 'date art' 'pitch art' 'stats art' 'cta art' 'links art' '. art'; }
  .screen.s-home .top { grid-area: top; } .screen.s-home .pips { grid-area: pips; }
  .screen.s-home .home { display: contents; }
  .screen.s-home .scope .marker { transform: scale(1.6); }
  .screen.s-home .scope { grid-area: art; align-self: center; justify-self: center; width: min(440px, 38vw, 58vh); height: auto; aspect-ratio: 1; margin: 0; }
  .screen.s-home .title { grid-area: title; justify-self: start; padding-left: 0; margin-left: 96px; font-size: 76px; letter-spacing: .24em; }
  .screen.s-home .date { grid-area: date; justify-self: start; margin: 18px 0 0 96px; }
  .screen.s-home .pitch { grid-area: pitch; justify-self: start; text-align: left; margin: 28px 0 0 96px; max-width: 420px; font-size: 20px; }
  .screen.s-home .stats { grid-area: stats; justify-self: start; margin: 32px 0 0 96px; gap: 40px; }
  .screen.s-home .stats div { align-items: flex-start; }
  .screen.s-home .stats .num { font-size: 26px; }
  .screen.s-home .cta { grid-area: cta; margin: 40px 0 0 96px; padding: 0; }
  .screen.s-home .links { grid-area: links; justify-content: flex-start; margin: 10px 0 0 96px; padding: 0; gap: 28px; }
  .screen.s-home .links button { padding-left: 0; }

  /* How to play: the two examples side by side, rules in a 2×2 grid */
  .screen.s-howto { align-items: center; }
  .screen.s-howto .top, .screen.s-howto .pips { align-self: stretch; }
  .screen.s-howto .sheet { width: 100%; max-width: 980px; padding: 40px 28px 24px; }
  .screen.s-howto .sheet h2 { font-size: 40px; max-width: 760px; }
  .screen.s-howto .lede { font-size: 17px; max-width: 640px; }
  .examples { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
  .examples .ex-board { height: 150px; }
  .screen.s-howto .rules { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .screen.s-howto .rules li:nth-last-child(2) { border-bottom: 1px solid var(--rule); }

  /* About + notices: a comfortable reading column */
  .screen.s-reading { align-items: center; }
  .screen.s-reading .top, .screen.s-reading .pips { align-self: stretch; }
  .screen.s-reading .sheet, .screen.s-reading .notice { width: 100%; max-width: 680px; padding-top: 56px; }
  .screen.s-reading .sheet h2, .screen.s-reading .notice h2 { font-size: 36px; }
  .screen.s-reading .sheet p { font-size: 16px; line-height: 1.6; }

  /* End: score, tiles and Copy on the left; the round-by-round list on the right */
  .screen.s-end { display: grid; grid-template-columns: 1fr 1fr; column-gap: 72px;
    grid-template-rows: auto auto 1fr auto auto auto auto auto auto auto 1.2fr;
    grid-template-areas: 'top top' 'pips pips' '. .' 'date rows' 'big rows' 'line rows' 'tiles rows' 'cta rows' 'next rows' 'note rows' '. .'; }
  .screen.s-end .top { grid-area: top; } .screen.s-end .pips { grid-area: pips; }
  .screen.s-end .end { display: contents; }
  .screen.s-end .end > .label { grid-area: date; margin-left: 96px; }
  .screen.s-end .big { grid-area: big; margin: 14px 0 0 96px; }
  .screen.s-end .big .num { font-size: 132px; }
  .screen.s-end .endline { grid-area: line; margin: 16px 0 0 96px; font-size: 18px; }
  .screen.s-end .tiles { grid-area: tiles; margin: 28px 0 0 96px; max-width: 420px; gap: 8px; }
  .screen.s-end .cta { grid-area: cta; margin: 32px 0 0 96px; padding: 0; max-width: 420px; }
  .screen.s-end .next { grid-area: next; justify-self: start; margin-left: 96px; padding: 18px 0 0; }
  .screen.s-end .note { grid-area: note; justify-self: start; margin: 8px 0 0 96px; text-align: left; }
  .screen.s-end .rows { grid-area: rows; align-self: center; margin: 0 96px 0 0; }
  .screen.s-end .rows li { padding: 16px 0; font-size: 16px; }
  .screen.play {
    max-width: 1320px; border: 0;
    display: grid; grid-template-columns: minmax(340px, 400px) 1fr;
    grid-template-rows: auto auto auto auto auto 1fr auto;
    grid-template-areas: 'top top' 'pips pips' 'prompt stage' 'timer stage' 'readout stage' 'gap stage' 'cta stage';
    column-gap: 0;
  }
  .screen.play .top { grid-area: top; height: 64px; padding: 0 28px; }
  .screen.play .pips { grid-area: pips; margin: 0 28px 4px; }
  .screen.play .prompt { grid-area: prompt; min-height: 0; padding: 40px 32px 0 28px; }
  .screen.play .prompt h1 { font-size: 34px; margin-top: 16px; }
  .screen.play .timer, .screen.play .result { grid-area: timer; padding: 24px 32px 0 28px; }
  .screen.play .timer .secs { font-size: 28px; }
  .screen.play .result { height: auto; padding-top: 32px; }
  .screen.play .result .score { font-size: 76px; }
  .screen.play .readout, .screen.play .verdict { grid-area: readout; justify-content: flex-start; text-align: left; padding: 22px 32px 0 28px; height: auto; min-height: 0; }
  .screen.play .verdict { font-size: 15px; text-wrap: pretty; }
  .screen.play .cta { grid-area: cta; padding: 0 32px 28px 28px; }
  .screen.play .stage { grid-area: stage; margin: 16px 28px 28px 0; padding: 24px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sunk); }
  .screen.play .stage::before { border-radius: 8px; -webkit-mask: none; mask: none; opacity: .7; }
  .screen.play .mapview { inset: 16px; }
  .screen.play .zoom { right: 16px; bottom: 16px; }
  .screen.play .legend { left: 16px; bottom: 18px; }
  .screen.play .wheel { width: min(520px, calc(100cqw - 48px), calc(100cqh - 48px)); }
  .screen.play .grid { width: min(560px, calc(100cqw - 24px), calc(100cqh - 24px)); }
  .screen.play .shape { width: min(520px, calc(100cqw - 24px), calc(100cqh - 24px)); }
  .screen.play .line { max-width: 760px; }
  .screen.play .scene { max-height: min(640px, 100%); }
  @media (hover: hover) and (pointer: fine) { .kbd-hint { display: block; margin: 12px 0 0; text-align: center; font-size: 12px; color: var(--ink-3); } }
}

/* ═══ 2. Warm theme ═══ */

@font-face { font-family: 'Fredoka'; src: url('/fonts/Fredoka-Variable.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('/fonts/Nunito-Variable.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #FFF8EC; --raised: #FFFDF7; --sunk: #FBF2E4;
  --ink: #4E3B2E; --ink-2: #8A7462; --ink-3: #C4B19B; --rule: #EFE3D1; --rule-2: #E3D2BA;
  --match: #F2A541; --match-ink: #4A2A05; --dodge: #A9D2F0; --dodge-ink: #123A57;
  --urgent: #E0703A; --error: #D9573B;
  /* heat (mirrors RAMPS.warm in js/heat.js) */
  --h0: #A8CDEB; --h1: #8EA6E2; --h2: #A27CD0; --h3: #E2667E; --h4: #E5532E; --h5: #A9271A;
  --t0: #E4EEF8; --t0-ink: #4E6A85; --t1: #D9CDF1; --t1-ink: #4B3A78; --t2: #FFD9A3; --t2-ink: #5A3405; --t3: #F2A541; --t3-ink: #3F2304;
  --land: #EADBC1; --land-off: #F4EBDD; --land-line: #FFF8EC;
  --map-border: #B89B76; --map-state: #CDB696;   /* country borders / US state lines: clear but quiet */
  --ic-line: #4E3B2E; --ic-fill: #FFFDF7; --ic-shade: #EFE3D1; --ic-acc: #F2A541;
  --font-ui: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-mono: 'Nunito', system-ui, sans-serif;        /* rounded everywhere; numbers stay tabular */
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
}
body { font-weight: 600; background: radial-gradient(120% 80% at 50% 0%, #FFFBF3 0%, #FFF8EC 60%, #FBEFDD 100%) fixed; }
.num, .mono { font-variant-numeric: tabular-nums; font-weight: 800; }
.label { font: 800 11px/1 var(--font-ui); letter-spacing: .08em; }

/* Header */
.brand .mark { background: radial-gradient(circle, #FFE7B0 0 22%, #F2A541 45%, #E2667E 75%, #A27CD0 100%); box-shadow: 0 0 0 2px #FFFDF7, 0 1px 3px rgba(78,59,46,.25); }
.brand .word { font: 600 20px/1 var(--font-display); letter-spacing: 0; text-transform: lowercase; }
.top .day { font: 800 12px/1 var(--font-ui); letter-spacing: .06em; }
.top .total .num { font-size: 18px; }
.pips li { height: 6px; border-radius: 99px; background: var(--rule-2); opacity: 1; }
.pips li.now { background: var(--ink-3); }

/* Prompt */
.mode { font: 800 11px/1 var(--font-ui); letter-spacing: .08em; padding: 7px 10px 6px; border-radius: 99px; }
.meta .hint, .meta .round { font: 800 11px/1 var(--font-ui); letter-spacing: .06em; }
.prompt h1 { font: 600 clamp(24px, 7.4vw, 29px)/1.12 var(--font-display); letter-spacing: -.005em; }

/* Timer: a soft rounded bar instead of instrument ticks */
.timer .track { height: 10px; border-radius: 99px; background: var(--rule); box-shadow: inset 0 1px 2px rgba(78,59,46,.12); }
.timer .fill { top: 0; height: 10px; border-radius: 99px; background: linear-gradient(#FFC15E, #F2A541); }
.timer .secs { font: 600 24px/1 var(--font-display); }
.timer.urgent .fill { background: linear-gradient(#F29268, #E0703A); }

/* Stage: a soft paper card */
.stage::before { background: radial-gradient(circle, #EADBC6 1px, transparent 1.5px) center / 16px 16px; opacity: .55; }
.maplayer .r { stroke: var(--map-border); stroke-width: calc(1px * var(--px, 1)); }
.maplayer .r.hover { fill: #E2CFAE; }
.maplayer .lines .r, .maplayer .lines .c { stroke: rgba(255,248,236,.85); }
.zoom button { background: rgba(255,253,247,.94); border: 0; border-radius: 14px; color: var(--ink); box-shadow: 0 2px 0 rgba(78,59,46,.12), 0 6px 16px rgba(78,59,46,.10); font: 600 24px/1 var(--font-display); }
.legend { font: 800 10px/1 var(--font-ui); letter-spacing: .06em; }

/* Marker: a friendly ink crosshair with a cream halo */
.marker::before { border-color: var(--ink); border-width: 2px; box-shadow: 0 0 0 3px rgba(255,253,247,.9), inset 0 0 0 2px rgba(255,253,247,.6); }
.marker::after { background: linear-gradient(var(--ink), var(--ink)) center 0 / 2px 8px no-repeat, linear-gradient(var(--ink), var(--ink)) center 100% / 2px 8px no-repeat,
  linear-gradient(var(--ink), var(--ink)) 0 center / 8px 2px no-repeat, linear-gradient(var(--ink), var(--ink)) 100% center / 8px 2px no-repeat; filter: drop-shadow(0 0 1.5px #FFFDF7); }
.marker i { background: var(--ink); box-shadow: 0 0 0 2px #FFFDF7; }

/* Fields */
.wheel::after { background: repeating-conic-gradient(from -.5deg, var(--ink-3) 0 1deg, transparent 1deg 10deg); }
.wheel canvas.disc { box-shadow: 0 0 0 8px var(--raised), 0 2px 0 8px rgba(78,59,46,.08), 0 12px 30px rgba(78,59,46,.14); }
.wheel.revealed canvas.disc { filter: saturate(.3) brightness(1.08) contrast(.8); opacity: .55; }
.grid .cell { fill: var(--raised); stroke: var(--rule); }
.grid .cell.sel { fill: #FFE7B8; }
.line .base { stroke: var(--ink-2); }

/* Readout + primary button */
.readout { font: 800 12px/1 var(--font-ui); letter-spacing: .04em; text-transform: none; }
.readout b { font-weight: 800; }
.btn { height: 58px; border-radius: 20px; background: var(--honey, #F2A541); color: #4A2A05; font: 600 19px/1 var(--font-display); letter-spacing: .01em; text-transform: none;
  box-shadow: inset 0 -4px 0 rgba(120,60,0,.18), 0 3px 0 rgba(120,60,0,.18); }
.btn:disabled { opacity: 1; background: #F1E6D4; color: #B9A48D; box-shadow: inset 0 -4px 0 rgba(78,59,46,.06); }
.btn.ghost { background: #F1E6D4; color: var(--ink); box-shadow: inset 0 -4px 0 rgba(78,59,46,.10); }
kbd { font: 800 10px/1 var(--font-ui); border-color: var(--rule-2); background: var(--raised); }

/* Reveal */
.result .score { font: 600 64px/.85 var(--font-display); }
.early { font: 800 9px/1 var(--font-ui); border-radius: 99px; padding: 4px 7px 3px; }
.result .temp { font: 800 13px/1 var(--font-ui); letter-spacing: .08em; }

/* Sheets */
.sheet h2, .notice h2 { font: 600 28px/1.15 var(--font-display); }
.example { border: 0; border-radius: 22px; background: var(--raised); box-shadow: 0 2px 0 rgba(78,59,46,.06), 0 8px 24px rgba(78,59,46,.08); }
.example .ex-board { border-radius: 14px; background: var(--sunk); }
.toast { border-radius: 99px; font: 800 13px/1 var(--font-ui); letter-spacing: .04em; }

@media (min-width: 960px) and (min-height: 600px) {
  .screen.play .stage { background: var(--raised); border: 0; border-radius: 28px; box-shadow: 0 3px 0 rgba(78,59,46,.06), 0 14px 40px rgba(78,59,46,.10); }
  .screen.play .stage::before { border-radius: 28px; }
  .screen.play .prompt h1 { font-size: 36px; }
}

/* ═══ 3. Game screens ═══ */
/* Prototype-only styles: typed answers, rarity badges, answer bars, the egg and the hatch. */
.answerbox { width: 100%; max-width: 520px; align-self: start; margin-top: 18px; }
.field-type { position: relative; }
.field-type input { width: 100%; height: 64px; padding: 0 20px; border: 0; border-radius: 22px; background: var(--raised); color: var(--ink);
  font: 600 22px/1 var(--font-display); box-shadow: inset 0 0 0 2px var(--rule-2), 0 3px 0 rgba(78,59,46,.05); outline: none; }
.field-type input:focus { box-shadow: inset 0 0 0 2.5px var(--ink), 0 3px 0 rgba(78,59,46,.05); }
.field-type input::placeholder { color: var(--ink-3); }
.answerbox .help { margin: 12px 4px 0; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.answerbox .help b { color: var(--ink); }
.suggest { margin-top: 12px; padding: 14px 16px; border-radius: 18px; background: #FFF0CC; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 700; font-size: 16px; }
.suggest .acts { display: flex; gap: 8px; margin-left: auto; }
.suggest button { height: 40px; padding: 0 16px; border: 0; border-radius: 14px; font: 800 14px/1 var(--font-ui); cursor: pointer; background: #F2A541; color: #4A2A05; }
.suggest button.no { background: #F1E6D4; color: var(--ink); }

.verdict-card { width: 100%; max-width: 520px; align-self: start; margin-top: 10px; padding: 18px; border-radius: 26px; background: var(--raised);
  box-shadow: 0 3px 0 rgba(78,59,46,.06), 0 14px 34px rgba(78,59,46,.10); }
.verdict-card .ans { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.verdict-card .ans h2 { margin: 0; font: 600 28px/1.1 var(--font-display); }
.tier { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--tc); color: var(--ti); font: 800 12px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; }
.tier.big { height: 36px; font-size: 13px; padding: 0 14px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); }
.tier.unique { background: linear-gradient(120deg, #4B4F86, #8A6FD1 55%, #E2667E); }
.verdict-card .why { margin: 8px 0 0; font-weight: 700; color: var(--ink-2); }
.verdict-card .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.verdict-card .stat { border-radius: 16px; background: var(--sunk); padding: 12px; }
.verdict-card .stat b { display: block; font: 600 24px/1 var(--font-display); }
.verdict-card .stat small { display: block; margin-top: 5px; font: 800 10px/1.2 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.bars { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.bars li { position: relative; display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 12px; border-radius: 12px; overflow: hidden; background: var(--sunk); font-weight: 700; font-size: 14px; }
.bars li i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bc); opacity: .55; border-radius: 12px; }
.bars li span { position: relative; } .bars li .p { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.bars li.you { box-shadow: inset 0 0 0 2px var(--ink); }
.bars .sep { height: auto; background: none; justify-content: center; color: var(--ink-3); font-size: 12px; }
.mapcard { position: relative; width: 100%; height: 220px; margin-top: 14px; border-radius: 18px; overflow: hidden; background: var(--sunk); }
.mapcard .mapview { inset: 0; }

/* end + egg */
.summary { flex: 1; min-height: 0; overflow-y: auto; padding: 18px var(--gutter) 0; }
.summary .label + h2 { margin: 6px 0 0; font: 600 34px/1.1 var(--font-display); }
.daylist { list-style: none; margin: 14px 0 0; padding: 0; }
.daylist li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 0; border-top: 1.5px solid var(--rule); }
.daylist li:last-child { border-bottom: 1.5px solid var(--rule); }
.daylist .q { font-size: 13px; color: var(--ink-2); font-weight: 700; grid-column: 1 / -1; }
.daylist .a { font: 600 18px/1.2 var(--font-display); }
.eggcard { margin: 18px 0 0; padding: 18px; border-radius: 26px; background: linear-gradient(160deg, #FFF3D9, #FFE3B0); text-align: center; }
.eggcard svg { width: 120px; height: 140px; overflow: visible; }
.eggcard h3 { margin: 6px 0 0; font: 600 22px/1.15 var(--font-display); }
.eggcard p { margin: 6px 0 0; color: #8A6A44; font-weight: 700; font-size: 14px; }
.egg.wobble { animation: wobble 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes wobble { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-6deg); } 80% { transform: rotate(5deg); } 90% { transform: rotate(-3deg); } }
.sharebox { margin: 16px 0 0; padding: 14px 16px; border-radius: 18px; background: var(--raised); box-shadow: inset 0 0 0 1.5px var(--rule-2); font: 700 14px/1.6 var(--font-ui); white-space: pre-wrap; color: var(--ink-2); }
.protonote { margin: 14px 0 18px; font-size: 12px; color: var(--ink-3); font-weight: 600; }

.hatch { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 var(--gutter); text-align: center; }
.hatch .glow { width: 220px; height: 220px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, var(--tc) 0%, transparent 70%); }
.hatch .glow svg { width: 170px; height: 170px; overflow: visible; }
.hatch .kick { margin-top: 10px; }
.hatch h2 { margin: 12px 0 0; font: 600 34px/1.1 var(--font-display); }
.story { width: 100%; max-width: 420px; margin-top: 16px; padding: 16px; border-radius: 22px; background: var(--raised); text-align: left; box-shadow: 0 3px 0 rgba(78,59,46,.06), 0 12px 30px rgba(78,59,46,.10); }
.story div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 8px 0; border-top: 1.5px solid var(--rule); font-size: 14px; font-weight: 700; }
.story div:first-child { border-top: 0; }
.story small { font: 800 10px/1.6 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) {
  .pop-in { animation: popin .7s cubic-bezier(.2,1.6,.4,1) both; }
  @keyframes popin { from { transform: scale(.3); opacity: 0; } }
}
@media (min-width: 960px) and (min-height: 600px) {
  .screen.play .answerbox, .screen.play .verdict-card { align-self: center; margin-top: 0; }
  .screen.play .mapcard { height: 300px; }
  .screen.play.s-summary, .screen.play.s-hatch { display: flex; max-width: 640px; }
}

/* Results scroll inside the stage on phones so the button never gets covered */
.stage.results { display: block; overflow-y: auto; padding-bottom: 12px; -webkit-overflow-scrolling: touch; }
.stage.results::before { display: none; }
.stage.results .verdict-card { margin: 4px auto 0; }
@media (max-width: 959px) { .mapcard { height: 170px; } }

/* "Checking overnight" chip */

/* Island screen (after hatching) */
.screen.s-island { position: relative; max-width: none; padding: 0; }
.islandview { position: absolute; inset: 0; }
.islandview svg { display: block; width: 100%; height: 100%; }
.islandview .res { transition: transform .2s; }
.ihud { position: absolute; left: 14px; right: 14px; top: calc(14px + env(safe-area-inset-top)); display: flex; gap: 8px; align-items: center; z-index: 2; }
.ihud .grow { flex: 1; }
.ipill { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 99px; background: rgba(255,253,247,.94); white-space: nowrap;
  box-shadow: 0 2px 0 rgba(78,59,46,.12), 0 6px 18px rgba(78,59,46,.10); font: 800 13px/1 var(--font-ui); color: var(--ink); }
.ipill.name { font: 600 16px/1 var(--font-display); }
.idock { position: absolute; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 2; display: flex; justify-content: center; }
.icard { width: 100%; max-width: 440px; padding: 16px; border-radius: 26px; background: rgba(255,253,247,.97); box-shadow: 0 3px 0 rgba(78,59,46,.12), 0 14px 34px rgba(78,59,46,.16); }
.icard h3 { margin: 0; font: 600 21px/1.2 var(--font-display); }
.icard p { margin: 6px 0 0; color: var(--ink-2); font-weight: 700; font-size: 14px; }
.icard .btn { margin-top: 14px; }
.legendrow { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 12px; }
.legendrow b { font: 800 13px/1 var(--font-ui); margin-right: 6px; }
.who { display: flex; align-items: center; gap: 12px; }
.who svg { width: 64px; height: 64px; overflow: visible; flex: none; }
.who h3 { margin-bottom: 6px; }
.story.flat { max-width: none; margin-top: 12px; padding: 4px 0 0; box-shadow: none; background: none; }

/* Wrong guesses stay visible so you can see your trail */
.tried { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.tried li { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; border-radius: 14px; background: #F7EADB; font-size: 14px; animation: drop .3s var(--ease); }
.tried li b { text-decoration: line-through; text-decoration-color: rgba(78,59,46,.4); flex: none; }
.tried li span { color: var(--ink-2); font-weight: 600; }
.field-type.nope { animation: shake .32s var(--ease); }
.field-type.nope input { box-shadow: inset 0 0 0 2.5px #E0703A; }
.eggcard.none { background: #F4EBDD; }
.eggcard.founder { margin-top: 12px; background: linear-gradient(160deg, #E6F4EA, #D3EBDD); } .eggcard.founder p { color: #3E6B50; } .eggcard.none svg { opacity: .45; filter: grayscale(.6); }
.eggcard.bellwether { background: linear-gradient(160deg, #EAF1FB, #D8E5F6); } .eggcard.bellwether p { color: #3D5A85; }

/* Island: always show the whole island; the sky fills any extra space (wide desktop windows) */
.islandview { background: linear-gradient(#A9DAF2, #D6EEF6 55%, #FBE9D6); }
.islandview { inset: calc(64px + env(safe-area-inset-top)) 0 calc(230px + env(safe-area-inset-bottom)); background: none; }
.screen.s-island { background: linear-gradient(#A9DAF2, #D6EEF6 55%, #FBE9D6); }
@media (min-width: 960px) { .islandview { inset: 70px 0 200px; } }
.islandview svg > rect[fill^="url(#sky"] { display: none; } /* the page supplies the sky, so no visible seam */

/* ── Interactive island ── */
.ihud .ipill.icon { width: 38px; padding: 0; justify-content: center; border: 0; cursor: pointer; }
.ihud .ipill.icon svg { width: 18px; height: 18px; }
.idock { flex-direction: column; align-items: center; gap: 8px; }
.icard { max-height: 46vh; overflow-y: auto; }
.icard.tall { max-height: min(64vh, 620px); }
.itabs { width: 100%; max-width: 440px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px; border-radius: 22px; background: rgba(255,253,247,.94);
  box-shadow: 0 2px 0 rgba(78,59,46,.10), 0 8px 20px rgba(78,59,46,.10); }
.itabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; border: 0; border-radius: 16px; background: none; cursor: pointer;
  font: 800 11px/1 var(--font-ui); color: var(--ink-2); }
.itabs button i { width: 26px; height: 26px; } .itabs button i svg { width: 100%; height: 100%; }
.itabs button.on { background: #FFE2AE; color: var(--ink); }
.screen.s-island.sheet-open .islandview { opacity: .55; transition: opacity .3s; }

.res.hop .bob { animation: hop .55s cubic-bezier(.3,1.6,.5,1) !important; }
@keyframes hop { 40% { transform: translateY(-9px); } }
.res:focus { outline: none; } .res:focus-visible circle:first-child { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 2; }
.bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.bubble { position: absolute; transform: translate(-50%, -100%); padding: 8px 12px; border-radius: 16px; background: #FFFDF7; color: var(--ink); white-space: nowrap;
  font: 600 15px/1 var(--font-display); box-shadow: 0 2px 0 rgba(78,59,46,.12), 0 8px 20px rgba(78,59,46,.18); animation: pop .3s var(--ease); transition: opacity .3s; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; margin-left: -6px; background: #FFFDF7; transform: rotate(45deg); border-radius: 2px; }
.bubble.out { opacity: 0; }
@keyframes pop { from { transform: translate(-50%, -80%) scale(.7); opacity: 0; } }

.hb-sec { margin-top: 14px; }
.hb-head { display: flex; align-items: center; justify-content: space-between; }
.hb-head span { font: 800 12px/1 var(--font-ui); color: var(--ink-2); }
.hb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.hb-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 0; border-radius: 16px; background: var(--sunk); cursor: pointer; font-family: var(--font-ui); color: var(--ink); min-width: 0; }
.hb-card svg { width: 44px; height: 44px; overflow: visible; }
.hb-card b { font-size: 12px; font-weight: 800; }
.hb-card small { font-size: 10px; color: var(--ink-2); font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-card.locked { cursor: default; background: repeating-linear-gradient(135deg, #F7EEDF 0 6px, #F2E6D3 6px 12px); justify-content: center; min-height: 82px; }
.hb-card.locked span { font: 600 22px/1 var(--font-display); color: #CDB89C; }

.arch { list-style: none; margin: 12px 0 0; padding: 0; }
.arch li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1.5px solid var(--rule); }
.arch .d b { display: block; font: 600 16px/1 var(--font-display); } .arch .d small { font-size: 12px; letter-spacing: 1px; }
.arch .best small { display: block; font: 800 9px/1.4 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.arch .best span { font-weight: 800; font-size: 14px; }
.playbtn { height: 36px; padding: 0 14px; border: 0; border-radius: 12px; background: #FFE2AE; color: #4A2A05; font: 800 13px/1 var(--font-ui); cursor: pointer; }

.sharecard { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; margin-top: 12px; padding: 12px; border-radius: 20px; background: var(--sunk); }
.sc-island { width: 120px; height: 120px; border-radius: 16px; overflow: hidden; background: linear-gradient(#A9DAF2, #FBE9D6); }
.sc-island svg { width: 100%; height: 100%; display: block; }
.sc-body b { font: 600 18px/1.2 var(--font-display); display: block; } .sc-body > span { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.sc-body .legendrow { margin-top: 8px; } .sc-body p { margin: 8px 0 0; font-size: 13px; }
.sharebtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; } .sharebtns .btn { margin: 0; }
@media (min-width: 960px) { .idock { max-width: 520px; margin: 0 auto; } }
.ipill .herdico { width: 22px; height: 22px; margin-right: 5px; overflow: visible; } .ihud { gap: 6px; } @media (max-width: 400px) { .ipill { padding: 0 11px; } .ipill.name { font-size: 15px; } }
.tier.unique { color: #FFF6E0 !important; text-shadow: 0 1px 1px rgba(40,30,80,.35); }

/* ── Landing page ─────────────────────────────────────────────────────────────────────── */
.screen.s-hero { display: block; height: auto; min-height: 100vh; min-height: 100dvh; max-width: none; overflow: visible; padding-bottom: env(safe-area-inset-bottom);
  background: radial-gradient(120% 60% at 50% 0%, #FFFBF3 0%, #FFF8EC 55%, #FBEFDD 100%); }
.hero-top { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 20px 10px; max-width: 1180px; margin: 0 auto; }
.hero-day { margin-left: auto; font: 800 12px/1 var(--font-ui); letter-spacing: .04em; color: var(--ink-2); }
.hero-link { font: 800 13px/1 var(--font-ui); color: var(--ink); text-decoration: none; padding: 10px 12px; border-radius: 99px; background: #F4EADB; }

.hero { display: flex; flex-direction: column; max-width: 1180px; margin: 0 auto; }
.hero-art { order: -1; position: relative; height: 300px; margin: 0 12px; border-radius: 32px; overflow: hidden;
  background: linear-gradient(#A9DAF2, #D6EEF6 60%, #FBE9D6); box-shadow: inset 0 -30px 60px rgba(255,248,236,.5); }
.hero-sky, .hero-sky svg { width: 100%; height: 100%; display: block; }
.hero-sky svg > rect[fill^="url(#sky"] { display: none; }
.hero-bubbles { position: absolute; inset: 0; pointer-events: none; }
.hero-copy { padding: 22px 22px 0; }
.hero-kicker { display: inline-block; padding: 7px 12px; border-radius: 99px; background: #FFE7B8; color: #6A3E05; font: 800 11px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; }
.hero-copy h1 { margin: 14px 0 0; font: 600 clamp(38px, 10.5vw, 68px)/1.02 var(--font-display); letter-spacing: -.01em; text-wrap: balance; }
.hero-copy > p { margin: 14px 0 0; font-size: 17px; line-height: 1.5; color: var(--ink-2); font-weight: 600; max-width: 520px; }
.hero-cta { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.hero-cta .btn { height: 62px; font-size: 21px; }
.hero-meta { text-align: center; font: 800 12px/1 var(--font-ui); color: var(--ink-2); }
.teaser { display: grid; gap: 6px; margin-top: 22px; padding: 16px 18px; border-radius: 22px; background: var(--raised); box-shadow: inset 0 0 0 1.5px var(--rule-2), 0 6px 20px rgba(78,59,46,.06); }
.teaser b { font: 600 19px/1.25 var(--font-display); }
.teaser > span:last-child { font-size: 14px; color: var(--ink-2); font-weight: 700; }

.ladder { max-width: 1180px; margin: 0 auto; padding: 44px 22px 8px; text-align: center; }
.ladder h2, .steps h3 { font-family: var(--font-display); font-weight: 600; }
.ladder h2 { margin: 0; font-size: 28px; }
.ladder-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 10px 6px; margin-top: 18px; }
.rung { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rung svg { width: 54px; height: 54px; overflow: visible; }
.ladder .arrow { font: 600 22px/1 var(--font-display); color: var(--ink-3); padding-bottom: 6px; }
.ladder p { max-width: 560px; margin: 16px auto 0; color: var(--ink-2); font-weight: 600; font-size: 15px; }

.steps { display: grid; gap: 12px; max-width: 1180px; margin: 0 auto; padding: 34px 16px 8px; scroll-margin-top: 20px; }
.step { position: relative; padding: 20px 18px 18px; border-radius: 26px; background: var(--raised); box-shadow: 0 3px 0 rgba(78,59,46,.05), 0 12px 30px rgba(78,59,46,.07); }
.step .n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 12px; background: #FFE2AE; font: 600 17px/1 var(--font-display); color: #6A3E05; }
.step h3 { margin: 12px 0 0; font-size: 22px; }
.step p { margin: 6px 0 0; color: var(--ink-2); font-weight: 600; font-size: 15px; }
.demo-input { margin-top: 14px; height: 50px; display: flex; align-items: center; padding: 0 16px; border-radius: 16px; background: var(--bg); box-shadow: inset 0 0 0 2px var(--rule-2); font: 600 19px/1 var(--font-display); }
.caret { width: 2px; height: 22px; margin-left: 2px; background: var(--ink); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo-badge { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.demo-badge small { font-weight: 800; color: var(--ink-2); }
.demo-hatch { margin-top: 8px; height: 70px; } .demo-hatch svg { width: 70px; height: 70px; overflow: visible; }
.hero-foot { display: grid; justify-items: center; gap: 14px; padding: 40px 22px 48px; text-align: center; color: var(--ink-2); font: 700 14px/1.5 var(--font-ui); }
.hero-foot .btn { max-width: 360px; }

@media (min-width: 960px) {
  .hero-top { padding: 22px 32px 10px; }
  .hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 18px 32px 0; }
  .hero-art { order: 0; height: min(600px, 72vh); margin: 0; border-radius: 40px; }
  .hero-copy { padding: 0; }
  .hero-cta { flex-direction: row; align-items: center; gap: 18px; }
  .hero-cta .btn { width: auto; padding: 0 34px; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 40px 32px 8px; }
  .ladder { padding-top: 64px; }
}

/* Herd vs Stray */
.mode.herdtag { background: #CFE3C1; color: #1F4A2A; }
.twostats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.ts { border-radius: 20px; padding: 14px 16px; }
.ts.herd { background: #DCEBD2; color: #1F4A2A; } .ts.stray { background: #FFE7B8; color: #5A3405; }
.ts small { display: block; font: 800 10px/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.ts b { display: block; margin-top: 6px; font: 600 32px/1 var(--font-display); } .ts b span { font-size: 15px; opacity: .6; }
.hero-copy > p b { color: var(--ink); }
.modes { max-width: 1180px; margin: 0 auto; padding: 44px 16px 0; text-align: center; }
.modes h2 { margin: 0 auto; max-width: 620px; font: 600 26px/1.2 var(--font-display); text-wrap: balance; }
.modes-row { display: grid; gap: 12px; margin-top: 18px; text-align: left; }
.modecard { padding: 18px; border-radius: 26px; }
.modecard.herd { background: #E6F1DE; } .modecard.stray { background: #FFF0CC; } .modecard.map { background: #E3F0FA; }
.modecard h3 { margin: 12px 0 0; font: 600 21px/1.2 var(--font-display); }
.modecard p { margin: 6px 0 0; color: var(--ink-2); font-weight: 600; font-size: 15px; }
@media (min-width: 960px) { .modes-row { grid-template-columns: repeat(3, 1fr); gap: 18px; } .modes { padding: 64px 32px 0; } }

/* Pin round */
.mode.pintag { background: #CFE4F5; color: #12405F; }
.verdict-card .stats.three { grid-template-columns: 1fr 1fr 1fr; }
.verdict-card .stats.three .stat b { font-size: 21px; }
.mapcard.tall { height: 240px; }
@media (min-width: 960px) { .mapcard.tall { height: 340px; } }
.citydot { width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #FFFDF7; box-shadow: 0 0 0 2px #8A7462; z-index: 2; pointer-events: none; }
.citydot.mine { width: 16px; height: 16px; margin: -8px 0 0 -8px; background: #F2A541; box-shadow: 0 0 0 3px #4E3B2E, 0 0 0 6px rgba(255,253,247,.9); z-index: 3; }
.pinline { stroke: #4E3B2E; stroke-width: 2px; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; fill: none; }
.maplegend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 2px 0; font: 700 12px/1 var(--font-ui); color: var(--ink-2); }
.maplegend span { display: inline-block; }
.dotme { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 2px #4E3B2E; }
.dotcity { width: 12px; height: 12px; border-radius: 50%; background: #F2A541; box-shadow: 0 0 0 2px #4E3B2E; }
.heatkey { width: 26px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--h0), var(--h2), var(--h4), var(--h5)); }
.kmnote { font: 700 12px/1 var(--font-ui); color: var(--ink-2); }
.meta .mode { white-space: nowrap; }

/* No spoilers mid-puzzle */
.pips li.neutral { background: var(--ink-3); opacity: .9; }
.locked { align-self: center; text-align: center; padding: 0 12px; }
.lockmark svg { width: 64px; height: 64px; }
.locked h2 { margin: 10px 0 0; font: 600 30px/1.1 var(--font-display); }
.locked .your { margin: 10px 0 0; font: 600 22px/1.25 var(--font-display); color: var(--ink); }
.locked .later { margin: 12px 0 0; color: var(--ink-2); font-weight: 700; font-size: 14px; }
.tapnote { margin: 14px 0 0; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.daylist .rowbtn { cursor: pointer; border-radius: 12px; transition: background .15s; }
.daylist .rowbtn:hover { background: var(--sunk); }


/* After you submit: stamp, ring fill + count-up, sparkles */
.stamp { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.stamp .chip { max-width: 100%; padding: 10px 18px; border-radius: 18px; background: var(--raised); box-shadow: inset 0 0 0 2px var(--rule-2), 0 3px 0 rgba(78,59,46,.06);
  font: 600 22px/1.2 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stamp b { display: inline-block; padding: 7px 14px 6px; border-radius: 10px; border: 2.5px solid #C9721E; color: #C9721E; transform: rotate(-6deg);
  font: 800 14px/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; }
.stamp.miss b { border-color: var(--ink-3); color: var(--ink-2); }
.ring { position: relative; width: 168px; height: 168px; margin: 18px auto 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--rule); stroke-width: 12; }
.ring .arc { fill: none; stroke: var(--arc, #F2A541); stroke-width: 12; stroke-linecap: round; }
.ring .score { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .n { font: 600 54px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ring .of { margin-top: 2px; font: 800 14px/1 var(--font-ui); color: var(--ink-2); }
.ring .score small { margin-top: 4px; font: 800 10px/1 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.sparks { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.spark { position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: #F2A541; opacity: 0; animation: spark .9s cubic-bezier(.2,.7,.2,1) forwards; }
.spark.star { background: none; width: 14px; height: 14px; margin: -7px; }
.spark.star::before { content: ''; position: absolute; inset: 0; background: #F7C548; clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); }
@keyframes spark { 0% { opacity: 1; transform: translate(0, 0) scale(.4); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); } }
@media (prefers-reduced-motion: no-preference) {
  .stamp .chip { animation: chipIn .45s cubic-bezier(.2,1.5,.4,1) both; }
  .stamp b { animation: stampIn .4s cubic-bezier(.2,1.6,.4,1) .2s both; }
  .ring.done { animation: ringPop .4s cubic-bezier(.2,1.6,.4,1); }
}
@keyframes chipIn { from { transform: translateY(14px) scale(.85); opacity: 0; } }
@keyframes stampIn { from { transform: rotate(-6deg) scale(2.2); opacity: 0; } }
@keyframes ringPop { 50% { transform: scale(1.06); } }

/* The locked-in moment takes on the answer's tier */
.spark { background: var(--c, #F2A541); }
.spark.star::before { background: var(--c, #F7C548); }
.tierbadge { margin-top: 14px; opacity: 0; transform: scale(.6); transition: opacity .25s, transform .4s cubic-bezier(.2,1.7,.4,1); }
.tierbadge.show { opacity: 1; transform: none; }
.locked .ring::before { content: ''; position: absolute; inset: -18px; border-radius: 50%; opacity: 0; transition: opacity .6s; pointer-events: none; }
.locked.fx-legendary .ring.done::before { opacity: 1; background: radial-gradient(circle, rgba(247,197,72,.55) 0%, rgba(247,197,72,0) 68%); animation: glow 2.4s ease-in-out infinite; }
.locked.fx-unique .ring.done::before { opacity: 1; background: conic-gradient(from 0deg, rgba(138,111,209,.35), rgba(226,102,126,.35), rgba(247,197,72,.35), rgba(134,182,224,.35), rgba(138,111,209,.35));
  -webkit-mask: radial-gradient(circle, transparent 52%, #000 54%, transparent 72%); mask: radial-gradient(circle, transparent 52%, #000 54%, transparent 72%); animation: spin 6s linear infinite; }
.locked.fx-epic .ring.done::before { opacity: 1; background: radial-gradient(circle, rgba(240,161,103,.32) 0%, rgba(240,161,103,0) 66%); }
.locked.fx-legendary .stamp .chip { box-shadow: inset 0 0 0 2px #E5AE1F, 0 0 0 6px rgba(247,197,72,.25); }
.locked.fx-unique .stamp .chip { box-shadow: inset 0 0 0 2px #6F5FC4, 0 0 0 6px rgba(138,111,209,.2); }
.locked.fx-legendary .ring .n, .locked.fx-unique .ring .n { background: linear-gradient(180deg, #4E3B2E 30%, #B07A0E); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes glow { 50% { transform: scale(1.08); opacity: .75; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .locked .ring::before { animation: none !important; } }

/* ── Real game additions ── */
.lineup { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 2px; }
.lineup .mode { display: inline-flex; align-items: center; gap: 6px; }
.lineup .mode small { font: 800 10px/1 var(--font-ui); opacity: .6; }
.daylist li { grid-template-columns: 1fr auto auto; }
.daylist .pts { font: 600 18px/1 var(--font-display); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.daylist .pts::after { content: ' pts'; font: 800 10px/1 var(--font-ui); letter-spacing: .06em; }
.rowbtn { cursor: pointer; border-radius: 12px; }
.rowbtn:hover .a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--rule-2); }
.rowbtn:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; }
.summary .sharebtns { margin: 12px 0 calc(24px + env(safe-area-inset-bottom)); }
.barshead { margin: 16px 0 0; font: 800 11px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.eggnote { padding: 10px 12px; border-radius: 14px; background: #FFF0CC; color: #6A4A12 !important; }
.archpts { font: 600 20px/1 var(--font-display); text-align: right; } .archpts small { display: block; font: 800 10px/1.4 var(--font-ui); color: var(--ink-2); }
.notice h1 { margin: 0; font: 600 30px/1.15 var(--font-display); }
.notice .btn { margin-top: 22px; align-self: flex-start; }
.hatch h2 { outline: none; }

/* Waiting egg on the island */
.isle-egg { cursor: pointer; }
.isle-egg .egg-body { transform-box: fill-box; transform-origin: 50% 100%; }
.isle-egg:focus { outline: none; } .isle-egg:focus-visible circle { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 2; }
@media (prefers-reduced-motion: no-preference) {
  .isle-egg .egg-body { animation: wobble 2.6s ease-in-out infinite; }
  .isle-egg .egg-halo { animation: halo 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .isle-egg.fresh .egg-drop { animation: eggdrop .9s cubic-bezier(.3,1.5,.5,1) both; }
  .isle-egg.tap .egg-body { animation: eggtap .5s ease-in-out; }
}
@keyframes eggdrop { from { opacity: 0; transform: translateY(-70px); } 60% { opacity: 1; } }
@keyframes halo { 50% { opacity: .15; transform: scale(1.25); } }
@keyframes eggtap { 25% { transform: rotate(-12deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-6deg); } }
.eggrow { display: flex; align-items: center; gap: 12px; }
.eggrow svg { width: 56px; height: 64px; flex: none; overflow: visible; }
.eggtimer { display: inline-flex; margin-top: 10px; padding: 8px 12px; border-radius: 99px; background: #FFF0CC; color: #6A4A12; font: 800 13px/1 var(--font-ui); font-variant-numeric: tabular-nums; }

/* ── Account (optional sign-in) ── */
.acct { position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center; padding: 12px; background: rgba(78,59,46,.32); }
@media (min-width: 640px) { .acct { place-items: center; } }
@media (prefers-reduced-motion: no-preference) { .acct { animation: fade .2s ease-out; } .acct-card { animation: sheetup .28s cubic-bezier(.2,.9,.3,1.2); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetup { from { transform: translateY(30px); opacity: 0; } }
.acct-card { position: relative; width: 100%; max-width: 420px; padding: 22px 20px calc(18px + env(safe-area-inset-bottom)); border-radius: 28px; background: var(--raised);
  box-shadow: 0 3px 0 rgba(78,59,46,.12), 0 20px 50px rgba(78,59,46,.25); }
.acct-card h2 { margin: 0 40px 0 0; font: 600 26px/1.15 var(--font-display); }
.acct-card p { margin: 8px 0 0; color: var(--ink-2); font-weight: 700; font-size: 15px; line-height: 1.45; }
.acct-card p b { color: var(--ink); }
.acct-card .btn { width: 100%; margin-top: 14px; }
.acct-card .btn + .btn { margin-top: 8px; }
.acct-x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--sunk); color: var(--ink); font: 600 24px/1 var(--font-ui); cursor: pointer; }
.acct-form { margin-top: 16px; }
.acct-form label { display: block; font: 800 11px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 8px 4px; }
.acct-form input { width: 100%; height: 56px; padding: 0 18px; border: 0; border-radius: 18px; background: var(--sunk); color: var(--ink);
  font: 700 18px/1 var(--font-ui); box-shadow: inset 0 0 0 1.5px var(--rule-2); outline: none; }
.acct-form input:focus { box-shadow: inset 0 0 0 2.5px var(--ink); }
.acct-form input.code { font: 600 30px/1 var(--font-display); letter-spacing: .4em; text-align: center; padding-left: calc(18px + .4em); }
.acct-err { min-height: 1.2em; margin: 8px 4px 0 !important; color: var(--error) !important; font-size: 14px !important; }
.acct-fine { font-size: 13px !important; color: var(--ink-3) !important; text-align: center; }
.linkbtn { border: 0; background: none; padding: 4px; color: var(--ink-2); font: 800 13px/1 var(--font-ui); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ipill.acctpill { margin-left: 8px; border: 0; cursor: pointer; font: 800 13px/1 var(--font-ui); color: var(--ink); background: #FFE7B0; }
.ipill.acctpill.on { background: rgba(255,253,247,.94); color: var(--ink-2); }
.ipill.acctpill.on::before { content: ''; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #79B567; }
.savenudge { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 14px 16px; border-radius: 20px; background: var(--raised); box-shadow: inset 0 0 0 1.5px var(--rule-2); }
.savenudge div { flex: 1; } .savenudge b { display: block; font: 600 17px/1.2 var(--font-display); } .savenudge span { display: block; margin-top: 3px; font-size: 13px; color: var(--ink-2); font-weight: 700; }
.savenudge .btn { width: auto; flex: none; padding: 0 18px; margin: 0; }
@media (max-width: 480px) { .ihud .ipill.name, .ihud .ipill.icon[data-tab="share"] { display: none; } .ipill.acctpill { margin-left: 0; } }
.eggfine { font-size: 13px !important; color: var(--ink-3) !important; }
.hatchwhy { max-width: 380px; margin: 12px auto 0; color: var(--ink-2); font-weight: 700; line-height: 1.5; }

/* Island zoom: pinch / scroll / drag / double-tap, plus buttons */
.islandview svg { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.islandview svg:active { cursor: grabbing; }
.izoom { position: absolute; right: 14px; top: calc(78px + env(safe-area-inset-top)); z-index: 2; display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 960px) { .izoom { top: 50%; transform: translateY(-50%); } }
.izoom button { width: 44px; height: 44px; border: 0; border-radius: 14px; background: rgba(255,253,247,.94); color: var(--ink);
  font: 700 22px/1 var(--font-ui); cursor: pointer; box-shadow: 0 2px 0 rgba(78,59,46,.12), 0 6px 18px rgba(78,59,46,.10); }
.izoom button.wide { width: auto; min-width: 44px; padding: 0 10px; font: 800 12px/1.1 var(--font-ui); white-space: normal; max-width: 64px; }
.izoom button:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; }
.screen.s-island.sheet-open .izoom { display: none; }

/* Wardrobe */
.wearing { margin-top: 10px !important; font-size: 13px !important; }
.wardrobe { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.wardrobe li { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 16px; background: var(--sunk); }
.wardrobe svg { width: 48px; height: 48px; overflow: visible; }
.wardrobe b { display: block; font: 600 16px/1.2 var(--font-display); }
.wardrobe small { display: block; margin-top: 2px; font: 800 11px/1.3 var(--font-ui); letter-spacing: .04em; color: var(--ink-2); text-transform: uppercase; }
.wardrobe .btn { width: auto; height: 40px; padding: 0 14px; margin: 0; font-size: 14px; }
.wardrobe.compact li { grid-template-columns: 40px 1fr; } .wardrobe.compact svg { width: 40px; height: 40px; }

/* Flock meter (after each answer): 100 sheep outlines, one lights up per point */
.flockmeter { position: relative; width: min(300px, 82vw); margin: 18px auto 0; }
.flockmeter .score { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.flockmeter .n { font: 600 52px/1 var(--font-display); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.flockmeter .of { font: 800 14px/1 var(--font-ui); color: var(--ink-2); }
.fm-grid { display: block; width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.fm-grid use { --b: transparent; --h: transparent; --s: #D9C8AF; }
.fm-grid use.on { --b: var(--lit); --h: #7A604E; --s: color-mix(in srgb, var(--lit) 65%, #4E3B2E); }
.flockmeter.unique .fm-grid use.on { --b: #6F5FC4; --s: #4B3F96; }
.flockmeter .sparks { top: 58%; }
@media (prefers-reduced-motion: no-preference) {
  .fm-grid use.on { animation: sheepPop .3s ease-out both; }
  .flockmeter.done .n { animation: ringPop .4s cubic-bezier(.2,1.6,.4,1); display: inline-block; }
}
@keyframes sheepPop { from { opacity: .2; } 40% { opacity: 1; filter: brightness(1.25); } }
@media (max-height: 700px) { .flockmeter { width: min(240px, 70vw); } .flockmeter .n { font-size: 42px; } }
@media (min-width: 960px) and (min-height: 701px) { .flockmeter { width: 380px; } .flockmeter .n { font-size: 60px; } }

/* Score screen, wide layout: the question you just answered stays in the left column. Phones keep the focused view. */
.lockside { display: none; }
@media (min-width: 960px) and (min-height: 600px) {
  .screen.play .lockside { display: block; }
}
.btn.checking { color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) { .btn.checking { animation: pulse 1s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .6; } }
/* Country rounds: countries already tried are greyed out */
.mapview .r.nope-region { fill: #D8CDBE !important; opacity: .55; }

/* ── Text pages: How to play · About · Privacy (server/views/page.html) ─────────────────────── */
body.doc-body { height: auto; }
.doc { max-width: 720px; margin: 0 auto; padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom); }
.doc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 72px; }
.doc-top .btn.small { width: auto; height: 44px; padding: 0 18px; border-radius: 14px; font-size: 16px; display: inline-flex; align-items: center; text-decoration: none; }
.doc-main { padding: 8px 0 24px; }
.doc-main h1 { font: 600 clamp(32px, 9vw, 44px)/1.05 var(--font-display); margin: 12px 0 14px; letter-spacing: -.01em; }
.doc-lede { font-size: 18px; line-height: 1.5; color: var(--ink); margin: 0 0 28px; max-width: 60ch; }
.doc-card { background: var(--raised); border-radius: 24px; padding: 22px 22px 8px; margin: 0 0 16px;
  box-shadow: 0 1px 0 var(--rule-2), 0 10px 30px -18px rgba(78,59,46,.25); }
.doc-card h2 { font: 600 23px/1.15 var(--font-display); margin: 0 0 10px; }
.doc-card p, .doc-list li { font-size: 16px; line-height: 1.55; color: var(--ink); margin: 0 0 14px; max-width: 62ch; }
.doc-card a, .doc-lede a { color: inherit; text-decoration-color: var(--match); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.doc-card code { font: 700 14px/1 ui-monospace, 'SF Mono', Menlo, monospace; background: var(--sunk); padding: 2px 6px; border-radius: 6px; }
.doc-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.doc-card-head h2 { margin: 0; }
.doc-card-head .mode, .modecard .mode { font-size: 14px; padding: 9px 14px 8px; letter-spacing: .07em; }
.doc-list { padding-left: 20px; margin: 0 0 14px; }
.doc-list li { margin: 0 0 10px; }
/* Worked examples */
.eg { margin: 4px 0 16px; padding: 14px 16px; background: var(--sunk); border-radius: 18px; }
.eg figcaption { font: 600 17px/1.3 var(--font-display); margin: 0 0 10px; }
.eg-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.eg-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto 2.4em; grid-template-areas: 'name chip pts' 'bar bar bar';
  align-items: center; column-gap: 10px; row-gap: 6px; font-size: 15px; min-height: 30px; }
.eg-rows li > b { grid-area: name; }
.eg-rows li > .tier { grid-area: chip; }
.eg-rows li > .eg-pts { grid-area: pts; }
.eg-rows li.eg-wrong > span { grid-column: 2 / -1; text-align: right; font-size: 14px; }
.eg-bar { grid-area: bar; height: 8px; border-radius: 99px; background: var(--rule-2); position: relative; overflow: hidden; }
.eg-bar::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--match); border-radius: inherit; }
.eg-pts { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.eg-rows .tier { height: 26px; font-size: 11px; padding: 0 10px; }
.eg-wrong { color: var(--ink-2); }
.eg-wrong b { text-decoration: line-through; text-decoration-color: var(--error); }
.eg-note { font-size: 13px !important; color: var(--ink-2) !important; margin: 10px 0 0 !important; }
.doc-ladder { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.doc-ladder li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.doc-ladder .tier { min-width: 8.6em; justify-content: center; }
.doc-herdlings { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.doc-herdlings svg { width: 52px; height: 52px; }
.doc-cta { margin: 28px 0 8px; display: flex; justify-content: center; }
.doc-cta .btn { max-width: 360px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.doc-foot { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 24px 0 40px; color: var(--ink-2); font: 700 13px/1.5 var(--font-ui); }
.doc-foot nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.doc-foot nav a { color: var(--ink); text-decoration: none; padding: 12px 12px; border-radius: 99px; }
.doc-foot nav a:hover { background: var(--sunk); }
.foot-links { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.foot-links a { color: var(--ink); text-decoration: none; padding: 12px; border-radius: 99px; font-weight: 800; }
.foot-links a:hover { background: var(--sunk); }
.eg-rows li > b small { font-weight: 700; color: var(--ink-2); font-size: 13px; }

/* Tap targets: everything you can press is at least 44px tall (the "Did you mean" buttons are pressed against the clock). */
.suggest button, .playbtn, .ipill, .wardrobe .btn, .hero-link { min-height: 44px; }
.hero-link { display: inline-flex; align-items: center; }
/* Island card: tower progress and the next-six clock */
.towerline { margin: -4px 0 10px; font: 800 13px/1.3 var(--font-ui); color: var(--ink-2); }
.eggtimer.next { background: var(--sunk); color: var(--ink-2); }

.tipline { margin: 18px 0 4px; text-align: center; font: 700 14px/1.4 var(--font-ui); color: var(--ink-2); }
.tipline a { color: var(--ink); text-decoration-color: var(--match); text-decoration-thickness: 2px; text-underline-offset: 3px; padding: 12px 4px; }

.invitenote { margin: 12px 0 0; text-align: center; font: 700 13px/1.45 var(--font-ui); color: var(--ink-2); }

.hb-note { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.bday { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; padding: 10px 12px; border-radius: 16px; background: var(--sunk); font-size: 13px; line-height: 1.4; }
.bday .playbtn { flex: none; }
.bdayform { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin: 12px 0 14px; }
.bdayform select { width: 100%; min-height: 48px; padding: 0 12px; border-radius: 14px; border: 0; background: var(--sunk); color: var(--ink); font: 700 16px/1 var(--font-ui); box-shadow: inset 0 0 0 1.5px var(--rule-2); }

/* Island card: collapsible to a slim bar (title + main button) */
.icard.home { position: relative; }
.icollapse { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 14px; background: none; color: var(--ink-2); cursor: pointer; }
.icollapse svg { width: 20px; height: 20px; transition: transform .2s var(--ease); }
.icard.home h3 { padding-right: 44px; }
.icard.home.mini { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; padding: 10px 10px 10px 16px; }
.icard.home.mini .more { display: none; }
.icard.home.mini h3 { font-size: 17px; padding-right: 0; cursor: pointer; }
.icard.home.mini .btn { grid-column: 2; grid-row: 1; margin: 0 40px 0 0; width: auto; height: 44px; padding: 0 16px; border-radius: 14px; font-size: 15px; white-space: nowrap; }
.icard.home.mini .icollapse { top: 50%; transform: translateY(-50%); }
.icard.home.mini .icollapse svg { transform: rotate(180deg); }
/* Map: US state borders (orientation only) */
.maplayer .b { fill: none; stroke: var(--map-state); stroke-width: calc(.7px * var(--px, 1)); stroke-linejoin: round; pointer-events: none; opacity: 0; transition: opacity .25s; }
.maplayer.zoomed .b { opacity: 1; }
.maplayer .lines .b { opacity: .6; }

.wrongwhy { margin: 10px 0 0; text-align: center; color: var(--ink-2); font-weight: 700; }

/* ═══ 4. Dark mode (follows the device setting) ═══
   Warm cocoa surfaces and cream ink. The island art keeps its daylight sky (it's a window onto the island); the
   chrome around it goes dark. Tier chips keep their colours so a rarity looks the same everywhere. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #1D1712; --raised: #29211B; --sunk: #231C16;
    --ink: #F5E9D8; --ink-2: #C2AE97; --ink-3: #85715E; --rule: #352B23; --rule-2: #46392E;
    --match-ink: #3A2104; --dodge: #7FB3DE; --dodge-ink: #0E2A40;
    --urgent: #F08A55; --error: #F0775B;
    --land: #6A5746; --land-off: #3A3029; --land-line: #1D1712;
    --map-border: #241C16; --map-state: #4A3C30;
    --ic-line: #F5E9D8; --ic-fill: #29211B; --ic-shade: #352B23;
    --pill: rgba(41,33,27,.94); --warmchip: #4A3A22; --warmchip-ink: #FFD9A3;
  }
  body, .screen.s-hero { background: radial-gradient(120% 80% at 50% 0%, #2A211A 0%, #1D1712 60%, #181310 100%) fixed; }
  .brand .mark { box-shadow: 0 0 0 2px var(--raised), 0 1px 3px rgba(0,0,0,.4); }
  .stage::before { background: radial-gradient(circle, #3A2F27 1px, transparent 1.5px) center / 16px 16px; }
  .maplayer .r.hover { fill: #806A55; }
  .maplayer .lines .r, .maplayer .lines .c { stroke: rgba(29,23,18,.85); }
  .mapview .r.nope-region { fill: #3A3029 !important; }
  .zoom button, .ipill, .itabs, .izoom button, .ipill.acctpill.on { background: var(--pill); }
  .icard { background: rgba(41,33,27,.97); }
  .marker::before { box-shadow: 0 0 0 3px rgba(29,23,18,.9), inset 0 0 0 2px rgba(29,23,18,.6); }
  .marker i { box-shadow: 0 0 0 2px var(--bg); }
  .btn:disabled { background: #352B23; color: #85715E; }
  .btn.ghost, .suggest button.no { background: #352B23; color: var(--ink); }
  .suggest, .eggnote, .eggtimer { background: #3B2F1C; color: #FFD9A3 !important; }
  .eggcard { background: linear-gradient(160deg, #3B2E1E, #4A3720); }
  .eggcard p { color: #D9B98A; }
  .eggcard.none { background: #2B231D; }
  .eggcard.founder { background: linear-gradient(160deg, #1F3327, #24402F); } .eggcard.founder p { color: #A9D4B8; }
  .eggcard.bellwether { background: linear-gradient(160deg, #1E2A3D, #23344D); } .eggcard.bellwether p { color: #A9C3E6; }
  .tried li { background: #2E251E; }
  .tried li b { text-decoration-color: rgba(245,233,216,.45); }
  .itabs button.on, .playbtn, .step .n, .hero-kicker, .ipill.acctpill, .ts.stray { background: var(--warmchip); color: var(--warmchip-ink); }
  .hb-card.locked { background: repeating-linear-gradient(135deg, #2B231D 0 6px, #30271F 6px 12px); }
  .hb-card.locked span { color: #5E4E40; }
  .hero-link { background: #2E251E; }
  .mode.herdtag, .ts.herd { background: #2F4426; color: #CFE3C1; }
  .mode.pintag { background: #1F3A4F; color: #CFE4F5; }
  .modecard.herd { background: #24301F; } .modecard.stray { background: #33291A; } .modecard.map { background: #1F2A33; }
  .citydot { box-shadow: 0 0 0 2px var(--ink-2); }
  .citydot.mine, .dotcity { box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px rgba(29,23,18,.9); }
  .pinline { stroke: var(--ink); }
  .dotme { box-shadow: inset 0 0 0 2px var(--ink); }
  .stamp b { border-color: #F2A541; color: #F2A541; }
  .locked.fx-legendary .ring .n, .locked.fx-unique .ring .n { background: linear-gradient(180deg, #F5E9D8 30%, #F7C548); -webkit-background-clip: text; background-clip: text; }
  .fm-grid use { --s: #5E4E40; }
  .acct { background: rgba(0,0,0,.55); }
  .doc-card { box-shadow: 0 1px 0 var(--rule-2), 0 10px 30px -18px rgba(0,0,0,.6); }
  .doc-card a, .doc-lede a { text-decoration-color: #F2A541; }
}
