/* ───────────────────────── Forehead Capital ───────────────────────── */

:root {
  --paper: #F2EDE3;
  --paper-2: #E7E0D2;
  --ink: #151413;
  --ink-2: #3A3732;
  --muted: #7A7368;
  --line: rgba(21, 20, 19, .14);
  --funded: #19C37D;
  --funded-ink: #03170D;
  --pass: #FF4A2E;
  --pass-ink: #200500;
  --pink: #FF6FAE;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-pop: cubic-bezier(.2, 1.5, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
html:has(body[data-screen="stage"]) { overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

/* film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: .32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* screens */
.screen { display: none; }
body[data-screen="home"] .home,
body[data-screen="ready"] .ready,
body[data-screen="results"] .results { display: block; }
body[data-screen="stage"] .stage { display: block; }
body[data-screen="stage"] { overflow: hidden; overscroll-behavior: none; }

.wrap {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 56px max(16px, env(safe-area-inset-left));
}
@media (min-width: 720px) { .wrap { padding-left: 32px; padding-right: 32px; } }

/* ───────── shared bits ───────── */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) 0 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.025em;
  font-stretch: 90%;
}
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand span { white-space: nowrap; }
.top .chip { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 8px 11px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  white-space: nowrap;
}
.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker {
  margin: 0;
  font-size: clamp(11px, 3cqmin, 15px);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .75;
}

.cta {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--ink) 30%, transparent);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
@media (hover: hover) { .cta:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 color-mix(in srgb, var(--ink) 30%, transparent); } }
.cta:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 color-mix(in srgb, var(--ink) 30%, transparent); }
.ghost {
  appearance: none;
  min-height: 56px;
  padding: 0 22px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: transparent;
  font-size: 17px;
  font-weight: 600;
  transition: background .15s;
}
@media (hover: hover) { .ghost:hover { background: color-mix(in srgb, currentColor 8%, transparent); } }
.ghost:active { transform: scale(.97); }
.link {
  appearance: none;
  border: 0;
  background: none;
  padding: 8px 2px;
  font: 500 13px/1.3 var(--mono);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  opacity: .8;
}
.link:hover { opacity: 1; }

/* ───────── HOME ───────── */
.hero { padding: 28px 0 0; }
@media (min-width: 720px) { .hero { padding-top: 56px; } }
.headline {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(44px, min(10.4vw, 17svh), 132px);
  font-weight: 800;
  font-stretch: 82%;
  line-height: .88;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.headline .mark {
  white-space: nowrap;
  padding: 0 .06em;
  margin: 0 -.06em;
  background: linear-gradient(180deg, transparent 58%, var(--pink) 58%, var(--pink) 90%, transparent 90%);
}

.settings {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 40px 0 0;
  padding: 14px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.set { display: flex; align-items: center; gap: 12px; }
.set-label { font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); min-width: 64px; }
@media (min-width: 720px) { .set-label { min-width: 0; } }
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  min-width: 54px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }

.decks-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 40px 0 16px;
}
.decks-head h2, .cap-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  font-stretch: 85%;
  letter-spacing: -.035em;
  line-height: 1;
}
.decks-head span, .cap-head span { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }

.decks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 680px) { .decks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }

.deck {
  --c: var(--paper-2);
  --k: var(--ink);
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 212px;
  padding: 14px 14px 12px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--c);
  color: var(--k);
  text-align: left;
  box-shadow: 0 0 0 var(--ink);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
  animation: rise .5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms + 80ms);
}
@media (hover: hover) { .deck:hover { transform: translate(-3px, -3px) rotate(-.6deg); box-shadow: 5px 5px 0 var(--ink); } }
.deck:active { transform: translate(1px, 1px) scale(.985); box-shadow: 0 0 0 var(--ink); transition-duration: .06s; }
.deck-top { display: flex; align-items: flex-start; justify-content: space-between; }
.deck-no { font: 500 11px/1 var(--mono); letter-spacing: .06em; opacity: .7; padding-top: 4px; }
.deck-icon { width: 42px; height: 42px; }
.deck-title {
  margin-top: auto;
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 800;
  font-stretch: 85%;
  line-height: .95;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.deck-short { font-size: 14px; line-height: 1.3; opacity: .78; text-wrap: pretty; }
.deck-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1.5px solid color-mix(in srgb, currentColor 28%, transparent);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.deck .tag-best { color: inherit; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ───────── READY ───────── */
.ready { min-height: 100dvh; background: var(--c, var(--paper)); color: var(--k, var(--ink)); }
.ready .wrap { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.back {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 14px 0 8px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
}
.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ready .eyebrow { color: inherit; opacity: .7; }
.ready-body {
  flex: 1;
  display: grid;
  align-items: center;
  gap: 8px 40px;
  padding: 8px 0 16px;
}
@media (min-width: 860px) { .ready-body { grid-template-columns: 1.25fr 1fr; } }
.ready-copy { animation: rise .45s var(--ease-out) both; }
.ready-title {
  margin: 0;
  font-size: clamp(54px, 11vw, 136px);
  font-weight: 800;
  font-stretch: 78%;
  line-height: .86;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.ready-short { margin: 14px 0 0; font-size: clamp(17px, 2vw, 21px); line-height: 1.35; opacity: .85; }
.rules {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
}
.rules li { display: flex; align-items: center; gap: 12px; }
.rules .k {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 1.5px solid currentColor;
  border-radius: 8px;
  font-size: 14px;
}
.ready-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.ready .cta { background: var(--k, var(--ink)); color: var(--c, var(--paper)); border-color: var(--k, var(--ink)); box-shadow: 4px 4px 0 color-mix(in srgb, var(--k, var(--ink)) 28%, transparent); }

.ready-art { width: min(340px, 72vw); justify-self: center; order: -1; overflow: visible; }
@media (min-width: 860px) { .ready-art { order: 0; width: min(420px, 100%); } }
@media (max-height: 560px) and (orientation: landscape) { .ready-art { display: none; } }
.ready-art .skin { fill: var(--k, var(--ink)); }
.ready-art .face { fill: none; stroke: var(--c, var(--paper)); stroke-width: 4.5; stroke-linecap: round; }
.ready-art .screen-fill { fill: var(--c, var(--paper)); stroke: var(--k, var(--ink)); stroke-width: 5; }
.ready-art .ink-fill { fill: var(--k, var(--ink)); }
.ready-art .arr path { fill: none; stroke: currentColor; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.ready-art text { font: 600 15px var(--mono); letter-spacing: .08em; fill: currentColor; }
.ready-art .arr-pass { animation: bob-up 2.4s ease-in-out infinite; }
.ready-art .arr-funded { animation: bob-down 2.4s ease-in-out infinite; }
.ready-art .head { transform-box: view-box; transform-origin: 120px 200px; animation: nod 2.4s ease-in-out infinite; }
@keyframes bob-up { 0%, 100% { transform: translateY(0); opacity: .55; } 75% { transform: translateY(-6px); opacity: 1; } }
@keyframes bob-down { 0%, 100% { transform: translateY(0); opacity: .55; } 25% { transform: translateY(6px); opacity: 1; } }
@keyframes nod { 0%, 50%, 100% { transform: none; } 25% { transform: translateY(4px) scaleY(.97); } 75% { transform: translateY(-3px) scaleY(.985); } }

/* ───────── STAGE ───────── */
.stage {
  --c: var(--paper);
  --k: var(--ink);
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  background: var(--c);
  color: var(--k);
  container-type: size;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
}
/* rotation-locked phone held sideways: turn the stage ourselves */
body[data-rot="cw"] .stage,
body[data-rot="ccw"] .stage {
  inset: auto;
  top: 0;
  left: 0;
  width: 100dvh;
  height: 100dvw;
  transform-origin: 0 0;
}
body[data-rot="cw"] .stage { transform: rotate(90deg) translateY(-100%); }
body[data-rot="ccw"] .stage { transform: rotate(-90deg) translateX(-100%); }

.runway {
  position: absolute;
  inset: 0 0 auto 0;
  height: max(5px, 1.2cqmin);
  background: color-mix(in srgb, var(--k) 16%, transparent);
  opacity: 0;
  transition: opacity .3s;
}
.runway i { display: block; height: 100%; background: var(--k); transform-origin: 0 50%; }
.stage[data-phase="play"] .runway { opacity: 1; }

.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.stage[data-phase="place"] .v-place,
.stage[data-phase="count"] .v-count,
.stage[data-phase="play"] .v-play,
.stage[data-phase="end"] .v-play { display: flex; }

/* place on forehead */
.place-title {
  margin: 2cqmin 0 0;
  max-width: 14ch;
  font-size: clamp(34px, 12cqmin, 96px);
  font-weight: 800;
  font-stretch: 80%;
  line-height: .9;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.place-sub { margin: 3cqmin 0 0; font-size: clamp(15px, 4cqmin, 22px); opacity: .8; }
.hold {
  width: min(320px, 50cqw);
  height: 10px;
  margin: 5cqmin 0 2cqmin;
  border: 2px solid currentColor;
  border-radius: 99px;
  overflow: hidden;
}
.hold i { display: block; width: 100%; height: 100%; background: currentColor; transform: scaleX(0); transform-origin: 0 50%; transition: transform .08s linear; }
.v-place .link { font-size: clamp(12px, 3cqmin, 14px); }
.place-close {
  position: absolute;
  top: max(calc(1.2cqmin + 12px), env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
}

/* countdown */
.count-num {
  font-size: min(56cqh, 60cqw);
  font-weight: 800;
  font-stretch: 75%;
  line-height: .85;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}
.count-num.anim { animation: count-pop .6s var(--ease-pop) both; }
.count-num.word { font-size: min(34cqh, 24cqw); letter-spacing: -.04em; }
@keyframes count-pop { from { transform: scale(1.6); opacity: 0; } 60% { opacity: 1; } to { transform: scale(1); } }

/* play */
.v-play { justify-content: flex-start; padding-top: 0; }
.hud {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: max(calc(1.2cqmin + 12px), env(safe-area-inset-top));
}
.hud-btn {
  justify-self: start;
  display: grid;
  place-items: center;
  width: clamp(40px, 11cqmin, 52px);
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
  opacity: .8;
}
.hud-btn svg { width: 46%; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.timer, .score { display: inline-flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.timer { font-size: clamp(26px, 9cqmin, 52px); font-weight: 600; letter-spacing: -.03em; }
.timer small, .score small { font-size: .38em; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.score { justify-self: end; font-size: clamp(22px, 7cqmin, 40px); font-weight: 600; }
.score small { font-size: .45em; }
.stage.warn .timer { animation: pulse 1s ease-in-out infinite; }
.stage.warn .runway i { animation: blink .5s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.score.bump span { display: inline-block; animation: bump .45s var(--ease-pop); }
@keyframes bump { 30% { transform: scale(1.6) rotate(-6deg); } }
@keyframes pulse { 50% { transform: scale(1.12); } }

.card {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1cqmin 2cqw 3cqmin;
}
.card-fit {
  flex: 0 1 auto;
  height: 62%;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* held upright, the name runs out of width long before height: keep the clue close */
@container (orientation: portrait) {
  .card-fit { height: 40%; }
  .card-clue { font-size: clamp(16px, 5cqw, 24px); }
}
.card-name {
  margin: 0;
  width: 100%;
  font-size: 120px;
  font-weight: 800;
  font-stretch: 78%;
  line-height: .9;
  letter-spacing: -.025em;
  text-wrap: balance;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}
.card-clue {
  margin: 2.5cqmin 0 0;
  max-width: 36ch;
  font-size: clamp(14px, 4.4cqmin, 28px);
  font-weight: 500;
  line-height: 1.25;
  opacity: .72;
  text-wrap: balance;
}
.card.anim .card-name { animation: card-in .32s var(--ease-pop) both; }
.card.anim .card-clue { animation: rise .35s .06s var(--ease-out) both; }
@keyframes card-in { from { transform: translateY(18%) scale(.94); opacity: 0; } }

.controls {
  display: flex;
  width: 100%;
  gap: 2.5cqmin;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}
.ctl {
  appearance: none;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  min-height: clamp(52px, 15cqmin, 76px);
  border: 2px solid currentColor;
  border-radius: 999px;
  background: transparent;
  font-size: clamp(17px, 5cqmin, 26px);
  font-weight: 700;
  letter-spacing: -.01em;
  transition: transform .1s;
}
.ctl:active { transform: scale(.97); }
.ctl svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ctl-funded { background: var(--k); color: var(--c); border-color: var(--k); }

/* funded / pass / time stamp */
.flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3cqmin;
  padding: 24px;
  text-align: center;
}
.flash.show { display: flex; }
.flash[data-kind="funded"] { background: var(--funded); color: var(--funded-ink); }
.flash[data-kind="pass"] { background: var(--pass); color: var(--pass-ink); }
.flash[data-kind="end"] { background: var(--ink); color: var(--paper); }
.stamp {
  padding: .06em .28em .12em;
  border: max(5px, 1.5cqmin) solid currentColor;
  border-radius: .14em;
  font-size: min(26cqmin, 20cqw);
  font-weight: 800;
  font-stretch: 78%;
  line-height: 1;
  letter-spacing: -.03em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(-5deg);
}
.stamp { margin: 1cqmin 0 3cqmin; }
.flash[data-kind="end"] .stamp { font-size: min(17cqmin, 11.5cqw); }
.stamp.anim { animation: stamp .3s var(--ease-pop) both; }
.flash[data-kind="pass"] .stamp.anim { animation: stamp .3s var(--ease-pop) both, shake .4s .26s ease-out both; }
@keyframes shake { 0%, 100% { translate: 0; } 20% { translate: -4% 0; } 40% { translate: 3.5% 0; } 60% { translate: -2.5% 0; } 80% { translate: 1.5% 0; } }
@keyframes stamp { from { transform: rotate(-14deg) scale(1.8); opacity: 0; } to { transform: rotate(-5deg) scale(1); opacity: 1; } }
.flash-name { margin: 0; font-size: clamp(16px, 6cqmin, 36px); font-weight: 700; letter-spacing: -.02em; opacity: .8; }
.flash-line { margin: 0; font-size: clamp(11px, 3.4cqmin, 16px); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.flash-streak {
  margin: 0;
  padding: .55em 1em;
  border-radius: 999px;
  background: currentColor;
  font-size: clamp(11px, 3.4cqmin, 16px);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  animation: count-pop .4s .1s var(--ease-pop) both;
}
.flash-streak span { color: var(--funded); }
.flash-wait { margin: 0; font-size: clamp(11px, 3cqmin, 14px); letter-spacing: .1em; text-transform: uppercase; opacity: .75; animation: pulse-o 1.2s ease-in-out infinite; }
@keyframes pulse-o { 50% { opacity: .35; } }

/* cash that flies out of a Funded */
.fx { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.bill, .coin {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  font: 800 3.4cqmin/1 var(--display);
  will-change: transform, opacity;
}
.bill {
  width: 11cqmin;
  height: 5.8cqmin;
  border: .5cqmin solid #0B5E37;
  border-radius: .8cqmin;
  background: #E4F6D6;
  color: #0B5E37;
  box-shadow: inset 0 0 0 .5cqmin #E4F6D6, inset 0 0 0 .75cqmin #7FCB9B, .4cqmin .5cqmin 0 rgba(3, 23, 13, .25);
}
.coin {
  width: 6.2cqmin;
  height: 6.2cqmin;
  border: .5cqmin solid #8A6400;
  border-radius: 50%;
  background: #FFD23F;
  color: #6B4E00;
  box-shadow: inset 0 0 0 .5cqmin #FFE58A, .4cqmin .5cqmin 0 rgba(3, 23, 13, .25);
}

/* pause */
.pause-panel {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2cqmin;
  padding: 24px;
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  color: var(--paper);
  text-align: center;
}
.stage.paused .pause-panel { display: flex; }
.pause-panel h2 { margin: 0; font-size: clamp(36px, 13cqmin, 88px); font-weight: 800; font-stretch: 80%; letter-spacing: -.04em; line-height: .9; }
.pause-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 3cqmin; }
.pause-panel .cta { background: var(--paper); color: var(--ink); border-color: var(--paper); box-shadow: none; }

/* ───────── RESULTS ───────── */
.results { background: var(--paper); }
.res-head { position: relative; padding: 24px 0 4px; }
@media (min-width: 720px) { .res-head { padding-top: 48px; } }
.res-score { position: relative; display: flex; align-items: flex-end; align-items: last baseline; gap: 16px; }
.res-num {
  font-size: clamp(132px, 30vw, 260px);
  font-weight: 800;
  font-stretch: 75%;
  line-height: .76;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
  animation: count-pop .7s var(--ease-pop) both;
}
.res-label { padding-bottom: .1em; font-size: clamp(24px, 4.4vw, 40px); font-weight: 700; line-height: .95; letter-spacing: -.03em; }
.best-stamp {
  align-self: flex-start;
  margin-left: auto;
  padding: 6px 12px 8px;
  border: 3px solid var(--funded);
  border-radius: 8px;
  color: #0C8A55;
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.01em;
  transform: rotate(6deg);
  animation: stamp .35s .45s var(--ease-pop) both;
}
.res-verdict { margin: 22px 0 0; font-size: clamp(26px, 4.6vw, 44px); font-weight: 700; letter-spacing: -.03em; line-height: 1.02; text-wrap: balance; }
.res-meta { margin: 10px 0 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.res-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; }
.res-actions .short { display: none; }
.res-num.counting { animation: none; }

.rain { position: fixed; inset: 0; z-index: 80; pointer-events: none; overflow: hidden; }
.rain .bill, .rain .coin { top: -40px; font-size: 13px; }
.rain .bill { width: 52px; height: 28px; border-width: 2px; border-radius: 5px; box-shadow: inset 0 0 0 2px #E4F6D6, inset 0 0 0 3.5px #7FCB9B, 2px 3px 0 rgba(21, 20, 19, .2); }
.rain .coin { width: 28px; height: 28px; border-width: 2px; box-shadow: inset 0 0 0 2px #FFE58A, 2px 3px 0 rgba(21, 20, 19, .2); }

.cap-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 48px 0 12px; }
.cap { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.cap li {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  animation: rise .4s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 30ms + 200ms);
}
.cap .no { font: 500 11px var(--mono); color: var(--muted); }
.cap .nm { font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.cap .nm small { display: block; margin-top: 3px; font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.cap .tag {
  padding: 6px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font: 600 10.5px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cap li.is-funded .tag { background: var(--funded); border-color: var(--ink); }
.cap li.is-pass .nm, .cap li.is-time .nm { color: var(--muted); }
.cap li.is-pass .tag, .cap li.is-time .tag { color: var(--muted); border-color: var(--line); }
.cap-empty { padding: 20px 0; color: var(--muted); font-size: 16px; }

/* toast + debug */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 95;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  text-align: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  letter-spacing: .02em;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.debug {
  position: fixed;
  left: 8px;
  bottom: 8px;
  z-index: 96;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .75);
  color: #9f9;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre;
  pointer-events: none;
}

/* ───────── phones ───────── */
@media (max-width: 559px) {
  .top { padding-bottom: 10px; }
  .brand { font-size: 18px; }
  .brand-mark { width: 30px; height: 30px; }
  .hero { padding-top: 14px; }
  .eyebrow { font-size: 11px; margin-bottom: 12px; }
  .headline { font-size: clamp(44px, 13.6vw, 64px); }

  .settings { margin-top: 26px; padding: 12px 0; }
  .set { width: 100%; justify-content: space-between; }
  .seg button { min-height: 40px; min-width: 62px; font-size: 15px; }

  .decks-head { margin: 26px 0 12px; }
  .decks { grid-template-columns: 1fr; gap: 10px; }
  .deck {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "title icon" "short icon" "foot foot";
    column-gap: 14px;
    row-gap: 4px;
    min-height: 0;
    padding: 16px 16px 12px;
    border-radius: 20px;
  }
  .deck-top { display: contents; }
  .deck-no { display: none; }
  .deck-icon { grid-area: icon; align-self: center; width: 54px; height: 54px; }
  .deck-title { grid-area: title; margin: 0; font-size: 30px; }
  .deck-short { grid-area: short; font-size: 15px; }
  .deck-foot { grid-area: foot; margin-top: 10px; }

  /* ready: start button stays under your thumb */
  .ready .wrap { padding-bottom: 0; }
  .ready-body { align-items: start; align-content: start; padding-top: 0; }
  .ready-art { width: min(250px, 62vw); margin: -4px 0 4px; }
  .ready-title { font-size: clamp(48px, 15vw, 72px); }
  .ready-short { margin-top: 10px; }
  .rules { margin-top: 20px; }
  .ready-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 20px calc(-1 * max(16px, env(safe-area-inset-right))) 0 calc(-1 * max(16px, env(safe-area-inset-left)));
    padding: 12px max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: var(--c);
  }
  .ready-actions .cta { flex: 1; min-height: 62px; font-size: 20px; }

  .res-num { font-size: clamp(120px, 40vw, 180px); }
  .res-verdict { margin-top: 18px; }
  .cap-head { margin-top: 36px; }
  .cap .nm { font-size: 19px; }
  .cap .nm small { font-size: 13px; }
}
@media (max-width: 559px) and (max-height: 700px) {
  .ready-art { width: min(190px, 50vw); }
  .ready-title { font-size: clamp(44px, 13vw, 60px); }
}

/* results on any phone (upright or sideways): replay bar pinned under your thumb */
@media (max-width: 559px), (orientation: landscape) and (max-height: 520px) {
  .results .wrap { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .res-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 8px;
    margin: 0;
    padding: 10px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: var(--paper);
    border-top: 1.5px solid var(--ink);
  }
  .res-actions .cta { order: 3; min-height: 52px; padding: 0 16px; box-shadow: none; }
  .res-actions .ghost { min-height: 52px; padding: 0 16px; font-size: 16px; }
  .res-actions .long { display: none; }
  .res-actions .short { display: inline; }
}

/* phone on its side, before a round: copy left, rules + start right */
@media (orientation: landscape) and (max-height: 520px) {
  .ready .top { padding-bottom: 6px; }
  .ready-body { align-items: center; padding: 0 0 12px; }
  .ready-copy {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    grid-template-rows: auto auto 1fr;
    column-gap: 36px;
    align-items: start;
  }
  .ready-copy .eyebrow { grid-column: 1; grid-row: 1; margin-bottom: 8px; }
  .ready-title { grid-column: 1; grid-row: 2; font-size: clamp(40px, 8.4vw, 76px); }
  .ready-short { grid-column: 1; grid-row: 3; font-size: 16px; }
  .rules { grid-column: 2; grid-row: 1 / 3; margin: 0; gap: 8px; }
  .ready-actions { grid-column: 2; grid-row: 3; margin-top: 14px; }
  .ready-actions .cta { width: 100%; }
  .res-num { font-size: clamp(110px, 24vw, 200px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
