/* Longtail: screens. Type set over the landscape on a strict grid; left-aligned, bottom-weighted,
   like titles over a long night shot. */

/* ================= Opening titles (CSS only: they run before any script) ================= */

.intro .hero-title .wi {
  animation: hero-rise 1.2s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 85ms + 140ms - var(--elapsed, 0ms));
}
.intro [data-intro] {
  animation: intro-in 1s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 90ms + 160ms - var(--elapsed, 0ms));
}
@keyframes hero-rise { from { transform: translateY(108%) rotate(2.5deg); } }
@keyframes intro-in { from { opacity: 0; transform: translateY(14px); } }

/* Leaving screens are pinned in place by motion.js while their type exits. */
.screen.is-leaving { pointer-events: none; }

/* ================= Legibility over the scene ================= */
/* The world is the picture; washes only where type sits, never a box. */
.has-world .screen:not(.round)::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(var(--veil), .42) 0%, rgba(var(--veil), .16) 40%, rgba(var(--veil), 0) 62%),
    linear-gradient(0deg, rgba(var(--veil), .5) 0%, rgba(var(--veil), 0) 46%);
}
.has-world .screen.brief::before, .has-world .screen.results::before {
  background: linear-gradient(0deg, rgba(var(--veil), .75) 0%, rgba(var(--veil), .3) 60%, rgba(var(--veil), .1) 100%);
}
.has-world .screen p, .has-world .screen li, .has-world .screen .btn + p { text-shadow: 0 0 16px rgba(var(--veil), .9), 0 0 3px rgba(var(--veil), .6); }
.has-world .btn { text-shadow: none; }

/* ================= Figures: the curve and the dot (2D) ================= */

.fig { width: 100%; height: auto; overflow: visible; }
.fig__hatch { stroke: var(--line); stroke-width: 1.2; }
.fig__line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.fig__base { stroke: var(--line-strong); stroke-width: 1; }
.fig__cap { fill: var(--mute); font-family: var(--font-mono); font-size: 12px; }
.fig__trail { fill: none; stroke: var(--ember); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fig__halo { fill: var(--night); }
.fig__core { fill: var(--h0); stroke: none; transition: fill .2s; }
.fig__n { fill: var(--night); font-family: var(--font-mono); font-weight: 500; }
.fig__dot[data-heat="1"] .fig__core { fill: var(--h1); }
.fig__dot[data-heat="2"] .fig__core { fill: var(--h2); }
.fig__dot[data-heat="3"] .fig__core { fill: var(--h3); }
.fig__dot[data-heat="4"] .fig__core { fill: var(--h4); }
.fig__dot[data-heat="5"] .fig__core { fill: var(--h5); }
.fig__dot[data-heat="4"] .fig__n, .fig__dot[data-heat="5"] .fig__n { fill: var(--ink); }
.fig__ring { fill: none; stroke: var(--ember); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ring 1.2s var(--ease-out) forwards; }
.fig__dot.is-landed .fig__core { animation: land .5s var(--ease-out); transform-box: fill-box; transform-origin: center; }
.fig__leader { stroke: var(--line-strong); stroke-width: 1; }
.fig__label { fill: var(--ink); font-family: var(--font-display); font-style: italic; font-size: 19px; }
.fig__note { animation: fade-in .4s ease-out; }
.fig__dot.is-pop { animation: pop .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 120ms + 300ms); }
.fig__cliff line { stroke: var(--ember); stroke-width: 1; stroke-dasharray: 3 4; }
.fig__cliff text { fill: var(--ember-ink); font-family: var(--font-mono); font-size: 12px; }
:root[data-theme="light"] .fig__core { fill: var(--ink); }
:root[data-theme="light"] .fig__dot[data-heat="0"] .fig__core { fill: var(--night); stroke: var(--ink); stroke-width: 1.5; }

@keyframes ring { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(3); } }
@keyframes land { 40% { transform: scale(1.6); } }
@keyframes pop { from { opacity: 0; } }

/* ================= The odometer ================= */

.odo { display: inline-flex; position: relative; font-family: var(--font-display); font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1; line-height: 1; }
/* Display numerals use the face's 20pt optical cut: at its 96pt cut the 1's flag and foot are
   hairlines and it reads as a capital I. Same cut everywhere a number is set large. */
.odo, .results__streaknum, .stat__v, .home__streak, .home__score, .reveal__pts, .results__num { font-optical-sizing: none; font-variation-settings: "opsz" 20; }
.odo__face { display: inline-flex; user-select: none; -webkit-user-select: none; }
.odo__col { display: inline-block; height: 1em; overflow: hidden; position: relative; transition: opacity .25s; }
.odo__strip { display: flex; flex-direction: column; will-change: transform; }
.odo__strip > span { display: block; height: 1em; line-height: 1; text-align: center; }

/* ================= Home ================= */

.home { position: relative; }
.home__stage {
  min-height: calc(100svh - 56px - max(10px, env(safe-area-inset-top)));
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  padding-bottom: clamp(26px, 6vh, 84px);
}
.home__meta { font-size: .9375rem; color: var(--mute); margin-bottom: clamp(12px, 2.6vh, 28px); display: flex; align-items: center; gap: 10px; }
.home__title {
  font-size: clamp(3.5rem, 15.8vw, 11.75rem);
  line-height: .86; letter-spacing: -.038em; font-weight: 500;
  max-width: 8.6em;
  margin: 0 0 clamp(18px, 3.4vh, 36px) -.04em;
  text-wrap: balance;
}
.home__title--challenge { font-size: clamp(2.75rem, 11vw, 8rem); max-width: 10em; }
.challenge__q { font-style: italic; color: var(--ember-ink); }
.home__lede { font-size: clamp(1.0625rem, 1.35vw, 1.25rem); line-height: 1.5; max-width: 31rem; margin-bottom: clamp(20px, 3.6vh, 36px); }
.home__cta { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 26rem; }
.btn--play { min-height: 60px; font-size: 1.125rem; padding: 0 22px; width: 100%; }
.home__sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 22px; margin-top: 12px; }
.home__date { color: var(--mute); font-size: .875rem; min-width: 4.5em; }
.home__date:empty { display: none; }
.home__err { border-left: 2px solid var(--ember); padding: 4px 0 4px 14px; margin-bottom: 20px; max-width: 30rem; }

.home__streak { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .22em; font-size: clamp(6rem, 34vw, 15rem); line-height: .82; letter-spacing: -.04em; margin: 0 0 clamp(16px, 3vh, 30px) -.05em; font-weight: 500; }
.home__streakword { font-size: clamp(1.75rem, 6vw, 3.5rem); letter-spacing: -.01em; line-height: 1; }
.home__score { display: flex; align-items: baseline; gap: 14px; font-size: clamp(6rem, 33vw, 14rem); line-height: .82; letter-spacing: -.04em; margin: 0 0 18px -.05em; font-weight: 500; }
.home__max { font-size: clamp(1rem, 2vw, 1.375rem); color: var(--mute); letter-spacing: 0; }
.home__marks { margin-bottom: 18px; }
.home__verdict { font-size: clamp(1.5rem, 4vw, 2.4rem); line-height: 1.1; margin-bottom: 14px; max-width: 18em; }
.home__next { font-size: 1rem; }
.countdown { font-size: .95em; letter-spacing: .02em; }
.home__below { max-width: 40rem; padding: 8px 0 32px; }
.home__share { margin-bottom: 20px; }
.home--done .home__sub { margin-top: 18px; }
@media (min-width: 1100px) {
  /* Score on columns 1-7, the share desk on 9-12, both resting on the same baseline. */
  .home--done { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; }
  .home--done .home__stage { grid-column: 1 / span 7; }
  .home--done .home__below { grid-column: 9 / -1; padding-bottom: clamp(26px, 6vh, 84px); }
  .home--done .share__grid { grid-template-columns: 1fr; }
  .home__score { font-size: clamp(6rem, 17vw, 19rem); }
}

.home__how { border-top: 1px solid var(--line); padding-top: 28px; }
.home__how h2 { margin-bottom: 18px; }
.how__rules { counter-reset: r; display: grid; gap: 12px; margin-bottom: 26px; }
.how__rules li { counter-increment: r; position: relative; padding-left: 2.2em; font-size: 1.0625rem; line-height: 1.45; max-width: 34rem; }
.how__rules li::before { content: counter(r); position: absolute; left: 0; top: .3em; font-family: var(--font-mono); font-size: .8125rem; color: var(--mute); }
.how__rules .it { font-size: 1.2em; line-height: 1.2; }
.how__fig { margin: 0 0 18px; padding: 16px 0 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.how__fig figcaption { margin-bottom: 4px; }

.ghostmark {
  display: inline-block; flex: none;
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px dashed currentColor; vertical-align: -.1em; margin-right: 8px;
}

/* ================= Briefing: the credits ================= */

.brief { padding-top: clamp(20px, 6vh, 80px); }
.brief__head { margin-bottom: clamp(30px, 7vh, 80px); }
.brief__title { font-size: clamp(3rem, 12vw, 8.5rem); line-height: .88; letter-spacing: -.035em; margin-left: -.04em; }
.brief__lede { margin-top: 16px; max-width: 32rem; }
.credits__frame { overflow: clip; margin: 0 calc(-1 * var(--margin)); padding: 0 var(--margin) 16px; }
.credits { display: grid; gap: clamp(26px, 5vh, 46px); }
.credit { display: grid; grid-template-columns: 1fr; gap: 6px; text-align: center; }
.credit__role { color: var(--mute); font-size: 1rem; display: flex; justify-content: center; align-items: baseline; gap: 10px; }
.credit__role .it { font-size: 1.3125rem; color: var(--ink); }
.credit__n { font-size: .8125rem; }
.credit__mult { color: var(--ember-ink); font-size: .875rem; }
.credit__prompt { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.75rem, 3.8vw, 2.875rem); line-height: 1; letter-spacing: -.02em; text-wrap: balance; }
.credit__rule { color: var(--mute); font-size: .9375rem; margin-top: 8px; max-width: 30rem; margin-inline: auto; text-wrap: pretty; }
.credit__pts { color: var(--ink); }
.credit[data-done] { opacity: .42; }
/* Over the world the credits get their own soft wash and halo; the rest of the page stays open. */
.has-world .credits { position: relative; isolation: isolate; }
.has-world .credits::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: -36px -6%;
  background: radial-gradient(70% 58% at 50% 50%, rgba(var(--veil), .78), rgba(var(--veil), .5) 55%, rgba(var(--veil), 0) 100%);
}
@media (min-width: 760px) { .has-world .credits::before { inset: -48px -4%; background: radial-gradient(60% 60% at 46% 50%, rgba(var(--veil), .8), rgba(var(--veil), .52) 55%, rgba(var(--veil), 0) 100%); } }
.has-world .credit__rule, .has-world .credit__role { color: color-mix(in srgb, var(--ink) 72%, var(--mute)); text-shadow: 0 0 12px rgba(var(--veil), 1), 0 0 3px rgba(var(--veil), .9); }
.has-world .credit__role .it { color: var(--ink); }
@media (min-width: 760px) {
  .credits { max-width: 72rem; }
  .credit { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--gap); text-align: left; align-items: baseline; }
  .credit__role { justify-content: flex-end; text-align: right; padding-right: calc(var(--gap) * .5); }
  .credit__rule { margin-inline: 0; }
}
.brief__go {
  position: sticky; bottom: 0; z-index: 2;
  margin: 0 calc(-1 * var(--margin));
  padding: 26px var(--margin) max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(var(--veil), 0), rgba(var(--veil), .92) 38%);
  display: grid; gap: 10px; justify-items: start;
}
.brief__go .btn { max-width: 26rem; }
@media (min-width: 760px) { .brief__go { justify-items: center; } .brief__go p { text-align: center; } }

/* ================= Round ================= */

body[data-screen="round"] { overflow: hidden; }
body[data-screen="round"] .bar { display: none; }

.round {
  position: fixed; left: 0; right: 0;
  top: var(--vvtop, 0px); height: var(--vvh, 100dvh);
  z-index: 3;
  display: flex; flex-direction: column;
  padding: max(8px, env(safe-area-inset-top)) var(--margin) 0;
}
.round::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgba(var(--veil), .9) 0%, rgba(var(--veil), .62) 38%, rgba(var(--veil), .2) 70%, rgba(var(--veil), 0) 100%);
}
.round > * { width: 100%; max-width: 76rem; margin-inline: auto; }
.round__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; flex: none; }
.round__where { font-size: .9375rem; display: flex; align-items: baseline; gap: 10px; }
.round__where .it { font-size: 1.25rem; }
.round__mult { color: var(--ember-ink); font-size: .875rem; }
.round__clock { display: flex; align-items: center; gap: 14px; }
.round__end { font-size: .875rem; color: var(--mute); min-height: 40px; padding: 0 4px; text-decoration: underline; text-underline-offset: .28em; text-decoration-color: var(--line-strong); }
.round__end:hover { color: var(--ink); }
.timer { min-width: 3.4ch; text-align: right; }
.timer__num { font-size: 1.625rem; font-weight: 500; line-height: 1; display: inline-block; transition: color .2s; }
.timer__track { height: 1px; background: var(--line); flex: none; margin-top: 4px; overflow: hidden; }
.timer__fill { height: 100%; background: var(--ink); transform-origin: left center; will-change: transform; }
.round[data-state="leadin"] .timer__fill { background: var(--line-strong); }
.round[data-urgent] .timer__track { height: 2px; }
.round[data-urgent] .timer__fill { background: var(--ember); }
.round[data-urgent] .timer__num { color: var(--ember-ink); }

.round__brief {
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 14px 0 16px;
}
/* Bottom-weighted by an auto margin (not flex-end), so any overflow runs downwards where the
   fitter can measure it. */
.round__prompt {
  margin-top: auto;
  font-size: 44px; line-height: .92; letter-spacing: -.03em; font-weight: 500;
  margin-left: -.03em; max-width: 13em; text-wrap: balance;
}
.round__rule { font-size: 1rem; line-height: 1.4; color: var(--mute); margin-top: 14px; max-width: 34rem; }
.round__source { margin-top: 6px; }
.tried { margin-top: 8px; }

.lock {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 6px; padding: 3px 10px 3px 8px;
  border: 1px solid var(--ember); color: var(--ember-ink);
  font-weight: 600; font-size: .9375rem; line-height: 1.3; vertical-align: baseline;
}
.lock svg { width: 13px; height: 13px; }

.round__dock { flex: none; padding-bottom: max(10px, env(safe-area-inset-bottom)); }

/* The bank: what is locked in right now. */
.bank { position: relative; padding: 10px 0 10px; border-top: 1px solid var(--line); min-height: 66px; isolation: isolate; }
.bank__glow {
  position: absolute; z-index: -1; pointer-events: none; opacity: 0;
  left: calc(-1 * var(--margin)); right: calc(-1 * var(--margin)); top: -60px; bottom: -40px;
  background: radial-gradient(34% 46% at 34% 55%, rgba(255, 90, 31, .3), rgba(255, 90, 31, 0));
}
.bank__empty { font-size: .9375rem; color: var(--mute); min-height: 46px; display: flex; align-items: center; }
.bank[data-empty] .bank__row, .bank[data-empty] .bank__sub { display: none; }
.bank:not([data-empty]) .bank__empty { display: none; }
.bank__row { display: flex; align-items: flex-end; justify-content: flex-start; gap: clamp(14px, 2.4vw, 32px); }
.bank__main { min-width: 0; flex: 0 1 auto; }
/* On wide screens the dock is a compact unit at the left of the frame, under the prompt. */
.round__dock > * { max-width: 46rem; }
.bank__kicker { display: block; font-size: .8125rem; color: var(--mute); margin-bottom: 2px; }
.bank__labels { position: relative; display: grid; min-width: 0; }
.bank__label {
  grid-area: 1 / 1; position: relative;
  font-size: clamp(1.75rem, 6.4vw, 2.75rem); line-height: 1.04; letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.bank__label.is-out { color: var(--mute); }
.bank__strike { position: absolute; left: 0; right: 0; top: 56%; height: 1.5px; background: var(--ember); transform-origin: 0 50%; }
.cw { display: inline-block; overflow: clip; overflow-clip-margin: .1em; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.ch { display: inline-block; }
.bank__score { position: relative; display: flex; align-items: flex-end; flex: none; }
.odo.bank__pts { font-size: clamp(2.6rem, 10vw, 3.75rem); font-weight: 500; letter-spacing: -.03em; }
.odo.bank__pts { transition: color .9s ease-out; }
.round__prompt { transition: opacity 1s ease-out; }
/* The upgrade beat: the points burn ember while they roll, the prompt steps back, then both settle. */
.round.is-upgrade .odo.bank__pts { color: var(--ember-ink); transition: color .1s; }
.round.is-upgrade .round__prompt { opacity: .5; transition: opacity .12s; }
.bank__delta { position: absolute; right: calc(100% + 10px); bottom: .7em; white-space: nowrap; color: var(--ember-ink); font-size: 1rem; opacity: 0; pointer-events: none; }
.bank__sub { display: flex; gap: 9px; align-items: center; margin-top: 6px; }
.bank__band { font-family: var(--font-display); font-style: italic; font-size: 1.0625rem; }
.bank .mark { --d: 8px; }
.bank__sweep { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--ember); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }

/* Feedback line */
.fb { min-height: 52px; display: flex; align-items: center; padding: 4px 0; }
.fb.is-new > * { animation: fb-in .26s var(--ease-out); }
@keyframes fb-in { from { opacity: 0; transform: translateY(4px); } }
.fb__msg { display: flex; align-items: baseline; gap: 10px; font-size: .9688rem; line-height: 1.35; flex-wrap: wrap; color: var(--mute); }
.fb__msg::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; transform: translateY(-.1em); opacity: .7; }
.fb__msg[data-tone="info"]::before { display: none; }
.fb__msg[data-tone="good"], .fb__msg[data-tone="up"] { color: var(--ink); }
.fb__msg[data-tone="good"]::before, .fb__msg[data-tone="up"]::before { background: var(--ember); opacity: 1; box-shadow: 0 0 10px var(--ember); }
.fb__msg[data-tone="up"] { font-weight: 600; }
.fb__msg > span { flex: 1; min-width: 0; }
.fb__suggest { font-weight: 600; color: var(--ink); }

.suggest {
  width: 100%; min-height: 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 4px 4px 4px 14px;
  border: 1px solid var(--ember);
  text-align: left; color: var(--ink);
}
.suggest__q { font-size: 1rem; line-height: 1.2; }
.suggest__q strong { font-size: 1.25rem; font-weight: 500; }
.suggest__yes {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 12px; background: var(--ember); color: var(--on-ember);
  font-weight: 600; font-size: 1rem;
}
.suggest__yes .key { font-family: var(--font-mono); font-size: .6875rem; padding: 1px 5px; border: 1px solid currentColor; opacity: .75; }
@media (hover: none) { .suggest__yes .key { display: none; } }

/* Input */
.entry { display: flex; align-items: stretch; border-bottom: 1px solid var(--line-strong); transition: border-color .2s; }
.entry:focus-within { border-bottom-color: var(--ember); }
.entry__input {
  flex: 1; min-width: 0; height: 60px; padding: 0 0 2px;
  border: 0; border-radius: 0; background: transparent; color: var(--ink);
  font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 1.875rem; letter-spacing: -.005em;
  caret-color: var(--ember);
  -webkit-appearance: none; appearance: none;
}
.entry__input::placeholder { color: var(--mute); opacity: .55; }
.entry__input:focus { outline: none; }
.entry__input:disabled { opacity: .5; }
.entry__go { flex: none; width: 52px; display: grid; place-items: center; color: var(--ember-ink); }
.entry__go svg { width: 24px; height: 24px; }
.entry__go:disabled { opacity: .4; }
.entry__go:focus-visible { outline-offset: -2px; }

@media (max-height: 560px) {
  .round__brief { padding: 8px 0 10px; }
  .round__rule { margin-top: 8px; font-size: .9375rem; }
  .round__source { display: none; }
  .bank { padding: 6px 0; min-height: 54px; }
  .bank__label { font-size: 1.5rem; }
  .odo.bank__pts { font-size: 2.25rem; }
  .bank__empty { min-height: 36px; }
  .bank__sub { margin-top: 2px; }
  .fb { min-height: 38px; padding: 2px 0; }
  .entry__input { height: 52px; font-size: 1.625rem; }
}
@media (max-height: 420px) {
  .round__rule { font-size: .875rem; line-height: 1.3; }
  .bank__sub, .bank__kicker, .tried { display: none; }
}

/* ================= Reveal ================= */

.reveal { padding-top: clamp(14px, 3vh, 36px); }
.reveal__where { font-size: .9375rem; display: flex; align-items: baseline; gap: 10px; }
.reveal__where .it { font-size: 1.25rem; }
.reveal__prompt { font-size: clamp(1.75rem, 4.6vw, 3.4rem); line-height: .98; letter-spacing: -.02em; max-width: 16em; margin-top: 10px; }
.reveal__window { height: clamp(90px, 26vh, 340px); }
.reveal__figure { display: flex; align-items: baseline; gap: 14px; }
.odo.reveal__pts { font-size: clamp(7rem, 34vw, 16rem); line-height: .82; letter-spacing: -.045em; font-weight: 500; margin-left: -.05em; }
.reveal__unit { font-size: .9375rem; color: var(--mute); }
.reveal__rule { display: block; height: 1px; max-width: 30rem; margin: 18px 0 14px; background: var(--ember); transform: scaleX(0); transform-origin: 0 50%; }
.reveal__band { display: flex; align-items: center; gap: 12px; }
.reveal__band .mark { --d: 11px; }
.reveal__bandname { font-size: clamp(1.625rem, 4.2vw, 2.5rem); line-height: 1; }
.reveal__fig { margin: 26px 0 6px; max-width: 42rem; min-height: 96px; }
.reveal__fig:not(.reveal__fig--slim) { min-height: 190px; }
.reveal:not(.is-landed) .reveal__after { opacity: 0; }
.reveal__after { max-width: 42rem; margin-top: 18px; }
.reveal__line { font-size: 1.125rem; line-height: 1.5; }
.reveal__answer { font-size: 1.45em; font-weight: 500; line-height: 1.1; }
.reveal__stat { display: block; margin-top: .4em; color: var(--mute); font-size: .875em; }
.reveal__desc { margin-top: 4px; font-size: 1.125rem; }
.reveal__note { margin-top: 10px; }
.reveal__ghost { display: flex; gap: 6px; align-items: baseline; margin-top: 18px; padding: 10px 0; border-top: 1px dashed var(--line-strong); border-bottom: 1px dashed var(--line-strong); }
.reveal__ghost .it { font-size: 1.15em; }
.rare { margin-top: 40px; }
.rare__head { margin-bottom: 14px; }
.rare__item { padding: 12px 0 13px; border-top: 1px solid var(--line); }
.rare__item:last-child { border-bottom: 1px solid var(--line); }
.rare__row { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.rare__label { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; line-height: 1.1; letter-spacing: -.01em; }
.rare__pts { font-size: .9375rem; color: var(--ember-ink); }
.rare__desc { font-size: .9375rem; line-height: 1.45; color: var(--mute); margin-top: 3px; max-width: 34rem; }
.reveal__top { margin-top: 20px; font-size: 1rem; }
.reveal__top .it { font-size: 1.15em; }
.reveal__source { margin-top: 14px; }
.reveal__next {
  position: sticky; bottom: 0; z-index: 2;
  margin: 28px calc(-1 * var(--margin)) 0; padding: 26px var(--margin) max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(var(--veil), 0), rgba(var(--veil), .92) 40%);
}
.reveal__next .btn { max-width: 26rem; }
/* Short screens (small phones, phones held sideways): the sticky bars give the content its height back. */
@media (max-height: 560px) {
  .reveal__next, .brief__go { padding-top: 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); margin-top: 16px; }
  .reveal__next .btn, .brief__go .btn { min-height: 44px; padding-block: 8px; }
  .brief__go p { display: none; }
}

@media (min-width: 1100px) {
  /* The score holds the left of the frame; the curve and the context read down the right. */
  .reveal { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }
  .reveal__head, .reveal__window, .reveal__next { grid-column: 1 / -1; }
  .reveal__window { height: clamp(40px, 14vh, 180px); }
  .reveal__score { grid-column: 1 / span 6; grid-row: 3 / span 2; }
  .reveal__fig { grid-column: 8 / -1; grid-row: 3; margin-top: 10px; }
  .reveal__after { grid-column: 8 / -1; grid-row: 4; margin-top: 8px; }
  .reveal__next { grid-row: 5; }
}

/* ================= Results ================= */

.results__head {
  min-height: calc(92svh - 56px);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  padding-bottom: clamp(26px, 5vh, 60px);
}
.results__where { font-size: .9375rem; color: var(--mute); margin-bottom: 10px; }
.results__total { display: flex; align-items: baseline; gap: 14px; margin: 0 0 22px -.05em; font-size: inherit; }
.odo.results__num { font-size: clamp(8rem, 40vw, 22rem); line-height: .8; letter-spacing: -.05em; font-weight: 500; }
.results__max { font-size: clamp(1rem, 2vw, 1.5rem); color: var(--mute); }
.results__marks { margin-bottom: 20px; }
.results__verdict { font-size: clamp(1.625rem, 4.4vw, 2.75rem); line-height: 1.05; max-width: 16em; }
.results__body { max-width: 44rem; padding-bottom: 32px; }
.results__fig { margin: 0 0 18px; }
.results__streak { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 6px 0; }
.results__streaknum { font-family: var(--font-display); font-size: 3rem; line-height: 1; font-weight: 500; }
.results__flag { display: flex; gap: 10px; align-items: center; font-weight: 600; margin: 8px 0; }
.shield { width: 12px; height: 14px; flex: none; background: var(--ember); clip-path: polygon(50% 0, 100% 16%, 100% 52%, 50% 100%, 0 52%, 0 16%); }
.results__h { margin: 48px 0 18px; }
.share__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share__note { margin-top: 12px; max-width: 34rem; }
.inline-link { text-decoration: underline; text-underline-offset: .2em; text-decoration-color: var(--line-strong); font: inherit; color: var(--ink); }

.receipt__row {
  display: grid; grid-template-columns: 1.8em 1fr auto 3.2ch; gap: 12px; align-items: center;
  padding: 11px 0; border-top: 1px solid var(--line);
}
.receipt__row:last-child { border-bottom: 1px solid var(--line); }
.receipt__n { color: var(--mute); font-size: .8125rem; }
.receipt__what { display: flex; flex-direction: column; min-width: 0; }
.receipt__kind { font-size: 1rem; color: var(--mute); }
.receipt__answer { font-family: var(--font-display); font-weight: 500; font-size: 1.375rem; line-height: 1.12; overflow-wrap: anywhere; }
.receipt__pts { text-align: right; font-size: 1rem; }
.results__cablist li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.results__cablabel { flex: 1; font-size: 1.375rem; }
.results__cab .link { margin-top: 6px; }
.results__next { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); }
.results__count { margin-bottom: 16px; }

/* Duel: you against the ghost */
.duel { margin-top: 26px; }
.duel__head, .duel__totals { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 8px 0; }
.duel__head { color: var(--mute); font-size: .9375rem; border-bottom: 1px solid var(--line-strong); }
.duel__row { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; padding: 10px 0 11px; border-bottom: 1px solid var(--line); }
.duel__kind { grid-column: 1 / -1; font-size: .9375rem; display: flex; gap: 8px; align-items: baseline; color: var(--mute); }
.duel__side { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; min-width: 0; }
.duel__answer { position: relative; font-family: var(--font-display); font-weight: 500; font-size: 1.1875rem; line-height: 1.15; min-width: 0; overflow-wrap: anywhere; }
.duel__pts { font-size: .9375rem; flex: none; }
.duel__row[data-lead="you"] .duel__side--you .duel__pts,
.duel__row[data-lead="ghost"] .duel__side--ghost .duel__pts { color: var(--ember-ink); }
.duel__side--ghost { color: var(--mute); }
.redact {
  position: absolute; left: 0; top: .12em; bottom: .08em; right: 0;
  background: var(--ink); transform-origin: right center;
  transition: transform .5s var(--ease-out); transform: scaleX(0);
}
.duel__answer.is-redacted .redact { transform: scaleX(1); }
.duel__answer.is-redacted .duel__text { color: transparent; }
.duel__text { transition: color .25s .25s; }
.duel__totals { font-size: 1.75rem; line-height: 1; padding-top: 14px; }
.duel__verdict { font-family: var(--font-display); font-style: italic; font-size: clamp(1.625rem, 4vw, 2.25rem); line-height: 1.1; margin-top: 12px; opacity: 0; transition: opacity .5s; }
.duel.is-done .duel__verdict { opacity: 1; }
.duel__verdict[data-result="win"] { color: var(--ember-ink); }

/* ================= Sheets: How to play, Stats, names ================= */

.how__p { max-width: 36rem; margin-top: 14px; }
.how__h { font-size: clamp(1.5rem, 3vw, 2rem); margin: 46px 0 14px; }
.how__rounds li { display: grid; grid-template-columns: 2.2em 8.5em 1fr; gap: 6px 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: baseline; }
.how__rounds li:last-child { border-bottom: 1px solid var(--line); }
.how__n { color: var(--mute); font-size: .8125rem; }
.how__name { font-size: 1.375rem; line-height: 1.1; }
.how__rule { font-size: .9688rem; line-height: 1.45; color: var(--mute); }
@media (max-width: 520px) {
  .how__rounds li { grid-template-columns: 2.2em 1fr; }
  .how__rule { grid-column: 2; }
}
.how__bands { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0 var(--gap); }
.how__bands li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.how__bands li .mono { margin-left: auto; }
.how__bands .mark { --d: 9px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--gap); margin: 0; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { padding: 14px 0 16px; border-top: 1px solid var(--line); }
.stat__v { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.5rem, 7vw, 3.75rem); line-height: .95; letter-spacing: -.03em; margin-top: 6px; }
.stat--big { grid-column: 1 / -1; }
.stat--big .stat__v { font-size: clamp(5rem, 22vw, 9rem); line-height: .85; }
.hist { margin-top: 6px; }
.hist__row { display: grid; grid-template-columns: 6em 1fr 2.6em; gap: 12px; align-items: center; padding: 5px 0; }
.hist__k { font-size: .8125rem; color: var(--mute); }
.hist__bar { height: 1px; width: max(6px, var(--w)); background: var(--ink); position: relative; }
.hist__bar::after { content: ""; position: absolute; right: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.hist__bar[data-empty] { background: var(--line-strong); width: 6px; }
.hist__bar[data-empty]::after { display: none; }
.hist__v { text-align: right; font-size: .875rem; }
.namer { max-width: 30rem; }
.copybox { width: 100%; font-family: var(--font-mono); font-size: .875rem; padding: 12px; min-height: 140px; resize: vertical; background: transparent; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 0; }

/* ================= The Cabinet, as your sky ================= */

.sky {
  position: fixed; inset: 0; z-index: 5;
  display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  padding: max(16px, env(safe-area-inset-top)) var(--margin) max(20px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.sky__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.sky__top > div { max-width: 34rem; }
.sky__top button, .sky__top a, .sky__bottom { pointer-events: auto; }
.sky__title { font-size: clamp(3rem, 11vw, 7.5rem); line-height: .88; letter-spacing: -.035em; margin: 18px 0 0 -.04em; }
.sky__intro { margin-bottom: 18px; }
.sky__intro { color: var(--mute); }
.sky__intro > p:first-child:not(.small) { color: var(--ink); font-family: var(--font-display); font-style: italic; font-size: 1.75rem; }
.sky__bottom {
  max-width: 40rem; max-height: 58vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 0 0;
}
.sky__card { padding-bottom: 8px; }
.sky__where { font-size: .8125rem; color: var(--mute); }
.sky__label { font-size: clamp(2.25rem, 8vw, 4.25rem); line-height: .95; letter-spacing: -.025em; margin: 6px 0 8px; }
.sky__desc { font-size: 1.25rem; line-height: 1.3; }
.sky__facts { margin-top: 8px; max-width: 32rem; }
.sky__read { margin-top: 4px; }
.sky__list { margin-top: 10px; }
.cab__item { border-top: 1px solid var(--line); }
.cab__item:last-child { border-bottom: 1px solid var(--line); }
.cab__btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 0 2px; text-align: left; min-height: 44px; }
.cab__btn:hover .cab__label { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.cab__label { flex: 1; font-family: var(--font-display); font-weight: 500; font-size: 1.375rem; line-height: 1.1; }
.cab__pts { font-size: .875rem; color: var(--ember-ink); }
.cab__meta { padding: 0 0 12px 21px; }
/* With live stars the scene carries the page; type sits on washes. Without, a plain page. */
.sky-open .sky::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(var(--veil), .7), rgba(var(--veil), 0) 28%, rgba(var(--veil), 0) 40%, rgba(var(--veil), .82) 68%, rgba(var(--veil), .94));
}
.sky p, .sky li, .sky h2, .sky h1 { text-shadow: 0 0 18px rgba(var(--veil), .95), 0 0 4px rgba(var(--veil), .7); }
.no-world .sky, :root:not(.has-world) .sky { background: var(--scrim); pointer-events: auto; overflow-y: auto; justify-content: flex-start; }
:root:not(.has-world) .sky__bottom { max-height: none; overflow: visible; }

.sky__tags { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.sky__tag {
  position: absolute; left: 0; top: 0; margin-top: -.7em;
  display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 5px;
  white-space: nowrap; opacity: 0; transition: opacity .3s ease-out;
  color: var(--ink);
}
.sky__tag.is-left { flex-direction: row-reverse; padding: 4px 5px 4px 4px; }
.sky__tick { flex: none; width: 16px; height: 1px; background: var(--line-strong); }
.sky__name { font-family: var(--font-display); font-style: italic; font-size: 1.0625rem; line-height: 1; text-shadow: 0 0 10px rgba(var(--veil), 1), 0 0 3px rgba(var(--veil), .9); }
.sky__tag:hover .sky__name { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.sky__lead { font-family: var(--font-display); font-style: italic; font-size: clamp(1.25rem, 3.4vw, 1.625rem); line-height: 1.15; color: var(--ink); margin-bottom: 8px; max-width: 18em; }
@media (prefers-reduced-motion: reduce) { .sky__tag { transition: none; } }

/* While the Cabinet or a sheet is up, the page underneath steps back. */
.sky-open #view, .sky-open .bar { opacity: 0; transition: opacity .35s; }

@media (prefers-reduced-motion: reduce) {
  .intro .hero-title .wi, .intro [data-intro] { animation: none; }
}

/* Small type that can land on the bright peak gets full ink over the world. */
.has-world .home__meta, .has-world .brief__lede, .has-world .results__where { color: var(--ink); }

/* How to play / Stats: the page underneath (and its giant headline) steps out entirely, so the sheet
   reads as type over a dim landscape, never over other type. */
:root:has(.sheet[open]) #view,
:root:has(.sheet[open]) .bar { opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.sheet { background: rgba(var(--veil), .78); }

/* Briefing: today's prompts are sealed until their clock starts. A redaction bar where the title
   would be, hatched like the curve's shading, with a small caption. */
.credit__prompt--sealed { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.credit__seal {
  display: block; width: clamp(11rem, 26vw, 22rem); height: .78em;
  border: 1px solid var(--line-strong, var(--line));
  background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--line) 6px 7px);
}
.credit__sealtext {
  font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .02em; color: var(--mute);
  line-height: 1.2;
}
@media (min-width: 760px) { .credit__prompt--sealed { padding-top: .12em; } }

/* Footer: the crawlable links and the maker's credit. Home only, never during play. */
.foot {
  position: relative; z-index: 2; display: none;
  padding: 28px var(--margin) max(22px, env(safe-area-inset-bottom));
  font-size: .8125rem; line-height: 1.5; color: var(--mute);
}
body[data-screen="home"] .foot, body[data-screen="boot"] .foot { display: block; }
:root:has(.sheet[open]) .foot, .sky-open .foot { display: none; }
.foot a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.foot a:hover { text-decoration-color: currentColor; }
.foot__nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 6px; }
.has-world .foot { text-shadow: 0 0 12px rgba(var(--veil), .9); }
@media (min-width: 900px) and (min-height: 620px) {
  /* Desktop: a quiet line in the empty corner, clear of the bottom-left type. */
  .foot { position: fixed; right: 0; bottom: 0; max-width: 34rem; text-align: right; padding-left: 0; }
  .foot__nav { justify-content: flex-end; }
}
