/* The base page: one night stage in navy and gold, with a small working copy of the game up top. */
:root {
  --stage: #10245c; --panel: #1a3580; --panel-edge: #3a5cb8; --gold: #ffc72c; --gold-deep: #e8aa00; --gold-soft: #ffe7a3; --gold-ink: #2a1c00;
  --text: #f4f7ff; --muted: #c3cfee; --danger: #ffb4a8; --danger-ink: #7a1408;
  /* Every gold prop sits the same height off the stage, lit from above. */
  --lift: 0 12px 22px rgb(3 8 30 / 0.5);
  /* One type scale: show titles, section titles, card titles, then body. */
  --title-xl: clamp(2.25rem, 4.4vw, 4rem); --title: clamp(2rem, 3.8vw, 3.25rem); --title-s: clamp(1.25rem, 2vw, 1.6rem);
  --bulb: radial-gradient(circle, #fff8d8 0 3px, #ffc72c 4.5px, rgb(255 199 44 / 0.35) 6px, transparent 8px);
  --bulb-off: radial-gradient(circle, #2a3768 0 3.5px, rgb(255 199 44 / 0.12) 4.5px, transparent 5.5px);
  --display: "Bowlby One", "Arial Black", sans-serif;
  --body: "Nunito", -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: dark;
  scrollbar-color: var(--panel-edge) var(--stage);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--stage); color: var(--text); font: 500 1.0625rem/1.45 var(--body); overflow-x: clip; }
::selection { background: var(--gold); color: var(--gold-ink); }
h1, h2 { margin: 0; font-family: var(--display); font-weight: 400; text-wrap: balance; }
p, ol, ul, figure { margin: 0; padding: 0; }
a { color: var(--gold); font-weight: 800; text-underline-offset: 0.2em; }
/* Keyboard focus glows like a marquee bulb. */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; box-shadow: 0 0 0 6px rgb(255 199 44 / 0.22), 0 0 22px 4px rgb(255 199 44 / 0.45); }
[tabindex="-1"]:focus-visible { outline: none; }
img { display: block; max-width: 100%; height: auto; }
/* A faint film grain keeps the navy from looking flat. */
body::after { content: ""; position: fixed; z-index: 9; inset: 0; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); }

/* The cast peeks over the top of the form ticket. */
.ticket-stage { width: 100%; min-width: 0; text-align: left; }
.heads { display: flex; justify-content: space-around; height: clamp(58px, 7vw, 85px); overflow: hidden; }
.heads img { width: min(24%, 106px); height: auto; align-self: flex-start; transform: translateY(34%); transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1); }
.heads img:nth-child(even) { scale: -1 1; }
.heads img:nth-child(2) { transition-delay: 50ms; }
.heads img:nth-child(3) { transition-delay: 100ms; }
.heads img:nth-child(4) { transition-delay: 150ms; }
.ticket-stage.awake .heads img { transform: translateY(16%); }
.ticket-stage.ready .heads img { transform: translateY(0); }

/* The shadow sits on a wrapper, because a mask would cut it off. Each part of the ticket is cut on its own. */
.ticket-shadow { filter: drop-shadow(var(--lift)); }
.ticket { --notch: 12px; display: grid; grid-template-columns: minmax(0, 1fr); color: var(--gold-ink); color-scheme: light; }
.ticket-main, .ticket-stub { background: var(--gold); mask-composite: intersect; }
.ticket-main {
  border-radius: 14px 14px 0 0;
  mask-image: radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000), radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000);
}
.ticket-stub {
  border-radius: 0 0 14px 14px;
  mask-image: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000), radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000);
  transition: transform 460ms cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: 100% 0;
}
.ticket-stub.torn { transform: translateY(8px) rotate(-3deg); }
.used-stamp { justify-self: center; padding: 6px 14px; font: 400 clamp(1.25rem, 2.2vw, 1.75rem)/1.1 var(--display); color: var(--stage); border: 4px solid var(--stage); border-radius: 8px; transform: rotate(-8deg); }
.ticket h2 { font-size: var(--title-s); line-height: 1.15; }
.ticket-main { display: grid; gap: 14px; padding: clamp(18px, 2.4vw, 30px); align-content: start; }
.ticket-stub { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 14px clamp(18px, 2.4vw, 30px); border-top: 2px dashed rgb(42 28 0 / 0.55); background: var(--gold-soft); }
.ticket-stub h2 { font-size: 1rem; }
.ticket-stub .btn { min-height: 44px; padding: 8px 18px; font-size: 1rem; }
.ticket-stub .used-stamp { margin-inline: auto; }
.ticket input { background: #fffaf0; color: var(--gold-ink); border-color: var(--gold-ink); caret-color: var(--gold-ink); }
.ticket input::placeholder { color: #5c4500; }
.ticket .problem { color: var(--danger-ink); }
.ticket :focus-visible, .ask :focus-visible { outline-color: var(--stage); box-shadow: 0 0 0 6px rgb(16 36 92 / 0.22), 0 0 18px 2px rgb(16 36 92 / 0.35); }
.ticket ::selection { background: var(--stage); color: var(--text); }

/* Trying the game */
.try { display: grid; gap: clamp(20px, 3vw, 44px); grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); align-items: center; padding: clamp(24px, 5vw, 64px) var(--gutter); max-width: 92rem; margin-inline: auto; }
.try h2 { font-size: var(--title); line-height: 1.05; margin-bottom: 14px; }
.try p { max-width: 32em; font-size: 1.125rem; }

.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
label { position: relative; display: grid; gap: 6px; font-weight: 700; align-content: start; }
label small { font-weight: 500; color: inherit; opacity: 0.85; }
input {
  width: 100%; min-width: 0; min-height: 52px; padding: 10px 12px; border-radius: 8px; font: 700 1.0625rem/1.2 var(--body);
  color: var(--text); background: var(--stage); border: 2px solid var(--panel-edge); caret-color: var(--gold);
}
input::placeholder { color: var(--muted); opacity: 0.8; font-weight: 500; }
.code-input { letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 12px 24px; border: 0; border-radius: 8px;
  font: 800 1.125rem/1.2 var(--body); text-decoration: none; cursor: pointer; transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1), background-color 160ms;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { cursor: default; opacity: 0.6; }
.btn.quiet { background: transparent; color: inherit; border: 2px solid currentColor; }
.btn.quiet:hover { background: rgb(42 28 0 / 0.1); }
.btn.dark { background: var(--stage); color: var(--text); text-align: center; }
.btn.dark:hover:not(:disabled) { background: var(--panel); }
.problem:empty { display: none; }
.problem { color: var(--danger); font-weight: 700; }
.saved-note { font-weight: 700; }
.saved-link { display: grid; gap: 12px; }
.saved-link .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.saved-link .actions .btn { flex: 1 1 12rem; }
.send-to-me { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-weight: 700; }
.send-link { min-height: 44px; display: inline-flex; align-items: center; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ask-price { margin-top: 10px; font-weight: 700; }

/* The little game: a TV, and a phone leaning on it */
.demo { position: relative; padding-bottom: clamp(72px, 9vw, 124px); padding-right: clamp(36px, 8vw, 120px); container-type: inline-size; }
.tv { padding: 2.2cqw; background: #050b24; border-radius: 2.6cqw; box-shadow: 0 1.6cqw 4cqw rgb(3 8 30 / 0.55); }
.tv-screen { display: grid; gap: 2.2cqw; padding: 3cqw; background: var(--stage); border-radius: 1cqw; aspect-ratio: 16 / 10; align-content: space-between; border: 1px solid var(--panel-edge); }
.tv-scores { display: flex; justify-content: center; gap: 2cqw; font-size: max(0.75rem, 2cqw); font-weight: 800; }
.tv-scores span { display: flex; gap: 1.6cqw; padding: 0.5cqw 1.6cqw; background: var(--panel); border-radius: 0.8cqw; }
.tv-scores b { color: var(--gold); font-variant-numeric: tabular-nums; }
/* The TV shows a Tap to Race heat: sky, grass, two curbed lanes and a checkered finish. */
.tv-screen.race { align-content: space-between; gap: 1.2cqw; background: linear-gradient(#8fd4ff, #c9ecff 33%, #6cc04a 33.2%, #4f9e35); }
.race .tv-scores span { background: rgb(10 23 64 / 0.85); }
.race-title { justify-self: center; width: 25cqw; height: auto; filter: drop-shadow(0 0.6cqw 0.6cqw rgb(3 8 30 / 0.35)); }
.race-track { display: grid; padding: 1cqw 0; background: #56708f; border-block: 1cqw solid transparent; border-image: repeating-linear-gradient(90deg, #e2493b 0 4cqw, #fff4e4 4cqw 8cqw) 1; position: relative; }
.race-track::before { content: ""; position: absolute; top: 0; bottom: 0; left: 8.4cqw; width: 0.8cqw; background: #ffd84a; }
.race-track::after { content: ""; position: absolute; top: 0; bottom: 0; right: 1.2cqw; width: 2cqw; background: conic-gradient(#111 25%, #fff 0 50%, #111 0 75%, #fff 0) 0 0 / 1cqw 1cqw; }
.lane { position: relative; height: 10.5cqw; }
.lane + .lane { border-top: 0.4cqw dashed rgb(255 255 255 / 0.7); }
.race-car { --at: 0; position: absolute; z-index: 1; bottom: 0.2cqw; left: calc(9.6cqw + var(--at) * (100% - 25.6cqw)); width: 12cqw; height: auto; filter: drop-shadow(0 0.5cqw 0.4cqw rgb(3 8 30 / 0.4)); transition: left 220ms cubic-bezier(0.16, 1, 0.3, 1); }
.race-car.won { animation: car-win 600ms cubic-bezier(0.16, 1, 0.3, 1) 2; }
@keyframes car-win { 50% { translate: 0 -1.6cqw; } }
.lane-name { position: absolute; left: 1.2cqw; top: 50%; translate: 0 -50%; padding: 0.2cqw 1cqw; border-radius: 0.5cqw; background: var(--gold); color: var(--gold-ink); font-size: max(0.6875rem, 1.5cqw); font-weight: 800; }
.race .tv-status { justify-self: center; padding: 0.6cqw 2cqw; border-radius: 99px; background: rgb(10 23 64 / 0.85); }
.tv-status { text-align: center; color: var(--gold); font-size: max(0.8125rem, 2cqw); font-weight: 800; min-height: 1.4em; }
.phone {
  position: absolute; right: 0; bottom: 0; width: clamp(148px, 28cqw, 216px); display: grid; gap: 8px; padding: 12px;
  background: var(--panel); border: 5px solid #050b24; border-radius: 22px; box-shadow: 0 10px 28px rgb(3 8 30 / 0.6); transform: rotate(3deg);
}
.phone-name { font-weight: 800; line-height: 1.15; }
.phone-name small { display: block; font-weight: 500; font-size: 0.8125rem; color: var(--muted); }
.buzz {
  min-height: clamp(64px, 12cqw, 92px); border: 0; border-radius: 12px; cursor: pointer; font: 400 clamp(1.35rem, 4.4cqw, 1.9rem)/1 var(--display);
  background: var(--gold); color: var(--gold-ink); box-shadow: 0 6px 12px rgb(3 8 30 / 0.55); transition: transform 90ms, box-shadow 90ms, background-color 200ms;
}
.buzz:hover:not(:disabled) { background: #ffd24f; }
.buzz:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 4px rgb(3 8 30 / 0.55); }
.buzz:disabled { cursor: default; background: var(--panel-edge); color: var(--text); box-shadow: none; }
.phone-hint { text-align: center; font-size: 0.8125rem; font-weight: 700; color: var(--muted); }

/* A rail of marquee bulbs tops the dark sections below the demo, so the whole page reads as one theater. They light as you reach them (hero.css). */
.how, .lineup, .faq { background: var(--bulb-off) 0 0 / 38px 16px repeat-x; }

/* How it works */
.how, .games, .lineup, .faq { padding: clamp(40px, 7vw, 88px) var(--gutter); max-width: 92rem; margin-inline: auto; }
.how h2, .games h2, .lineup h2, .faq h2 { font-size: var(--title); line-height: 1.05; margin-bottom: clamp(20px, 3vw, 36px); }

/* The games: their own title art does the talking */

/* Asking for a code: the page's one big block of color */
.ask {
  border-top: 4px dashed var(--gold-ink); scroll-margin-top: 16px; display: grid; gap: clamp(20px, 4vw, 64px); grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start;
  padding: clamp(40px, 7vw, 88px) max(var(--gutter), calc((100vw - 92rem) / 2 + var(--gutter))); background: var(--gold); color: var(--gold-ink); color-scheme: light;
}
.ask h2 { font-size: var(--title-xl); line-height: 1.04; margin-bottom: 12px; }
.ask-copy p { font-size: 1.1875rem; font-weight: 700; max-width: 26em; }
.ask-form { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ask-form input { background: #fffaf0; color: var(--gold-ink); border-color: var(--gold-ink); caret-color: var(--gold-ink); }
.ask-form input::placeholder { color: #5c4500; }
.ask-form .problem, .ask-form .btn, .ask-done { grid-column: 1 / -1; }
.ask .problem { color: var(--danger-ink); }
.ask ::selection { background: var(--stage); color: var(--text); }
.ask-done { display: grid; gap: 6px; font-size: 1.1875rem; font-weight: 700; }
.ask-done strong { font: 400 clamp(1.5rem, 2.6vw, 2rem)/1.15 var(--display); }
.trap { position: absolute; left: -100vw; width: 1px; height: 1px; overflow: hidden; }

/* The cast standing on the stage floor, lit from the footlights */
.floor { position: relative; background: radial-gradient(ellipse 60% 70% at 50% 100%, rgb(255 199 44 / 0.12), transparent 70%); }
.cast { display: flex; justify-content: center; align-items: flex-end; gap: clamp(0px, 3vw, 48px); padding-top: clamp(56px, 8vw, 96px); }
.wood { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 20px; padding: 26px var(--gutter) max(22px, env(safe-area-inset-bottom, 0px)); background: var(--bulb) 0 0 / 38px 16px repeat-x, linear-gradient(#0a1740, #050b24); color: var(--muted); }
.wood strong { font: 400 1.25rem/1 var(--display); color: var(--gold); }
.wood a { color: var(--gold); display: inline-block; padding-block: 12px; }

@media (max-width: 60rem) {
  .try { grid-template-columns: minmax(0, 1fr); }
  .ask { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 34rem) {
  .ask-form { grid-template-columns: minmax(0, 1fr); }
}
/* Too narrow for the phone to lean on the TV without covering it, so it sits underneath. */
@container (max-width: 34rem) {
  .phone { position: static; width: 100%; margin-top: 14px; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); align-items: center; transform: none; }
  .phone-hint { grid-column: 1 / -1; }
}
@media (max-width: 34rem) {
  .demo { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .race-car, .buzz, .heads img, .ticket-stub { transition: none; }
  .ticket-stub.torn { transform: none; }
}
