/* Foldaway: an exercise book. Squared paper, graphite, one ballpoint blue,
   highlighters for how far each answer flew. */
:root {
  /* Night: deep navy panels, pale text, one lantern-gold action, cyan glow for what you can touch. */
  --paper: #070d1c; --card: #0f182c; --card-2: #142036; --grid: #253553;
  --lead: #eef2f8; --lead-2: #c3cddc; --muted: #8f9bb1; --rule: #1f2c45;
  --ink: #8fe1ff; --ink-hi: #b9eeff; --ink-low: #2a8fb5;
  --gold: #ffc94a; --gold-hi: #ffd978; --gold-low: #b07d1c;
  --red: #ff6b7a; --tape: #fff1a8;
  --t1: #b4bac4; --t2: #3fd67f; --t3: #ffd43b; --t4: #ff8c42; --t5: #b36bff; --t0: #e8505b;
  --ui: 'Fredoka', system-ui, -apple-system, sans-serif;
  --hand: 'Kalam', 'Comic Neue', cursive;
  --gutter: clamp(16px, 5vw, 80px);
  --dock-offset: 0px;
  --lift: 0 0 0 1px rgba(160, 190, 230, .12), 0 24px 50px -22px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--paper); color: var(--lead); font: 17px/1.5 var(--ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
button, a, input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Holographic foil: the rarest tier (#b36bff) everywhere it is drawn, slowly shimmering.
   The tier colour arrives inline as --c, so the override needs !important. */
:root { --foil: linear-gradient(100deg, #ff8fd0, #ffd36b 20%, #7ff0b0 40%, #7cc8ff 60%, #c39bff 80%, #ff8fd0); }
[style*="#b36bff"] { --c: var(--foil) !important; }
[style*="#b36bff"] .hl, [style*="#b36bff"]::before, [style*="#b36bff"] b::before, i[style*="#b36bff"], li.done[style*="#b36bff"] { background-size: 200% 100%; animation: foil 5s linear infinite; }
@keyframes foil { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { [style*="#b36bff"] .hl, [style*="#b36bff"]::before, [style*="#b36bff"] b::before, i[style*="#b36bff"], li.done[style*="#b36bff"] { animation: none !important; } }

/* Highlighter swipe: sits behind text, multiplied onto the paper. */
.hl { position: absolute; inset: 34% -5px 14% -5px; background: var(--c, var(--t3)); opacity: .6; mix-blend-mode: screen; border-radius: 2px 6px 3px 7px; transform: skewX(-6deg); transform-origin: center; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.bar { position: absolute; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: calc(20px + env(safe-area-inset-top, 0px)) var(--gutter) 12px; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--lead); font: 800 22px/1 var(--ui); letter-spacing: -.02em; }
.brand-plane { width: 46px; height: 24px; overflow: visible; }
.brand-plane path { stroke: #cfd8ff; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.brand-plane .trail { fill: none; stroke: rgba(150,215,255,.8); stroke-width: 1.3; stroke-dasharray: 2.6 3.2; }
.brand-plane .wing { fill: #fff; } .brand-plane .keel { fill: #c9d5e6; }  .brand-plane .fold { fill: none; stroke-width: 1; }
.bar-actions { display: flex; gap: 4px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--lead); transition: background .15s, transform .15s; }
.icon-btn:hover { color: var(--ink); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 26px; height: 26px; fill: none; stroke: #cfd8ff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.icon-btn svg .pap { fill: #1b2152; }

 .icon-btn svg { transition: transform .2s; }
#btnSound .mute { display: none; }
#btnSound[aria-pressed="false"] .wave { display: none; }
#btnSound[aria-pressed="false"] .mute { display: inline; }

main { position: relative; z-index: 5; }
.screen { perspective: 1600px; display: none; min-height: 100svh; padding: 112px var(--gutter) 72px; }
.screen.active { display: flex; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.primary-btn, .throw-btn, .next-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 14px 26px; border: 0; border-radius: 12px; background: var(--gold); color: #1a1433; font: 800 18px/1 var(--ui); text-decoration: none; box-shadow: 0 3px 0 var(--gold-low), 0 0 26px rgba(255, 201, 74, .28); transition: transform .12s, box-shadow .12s, background .12s; }


.link-btn { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; padding: 0; border: 0; background: none; font: 600 16px var(--ui); color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; text-decoration-color: #2340b855; cursor: pointer; transition: text-decoration-color .15s, text-underline-offset .15s; }
.link-btn:hover { text-decoration-color: var(--ink); text-underline-offset: 3px; }
.home-links { display: flex; gap: 22px; flex-wrap: wrap; }
.home-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 5px; text-decoration-color: #2340b855; transition: text-decoration-color .15s, text-underline-offset .15s; }
.home-links a:hover { text-decoration-color: var(--ink); text-underline-offset: 3px; }

/* ── Home ────────────────────────────────────────────────────────────── */
#screen-home { align-items: center; padding-bottom: 128px; } /* clear of the drawn ground */
.home { width: 100%; display: grid; grid-template-columns: minmax(0, 600px) minmax(300px, 360px); justify-content: space-between; align-items: start; gap: 40px 64px; }
.home-main { min-width: 0; }
#homeTitle .w { display: inline-block; white-space: pre; }
/* Today's sheet: a sheet of plane paper, pre-creased where it will fold. */

.today-sheet::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .55; transition: opacity .2s;
  background:
    linear-gradient(90deg, transparent calc(50% - .6px), rgba(200,215,255,.07) 50%, transparent calc(50% + .6px)),
    linear-gradient(to bottom left, transparent calc(50% - .6px), rgba(200,215,255,.05) 50%, transparent calc(50% + .6px)) left top / 50% 46% no-repeat,
    linear-gradient(to bottom right, transparent calc(50% - .6px), rgba(200,215,255,.05) 50%, transparent calc(50% + .6px)) right top / 50% 46% no-repeat; }
.today-sheet.folding::before { opacity: 1; }
.today-sheet > * { position: relative; }

/* Today's flight: the day's slots on an index card. */
.today-card { margin-top: 44px; padding: 26px 24px 18px; }
.tc-title { margin: 0; font: 800 22px/1.2 var(--ui); letter-spacing: -.02em; color: var(--lead); }
.tc-sub { margin: 4px 0 12px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.tc-list { list-style: none; counter-reset: slot; margin: 0; padding: 0; }
.tc-list li { counter-increment: slot; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; min-height: 34px; border-bottom: 1.5px solid var(--rule); font-size: 15px; }
.tc-list li::before { content: counter(slot); font: 600 14px var(--ui); color: var(--muted); }
.tc-cat { color: var(--lead-2); font-weight: 600; }
.tc-blank { font: 700 16px var(--hand); color: rgba(200,215,255,.35); }
.tc-list .prompt-level { font-size: 13px; }
.tc-answer { position: relative; z-index: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 15px/1.5 var(--ui); color: var(--lead); }
.tc-answer::before { content: ''; position: absolute; inset: 36% -3px 14% -3px; background: var(--c); opacity: .55; mix-blend-mode: screen; z-index: -1; transform: skewX(-8deg); }
.tc-answer.miss { color: var(--red); }
.tc-answer.miss::before { display: none; }
.tc-foot { margin: 12px 0 0; font-size: 14px; color: var(--lead-2); }

.home-title { font: 800 clamp(56px, 6.4vw, 88px)/.92 var(--ui); letter-spacing: -.045em; margin: 0 0 14px; color: var(--lead); }
.home-tag { font-size: 17px; line-height: 1.45; color: var(--lead-2); margin: 0 0 22px; max-width: 24em; }
.home-menu { display: flex; flex-wrap: wrap; gap: 4px 26px; margin-top: 10px; }
.home-menu a, .home-menu button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; font: 600 17px var(--ui); color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; text-decoration-color: #2340b855; cursor: pointer; transition: text-decoration-color .15s, text-underline-offset .15s; }
.home-menu a:hover, .home-menu button:hover { text-decoration-color: var(--ink); text-underline-offset: 3px; }
.sheet .demo { margin: 6px 0 18px; }

.demo { margin: 0 0 26px; }
.demo figcaption { font-size: 15px; color: var(--muted); margin-bottom: 2px; }
.demo figcaption b { color: var(--lead); font-weight: 700; }
.demo svg { display: block; width: 100%; height: auto; overflow: visible; }
.demo .demo-ground { stroke: var(--lead-2); stroke-width: 1.8; stroke-linecap: round; fill: none; }
.demo .demo-ticks { stroke: rgba(200,215,255,.4); stroke-width: 1.2; }
.demo .arc { fill: none; stroke: var(--lead-2); stroke-width: 1.6; stroke-dasharray: 5 6; stroke-linecap: round; }
.demo .mk { transform-box: fill-box; transform-origin: left; stroke: var(--c); stroke-width: 11; stroke-linecap: round; opacity: .62; mix-blend-mode: screen; }
.demo text { font: 700 17px var(--hand); fill: var(--ink); text-anchor: middle; }
.demo text.km { font: 400 13px var(--hand); fill: var(--muted); }
.demo .demo-plane { transform-box: fill-box;  fill: #fff; stroke: var(--lead); stroke-width: 1.5; stroke-linejoin: round; }


#homeToday > p { margin: 0; color: var(--muted); }

.today-row { display: flex; align-items: baseline; gap: 16px; margin: 0 0 14px; }
.today-km { font: 800 46px/1 var(--ui); letter-spacing: -.03em; color: var(--lead); }
.today-km small { font-size: 18px; font-weight: 600; margin-left: 4px; color: var(--muted); }
.today-dots { align-self: center; }


/* ── Cards: plain index cards with a strip of tape ───────────────────── */
.paper { position: relative; background: var(--card); border-radius: 4px; box-shadow: var(--lift); }
.tape { display: none; position: absolute; top: -12px; left: 50%; width: 92px; height: 24px; margin-left: -46px; background: var(--tape); opacity: .85; transform: rotate(-3deg); box-shadow: 0 1px 1px #0000000f; clip-path: polygon(3% 0, 97% 4%, 100% 50%, 97% 100%, 2% 96%, 0 50%); pointer-events: none; }

/* ── Play: instruments ───────────────────────────────────────────────── */
#screen-play { padding-top: 96px; }
.hud { width: 100%; display: flex; align-items: flex-start; justify-content: space-between; height: fit-content; }
.hud-left { display: flex; flex-direction: column; gap: 10px; }
.hud-label { font: 700 16px/1 var(--ui); color: var(--lead-2); }
.pips { display: flex; list-style: none; padding: 0; margin: 0; gap: 7px; }
.pips li { width: 20px; height: 20px; border-radius: 50%; border: 1.6px dashed rgba(200,215,255,.4); transition: background .25s, transform .25s, border-color .25s; }
.pips li.current { border: 2px solid var(--ink); transform: scale(1.12); }
.pips li.done { border: 1.6px solid transparent; background: var(--c); box-shadow: 0 0 10px var(--c); }
.odo { display: flex; align-items: baseline; gap: 6px; color: var(--lead); }
.odo-unit { order: 2; font: 600 18px/1 var(--ui); color: var(--muted); }
.odo-digits { display: flex; height: 52px; overflow: hidden; font: 800 48px/1 var(--ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.odo-digit { display: block; height: 52px; overflow: hidden; transition: opacity .4s; }
.odo-strip { display: flex; flex-direction: column; transition: transform .9s cubic-bezier(.2, 1.2, .3, 1); }
.odo-strip span { display: grid; place-items: center; height: 52px; }


.flight-gain { position: fixed; z-index: 11; left: 34%; top: 40%; color: var(--ink); font: 800 48px/1 var(--ui); letter-spacing: -.03em; opacity: 0; pointer-events: none; }

/* ── Play: the prompt card ───────────────────────────────────────────── */
.prompt-dock { position: fixed; left: 0; right: 0; bottom: var(--dock-offset); z-index: 10; padding: 0 var(--gutter) max(14px, env(safe-area-inset-bottom, 0px)); }
/* While typing on a very short screen the card can reach the top bar (app.mjs sets card-over-bar): the bar steps aside. */
body.card-over-bar .bar { opacity: 0; pointer-events: none; }
.prompt-card { padding: 28px 28px 20px; }
/* The prompt sits on the nearest strip of land: a cut-paper hill the width of the
   screen, tinted by the region the plane is flying over (--strip, set by the sky). */
.prompt-dock { background: var(--strip, #eef4e6); transition: background-color 1.4s ease; } /* no filter: it re-rendered the whole sign every frame the clock ran */
.prompt-dock::before { content: ''; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: 26px; background: inherit;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 26' preserveAspectRatio='none'%3E%3Cpath d='M0 26V13C70 1 140 1 210 10s150 16 220 6c35-5 60-7 90-3V26Z'/%3E%3C/svg%3E") repeat-x left bottom / 520px 26px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 26' preserveAspectRatio='none'%3E%3Cpath d='M0 26V13C70 1 140 1 210 10s150 16 220 6c35-5 60-7 90-3V26Z'/%3E%3C/svg%3E") repeat-x left bottom / 520px 26px; }
.prompt-dock::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: screen;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }
.prompt-dock .prompt-card { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; background: transparent; box-shadow: none; border-radius: 0; padding-top: 10px; }
.prompt-dock .tape { display: none; }
/* The red margin line along the top of the card is the clock. */
.timer-bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #e8505b2e; }
.timer-bar i { display: block; height: 100%; background: var(--red); transform-origin: left; }
.prompt-card.timer-low .timer-bar { height: 5px; }
.prompt-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.timer-bar { display: none; } /* the ring shows time now */
.prompt-meta { display: flex; align-items: baseline; gap: 10px; font-size: 14px; color: var(--lead-2); }

.prompt-level { padding: 0 8px; border-radius: 3px 7px 4px 8px; font: 700 13px/1.7 var(--ui); color: var(--lead-2); }
.prompt-level[data-level="2"] { background: #ffd43b55; }
.prompt-level[data-level="3"] { background: #ff8c4255; color: var(--lead); }
/* The clock: a pencil ring that empties, seconds written in the middle. */
.timer { position: relative; flex: none; width: 54px; height: 54px; display: grid; place-items: center; margin: -6px -4px -8px 0; font: 800 19px/1 var(--ui); font-variant-numeric: tabular-nums; color: var(--ink); }
.timer span { position: relative; }
.timer.low { color: var(--red); animation: timer-pulse 1s ease-in-out infinite; }
@keyframes timer-pulse { 50% { transform: scale(1.08); } }
.prompt-text { font: 800 clamp(32px, 3.3vw, 44px)/1.02 var(--ui); letter-spacing: -.03em; margin: 0 0 6px; text-wrap: pretty; color: var(--lead); } /* fill each line; balance split long prompts into short half-width lines */
.prompt-text .w { display: inline-block; white-space: pre; }
.prompt-sub { font-size: 15px; line-height: 1.45; color: var(--muted); margin: 0; }
.answer-row { display: flex; gap: 10px; align-items: flex-end; margin-top: 18px; }
/* You write the answer on a ruled line, in pen. */
#answer { flex: 1 1 auto; min-width: 0; border: 0; border-bottom: 2px solid var(--grid); background: transparent; border-radius: 0; padding: 8px 2px 6px; font: 700 26px/1.2 var(--hand); color: var(--ink); outline: none; transition: border-color .15s; }

#answer::placeholder { color: var(--muted); font: 500 22px/1.2 var(--ui); }
#answer.shake { animation: shake .3s; border-bottom-color: var(--red); }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-2px); } }
.throw-btn { flex: none; padding: 14px 20px; }
.prompt-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--lead-2); margin-top: 12px; }
#firstTip { font-size: 14px; color: var(--lead-2); }
#tailwindStatus { font: 700 14px/1 var(--ui); color: var(--ink); position: relative; padding: 0 2px; }
#tailwindStatus::before { content: ''; position: absolute; inset: 34% -5px 12% -5px; border-radius: 2px 5px 3px 6px; background: #7cc8ff; opacity: .55; mix-blend-mode: screen; z-index: -1; }
.feedback { font-size: 15px; font-weight: 600; margin: 0; color: #c62d3a; }
.tried { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 8px 0 0; padding: 0; }
.tried:empty { display: none; }
.tried li { padding: 0 8px; border-radius: 3px 6px 4px 7px; background: #ff6b7a1f; font: 700 15px/1.6 var(--hand); color: #ff8f9b; text-decoration: line-through; text-decoration-thickness: 2px; }
.feedback:not(:empty) { padding-top: 10px; }

.reveal { display: grid; gap: 12px; margin-top: 14px; }
.stamp { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 4px; }
.stamp-tier { position: relative; display: inline-block; font: 800 30px/1.1 var(--ui); letter-spacing: -.02em; color: var(--lead); z-index: 0; }
.stamp-tier .hl { z-index: -1; }
.stamp-km { font: 800 26px/1 var(--ui); letter-spacing: -.02em; color: var(--ink); }
.stamp.t0 .stamp-tier { color: var(--red); }
.stamp.t0 .hl { inset: 52% -6px 38% -6px; background: var(--red); opacity: .9; mix-blend-mode: normal; transform: rotate(-2deg); }
.stamp.t0 .stamp-km { color: var(--muted); }
.reveal-answer { font: 700 24px/1.2 var(--hand); color: var(--ink); margin: 0 0 4px; overflow-wrap: anywhere; }
.tw { display: inline-block; margin-left: 10px; font: 600 13px/1.3 var(--ui); color: var(--muted); vertical-align: middle; }
.reveal-far { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.reveal-far em { color: var(--lead); font-style: normal; font-weight: 700; }
.next-btn { width: 100%; }

/* ── Result + archive cards ──────────────────────────────────────────── */

#screen-archive { justify-content: center; align-items: flex-start; }
.sheet-card { width: min(100%, 480px); padding: 32px 30px 26px; }
.result-label { margin: 0 0 6px; font: 600 16px/1.2 var(--ui); color: var(--muted); }
.result-km { margin: 0; font: 800 clamp(68px, 8vw, 96px)/.9 var(--ui); letter-spacing: -.045em; color: var(--lead); }
.result-km small { font-size: 26px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.result-where { margin: 10px 0 18px; font-size: 17px; font-weight: 600; color: var(--lead-2); }
.result-list { list-style: none; padding: 0; margin: 0 0 20px; }
.result-list li { padding: 9px 0 7px; border-bottom: 1.5px solid var(--rule); }
.result-list summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; cursor: pointer; list-style: none; border-radius: 6px; }
.result-list summary::-webkit-details-marker { display: none; }
.result-list summary:focus-visible { outline: 2px solid var(--lead); outline-offset: 3px; }
.result-list .q::after { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 0 2px 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); transition: transform .2s; }
.result-list details[open] .q::after { transform: translateY(2px) rotate(-135deg); }
.result-list .more { margin: 6px 0 2px; font-size: 14px; line-height: 1.4; color: var(--lead-2); }
.result-hint { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.result-list .sw { display: none; }
.result-list .q { display: block; font-size: 13px; color: var(--muted); }
.result-list .a { position: relative; display: inline-block; z-index: 0; font: 700 21px/1.15 var(--hand); color: var(--ink); overflow-wrap: anywhere; }
.result-list .a .hl { z-index: -1; }
.result-list .a .muted { color: var(--red); font-weight: 400; }
.result-list .k { font: 800 18px/1.1 var(--ui); text-align: right; color: var(--lead); font-variant-numeric: tabular-nums; }
.result-list .k small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.result-share { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.share-preview { display: grid; grid-template-columns: repeat(4, 18px); gap: 4px; }
.share-preview i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 1.4px solid var(--lead-2); }
.next-flight { color: var(--muted); font-size: 14px; margin: 12px 0 14px; }
.next-flight:empty { margin: 8px 0; }
.board-rank { margin: -8px 0 18px; font: 700 17px/1.35 var(--ui); color: var(--ink); }
.board { margin: 18px 0 4px; }
.board h3, .friends-card h3 { margin: 18px 0 6px; font-size: 15px; font-weight: 700; color: var(--lead); }
.board h3:first-child { margin-top: 0; }
.spread { display: flex; align-items: flex-end; gap: 3px; height: 84px; padding-bottom: 2px; border-bottom: 2px solid var(--lead); }
.spread i { flex: 1 1 0; height: var(--h); min-width: 0; border-radius: 3px 3px 0 0; background: var(--grid); transform-origin: bottom; }
.spread i.me { background: var(--ink); }
.spread-axis { display: flex; justify-content: space-between; margin: 4px 0 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-list { list-style: none; padding: 0; margin: 0; }
.board-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1.5px solid var(--rule); font-size: 15px; }
.board-list .br { color: var(--muted); font-variant-numeric: tabular-nums; }
.board-list .bn { overflow-wrap: anywhere; }
.board-list .bk { font-weight: 700; font-variant-numeric: tabular-nums; }
.board-list li.you { color: var(--ink); }
.board-list li.you .bn { font: 700 17px/1.2 var(--hand); }
.board-list small { font-size: 12px; color: var(--muted); font-family: var(--ui); font-weight: 500; }
.board-list .dots { display: flex; gap: 3px; margin-top: 4px; }
.board-list .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px #0000001f; }
.board-you { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.board-you:empty { display: none; }
.board-you a { color: var(--ink); font-weight: 600; }
.pilot-form label { display: block; margin: 16px 0 2px; font-size: 15px; font-weight: 700; color: var(--lead); }
.pilot-row { display: flex; align-items: center; gap: 14px; }
#pilotName { flex: 1 1 auto; min-width: 0; border: 0; border-bottom: 2px solid var(--grid); background: transparent; padding: 6px 2px; font: 700 24px/1.2 var(--hand); color: var(--ink); outline: none; }
#pilotName:focus { border-bottom-color: var(--ink); }
.pilot-msg { min-height: 20px; margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.invite-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.mates { list-style: none; padding: 0; margin: 0; }
.mates li { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1.5px solid var(--rule); font: 700 18px/1.2 var(--hand); color: var(--ink); }
.mates li.muted { font: 400 15px var(--ui); color: var(--muted); }
.mates .link-btn { margin: 0; font-size: 14px; }
.friends-offline { color: var(--red); }

.section-title { font: 800 32px/1.1 var(--ui); letter-spacing: -.03em; margin: 0 0 8px; color: var(--lead); }
.tickets { list-style: none; padding: 0; margin: 18px 0 0; }
.ticket { display: grid; grid-template-columns: 1fr auto; gap: 0 16px; padding: 11px 2px; border-bottom: 1.5px solid var(--rule); text-decoration: none; transition: background .15s; }

.ticket b { font-weight: 700; }
.ticket span { font-size: 13px; color: var(--muted); }
.ticket span:last-child { grid-column: 2; grid-row: 1 / 3; align-self: center; font: 700 16px var(--ui); color: var(--muted); }
.ticket .done { color: var(--ink) !important; }

.sheet { color: var(--lead); background: var(--card); border: 0; border-radius: 4px; box-shadow: var(--lift); padding: 32px 28px 26px; width: min(92vw, 470px); max-height: 86dvh; overflow: auto; }
.sheet::backdrop { background: rgba(4, 6, 20, .6); }
.close-btn { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; font-size: 26px; color: var(--muted); }
.close-btn:hover { background: rgba(127,220,255,.1); color: var(--ink); }
.how-list { padding-left: 22px; font-size: 16px; display: grid; gap: 10px; color: var(--lead-2); }
.how-list strong { color: var(--lead); }
.tier-key { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 4px; }
.tier-key li { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 12px; padding: 4px 0; border-bottom: 1.5px solid var(--rule); }
.tier-key i { display: none; }
.tier-key b { justify-self: start; position: relative; z-index: 0; font: 700 17px var(--ui); }
.tier-key b::before { content: ''; position: absolute; inset: 34% -5px 14% -5px; background: var(--c); opacity: .6; mix-blend-mode: screen; z-index: -1; transform: skewX(-8deg); }
.tier-key span { font-weight: 700; color: var(--lead-2); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 8px; margin: 20px 0 26px; }
.stat b { display: block; font: 800 32px/1.05 var(--ui); letter-spacing: -.03em; }
.stat span { font-size: 13px; color: var(--muted); }
.mini-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.tier-bars { display: grid; gap: 8px; }
.tier-bar { display: grid; grid-template-columns: 90px 1fr 28px; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.track { height: 12px; border-bottom: 1.5px solid var(--rule); }
.fill { height: 100%; background: var(--c); width: 0; opacity: .75; border-radius: 1px 4px 2px 3px; transition: width .6s cubic-bezier(.2, .9, .3, 1); }
.tier-bar span:last-child { text-align: right; color: var(--muted); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 10px); width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 10px; background: var(--lead); color: #fff; font-size: 15px; font-weight: 600; opacity: 0; pointer-events: none; z-index: 60; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.playing .toast { top: calc(150px + env(safe-area-inset-top, 0px)); bottom: auto; }
.foot { position: absolute; bottom: 16px; left: var(--gutter); right: var(--gutter); z-index: 6; display: flex; justify-content: flex-end; gap: 16px; color: var(--muted); font-size: 13px; }
.foot a { text-underline-offset: 3px; color: var(--muted); }
body[data-screen="result"] .foot a, body[data-screen="archive"] .foot a, body[data-screen="friends"] .foot a { color: var(--muted); text-shadow: none; }
body.playing .foot { display: none; }
body[data-screen="result"] .foot, body[data-screen="archive"] .foot { position: relative; left: auto; right: auto; bottom: auto; padding: 0 24px 22px; justify-content: center; }
.noscript { position: fixed; inset: 45% 20px auto; z-index: 80; padding: 20px; text-align: center; background: var(--card); }

/* ── Phones ──────────────────────────────────────────────────────────── */
/* Narrow screens: one column, the card under the start button. */
@media (max-width: 1000px) {
  .home { grid-template-columns: minmax(0, 640px); justify-content: start; }
  .today-card { margin-top: 8px; }
}
@media (max-width: 760px) {
  .bar { padding: calc(14px + env(safe-area-inset-top, 0px)) 12px 10px 16px; }
  .brand { font-size: 20px; }
  .bar-actions { gap: 0; }
  .screen { padding: 82px 16px 56px; }
  /* The top strip of the page shows the rooftop and the plane. */
  #screen-home { align-items: flex-start; padding-top: var(--home-top, 300px); }
  .home-date { font-size: 17px; margin-bottom: 10px; }
  .home-title { font-size: 60px; }
  .today-sheet { max-width: none; padding: 22px 20px 22px; rotate: 0deg; }
  .home-tag { font-size: 17px; margin-bottom: 20px; }
  .demo { margin-bottom: 20px; }
  .demo text { font-size: 20px; }
  .demo text.km { font-size: 15px; }
  #playBtn { width: 100%; }
  .home { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .today-card { margin-top: 12px; }

  #screen-play { padding: 76px 16px 0; }
  .pips { gap: 6px; }
  .pips li { width: 17px; height: 17px; }
  .odo-digits, .odo-digit, .odo-strip span { height: 40px; }
  .odo-digits { font-size: 36px; }
  .prompt-dock { top: auto; bottom: var(--dock-offset); padding: 0 0 max(8px, env(safe-area-inset-bottom, 0px)); }
  .prompt-card { padding: 22px 18px 14px; }
  .prompt-dock .prompt-card { padding-top: 6px; }
  .prompt-top { margin-bottom: 8px; }
  .prompt-text { font-size: 31px; }
  .prompt-sub { font-size: 14px; }
  .answer-row { margin-top: 12px; }
  #answer { font-size: 24px; }
  .throw-btn { min-height: 52px; padding: 12px 16px; font-size: 17px; }
  .flight-gain { left: 44%; top: 28%; font-size: 42px; }
  #screen-result { padding-top: 272px; }
  .sheet-card { padding: 28px 20px 22px; }
  .result-km { font-size: 76px; }
  .foot { position: relative; left: auto; right: auto; bottom: auto; justify-content: center; padding: 0 16px 20px; }
  .foot a { color: var(--muted); text-shadow: none; }
  body[data-screen="home"] #screen-home { min-height: 0; padding-bottom: 28px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  #screen-home { padding-top: 120px; }
  .home-tag { font-size: 15px; line-height: 1.35; margin-bottom: 12px; text-wrap: balance; }
  .prompt-sub { display: none; }
  .prompt-text { font-size: 27px; }
}
body.keyboard-open .prompt-bottom, body.keyboard-open .prompt-sub { display: none; }
body.keyboard-open .prompt-card { padding-top: 16px; padding-bottom: 12px; }
body.keyboard-open .answer-row { margin-top: 10px; }
@media (max-width: 760px) and (max-height: 560px) {
  .prompt-bottom { display: none; }
  .prompt-dock { max-height: calc(100dvh - 120px); overflow-y: auto; }
}
/* Short laptop windows: when the sign at the bottom would squeeze the sky (app.mjs sets
   body.side-dock), it stands at the right instead, under the distance counter, in its usual paper. */
body.side-dock .prompt-dock { left: auto; right: var(--gutter); width: min(470px, 44vw); top: 150px; bottom: 14px; padding: 0 !important; max-height: calc(100dvh - 164px); overflow-y: auto; background: none; filter: none; }
/* A tablet or unfolded phone held sideways: the on-screen keyboard pushes the sign up from its bottom edge. */
body.side-dock.keyboard-open .prompt-dock { top: auto; bottom: var(--dock-offset); max-height: none; overflow: visible; }
body.side-dock .prompt-dock::before, body.side-dock .prompt-dock::after { display: none; }
body.side-dock .prompt-sub, body.side-dock .prompt-bottom { display: none; }
@media (max-width: 360px) {
  .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── About, terms, privacy: one sheet on the daytime sky ─────────────── */
body.doc { background: linear-gradient(#050914, #1b2a47 520px, var(--paper) 900px) no-repeat, var(--paper); }
.doc main { display: flex; justify-content: center; padding: 108px var(--gutter) 72px; }
.doc article { width: min(100%, 640px); padding: 38px 36px 30px; }
.doc .section-title { margin-bottom: 16px; }
.doc h2 { margin: 28px 0 6px; font: 800 19px/1.3 var(--ui); letter-spacing: -.01em; color: var(--lead); }
.doc p { margin: 0 0 12px; color: var(--lead-2); line-height: 1.62; }
.doc p a { color: var(--ink); text-underline-offset: 3px; }
.doc .updated { font-size: 14px; color: var(--muted); }
.doc-links { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 26px; padding-top: 14px; border-top: 1.5px solid var(--rule); }
@media (max-width: 760px) { .doc main { padding: 84px 16px 48px; } .doc article { padding: 30px 20px 24px; } }

/* ── Settings: hand-drawn tick boxes ─────────────────────────────────── */
.prefs { list-style: none; padding: 0; margin: 14px 0 0; }
.prefs li { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1.5px solid var(--rule); }
.prefs b { display: block; font-weight: 700; color: var(--lead); }
.prefs span { display: block; font-size: 14px; line-height: 1.45; color: var(--muted); }
.tick { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: none; }
.tick svg { width: 30px; height: 30px; overflow: visible; }
.tick .box { fill: var(--card-2); stroke: #cfd8ff; stroke-width: 1.8; stroke-linejoin: round; }
.tick .mark { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .25s ease-out; }
.tick[aria-checked="true"] .mark { stroke-dashoffset: 0; }

/* ── Hangar ──────────────────────────────────────────────────────────── */
#screen-hangar { justify-content: center; align-items: flex-start; }
.hangar-card { width: min(100%, 640px); }
.hangar { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.plane-card { width: 100%; display: grid; justify-items: center; gap: 2px; padding: 10px 10px 14px; border: 1.5px solid var(--rule); border-radius: 8px; background: var(--card-2); text-align: center; transition: transform .15s, border-color .15s; }
.plane-card:not(.locked):hover { transform: translateY(-2px); }
.plane-card canvas { width: 160px; height: 110px; }
.plane-card b { font-weight: 700; color: var(--lead); }
.plane-card span { font-size: 13px; line-height: 1.35; color: var(--muted); }
.plane-card .prog { color: var(--lead-2); font-weight: 600; }
.plane-card .flying { color: var(--ink); font-weight: 700; }
.plane-card.mine { border-color: var(--ink); }
.plane-card.locked { cursor: default; }

.unlock-note { margin: 14px 0 0; font-weight: 600; color: var(--lead); }
.unlock-note a { color: var(--ink); }

/* ── Night overrides ─────────────────────────────────────────────────── */
/* Tier marks become a solid underline: a highlighter behind pale text would wash it out. */
.hl, .tc-answer::before, .tier-key b::before, #tailwindStatus::before { inset: auto -3px -3px -3px !important; height: 3px; border-radius: 3px; opacity: 1; mix-blend-mode: normal; transform: none; }
#tailwindStatus::before { --c: #7cc8ff; }
.stamp.t0 .hl { inset: 50% -6px auto -6px !important; height: 2.5px; box-shadow: none; }
.toast { background: var(--card-2); color: var(--lead); box-shadow: var(--lift); }



.home-menu a, .home-links a, .link-btn { text-decoration-color: rgba(143, 225, 255, .35); }

/* ── Neon edges (both themes) ────────────────────────────────────────── */
/* Panels carry a thin pink-violet-cyan edge, the same neon as the sky's horizon. */
.paper { border: 1px solid rgba(160, 190, 230, .14); background: linear-gradient(180deg, var(--card-2), var(--card)); }
.home-title { text-shadow: none; }


/* ── Day ─────────────────────────────────────────────────────────────── */
html[data-theme="day"] {
  --paper: #f6f8fb; --card: #ffffff; --card-2: #ffffff; --grid: #d5e3f0;
  --lead: #2b2f36; --lead-2: #4a4f58; --muted: #6b7380; --rule: #e3e9f0;
  --ink: #2340b8; --ink-hi: #2d4fd6; --ink-low: #16298a; --red: #e8505b;
  --lift: 0 1px 1px #1e284614, 0 14px 30px -14px #1e284659;
  color-scheme: light;
}
html[data-theme="day"] .hl, html[data-theme="day"] .tc-answer::before, html[data-theme="day"] .tier-key b::before, html[data-theme="day"] #tailwindStatus::before {
  inset: 34% -5px 14% -5px !important; height: auto; opacity: .6; mix-blend-mode: multiply; transform: skewX(-6deg); box-shadow: none; }
html[data-theme="day"] .stamp.t0 .hl { inset: 52% -6px 38% -6px !important; opacity: .9; mix-blend-mode: normal; }
html[data-theme="day"] .icon-btn svg, html[data-theme="day"] .brand-plane path, html[data-theme="day"] .tick .box { stroke: #2b3a67; }
html[data-theme="day"] .icon-btn svg .pap, html[data-theme="day"] .tick .box { fill: #fff; }
html[data-theme="day"] .brand-plane .trail { stroke: #4a4f58; }
html[data-theme="day"] .brand-plane { filter: none; }
html[data-theme="day"] .paper { background: #fff; border-color: rgba(28, 40, 70, .08); }

html[data-theme="day"] .result-list .a, html[data-theme="day"] .reveal-answer, html[data-theme="day"] #answer, html[data-theme="day"] .board-list li.you .bn, html[data-theme="day"] .mates li { text-shadow: none; }
html[data-theme="day"] .pips li { border-color: #4a4f5880; }
html[data-theme="day"] .pips li.done { border: 1.6px solid var(--lead-2); box-shadow: none; }
html[data-theme="day"] .toast { background: var(--lead); color: #fff; }

html[data-theme="day"] body.doc { background: linear-gradient(#7fbcec, #eef2ee 420px, var(--paper) 760px) no-repeat, var(--paper); }

/* Switching theme while the page is open: everything fades across, nothing jumps. */
html.theme-shift *, html.theme-shift *::before, html.theme-shift *::after { transition: background-color 1.6s ease, color 1.6s ease, border-color 1.6s ease, box-shadow 1.6s ease, fill 1.6s ease, stroke 1.6s ease, text-shadow 1.6s ease !important; }
/* The prompt sits on the land strip, not on a panel. */

/* ── Neon on what is already lit (night) ─────────────────────────────── */
html:not([data-theme="day"]) .flight-gain { color: var(--gold); }



/* ── Title screen ────────────────────────────────────────────────────── */
/* Everything centred over the world, like a game's title card. The name is cut from paper:
   each letter folded once (two planes of paper), lifted off the sky on its own shadow. */
#screen-home { align-items: flex-start; justify-content: center; padding-top: clamp(96px, 15vh, 170px); }
.home { display: block; max-width: 760px; margin: 0 auto; text-align: center; }
.home .today-card { display: none; }
.today-sheet, html[data-theme] .today-sheet { max-width: none; padding: 0; background: none; border: 0; box-shadow: none; rotate: 0deg; overflow: visible; }
.today-sheet::before { display: none; }
.wordmark { margin: 0 0 18px; font: 900 clamp(64px, 10vw, 148px)/.95 var(--ui); letter-spacing: -.035em; white-space: nowrap; }
.wordmark span { display: inline-block; padding: 0 .015em; }


.wordmark span:nth-child(odd) { rotate: -2.2deg; translate: 0 2px; }
.wordmark span:nth-child(3n) { rotate: 2.6deg; translate: 0 -3px; }
.wordmark span:nth-child(4) { rotate: -4deg; }
html:not([data-theme="day"]) .wordmark span { background-image: linear-gradient(168deg, #f4f1e8 0 51%, #c9cfda 51% 100%); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)) drop-shadow(0 14px 18px rgba(0, 0, 0, .45)) drop-shadow(0 0 22px rgba(255, 220, 160, .12)); }
.home-date { margin: 0 0 6px; font: 700 17px/1.3 var(--ui); color: var(--lead); }
.home-tag { margin: 0 auto 24px; max-width: none; font-size: 17px; color: var(--lead-2); }

#homeToday { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
#playBtn { min-width: 320px; min-height: 64px; font-size: 20px; }
.today-done { display: flex; flex-direction: column; align-items: center; }
.today-done .next-flight { text-align: center; }
.home-menu { justify-content: center; gap: 10px; margin-top: 4px; }
.home-menu a, .home-menu button { min-height: 44px; padding: 0 16px; border-radius: 10px; text-decoration: none; font-size: 15px; color: var(--lead); background: rgba(255, 255, 255, .55); border: 1px solid rgba(28, 40, 70, .1); transition: transform .15s, background .15s; }
html:not([data-theme="day"]) .home-menu a, html:not([data-theme="day"]) .home-menu button { background: rgba(15, 24, 44, .7); border-color: rgba(160, 190, 230, .16); color: var(--lead); text-shadow: none; }

body[data-screen="home"] .bar .brand span { visibility: hidden; } /* the title already says it */
/* Short laptop windows: the title and its menu tighten so the menu ends in open sky, above the hills. */
@media (min-width: 761px) and (max-height: 760px) {
  .home-tag { margin-bottom: 14px; }
  #homeToday { margin-bottom: 10px; }
  #screen-home { padding-bottom: 200px; }
}
@media (max-width: 760px) {
  #screen-home { padding-top: var(--home-top, 300px); }
  .wordmark { font-size: clamp(56px, 17vw, 76px); margin-bottom: 12px; }
  #playBtn { min-width: 0; width: 100%; }
  .home-menu { gap: 8px; }
  .home-menu { display: grid; grid-template-columns: repeat(6, 1fr); width: min(100%, 320px); margin-inline: auto; } /* three and two, never one left alone */
  .home-menu > * { grid-column: span 2; justify-content: center; padding: 0 6px; white-space: nowrap; }
  .home-menu > :nth-last-child(-n+2) { grid-column: span 3; }
}
html[data-theme="day"] .wordmark span { background-image: linear-gradient(168deg, #ffffff 0 51%, #dce5f0 51% 100%); /* an ink edge drawn round the outside only, like the houses */
  filter: drop-shadow(2px 0 0 #2b3a67) drop-shadow(-2px 0 0 #2b3a67) drop-shadow(0 2px 0 #2b3a67) drop-shadow(0 -2px 0 #2b3a67) drop-shadow(0 10px 12px rgba(20, 30, 60, .22)); }

/* ── Flight path (progress) ─────────────────────────────────────────── */
.hud-left { gap: 6px; }
.pips { position: relative; gap: 18px; padding: 20px 0 4px; }
.pips::before { content: ''; position: absolute; left: 8px; right: 8px; top: 28px; border-top: 2px dashed rgba(110, 130, 160, .5); }
.pips li { position: relative; width: 16px; height: 16px; border: 2px solid rgba(110, 130, 160, .6) !important; background: var(--paper) !important; box-shadow: none !important; }
.pips li.current { border-color: var(--ink) !important; transform: scale(1.15); }
.pips li.done { border-color: transparent !important; background: var(--c) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent) !important; }
.pips li.miss { background: var(--paper) !important; border: 2px solid var(--red) !important; }
.path { position: relative; }
@media (max-width: 760px) { .pips { gap: 12px; } .pips li { width: 13px; height: 13px; } .pips::before { top: 26px; } }

/* ── The answer line ────────────────────────────────────────────────── */
.answer-row { position: relative; }
.answer-row .ink { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(100% - 120px); background: var(--ink); border-radius: 2px; transform-origin: left; opacity: 0; transition: opacity .2s; pointer-events: none; }
.answer-row:focus-within .ink { opacity: 1; }
#answer:focus { border-bottom-color: transparent; box-shadow: none; }

/* Room for descenders (the y of Foldaway): text clipped to its background needs padding below. */
.wordmark span { padding: .02em .03em .2em; margin-bottom: -.2em; }

/* The logo: the plane bobs and its trail redraws itself. */
.brand-plane .wing, .brand-plane .keel, .brand-plane .fold { animation: logo-bob 3.2s ease-in-out infinite; transform-box: view-box; }
.brand-plane .trail { stroke-dasharray: 2.6 3.2; animation: logo-trail 1.6s linear infinite; }
@keyframes logo-bob { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(1.5px, -2px) rotate(-4deg); } }
@keyframes logo-trail { to { stroke-dashoffset: -11.6; } }
.brand:hover .brand-plane .wing, .brand:hover .brand-plane .keel, .brand:hover .brand-plane .fold { animation-duration: .8s; }
@media (prefers-reduced-motion: reduce) { .brand-plane * { animation: none !important; } }

/* ── The flight console (prompt) ─────────────────────────────────────── */
/* A card sitting on the land strip: a neon edge running coral to amber to aqua, a timer that
   drains along its top edge, the question large, and one field with the Throw button in it. */
:root { --edge: linear-gradient(100deg, #ff3d7f, #ffb238 48%, #2ee6d6); }
html[data-theme] .prompt-dock .prompt-card {
  max-width: 820px; margin: 0 auto 6px; padding: 22px 26px 18px; border-radius: 18px; border: 2px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--edge) border-box;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45), 0 0 26px -6px rgba(255, 61, 127, .28), 0 0 32px -8px rgba(46, 230, 214, .25); }
html[data-theme="day"] .prompt-dock .prompt-card { background: linear-gradient(#ffffff, #ffffff) padding-box, var(--edge) border-box;
  box-shadow: 0 18px 40px -20px rgba(30, 40, 70, .35), 0 0 22px -8px rgba(255, 61, 127, .25), 0 0 28px -10px rgba(46, 230, 214, .28); }
.prompt-dock { padding-top: 14px; }
/* The timer as a bar along the top edge, aqua to amber, red and thicker in the last seconds. */
.prompt-dock .timer-bar { display: block; position: absolute; left: 18px; right: 18px; top: 10px; height: 4px; border-radius: 4px; background: rgba(128, 140, 170, .2); overflow: hidden; }
.prompt-dock .timer-bar i { background: linear-gradient(90deg, #2ee6d6, #ffb238); border-radius: 4px; }
.prompt-card.timer-low .timer-bar i { background: var(--red); }
.prompt-dock .prompt-top { margin: 8px 0 6px; }
.prompt-meta { gap: 8px; align-items: center; }
.prompt-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.prompt-category { padding: 3px 10px; border-radius: 999px; font: 700 13px/1.2 var(--ui); color: #fff; background: linear-gradient(90deg, #ff3d7f, #ff7a59); }

.prompt-dock .timer { width: auto; height: auto; margin: 0; display: flex; align-items: baseline; gap: 1px; font-size: 20px; }
.timer small { font-size: .7em; font-weight: 700; opacity: .75; }
.prompt-dock .prompt-text { margin: 4px 0 2px; }
/* One field: the answer and the Throw button together, with a glow while you type. */
.prompt-dock .answer-row { gap: 0; margin-top: 14px; padding: 5px 5px 5px 16px; border-radius: 14px; background: rgba(128, 140, 170, .12); border: 1.5px solid rgba(128, 140, 170, .3); transition: border-color .2s, box-shadow .2s; align-items: center; }
.prompt-dock .answer-row:focus-within { border-color: #2ee6d6; box-shadow: 0 0 0 3px rgba(46, 230, 214, .18), 0 0 22px rgba(46, 230, 214, .25); }
.prompt-dock #answer { border: 0 !important; padding: 8px 4px; box-shadow: none !important; }
.prompt-dock #answer::selection { background: rgba(255, 178, 56, .45); }
.prompt-dock .answer-row .ink { display: none; }
.prompt-dock .throw-btn { min-height: 50px; border-radius: 10px; }
.prompt-dock #answer.shake { animation: shake .3s; }
.prompt-dock .answer-row:has(#answer.shake) { border-color: var(--red); box-shadow: 0 0 0 3px rgba(232, 80, 91, .25); }
/* Wrong guesses: clear red chips, crossed out. */
.prompt-dock .tried li { background: rgba(255, 107, 122, .14); border: 1px solid rgba(255, 107, 122, .4); border-radius: 999px; padding: 0 10px; font: 700 14px/1.7 var(--ui); color: #e8505b; }
html:not([data-theme="day"]) .prompt-dock .tried li { color: #ff8f9b; }
/* A landed answer lights the card's edge in its tier colour for a moment. */

@keyframes card-lit { 0% { box-shadow: 0 0 0 3px var(--hit), 0 0 46px var(--hit); } 100% { box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45); } }
@media (max-width: 760px) {
  html[data-theme] .prompt-dock .prompt-card { margin: 0 10px 4px; padding: 18px 16px 14px; border-radius: 16px; }
  .prompt-dock .answer-row { padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) { .prompt-dock .prompt-card.lit { animation: none; } }

/* ── More neon where it fits ─────────────────────────────────────────── */
/* (no glow on the counter: its digits roll inside a clipped box, which turned the glow into a dark square) */
.home-menu a:hover, .home-menu button:hover { border-color: transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--edge) border-box; }
html[data-theme="day"] .home-menu a:hover, html[data-theme="day"] .home-menu button:hover { background: linear-gradient(#fff, #fff) padding-box, var(--edge) border-box; }






/* The console floats over the land itself: no separate strip under it. */
.prompt-dock { background: none !important; filter: none !important; }
.prompt-dock::before, .prompt-dock::after { display: none !important; }

/* The console is docked: attached to the bottom edge like a control panel, not a floating box. */
.prompt-dock { padding-bottom: 0 !important; }
html[data-theme] .prompt-dock .prompt-card { margin-bottom: 0; border-radius: 20px 20px 0 0; border-bottom-width: 0; padding-bottom: max(20px, env(safe-area-inset-bottom, 0px)); }
@media (max-width: 760px) { html[data-theme] .prompt-dock .prompt-card { margin: 0; border-radius: 18px 18px 0 0; border-left-width: 0; border-right-width: 0; } }
/* A miss reads as a plain red label, no strike-through line across it. */
.stamp.t0 .hl { display: none; }

/* ══ Depth pass: solid 3D pieces, cheap to draw ═══════════════════════ */
/* Paper grain as one static overlay (it used to be repainted on the canvas every frame). */
body::after { content: ''; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Title: solid letters extruded downward with stacked hard shadows. Text shadows are drawn once,
   so the letters can drop in without anything being recalculated per frame (the old blurred
   filters were the launch lag). */
html[data-theme] .wordmark span { filter: none; background: none; -webkit-background-clip: border-box; background-clip: border-box; will-change: transform, opacity;
  color: #fffaf0; text-shadow: 0 1px 0 #ece2cc, 0 2px 0 #e2d6bc, 0 3px 0 #d6c9ac, 0 4px 0 #cabb9c, 0 5px 0 #bdae8e, 0 6px 0 #b0a080, 0 7px 0 #a39373, 0 10px 0 rgba(20, 28, 60, .18), 0 18px 22px rgba(20, 28, 60, .28); }
html:not([data-theme="day"]) .wordmark span { color: #fff6e2; text-shadow: 0 1px 0 #e8d7b0, 0 2px 0 #dcc89c, 0 3px 0 #cfb988, 0 4px 0 #c0a974, 0 5px 0 #b19a64, 0 6px 0 #a18a56, 0 7px 0 #917a48, 0 10px 0 rgba(0, 0, 0, .35), 0 18px 26px rgba(0, 0, 0, .5); }

/* Buttons: a lit face on a thick base; they sink when pressed. */
.primary-btn, .throw-btn, .next-btn { border-radius: 14px; background: linear-gradient(180deg, #ffe07a, #ffc233 60%, #f7b21d); color: #2a1c05;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 6px 0 #b47a12, 0 12px 18px -6px rgba(0, 0, 0, .35) !important; transition: transform .1s, box-shadow .1s; }
.primary-btn:hover, .throw-btn:hover, .next-btn:hover { background: linear-gradient(180deg, #ffe690, #ffca47 60%, #f9b82b); transform: translateY(-1px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 7px 0 #b47a12, 0 14px 20px -6px rgba(0, 0, 0, .38) !important; }
.primary-btn:active, .throw-btn:active, .next-btn:active { transform: translateY(5px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 1px 0 #b47a12 !important; }
.home-menu a, .home-menu button { border-radius: 12px; box-shadow: 0 4px 0 rgba(20, 28, 60, .22); transition: transform .1s, box-shadow .1s; }






/* The flight deck: the prompt is the bottom of the screen, a solid panel edge to edge with a
   raised lip, like a game's control bar. The timer drains along the lip. */
@media all { /* every window size; the side layout below adjusts it */
  .prompt-dock { background: #fbf6ea !important; padding: 0 var(--gutter) max(16px, env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .8), 0 -6px 0 #d9ccb0, 0 -7px 0 rgba(20, 28, 60, .25), 0 -22px 30px -12px rgba(20, 28, 60, .25); }
  html:not([data-theme="day"]) .prompt-dock { background: #141d36 !important; box-shadow: inset 0 3px 0 rgba(160, 190, 240, .14), 0 -6px 0 #0a1022, 0 -7px 0 rgba(0, 0, 0, .6), 0 -22px 30px -12px rgba(0, 0, 0, .5); }
  html[data-theme] .prompt-dock .prompt-card { position: static; max-width: 820px; margin: 0 auto; padding: 26px 4px 6px; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .prompt-dock .timer-bar { left: 0; right: 0; top: 0; height: 6px; border-radius: 0; background: rgba(128, 140, 170, .22); }
  .prompt-dock .timer-bar i { border-radius: 0 4px 4px 0; }
  .prompt-dock .answer-row { background: #ffffff; border: 2px solid #d9ccb0; box-shadow: inset 0 3px 0 rgba(20, 28, 60, .08); }
  html:not([data-theme="day"]) .prompt-dock .answer-row { background: #0b1226; border-color: #2a3657; box-shadow: inset 0 3px 0 rgba(0, 0, 0, .45); }
  .prompt-dock .reveal { margin-top: 10px; }
}
@media (max-width: 760px) { .prompt-dock { padding: 0 14px max(10px, env(safe-area-inset-bottom, 0px)) !important; } html[data-theme] .prompt-dock .prompt-card { padding-top: 20px; margin: 0 auto; border-radius: 0; } }
/* A landed answer lights the deck's lip in its tier colour for a moment. */
.prompt-dock .prompt-card.lit { animation: none; }
.prompt-dock.lit { animation: deck-lit 1.1s ease-out; }
@keyframes deck-lit { 0% { box-shadow: inset 0 3px 0 rgba(255, 255, 255, .5), 0 -6px 0 var(--hit), 0 -30px 50px -8px var(--hit); } }
@media (prefers-reduced-motion: reduce) { .prompt-dock.lit { animation: none; } }

/* Logo: the plane flies a small lazy loop while its trail streams behind; on hover it zips away
   and comes back in from the left. */
.brand-plane .wing, .brand-plane .keel, .brand-plane .fold { animation: none; }
.brand-plane { overflow: visible; }
.brand-plane .flyer { transform-box: view-box; transform-origin: 36px 12px; animation: logo-fly 4.2s ease-in-out infinite; }
@keyframes logo-fly { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 25% { transform: translate(2px, -3px) rotate(-9deg); } 50% { transform: translate(3.5px, -.5px) rotate(3deg); } 75% { transform: translate(1px, 2px) rotate(7deg); } }
.brand:hover .brand-plane .flyer { animation: logo-zip .9s cubic-bezier(.5, 0, .3, 1); }
@keyframes logo-zip { 0% { transform: translate(0, 0) rotate(-6deg); opacity: 1; } 45% { transform: translate(46px, -14px) rotate(-18deg); opacity: 0; } 46% { transform: translate(-40px, 10px) rotate(-10deg); opacity: 0; } 100% { transform: translate(0, 0) rotate(0deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .brand-plane .flyer { animation: none !important; } }

/* ══ RGB split: words printed with a magenta and a cyan ghost either side ═══════════ */
/* --rx is how far the ghosts sit from the letters. It rests small, and jumps for a moment in a
   glitch: on its own every few seconds on the title, and whenever something lands in play. */
@property --rx { syntax: '<length>'; inherits: true; initial-value: 3px; }
:root { --mag: rgba(255, 40, 130, .9); --cyn: rgba(0, 225, 255, .9); }
html[data-theme] .wordmark span { --rx: 4px;
  text-shadow: calc(var(--rx) * -1) 0 0 var(--mag), var(--rx) 0 0 var(--cyn), 0 1px 0 #ece2cc, 0 2px 0 #e2d6bc, 0 3px 0 #d6c9ac, 0 4px 0 #cabb9c, 0 5px 0 #bdae8e, 0 6px 0 #b0a080, 0 7px 0 #a39373,
    calc(var(--rx) * -1) 7px 0 rgba(255, 40, 130, .5), var(--rx) 7px 0 rgba(0, 225, 255, .5), 0 18px 22px rgba(20, 28, 60, .3);
  animation: rgb-idle 6s steps(1) infinite; }
.wordmark span:nth-child(2) { animation-delay: .04s; } .wordmark span:nth-child(3) { animation-delay: .09s; } .wordmark span:nth-child(4) { animation-delay: .02s; }
.wordmark span:nth-child(5) { animation-delay: .12s; } .wordmark span:nth-child(6) { animation-delay: .06s; } .wordmark span:nth-child(7) { animation-delay: .1s; } .wordmark span:nth-child(8) { animation-delay: .03s; }
@keyframes rgb-idle { 0%, 91% { --rx: 4px; translate: 0 0; } 92% { --rx: 11px; translate: -3px 0; } 94% { --rx: 2px; translate: 4px 1px; } 96% { --rx: 14px; translate: -1px 0; } 98% { --rx: 6px; translate: 0 0; } 100% { --rx: 4px; } }
/* Smaller words and numbers: a tighter split. */
.prompt-text,
.stamp-tier,
.today-km,
.section-title,
.stamp-km { --rx: 2px; text-shadow: calc(var(--rx) * -1) 0 0 var(--mag), var(--rx) 0 0 var(--cyn); }
.result-km { --rx: 4px; background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--lead); }
.odo-digits { --rx: 3px; overflow: visible; clip-path: inset(0 -12px); } /* digits still roll inside, ghosts may hang out the sides */
html[data-theme="day"] .prompt-text, html[data-theme="day"] .section-title { --rx: 1.5px; }
/* The glitch: a quarter-second burst, then back to rest. */
.glitch { animation: rgb-glitch .42s steps(1) 1 !important; }
@keyframes rgb-glitch { 0% { --rx: 16px; translate: -4px 0; } 18% { --rx: 3px; translate: 5px 0; } 36% { --rx: 20px; translate: -2px 1px; } 54% { --rx: 7px; translate: 2px 0; } 72% { --rx: 12px; translate: 0 0; } 100% { translate: 0 0; } }
/* Buttons split on hover. */
.primary-btn:hover, .throw-btn:hover, .next-btn:hover { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), -5px 0 0 var(--mag), 5px 0 0 var(--cyn), 0 7px 0 #b47a12, 0 14px 20px -6px rgba(0, 0, 0, .38) !important; }


@media (prefers-reduced-motion: reduce) { html[data-theme] .wordmark span, .glitch { animation: none !important; } }

/* ══ RGB only where it earns it: the title, the +km flash and the final distance ══ */
.prompt-text, .odo-digits, .stamp-tier, .today-km, .section-title, .stamp-km, .brand span { text-shadow: none; }
.odo-digits { clip-path: none; overflow: hidden; }
.prompt-text.glitch, .odo-digits.glitch, .stamp-tier.glitch, .stamp-km.glitch { animation: none !important; }
.flight-gain { --rx: 3px; }

/* ══ The prompt, back in the world ═══════════════════════════════════ */
/* It sits on the land again: the strip is the ground the plane is flying over, with a cut
   grass edge. The countdown is a runway drawn across it: a little plane flies from the left
   to a flag on the right, leaving a coloured line behind it, and time is up when it lands. */
@media all { /* every window size; the side layout below adjusts it */
  .prompt-dock, html:not([data-theme="day"]) .prompt-dock { background: var(--strip, #eef4e6) !important; box-shadow: none; transition: background-color 1.2s ease; }
  .prompt-dock::before { display: block !important; content: ''; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: 26px; background: inherit;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 26' preserveAspectRatio='none'%3E%3Cpath d='M0 26V13C70 1 140 1 210 10s150 16 220 6c35-5 60-7 90-3V26Z'/%3E%3C/svg%3E") repeat-x left bottom / 520px 26px;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 26' preserveAspectRatio='none'%3E%3Cpath d='M0 26V13C70 1 140 1 210 10s150 16 220 6c35-5 60-7 90-3V26Z'/%3E%3C/svg%3E") repeat-x left bottom / 520px 26px; }
  html[data-theme] .prompt-dock .prompt-card { position: relative; padding-top: 44px; }
  /* The runway. */
  .prompt-dock .timer-bar { display: block; left: 4px; right: 4px; top: 22px; height: 0; overflow: visible; background: none; border-top: 2.5px dashed color-mix(in srgb, var(--lead) 35%, transparent); border-radius: 0; }
  .prompt-dock .timer-bar i { position: absolute; left: 0; right: 0; top: -4px; height: 4px; border-radius: 3px; transform-origin: left; background: linear-gradient(90deg, #2ee6d6, #ffb238 60%, #ff3d7f); }
  .timer-bar .runner { position: absolute; left: 0; right: 0; top: -17px; height: 20px; transform: translateX(calc(var(--t, 0) * 100%)); pointer-events: none; }
  .timer-bar .runner svg { position: absolute; left: -22px; top: -3px; width: 36px; height: 20px; overflow: visible; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .25)); animation: runner-bob 1.1s ease-in-out infinite; }
  @keyframes runner-bob { 50% { transform: translateY(-2.5px) rotate(-4deg); } }
  .timer-bar .flag { position: absolute; right: -2px; top: -20px; width: 2.5px; height: 20px; background: var(--lead); border-radius: 2px; }
  .timer-bar .flag::after { content: ''; position: absolute; left: 2px; top: 0; border-left: 13px solid #ff3d7f; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
  /* Last five seconds: the line goes red and the plane shakes. */
  .prompt-card.timer-low .timer-bar i { background: var(--red); }
  .prompt-card.timer-low .runner svg { animation: runner-shake .18s linear infinite; }
  @keyframes runner-shake { 25% { transform: translate(1px, -2px) rotate(-7deg); } 75% { transform: translate(-1px, 1px) rotate(6deg); } }
  /* The answer slip: a strip of white paper lying on the ground. */
  .prompt-dock .answer-row, html:not([data-theme="day"]) .prompt-dock .answer-row { background: #fffdf6; border: 0; border-radius: 10px; box-shadow: 0 4px 0 rgba(20, 28, 60, .18), 0 10px 18px -8px rgba(0, 0, 0, .3); rotate: -.4deg; }
  .prompt-dock .answer-row:focus-within { box-shadow: 0 4px 0 rgba(20, 28, 60, .18), 0 0 0 3px rgba(46, 230, 214, .55), 0 10px 18px -8px rgba(0, 0, 0, .3); }
  .prompt-dock #answer, html:not([data-theme="day"]) .prompt-dock #answer { color: #2340b8; text-shadow: none; }
  .prompt-dock #answer::placeholder { color: #8b93a3; }
  .prompt-dock.lit { animation: none; }
}
@media (prefers-reduced-motion: reduce) { .timer-bar .runner svg { animation: none !important; } }

/* ══ Buttons, tidied: one main button, one kind of secondary button ════════════ */
.primary-btn, .throw-btn, .next-btn { border: 0; border-radius: 14px; font-weight: 800; letter-spacing: .01em; background: #ffc83a; color: #2a1c05;
  box-shadow: inset 0 -5px 0 #dd9a17, 0 10px 18px -8px rgba(0, 0, 0, .4) !important; padding-bottom: 19px; transition: transform .1s, box-shadow .1s, background .15s; }
.primary-btn:hover, .throw-btn:hover, .next-btn:hover { background: #ffd255; transform: translateY(-1px); box-shadow: inset 0 -5px 0 #dd9a17, 0 14px 22px -8px rgba(0, 0, 0, .45) !important; }
.primary-btn:active, .throw-btn:active, .next-btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 #dd9a17, 0 4px 8px -4px rgba(0, 0, 0, .4) !important; padding-bottom: 16px; }
#playBtn { min-width: 300px; min-height: 62px; }
.prompt-dock .throw-btn { padding: 12px 22px 17px; min-height: 48px; }
.home-menu { gap: 10px; margin-top: 8px; }
.home-menu a, .home-menu button, html:not([data-theme="day"]) .home-menu a, html:not([data-theme="day"]) .home-menu button {
  min-height: 42px; padding: 0 18px 3px; border-radius: 12px; border: 0 !important; font: 700 15px var(--ui); text-shadow: none;
  background: #ffffff !important; color: #232a3d !important; box-shadow: inset 0 -3px 0 #cfd6e4, 0 8px 14px -8px rgba(0, 0, 0, .35); }
html:not([data-theme="day"]) .home-menu a, html:not([data-theme="day"]) .home-menu button { background: #232b4d !important; color: #eef2ff !important; box-shadow: inset 0 -3px 0 #151b36, 0 8px 14px -8px rgba(0, 0, 0, .6); }
.home-menu a:hover, .home-menu button:hover { transform: translateY(-1px); background: #f3f6fc !important; box-shadow: inset 0 -3px 0 #cfd6e4, 0 10px 16px -8px rgba(0, 0, 0, .4); }
html:not([data-theme="day"]) .home-menu a:hover, html:not([data-theme="day"]) .home-menu button:hover { background: #2c3660 !important; box-shadow: inset 0 -3px 0 #151b36, 0 10px 16px -8px rgba(0, 0, 0, .65); }
.home-menu a:active, .home-menu button:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 #cfd6e4 !important; }
.icon-btn { border-radius: 12px; }
.icon-btn:hover { background: rgba(255, 255, 255, .18); }
.icon-btn:hover svg { transform: none; filter: none; }

/* ══ Designer pass ════════════════════════════════════════════════════ */
/* No colour split on any text: clean, solid lettering. */
html[data-theme] .wordmark span { animation: none; text-shadow: 0 1px 0 #ece2cc, 0 2px 0 #e2d6bc, 0 3px 0 #d6c9ac, 0 4px 0 #cabb9c, 0 5px 0 #bdae8e, 0 6px 0 #b0a080, 0 7px 0 #a39373, 0 10px 0 rgba(20, 28, 60, .16), 0 18px 22px rgba(20, 28, 60, .28); }
.flight-gain, .result-km { text-shadow: none; }
.glitch { animation: none !important; }
/* One plane on screen is the player's. The progress dots and the countdown don't need their own. */
.pips { padding-top: 6px; } .pips::before { top: 14px; }
/* The line fills in solid up to the stop you are on, so progress reads at a glance. */
.pips::after { content: ''; position: absolute; left: 8px; top: 14px; width: calc((100% - 16px) * var(--p, 0)); border-top: 2px solid var(--ink); transition: width .5s ease; }
.pips li { z-index: 1; }
@media (max-width: 760px) { .pips::before, .pips::after { top: 12px; } }

/* The prompt is a paper signboard staked into the land, the same kind of sign as the
   landmark signposts: cream paper, ink outline, two posts. It is always dark ink on paper,
   whatever the hour, so it is always readable. */
@media all { /* every window size; the side layout below adjusts it */
  html[data-theme] .prompt-dock .prompt-card {
    --lead: #2b2f36; --lead-2: #4a4f58; --muted: #6b7380; --ink: #2340b8; --card: #fffaf0; --rule: #e6dcc6; --red: #e8505b;
    position: relative; max-width: 820px; margin: 0 auto 26px; padding: 46px 30px 22px; color: var(--lead);
    background: #fffaf0; border: 3px solid #2b3a67; border-radius: 12px 16px 13px 18px; box-shadow: 7px 8px 0 rgba(20, 28, 60, .3); rotate: -.35deg; }
  .prompt-dock .prompt-card::before, .prompt-dock .prompt-card::after { content: ''; position: absolute; bottom: -29px; width: 11px; height: 27px; background: #2b3a67; border-radius: 0 0 3px 3px; }
  .prompt-dock .prompt-card::before { left: 13%; } .prompt-dock .prompt-card::after { right: 13%; }
  .prompt-dock .prompt-card * { text-shadow: none !important; }
  .prompt-dock .prompt-text { color: #232a3d; }
  .prompt-dock .prompt-count { color: #4a4f58; }
  /* The countdown is a fuse across the top of the sign: a spark burns along it toward a ball
     of crumpled paper. If it gets there, the plane crumples. */
  .prompt-dock .timer-bar { left: 30px; right: 44px; top: 24px; border-top: 3px dotted #b9ad94; }
  .prompt-dock .timer-bar i { top: -5px; height: 5px; background: linear-gradient(90deg, #ffd23f, #ff8a3d 60%, #ff3d7f); }
  .timer-bar .runner { top: -12px; height: 18px; }
  .timer-bar .spark { position: absolute; left: -8px; top: 1px; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle, #fff 0 25%, #ffd23f 45%, #ff8a3d 70%, rgba(255, 61, 127, 0) 72%); box-shadow: 0 0 10px 3px rgba(255, 170, 60, .7); animation: spark 0.28s steps(2) infinite; }
  @keyframes spark { 50% { transform: scale(1.35) rotate(40deg); box-shadow: 0 0 14px 5px rgba(255, 120, 60, .8); } }
  .timer-bar .flag { right: -26px; top: -12px; width: 20px; height: 20px; background: #fff; border: 2.5px solid #2b3a67; border-radius: 46% 54% 50% 44%; }
  .timer-bar .flag::after { content: ''; position: absolute; inset: 3px; border: 0; border-top: 2px solid #2b3a67; border-left: 2px solid #2b3a67; border-radius: 60% 20%; transform: rotate(25deg); left: 3px; top: 4px; width: 8px; height: 6px; }
  .prompt-card.timer-low .timer-bar i { background: #e8505b; }
  .prompt-card.timer-low .spark { background: radial-gradient(circle, #fff 0 25%, #ff8a8a 45%, #e8505b 70%, rgba(232, 80, 91, 0) 72%); box-shadow: 0 0 12px 4px rgba(232, 80, 91, .8); animation-duration: .14s; }
  .prompt-card.timer-low:not(.answered) { animation: sign-shake .5s ease-in-out infinite; } /* only while the clock is still running */
  @keyframes sign-shake { 25% { rotate: -.9deg; } 75% { rotate: .3deg; } }
  /* Write the answer on the sign. */
  .prompt-dock .answer-row, html:not([data-theme="day"]) .prompt-dock .answer-row { background: #fff; border: 2.5px solid #2b3a67; border-radius: 12px; box-shadow: inset 0 3px 0 rgba(20, 28, 60, .07); rotate: 0deg; padding: 5px 5px 5px 16px; }
  .prompt-dock .answer-row:focus-within { box-shadow: inset 0 3px 0 rgba(20, 28, 60, .07), 0 0 0 4px rgba(255, 200, 58, .55); border-color: #2b3a67; }
  .prompt-dock .timer { color: #2340b8; }
  .prompt-dock .timer.low { color: #e8505b; }
  .prompt-dock .reveal-answer, .prompt-dock .stamp-km { color: #2340b8; }
  .prompt-dock .stamp-tier { color: #232a3d; } .prompt-dock .stamp.t0 .stamp-tier { color: #e8505b; }
  .prompt-dock .hl { inset: 34% -5px 14% -5px !important; height: auto; opacity: .6; mix-blend-mode: multiply; transform: skewX(-6deg); box-shadow: none; }
  .prompt-dock .tried li { color: #c62d3a; }
}
@media (max-width: 760px) { html[data-theme] .prompt-dock .prompt-card { margin: 0 4px 22px; padding: 40px 16px 16px; } .prompt-dock .timer-bar { left: 16px; right: 34px; top: 20px; } }
@media (prefers-reduced-motion: reduce) { .timer-bar .spark, .prompt-card.timer-low { animation: none !important; } }

.prompt-card.answered .spark { animation: none; opacity: 0; }

/* Type: Fredoka, a rounded face with a toy-like warmth, for everything but handwriting. */
.wordmark { font-weight: 700; letter-spacing: -.01em; }
.prompt-text, .section-title, .result-km, .home-title { font-weight: 700; letter-spacing: -.01em; }
.home-menu a, .home-menu button { font-weight: 600; font-size: 16px; }
.primary-btn, .throw-btn, .next-btn { font-weight: 700; }
/* Plain, flat details: no gradient chips or glowing rings. */
.prompt-category, html:not([data-theme="day"]) .prompt-category { background: none; box-shadow: none; font-weight: 600; color: var(--lead-2); border: 1.5px solid color-mix(in srgb, var(--lead) 28%, transparent); padding: 2px 9px; }

/* ══ The sign stands in the land itself ══════════════════════════════ */
/* No separate strip behind it: the scene's own ground runs under and around the sign, and its
   posts go into that ground. By night it is a dark board with pale ink, exactly like the
   landmark signposts in the scene, so it never glares. */
@media all { /* every window size; the side layout below adjusts it */
  .prompt-dock, html:not([data-theme="day"]) .prompt-dock { background: none !important; box-shadow: none !important; padding-bottom: 0 !important; }
  .prompt-dock::before { display: none !important; }
  html[data-theme] .prompt-dock .prompt-card { margin-bottom: 34px; }
  .prompt-dock .prompt-card::before, .prompt-dock .prompt-card::after { bottom: -37px; height: 35px; }
  html:not([data-theme="day"]) .prompt-dock .prompt-card {
    --lead: #eef2f8; --lead-2: #c3cddc; --muted: #94a0b8; --ink: #9fe3ff; --card: #16203c; --rule: #2a3657;
    background: #16203c; border-color: #d6e2f2; box-shadow: 7px 8px 0 rgba(0, 0, 0, .5); }
  html:not([data-theme="day"]) .prompt-dock .prompt-card::before, html:not([data-theme="day"]) .prompt-dock .prompt-card::after { background: #d6e2f2; }
  html:not([data-theme="day"]) .prompt-dock .prompt-text, html:not([data-theme="day"]) .prompt-dock .stamp-tier { color: #f3f6fc; }
  html:not([data-theme="day"]) .prompt-dock .prompt-count { color: #c3cddc; }
  html:not([data-theme="day"]) .prompt-dock .answer-row { background: #0d1529; border-color: #d6e2f2; box-shadow: inset 0 3px 0 rgba(0, 0, 0, .4); }
  html:not([data-theme="day"]) .prompt-dock #answer { color: #9fe3ff; }
  html:not([data-theme="day"]) .prompt-dock #answer::placeholder { color: #7f8aa3; }
  html:not([data-theme="day"]) .prompt-dock .timer { color: #9fe3ff; }
  html:not([data-theme="day"]) .prompt-dock .reveal-answer, html:not([data-theme="day"]) .prompt-dock .stamp-km { color: #9fe3ff; }
  html:not([data-theme="day"]) .prompt-dock .timer-bar { border-top-color: #3a4770; }
  html:not([data-theme="day"]) .timer-bar .flag { background: #16203c; border-color: #d6e2f2; }
  html:not([data-theme="day"]) .timer-bar .flag::after { border-color: #d6e2f2; }
  html:not([data-theme="day"]) .prompt-dock .hl { inset: auto -3px -3px -3px !important; height: 3px; opacity: 1; mix-blend-mode: normal; transform: none; }
  html:not([data-theme="day"]) .prompt-dock .tried li { color: #ff9aa5; }
}

/* ══ Title: drawn like the world ═════════════════════════════════════ */
/* White letters with the same navy ink outline as the house and the clock tower, standing on
   a solid ink edge. Tighter, with each letter tipped a little, like cut-out card. */
.wordmark { letter-spacing: -.01em; font-size: clamp(60px, 9.4vw, 140px); }
html[data-theme] .wordmark span { color: #fffdf6; padding: .02em .01em .18em; -webkit-text-stroke: .085em #232a4d; paint-order: stroke fill;
  text-shadow: 0 .06em 0 #232a4d, 0 .12em 0 #232a4d, .02em .16em 0 rgba(20, 24, 50, .35); }
html[data-theme] .wordmark span:nth-child(odd) { rotate: -2.5deg; translate: 0 .01em; }
html[data-theme] .wordmark span:nth-child(even) { rotate: 2deg; translate: 0 -.012em; }
html[data-theme] .wordmark span:nth-child(4) { rotate: -4deg; }
@media (max-width: 760px) { .wordmark { font-size: clamp(46px, 15vw, 76px); } }

/* The sign keeps one height while answering and while showing the result of a throw, so
   nothing behind it moves between prompts. */
@media (min-width: 761px) and (min-height: 601px) { html[data-theme] .prompt-dock .prompt-card { min-height: 286px; } }
@media (max-width: 760px) { html[data-theme] .prompt-dock .prompt-card { min-height: 300px; } }
/* Short phones give the scene the room instead: the sign may grow over the grass for a throw's
   result. And while typing nothing else is shown, so the sign is only as tall as the question and
   the answer box, which keeps the question on screen above the keyboard. */
@media (max-width: 760px) and (max-height: 640px) { html[data-theme] .prompt-dock .prompt-card { min-height: 0; } }
html[data-theme] body.keyboard-open .prompt-dock .prompt-card { min-height: 0; }

/* ══ Every panel is the same sign ═════════════════════════════════════ */
/* Result, hangar, friends, past flights, how to play, settings: cream paper with an ink
   outline by day, a dark board with pale ink by night, and a hard shadow. One look. */
.paper:not(.prompt-card), .sheet, html:not([data-theme="day"]) .paper:not(.prompt-card), html:not([data-theme="day"]) .sheet {
  background: #fffaf0; border: 3px solid #2b3a67; border-radius: 14px 18px 15px 20px; box-shadow: 7px 8px 0 rgba(20, 28, 60, .3); }
html:not([data-theme="day"]) .paper:not(.prompt-card), html:not([data-theme="day"]) .sheet { background: #16203c; border-color: #d6e2f2; box-shadow: 7px 8px 0 rgba(0, 0, 0, .5); }
html[data-theme="day"] .paper:not(.prompt-card), html[data-theme="day"] .sheet { background: #fffaf0; }
.result-list .a, .reveal-answer, .board-list li.you .bn, .mates li { text-shadow: none !important; }

/* Result: everything fits on one screen, in a clear order. */
#screen-result { padding-top: 96px; padding-bottom: 28px; align-items: flex-start; }
.result-card { width: min(100%, 500px); padding: 22px 26px 18px; }
.result-label { margin-bottom: 2px; }
.result-km { font-size: clamp(54px, 6vw, 76px); line-height: .95; }
.result-km small { font-size: 22px; }
.result-where { margin: 6px 0 2px; font-size: 16px; }
.board-rank { margin: 2px 0 10px; font-size: 15px; }
.result-list { margin: 0 0 12px; border-top: 2px solid var(--rule); }
.result-list li { padding: 5px 0 4px; border-bottom: 1.5px solid var(--rule); }
.result-list .q { font-size: 12px; line-height: 1.25; }
.result-list .a { font-size: 18px; line-height: 1.15; }
.result-list .k { font-size: 16px; } .result-list .k small { font-size: 11px; }
.result-share { grid-template-columns: 1fr; gap: 8px; }
.result-share .share-preview { display: none; }
#shareBtn { width: 100%; min-height: 50px; }
#saveCardBtn { margin-top: 2px; min-height: 36px; font-size: 14px; }
.board { margin-top: 10px; }
.spread { height: 56px; }
.next-flight { margin: 8px 0 6px; }
@media (max-width: 760px) { #screen-result { padding-top: 272px; } .result-card { width: 100%; padding: 20px 18px 16px; } }
html[data-theme="day"] .paper:not(.prompt-card), html[data-theme="day"] .sheet { border: 3px solid #2b3a67 !important; }
html:not([data-theme="day"]) .paper:not(.prompt-card), html:not([data-theme="day"]) .sheet { border: 3px solid #d6e2f2 !important; }
/* Title: only a little depth. A thin ink outline and one short step down. */

.odo { transform-origin: 100% 60%; }

/* Phone home: the menu stands on the land, which carries on down the page under it. */
@media (max-width: 760px) {
  body[data-screen="home"] { background: var(--land, var(--paper)); }
  html[data-theme="day"] body[data-screen="home"] .home-tag, html[data-theme="day"] body[data-screen="home"] .home-date { color: #1c2a3a; }
  html[data-theme="day"] body[data-screen="home"] .foot a { color: #1c2a3a; }
}

/* ══ Title: written by hand ══════════════════════════════════════════ */
/* The same pen that wrote the signposts and the answers, big and a little uphill, with one
   pencil line under it that draws itself once. No outline, no depth, no per-letter tilt. */
html[data-theme] .wordmark { font-family: 'Kalam', cursive; font-weight: 700; font-size: clamp(64px, 10.5vw, 156px); line-height: 1; letter-spacing: -.02em; rotate: -3deg; position: relative; padding-bottom: .12em; }
html[data-theme] .wordmark span { color: #1f3bb3; padding: 0; -webkit-text-stroke: 0; text-shadow: none; rotate: none !important; translate: none !important; background: none; filter: none; -webkit-text-fill-color: currentColor; }
html:not([data-theme="day"]) .wordmark span { color: #f4f8ff; }
.wm-line { position: absolute; left: 4%; right: 2%; bottom: -.04em; width: 94%; height: .22em; overflow: visible; pointer-events: none; }
.wm-line path { fill: none; stroke: #ffc83a; stroke-width: 9; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; animation: wm-draw .7s cubic-bezier(.3, .7, .2, 1) .9s forwards; }
@keyframes wm-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .wm-line path { animation: none; stroke-dashoffset: 0; } }
@media (max-width: 760px) { html[data-theme] .wordmark { font-size: clamp(56px, 18vw, 84px); } html[data-theme="day"] body[data-screen="home"] .wordmark span { color: #14246e; } .wm-line path { stroke-width: 6; } }

/* ══ Past flights are ticket stubs ═══════════════════════════════════ */
#tickets { display: grid; gap: 10px; }
#tickets li { border: 0; padding: 0; }
.ticket { position: relative; border: 2px solid var(--line, #2b3a67); border-radius: 10px; padding: 12px 16px 12px 16px; background: transparent; text-decoration: none; transition: transform .14s ease, background-color .14s ease; }
html[data-theme="day"] .ticket { border-color: #2b3a67; } html:not([data-theme="day"]) .ticket { border-color: #5a6a94; }
.ticket::before { content: ''; position: absolute; top: 6px; bottom: 6px; right: 96px; border-left: 2px dashed currentColor; opacity: .3; } /* the tear line */
.ticket span:last-child { width: 80px; text-align: center; }
@media (hover: hover) { .ticket:hover { transform: translateY(-1px); background: rgba(255, 200, 58, .12); } } /* a tap must not leave it lit */
.ticket .done { font-family: 'Kalam', cursive !important; font-size: 19px !important; }
.ticket span:last-child:not(.done) { font-weight: 500; }

/* ══ Hangar: planes pinned to a board ════════════════════════════════ */
.plane-card, html[data-theme] .plane-card { background: transparent; border: 2px solid transparent; box-shadow: none; border-radius: 12px; }
html[data-theme] .plane-card.mine { border-color: #ffc83a; box-shadow: none; background: rgba(255, 200, 58, .1); }
html[data-theme] .plane-card:not(.locked):hover { background: rgba(120, 140, 190, .1); }
#hangar { background-image: radial-gradient(circle, rgba(60, 80, 130, .22) 1.6px, transparent 2px); background-size: 28px 28px; border-radius: 12px; padding: 8px; }
.plane-card .flying { color: #b9770a; } html:not([data-theme="day"]) .plane-card .flying { color: #ffc83a; }

/* ══ Nothing hangs off the screen: on a desktop every card fits the window and, if it
   ever holds more than that, scrolls inside itself instead of making the page scroll. ══ */
@media (min-width: 761px) {
  .screen:not(#screen-home):not(#screen-play) { padding-top: 96px; padding-bottom: 28px; height: 100dvh; min-height: 0; }
  .screen .sheet-card { max-height: calc(100dvh - 128px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(120, 140, 190, .5) transparent; }
  .result-card { width: min(100%, 620px); }
  .result-list { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, auto); grid-auto-flow: column; column-gap: 28px; }
  .result-share { display: flex; align-items: center; gap: 18px; }
  #shareBtn { flex: 1; min-height: 46px; } #saveCardBtn { margin: 0; white-space: nowrap; }
  .archive-card { width: min(100%, 720px); }
  #tickets { grid-template-columns: 1fr 1fr; }
  .hangar-card { width: min(100%, 1000px); }
  .hangar { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
  .plane-card canvas { width: 128px; height: 88px; }
}

/* The underline sits under the letters' baseline, from the F to the last a, clear of the y's tail. */
html[data-theme] .wordmark { display: inline-block; width: fit-content; }
.wm-line { left: 1%; right: auto; width: 84%; top: .93em; bottom: auto; height: .16em; }
.plane-card.locked canvas, html[data-theme="day"] .plane-card.locked canvas { filter: none; opacity: 1; }
@media (min-width: 761px) { body[data-screen="result"] .foot, body[data-screen="archive"] .foot { position: absolute; bottom: 16px; left: var(--gutter); right: var(--gutter); padding: 0; justify-content: flex-end; } }
html[data-theme="day"] .foot a, html[data-theme="day"] body[data-screen] .foot a { color: #12204f; }
/* Once the answer is shown, the crossed-out guesses have done their job: the sign stays one height. */
.tried:has(~ .reveal:not([hidden])) { display: none; }

/* ══ Motion: nothing loops unless it is counting something down ══════ */
.brand-plane .flyer, .brand-plane .trail, .brand-plane .wing, .brand-plane .keel, .brand-plane .fold { animation: none; } /* the logo flies only when you point at it; it repainted every frame */
/* The mark matches the site icon: no trail, no glow, ghosts without an outline. */
html[data-theme] .brand-plane { width: 37px; height: 24px; filter: none; }
html[data-theme] .brand-plane .ghost { stroke: none; }
html[data-theme] .brand-plane .keel, html[data-theme] .brand-plane .wing { stroke: #2b3a67; stroke-width: .8; }
[style*="#b36bff"] .hl, [style*="#b36bff"]::before, [style*="#b36bff"] b::before, i[style*="#b36bff"], li.done[style*="#b36bff"] { animation: foil 2.4s ease-out 1; } /* the foil catches the light once */
.odo-strip { transition: transform .9s cubic-bezier(.16, 1, .3, 1); }

/* About page: the five tiers as a strip of highlighter marks, the same colours the game uses. */
.tier-list { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 4px 0 16px; padding: 0; }
.tier-list li { display: flex; align-items: baseline; gap: 8px; color: var(--lead-2); font-variant-numeric: tabular-nums; }
.tier-list b { font-weight: 600; color: var(--lead); background: linear-gradient(transparent 55%, color-mix(in srgb, var(--c) 55%, transparent) 55% 92%, transparent 92%); padding: 0 4px; }

/* Before the sky canvas has drawn, the page is already sky-coloured, so a refresh never flashes black. */
html { background: linear-gradient(#0b1030, #2a2f5e 60%, #141a3a) fixed; }
html[data-theme="day"] { background: linear-gradient(#6fb1ea, #cfe7f5 55%, #bfe0b4) fixed; }
body:not(.doc) { background: none; }
/* Home menu: plain written links under the main button, not a row of dark buttons. */
html[data-theme] .home-menu { gap: 4px 28px; }
html[data-theme] .home-menu a, html[data-theme] .home-menu button, html[data-theme] .home-menu a:hover, html[data-theme] .home-menu button:hover, html[data-theme] .home-menu a:active, html[data-theme] .home-menu button:active { background: none !important; border: 0; box-shadow: none !important; transform: none; padding: 0; border-radius: 0; color: var(--lead) !important; font: 600 17px var(--ui); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
html[data-theme] .home-menu a:hover, html[data-theme] .home-menu button:hover { text-decoration-color: currentColor; }
/* Small print on the home screen stays readable over a dusk sky. */
body[data-screen="home"] .today-km small, body[data-screen="home"] .next-flight { color: var(--lead); opacity: .85; }
/* The title is written in ink that pools: deep navy at the top of each letter, brighter blue at its foot.
   One hue, so it reads as ink and stands off the blue sky. At night the same fade runs white to pale blue. */
html[data-theme] .wordmark span { background: linear-gradient(176deg, #0f1a5a 18%, #2746d6 88%) !important; -webkit-background-clip: text !important; background-clip: text !important; color: transparent; -webkit-text-fill-color: transparent; }
html:not([data-theme="day"]) .wordmark span { background: linear-gradient(176deg, #ffffff 25%, #bcd2ff 92%) !important; -webkit-background-clip: text !important; background-clip: text !important; }
/* No fuzzy halo behind the home text. */
html[data-theme="day"] .home-date, html[data-theme="day"] .home-tag { text-shadow: none; }
/* Today's rank on the home screen, under the distance. */
.today-rank { margin: 2px 0 12px; font: 600 16px/1.3 var(--ui); color: var(--lead); text-align: center; }
/* On load nothing shows but sky until the right screen is ready, so a refresh never flashes the wrong one. */
#app, #sky, .bar { transition: opacity .25s ease; }
body[data-boot] #app, body[data-boot] #sky, body[data-boot] .bar { opacity: 0; transition: none; }
/* Room for the letters' tails and swashes, so the ink fade is not cut off at the edge of each letter's box. */
html[data-theme] .wordmark span { padding: .2em .12em .34em !important; margin: -.2em -.12em -.34em; }
/* The rule line: one quiet sentence under a prompt that rules something out. */
.prompt-rule { margin: 6px 0 12px; font: 500 15px/1.35 var(--ui); color: var(--muted); }
.prompt-dock .prompt-rule { color: #5a6072; }
html:not([data-theme="day"]) .prompt-dock .prompt-rule { color: #a9b6d3; }
/* The spark's carrier is a zero-width point moved along the fuse. As a full-width box slid by a
   transform it stuck out past the sign at the end of the clock, which widened the page on phones. */
.timer-bar .runner { right: auto; width: 0; transform: none; left: calc(var(--t, 0) * 100%); }
/* Packs: one row per themed pack, with its action or its price on the right. */
.packs-card { width: min(100%, 640px); }
.pack-list { list-style: none; margin: 16px 0 12px; padding: 0; display: grid; gap: 12px; }
.pack { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border: 2px solid color-mix(in srgb, var(--lead) 80%, transparent); border-radius: 12px; }
.pack h3 { margin: 0 0 4px; font: 700 19px/1.2 var(--ui); color: var(--lead); }
.pack p { margin: 0; color: var(--lead-2); font-size: 15px; line-height: 1.4; }
.pack .pack-meta { margin-top: 4px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.pack .primary-btn { flex: none; white-space: nowrap; }
.pack.locked { border-style: dashed; }
.pack-price { flex: none; display: grid; justify-items: end; gap: 2px; color: var(--lead); font-variant-numeric: tabular-nums; }
.pack-price b { font: 700 20px/1 var(--ui); } .pack-price small { color: var(--muted); font-size: 13px; }
@media (max-width: 760px) { .pack { flex-direction: column; align-items: stretch; } .pack-price { justify-items: start; } }
.result-list .said { display: block; grid-column: 1 / -1; margin-top: 2px; font: 500 13px/1.3 var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.pack-bundle { margin: 8px 0 0; font: 600 15px/1.4 var(--ui); color: var(--lead); }
.pack-bundle:empty { display: none; }
.pack-buy { flex: none; display: grid; justify-items: end; gap: 4px; }
@media (max-width: 760px) { .pack-buy { justify-items: stretch; } }
.restore-form { margin-top: 16px; } .restore-form label { display: block; font: 600 14px/1.4 var(--ui); color: var(--lead); margin-bottom: 4px; }
#packCode:empty { display: none; }
.pack-bundle { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.pack-bundle .link-btn { min-height: 32px; margin: 0; font-size: 15px; }
.restore { margin-top: 16px; } .restore summary { cursor: pointer; font: 600 15px/1.4 var(--ui); color: var(--ink); }
.restore[open] summary { margin-bottom: 8px; }
.sheet-card > .close-btn { display: grid; place-items: center; text-decoration: none; line-height: 1; z-index: 2; }
.restore summary { display: flex; align-items: center; min-height: 44px; }
.brand { min-height: 44px; }
/* Take-off cinematic: two black bars slide in from the edges and back out. Only transforms move,
   so the compositor does the work and the canvas keeps its frame rate. */
.cine-bar { position: fixed; left: 0; right: 0; height: max(64px, 11dvh); background: #05070d; z-index: 50; pointer-events: none; transition: transform .45s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
.cine-bar.top { top: 0; transform: translateY(-100%); } .cine-bar.bottom { bottom: 0; transform: translateY(100%); }
body.cine .cine-bar { transform: none; transition-duration: .35s; }
@media (prefers-reduced-motion: reduce) { .cine-bar { display: none; } }
/* Phones and tablets: no letterbox bars (they crowd a small screen), and no blended grain over the moving sky,
   which makes the GPU re-blend the whole dock every frame. */
/* Phones: no full-screen grain layer either; it was blended over the moving sky at full screen resolution every frame. */
@media (pointer: coarse) { .cine-bar { display: none; } .prompt-dock::after, body::after { display: none; } }
.fps-meter { position: fixed; top: max(6px, env(safe-area-inset-top, 0px)); left: 6px; z-index: 99; padding: 4px 8px; border-radius: 6px; background: #000a; color: #fff; font: 600 12px/1.3 ui-monospace, monospace; pointer-events: none; white-space: pre; }
/* Last five seconds, calmer and cheaper: the sign no longer rocks (rotating the whole sign repainted it every
   frame and felt frantic). The fuse turns red, the spark flickers with transform only, and the clock gives one
   small pulse a second. */
.prompt-card.timer-low:not(.answered) { animation: none; }
@keyframes spark { 50% { transform: scale(1.25); } }
.prompt-card.timer-low .spark { box-shadow: 0 0 10px 3px rgba(232, 80, 91, .7); animation-duration: .3s; }
.prompt-card.timer-low .runner svg { animation: none; }
@keyframes timer-pulse { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.08); } }
/* Once the prompt is answered the clock has no job: it fades out instead of showing the seconds that were left. */
.prompt-card .timer { transition: opacity .25s ease; }
.prompt-card.answered .timer { opacity: 0; }
/* Phones: thinner bars, so the scene and the plane keep most of the small screen. */
@media (max-width: 760px) { .cine-bar { height: max(40px, 7dvh); } }
/* Last five seconds: no shaking sign, but plenty of warning. The clock turns red and nudges once a second,
   the answer box's border turns red, and the fuse burns red. All small elements, so phones stay smooth. */
@keyframes timer-nudge { 0%, 100% { transform: translateX(0) scale(1); } 10% { transform: translateX(-2px) scale(1.08); } 20% { transform: translateX(2px) scale(1.08); } 30% { transform: translateX(0) scale(1); } }
.prompt-card.timer-low:not(.answered) .timer { animation: timer-nudge 1s ease-in-out infinite; }
.prompt-card.timer-low:not(.answered) .answer-row { border-color: var(--red) !important; }
@media (prefers-reduced-motion: reduce) { .prompt-card.timer-low .timer { animation: none; } }

/* Short laptop windows (set by app.mjs): the sign stands beside the scene, no legs, no ground strip. */
body.side-dock .prompt-dock { background: none !important; }
html[data-theme] body.side-dock .prompt-dock .prompt-card { margin: 0 6px 12px 0; }
body.side-dock .prompt-dock .prompt-card::before, body.side-dock .prompt-dock .prompt-card::after { display: none; }
/* and on the home screen the title shrinks with the window height, so the menu ends above the hills */
@media (min-width: 761px) and (max-height: 760px) { html[data-theme] .wordmark { font-size: clamp(64px, 15vh, 156px); } }
body.side-dock .prompt-dock .prompt-text { font-size: clamp(24px, 4.4vh, 32px); }
/* Frequent Flyer: the one offer on the packs screen, drawn like a pack card but heavier. */
.pack-bundle { align-items: center; justify-content: space-between; gap: 12px 20px; margin: 16px 0 0; padding: 18px 20px; border: 3px solid var(--lead); border-radius: 12px; background: color-mix(in srgb, var(--card) 80%, #ffd23f 20%); font-weight: 500; }
.pack-bundle .limit-note { flex-basis: 100%; padding-bottom: 12px; border-bottom: 1px dashed color-mix(in srgb, var(--lead) 35%, transparent); }
.pack-bundle .flyer { display: grid; gap: 4px; flex: 1 1 260px; }
.pack-bundle .flyer b { font: 700 21px/1.2 var(--ui); }
.pack-bundle .flyer span { color: var(--lead-2); font-size: 15px; line-height: 1.4; }
.pack-bundle .pack-buy .primary-btn { white-space: nowrap; }
@media (max-width: 760px) { .pack-bundle { flex-direction: column; align-items: stretch; } .pack-bundle .flyer { flex: none; } }
.extra-note { margin: 6px 0 0; font: 600 15px/1.4 var(--ui); color: var(--lead); } .extra-note:empty { display: none; }
html:not([data-theme="day"]) .pack-bundle { background: var(--card); border-color: #ffd23f; } /* night: no muddy yellow tint */
h2[tabindex="-1"]:focus { outline: none; }
.invite-welcome { margin: 14px 0 4px; padding: 16px 18px; border: 2px solid var(--lead); border-radius: 12px; }
.invite-welcome p { margin: 0 0 12px; color: var(--lead); line-height: 1.45; }
.invite-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
/* The day streak: under today's distance (or the Start button) on the home screen, and on today's result. */
.today-streak { margin: 0 0 12px; font: 600 15px/1.35 var(--ui); color: var(--lead); text-align: center; text-wrap: balance; }
#homeToday .primary-btn + .today-streak { margin: 12px 0 0; }
.today-rank .link-btn { min-height: 32px; margin: 0; font: inherit; color: inherit; }
.result-streak { margin: 4px 0 10px; font-size: 15px; font-weight: 600; color: var(--lead-2); }
.result-streak .link-btn, .install-note .link-btn { min-height: 32px; margin: 0 0 0 4px; font-size: 15px; }
.install-note { margin: 12px 0 0; font-size: 15px; font-weight: 600; color: var(--lead-2); }
.install-note .link-btn.quiet { color: var(--muted); }
/* Packs: gold is kept for the one purchase; each pack's free taster is an outlined button. */
.primary-btn.quiet-btn, .primary-btn.quiet-btn:hover, .primary-btn.quiet-btn:active { background: transparent; color: #d6e2f2; box-shadow: inset 0 0 0 2px currentColor !important; padding-bottom: 14px; }
.primary-btn.quiet-btn:hover { background: rgba(214, 226, 242, .08); }
html[data-theme="day"] .primary-btn.quiet-btn { color: #2b3a67; }
html[data-theme="day"] .primary-btn.quiet-btn:hover { background: rgba(43, 58, 103, .06); }
/* Footer links: the same small text, with room around it to tap. */
.foot a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 4px; }
/* By day the flight label and the km unit sit on bright sky: full navy ink, so they read like the digits beside them. */
html[data-theme="day"] .hud-label, html[data-theme="day"] .odo-unit { color: #2b3a67; }
/* Phones: the hangar in two columns, so fifteen planes are not one very long list. */
@media (max-width: 760px) { .hangar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .plane-card { padding: 8px 6px 12px; } .plane-card canvas { width: 100%; max-width: 160px; height: auto; aspect-ratio: 16 / 11; } }

.pack-bundle .pack-refund { flex-basis: 100%; margin-top: -4px; text-align: right; color: var(--muted); font-size: 13px; }
@media (max-width: 760px) { .pack-bundle .pack-refund { text-align: left; } }
/* Short phone screens (and zoomed pages): after an answer the sign tightens up, so it grows less over the scene
   and the plane's throw stays in view above it. */
@media (max-width: 760px) and (max-height: 640px) {
  .prompt-card.answered .prompt-text { font-size: 19px; line-height: 1.2; }
  .prompt-card.answered .stamp-tier { font-size: 24px; }
  .prompt-card.answered .stamp-km { font-size: 21px; }
  .prompt-card.answered .reveal-answer { font-size: 20px; margin: 0 0 2px; }
  .prompt-card.answered .reveal-far { font-size: 13px; line-height: 1.35; }
  .prompt-card.answered .next-btn { min-height: 44px; padding-top: 10px; padding-bottom: 12px; }
  .prompt-card.answered .reveal { margin-top: 6px; }
}
/* After a pack taster or a free extra flight: one quiet line about Frequent Flyer. */
.result-upsell { margin: 12px 0 0; font-size: 15px; font-weight: 600; color: var(--lead-2); }
.result-upsell a { color: var(--ink); }
/* How to play ends with one clear way out, always in view even when the rules scroll. */
.how-go { position: sticky; bottom: -26px; margin: 18px -28px -26px; padding: 14px 28px 22px; background: inherit; }
.how-go .primary-btn { width: 100%; }
/* Logbook: moving progress to another device. */
.move { display: grid; gap: 6px; }
.move .link-btn { min-height: 36px; margin: 0; justify-self: start; }
.move-code { margin: 0; font-size: 15px; font-weight: 600; color: var(--lead); }
.move-code b { font: 700 18px/1.2 ui-monospace, monospace; letter-spacing: .08em; color: var(--ink); white-space: nowrap; }
.move-in { display: flex; gap: 10px; align-items: center; }
.move-in input { flex: 1; min-width: 0; min-height: 40px; padding: 6px 10px; border: 1.5px solid var(--rule); border-radius: 8px; background: transparent; color: var(--lead); font: 600 15px var(--ui); }
.move-msg { margin: 0; font-size: 14px; color: var(--lead-2); }
.move-msg:empty { display: none; }
.move-title { margin-top: 24px; }
.move p.muted { margin: 0 0 2px; }
/* Very little room above the keyboard: the question shrinks so all of it stays on screen while typing. */
html[data-theme] body.keyboard-tight .prompt-dock .prompt-text { font-size: 19px; line-height: 1.2; }
body.keyboard-tight .prompt-dock .prompt-top { margin: 2px 0 2px; }
