/* Whitecap quiz. Sizes are design pixels on the 800 x 1280 canvas, written as
   calc(N * var(--u)). Values come from reference/tokens.css and reference/screens/. */

:root {
  /* One scale unit. Capped so a desktop browser shows a comfortable column. */
  --u: min(100vw / 800, 100vh / 1280, 1.25px);
  --vh: 100vh;

  --wc-blue-top: #2878bb;
  --wc-blue: #2a6fb2;
  --wc-navy: #1f3f8d;
  --wc-navy-deep: #142a63;
  --wc-ink: #0f1f45;
  --wc-gold: #e3b963;
  --wc-gold-light: #fde3ab;
  --wc-gold-on-white: #8a6418;

  --wc-white: #ffffff;
  --wc-surface-ba: #f4f7fb;
  --wc-tint: #e8f1fa;
  --wc-line: #d3deeb;
  --wc-muted: #4b5b7c;
  --wc-on-blue-muted: #dcecf8;
  --wc-scrim: rgba(5, 15, 45, 0.62);

  --wc-correct: #17804a;
  --wc-correct-mid: #2e9e62;
  --wc-correct-tint: #d9f2e3;
  --wc-wrong: #c8102e;
  --wc-wrong-soft: #e0384f;
  --wc-wrong-tint: #fde8eb;

  --wc-grad-player: linear-gradient(160deg, #2878bb 0%, #2a6fb2 45%, #1f3f8d 100%);
  --wc-grad-gold: linear-gradient(135deg, #fde3ab, #e3b963 60%, #d9a94c);
  --wc-grad-gold-text: linear-gradient(90deg, #e3b963, #fde3ab);

  --wc-font-cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --wc-font-body: 'Barlow', Arial, sans-serif;

  --wc-backdrop: #0b1736;
  --wc-min-touch: 48px; /* real CSS px floor, not scaled */
}

@supports (height: 100dvh) {
  :root {
    --u: min(100vw / 800, 100dvh / 1280, 1.25px);
    --vh: 100dvh;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--wc-backdrop);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--wc-font-body);
  color: var(--wc-white);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

h1, h2, h3, p { margin: 0; }
img, svg { display: block; }
button { font: inherit; color: inherit; }

/* The app column: the design's width, the full viewport height. */
#app {
  position: relative;
  width: calc(800 * var(--u));
  height: var(--vh);
  margin: 0 auto;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Keep content clear of a notch or camera cut-out when running full screen. */
  padding-top: env(safe-area-inset-top);
}
/* Screens with a BA panel pad the panel itself, so its background reaches the edge. */
.screen:not(:has(.ba-panel)) { padding-bottom: env(safe-area-inset-bottom); }

/* ---------- Backgrounds ---------- */

.bg-player {
  background:
    url(assets/wave.svg) 0 0 / calc(120 * var(--u)) calc(18 * var(--u)) repeat,
    var(--wc-grad-player);
  color: var(--wc-white);
}

.bg-ba {
  background: var(--wc-surface-ba);
  color: var(--wc-ink);
}

.bg-mid {
  background:
    url(assets/wave.svg) 0 0 / calc(120 * var(--u)) calc(18 * var(--u)) repeat,
    var(--wc-blue);
}

.gold-text {
  background: var(--wc-grad-gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Type scale (from tokens.css) ---------- */

.t-display-l { font-family: var(--wc-font-cond); font-weight: 700; font-size: calc(88 * var(--u)); line-height: calc(86 * var(--u)); text-transform: uppercase; letter-spacing: 0.01em; }
.t-display-m { font-family: var(--wc-font-cond); font-weight: 700; font-size: calc(76 * var(--u)); line-height: calc(76 * var(--u)); }
.t-headline-l { font-family: var(--wc-font-cond); font-weight: 700; font-size: calc(60 * var(--u)); line-height: calc(62 * var(--u)); }
.t-headline-m { font-family: var(--wc-font-cond); font-weight: 700; font-size: calc(50 * var(--u)); line-height: calc(54 * var(--u)); }
.t-title-l { font-family: var(--wc-font-cond); font-weight: 700; font-size: calc(40 * var(--u)); line-height: calc(44 * var(--u)); text-transform: uppercase; letter-spacing: 0.05em; }
.t-title-s { font-family: var(--wc-font-cond); font-weight: 700; font-size: calc(28 * var(--u)); line-height: calc(32 * var(--u)); text-transform: uppercase; letter-spacing: 0.04em; }
.t-body-l { font-weight: 600; font-size: calc(28 * var(--u)); line-height: calc(34 * var(--u)); }
.t-body-m { font-weight: 500; font-size: calc(22 * var(--u)); line-height: calc(30 * var(--u)); }
.t-body-s { font-weight: 500; font-size: max(11px, calc(18 * var(--u))); line-height: 1.33; }
.t-label { font-weight: 700; font-size: calc(16 * var(--u)); line-height: calc(20 * var(--u)); text-transform: uppercase; letter-spacing: 0.14em; }

/* ---------- Shared components ---------- */

/* Visible focus for keyboard users. */
:focus { outline: none; }
:focus-visible {
  outline: max(3px, calc(4 * var(--u))) solid var(--wc-gold);
  outline-offset: max(2px, calc(4 * var(--u)));
}

/* Player call to action: gold pill. */
.btn-gold {
  min-height: max(var(--wc-min-touch), calc(104 * var(--u)));
  padding: 0 calc(48 * var(--u));
  border: 0;
  border-radius: calc(52 * var(--u));
  background: var(--wc-grad-gold);
  color: var(--wc-navy);
  box-shadow: 0 calc(8 * var(--u)) calc(24 * var(--u)) rgba(10, 30, 80, 0.22);
  font-family: var(--wc-font-cond);
  font-weight: 700;
  font-size: calc(40 * var(--u));
  line-height: calc(44 * var(--u));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

/* BA action: navy, squarer, solid drop shadow. */
.btn-ba {
  min-height: max(var(--wc-min-touch), calc(104 * var(--u)));
  padding: 0 calc(40 * var(--u));
  border: 0;
  border-radius: calc(20 * var(--u));
  background: var(--wc-navy);
  color: var(--wc-white);
  box-shadow: 0 calc(6 * var(--u)) 0 var(--wc-navy-deep);
  font-family: var(--wc-font-cond);
  font-weight: 700;
  font-size: calc(40 * var(--u));
  line-height: calc(44 * var(--u));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.btn-ba:active { transform: translateY(calc(4 * var(--u))); box-shadow: 0 calc(2 * var(--u)) 0 var(--wc-navy-deep); }

/* BA screen header: mid blue with the wave and a gold rule. */
.ba-header {
  flex: none;
  height: calc(118 * var(--u)); /* 112 plus the 6 px rule */
  padding: 0 calc(32 * var(--u));
  display: flex;
  align-items: center;
  gap: calc(20 * var(--u));
  border-bottom: calc(6 * var(--u)) solid var(--wc-gold);
  color: var(--wc-white);
}
.ba-header .logo { width: calc(104 * var(--u)); height: calc(64 * var(--u)); }

/* Responsible-drinking strip, on every player-facing screen. */
.rd-strip {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(12 * var(--u));
  padding: calc(14 * var(--u)) calc(32 * var(--u));
  font-size: max(11px, calc(16 * var(--u)));
  line-height: 1.25;
  color: #eaf5fd;
  text-align: center;
}
.rd-strip .roundel {
  flex: none;
  width: max(24px, calc(34 * var(--u)));
  height: max(24px, calc(34 * var(--u)));
  border-radius: 50%;
  border: max(1.5px, calc(2 * var(--u))) solid var(--wc-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: max(9px, calc(13 * var(--u)));
}

/* ---------- Landscape on touch devices ---------- */

#turn { display: none; }

/* Set by app.js from the device orientation, not the viewport shape, so an
   open keyboard that shortens the viewport does not trigger it. */
html.is-landscape #app { display: none; }
html.is-landscape #turn {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    url(assets/wave.svg) 0 0 / 120px 18px repeat,
    var(--wc-grad-player);
  font-family: var(--wc-font-cond);
  font-weight: 700;
  font-size: 32px;
  text-align: center;
  color: var(--wc-white);
}

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

/* Headings take focus on screen change; they need no visible ring. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

/* Text fields must stay selectable for typing and caret placement on iOS. */
input, textarea { user-select: text; -webkit-user-select: text; }

/* ---------- Prize card (Pitch and Get ready) ---------- */

.prizes { align-self: stretch; display: flex; flex-direction: column; }
.prizes-title {
  margin: 0 0 calc(6 * var(--u));
  font-family: var(--wc-font-cond); font-weight: 700;
  font-size: calc(28 * var(--u)); line-height: calc(32 * var(--u));
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--wc-gold-light); text-align: center;
}
.prizes-lead { margin: 0 0 calc(24 * var(--u)); text-align: center; }
.prize-card {
  display: flex; gap: max(1px, calc(2 * var(--u)));
  background: #dbe6f2; border-radius: calc(24 * var(--u)); overflow: hidden;
  box-shadow: 0 calc(10 * var(--u)) calc(30 * var(--u)) rgba(10, 30, 80, 0.25);
}
.prize-col {
  flex: 1 1 0; min-width: 0;
  padding: calc(26 * var(--u)) calc(10 * var(--u)) calc(28 * var(--u));
  background: var(--wc-white);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: calc(4 * var(--u));
}
.prize-score { height: calc(72 * var(--u)); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: calc(4 * var(--u)); color: var(--wc-blue); white-space: nowrap; }
.prize-score b { font-family: var(--wc-font-cond); font-weight: 700; font-size: calc(48 * var(--u)); line-height: calc(48 * var(--u)); }
.prize-score span { font-weight: 700; font-size: max(10px, calc(16 * var(--u))); line-height: calc(20 * var(--u)); letter-spacing: 0.1em; text-transform: uppercase; }
.prize-rule { width: calc(48 * var(--u)); height: max(1px, calc(2 * var(--u))); margin: calc(14 * var(--u)) 0 calc(12 * var(--u)); background: #7d8ca6; }
.prize-icons { display: flex; gap: calc(8 * var(--u)); margin-bottom: calc(12 * var(--u)); }
.prize-icons img { width: calc(68 * var(--u)); height: calc(68 * var(--u)); border-radius: calc(16 * var(--u)); background: var(--wc-tint); }
.prize-name { font-weight: 500; font-size: calc(24 * var(--u)); line-height: calc(30 * var(--u)); color: var(--wc-ink); white-space: nowrap; }
.prize-or { font-size: max(10px, calc(18 * var(--u))); line-height: calc(24 * var(--u)); color: #5f6f8c; }
.prizes-note { margin: calc(16 * var(--u)) 0 0; text-align: center; color: var(--wc-on-blue-muted); }

/* ---------- BA panel and slide-to-start ---------- */

.ba-panel {
  flex: none;
  display: flex; flex-direction: column; gap: calc(18 * var(--u));
  padding: calc(22 * var(--u)) calc(32 * var(--u)) calc(28 * var(--u));
  padding-bottom: max(calc(28 * var(--u)), env(safe-area-inset-bottom));
  background: var(--wc-white); color: var(--wc-ink);
  border-top: calc(6 * var(--u)) solid var(--wc-gold);
}

.slider {
  --pad: calc(8 * var(--u));
  --knob: max(var(--wc-min-touch), calc(86 * var(--u)));
  position: relative;
  height: calc(var(--knob) + 2 * var(--pad));
  border-radius: 999px;
  background: var(--wc-tint);
  border: 1px solid #cfdcec;
  display: flex; align-items: center; justify-content: center;
  gap: calc(14 * var(--u));
  padding-left: calc(var(--knob) + var(--pad) + calc(2 * var(--u)));
  padding-right: calc(16 * var(--u));
  color: var(--wc-navy);
  overflow: hidden;
}
.slider-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: calc(var(--knob) + 2 * var(--pad));
  border-radius: 999px;
  background: #d5e4f4;
  pointer-events: none;
}
.slider-label {
  position: relative;
  font-family: var(--wc-font-cond); font-weight: 700;
  font-size: calc(34 * var(--u)); line-height: calc(38 * var(--u));
  letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}
.slider-chevrons { position: relative; flex: none; width: calc(44 * var(--u)); height: calc(24 * var(--u)); pointer-events: none; }
.slider-knob {
  position: absolute; left: var(--pad); top: var(--pad);
  width: var(--knob); height: var(--knob);
  padding: 0; border: 0; border-radius: 50%;
  background: var(--wc-navy);
  box-shadow: 0 calc(4 * var(--u)) calc(10 * var(--u)) rgba(20, 42, 99, 0.3);
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  touch-action: none;
  z-index: 1;
}
.slider-knob:active { cursor: grabbing; }
.slider-knob svg { width: 44%; height: 44%; }
.slider.is-springing .slider-knob,
.slider.is-springing .slider-fill { transition: transform 0.2s ease-out, width 0.2s ease-out; }
.slider.is-done .slider-knob,
.slider.is-done .slider-fill { transition: transform 0.2s ease-out, width 0.2s ease-out; }

/* ---------- Pitch ---------- */

.pitch-main {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: space-evenly;
  gap: calc(44 * var(--u));
  padding: calc(32 * var(--u)) calc(56 * var(--u)) calc(12 * var(--u));
}
.pitch-logo { width: calc(240 * var(--u)); height: calc(148 * var(--u)); }
.pitch-headline { text-align: center; }

/* Secondary player action: outlined pill. */
.btn-outline {
  min-height: max(var(--wc-min-touch), calc(88 * var(--u)));
  padding: 0 calc(44 * var(--u));
  border: max(2px, calc(3 * var(--u))) solid rgba(255, 255, 255, 0.7);
  border-radius: calc(44 * var(--u));
  background: transparent;
  color: var(--wc-white);
  font-family: var(--wc-font-cond); font-weight: 700;
  font-size: calc(34 * var(--u)); line-height: calc(38 * var(--u));
  text-transform: uppercase; letter-spacing: 0.06em;
  cursor: pointer;
}

.btn-gold { display: inline-flex; align-items: center; justify-content: center; gap: calc(14 * var(--u)); }
.btn-gold svg { width: calc(34 * var(--u)); height: calc(34 * var(--u)); flex: none; }
.btn-gold:disabled {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.75);
  box-shadow: none;
  cursor: default;
}
.btn-gold:disabled svg { display: none; }

/* ---------- Name ---------- */

.name-main {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; justify-content: center;
  gap: calc(28 * var(--u));
  padding: calc(36 * var(--u)) calc(64 * var(--u)) calc(8 * var(--u));
}
.name-logo { width: calc(150 * var(--u)); height: calc(92 * var(--u)); align-self: center; }
.name-heading { display: flex; flex-direction: column; align-items: center; gap: calc(10 * var(--u)); text-align: center; }
.name-title { text-transform: uppercase; }
.name-sub { color: #eaf5fd; }
.name-form { display: flex; flex-direction: column; gap: calc(28 * var(--u)); }
.name-label {
  margin-bottom: calc(-18 * var(--u));
  font-weight: 700; font-size: max(11px, calc(16 * var(--u))); line-height: calc(20 * var(--u));
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--wc-gold-light);
}
.name-input {
  height: max(var(--wc-min-touch), calc(100 * var(--u)));
  padding: 0 calc(32 * var(--u));
  border-radius: calc(22 * var(--u));
  border: max(2px, calc(4 * var(--u))) solid var(--wc-gold);
  background: var(--wc-white); color: var(--wc-ink);
  font-family: var(--wc-font-body); font-weight: 600;
  /* 16 px floor stops iOS zooming in on focus. */
  font-size: max(16px, calc(40 * var(--u)));
  outline: none;
  width: 100%;
}
.name-input::placeholder { color: #7d8ca6; font-weight: 500; }
.name-input:focus-visible { box-shadow: 0 0 0 calc(6 * var(--u)) rgba(227, 185, 99, 0.35); outline: none; }
.name-input.is-invalid { border-color: var(--wc-wrong-soft); }
.name-input.is-invalid:focus-visible { box-shadow: 0 0 0 calc(6 * var(--u)) rgba(224, 56, 79, 0.3); }
.name-error {
  display: flex; align-items: center; gap: calc(10 * var(--u));
  align-self: flex-start;
  margin-top: calc(-14 * var(--u));
  padding: calc(8 * var(--u)) calc(16 * var(--u));
  border-radius: calc(12 * var(--u));
  background: var(--wc-white); color: var(--wc-wrong);
  font-weight: 600; font-size: max(12px, calc(20 * var(--u))); line-height: 1.3;
}
.name-error[hidden] { display: none; }
.name-error svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); min-width: 14px; min-height: 14px; flex: none; }

/* Keyboard open: keep only what is needed to type and continue. */
.name-screen.is-compact .name-sub,
.name-screen.is-compact .rd-strip { display: none; }
.name-screen.is-compact .name-main { justify-content: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
/* The logo stays, smaller, so the BA can still hold it to end the game. */
.name-screen.is-compact .name-logo { width: 64px; height: 40px; flex: none; }
.name-screen.is-compact .name-title { font-size: calc(60 * var(--u)); line-height: 1; }

/* ---------- Get ready ---------- */

.ready-main {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: space-evenly;
  gap: calc(32 * var(--u));
  padding: calc(36 * var(--u)) calc(64 * var(--u)) calc(24 * var(--u));
}
.ready-logo { width: calc(130 * var(--u)); height: calc(80 * var(--u)); }
.ready-heading { display: flex; flex-direction: column; align-items: center; gap: calc(12 * var(--u)); text-align: center; }
.ready-title { text-transform: uppercase; }
.ready-rules { color: #eaf5fd; line-height: calc(32 * var(--u)); }
.ready-ring { --ring: max(112px, calc(200 * var(--u))); position: relative; flex: none; width: var(--ring); height: var(--ring); }
.ready-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ready-count { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ready-count .t-label { color: var(--wc-on-blue-muted); font-size: calc(var(--ring) * 0.08); line-height: 1.15; letter-spacing: 0.12em; }
.ready-count b { font-family: var(--wc-font-cond); font-weight: 600; font-size: calc(var(--ring) * 0.48); line-height: 0.96; }
.prizes-title.is-muted { color: var(--wc-on-blue-muted); }

/* ---------- Question ---------- */

.q-header {
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(36 * var(--u)) calc(64 * var(--u)) 0;
}
.q-score { width: calc(180 * var(--u)); display: flex; flex-direction: column; align-items: flex-start; }
.q-score b, .q-score span { color: var(--wc-on-blue-muted); }
.q-score b { font-family: var(--wc-font-cond); font-weight: 500; font-size: calc(38 * var(--u)); line-height: calc(38 * var(--u)); }
.q-score .t-label { font-size: max(9px, calc(16 * var(--u))); }
.q-logo { width: calc(150 * var(--u)); height: calc(92 * var(--u)); }
.q-player {
  width: calc(180 * var(--u)); min-width: 0;
  display: flex; align-items: center; justify-content: flex-end; gap: calc(10 * var(--u));
  font-weight: 600; font-size: max(11px, calc(22 * var(--u))); line-height: 1.35;
}
.q-player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-player svg {
  flex: none; box-sizing: content-box;
  width: calc(24 * var(--u)); height: calc(24 * var(--u));
  padding: calc(10 * var(--u)); border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.q-main {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; justify-content: center;
  gap: calc(40 * var(--u));
  padding: calc(8 * var(--u)) calc(64 * var(--u)) calc(16 * var(--u));
}
.q-pill-row { flex: none; height: calc(48 * var(--u)); margin: calc(20 * var(--u)) 0 calc(-20 * var(--u)); display: flex; justify-content: center; }
.q-pill {
  display: flex; align-items: center; gap: calc(10 * var(--u));
  height: calc(48 * var(--u)); padding: 0 calc(22 * var(--u));
  border-radius: 999px;
  font-family: var(--wc-font-cond); font-weight: 700;
  font-size: calc(28 * var(--u)); letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.q-pill svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); flex: none; }
.q-pill.is-locked { background: rgba(255, 255, 255, 0.16); color: var(--wc-white); }
.q-pill.is-right { background: var(--wc-correct); color: var(--wc-white); }
.q-pill.is-wrong { background: var(--wc-white); color: var(--wc-wrong); }

/* Room for three lines of question text, so nothing moves if it wraps. */
.q-block { flex: none; height: calc(176 * var(--u)); display: flex; align-items: center; }
.q-row { flex: 1; display: flex; align-items: flex-start; gap: calc(24 * var(--u)); }
.q-num {
  flex: none; align-self: flex-start; margin-top: calc(-9 * var(--u));
  width: calc(72 * var(--u)); height: calc(72 * var(--u)); border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--wc-font-cond); font-weight: 600; font-size: calc(28 * var(--u));
  color: var(--wc-on-blue-muted);
}
.q-text { flex: 1; text-align: left; }

.q-timer { flex: none; display: flex; align-items: center; gap: calc(12 * var(--u)); }
.q-timer-icon svg { width: calc(30 * var(--u)); height: calc(30 * var(--u)); }
.q-bar { flex: 1; height: calc(16 * var(--u)); border-radius: calc(8 * var(--u)); background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.q-bar span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--wc-gold); }
.is-frozen .q-bar span { background: rgba(255, 255, 255, 0.55); }
.q-secs { flex: none; width: calc(52 * var(--u)); font-family: var(--wc-font-cond); font-weight: 600; font-size: calc(34 * var(--u)); line-height: 1; font-variant-numeric: tabular-nums; }

.q-answers { flex: none; display: flex; flex-direction: column; gap: calc(20 * var(--u)); }
.answer {
  width: 100%; min-height: calc(136 * var(--u));
  padding: calc(20 * var(--u)) calc(28 * var(--u));
  border-radius: calc(24 * var(--u));
  display: flex; align-items: center; gap: calc(24 * var(--u));
  text-align: left;
  background: var(--wc-white); color: var(--wc-ink);
  border: 0;
  box-shadow: 0 calc(8 * var(--u)) calc(24 * var(--u)) rgba(10, 30, 80, 0.22);
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}
.answer:disabled { cursor: default; }
.answer-badge {
  flex: none; width: calc(64 * var(--u)); height: calc(64 * var(--u)); border-radius: 50%;
  background: var(--wc-tint); color: var(--wc-navy);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--wc-font-cond); font-weight: 700; font-size: calc(34 * var(--u));
}
.answer-badge svg { width: 56%; height: 56%; }
.answer-text { flex: 1; font-weight: 600; font-size: calc(28 * var(--u)); line-height: calc(34 * var(--u)); }

/* Borders are drawn inside with a shadow so the button never changes size. */
.answer.is-picked { box-shadow: inset 0 0 0 calc(5 * var(--u)) var(--wc-gold), 0 0 0 calc(6 * var(--u)) rgba(227, 185, 99, 0.3); }
.answer.is-picked .answer-badge { background: var(--wc-navy); color: var(--wc-white); }
.answer.is-dim { background: rgba(255, 255, 255, 0.5); color: #33435f; box-shadow: none; }
.answer.is-dim .answer-badge { background: rgba(255, 255, 255, 0.6); color: var(--wc-muted); }
.answer.is-correct { background: var(--wc-correct-tint); box-shadow: inset 0 0 0 calc(3 * var(--u)) var(--wc-correct-mid), 0 calc(8 * var(--u)) calc(24 * var(--u)) rgba(10, 30, 80, 0.22); }
.answer.is-correct .answer-badge { background: var(--wc-correct-mid); color: var(--wc-white); }
.answer.is-wrong { background: var(--wc-white); box-shadow: inset 0 0 0 calc(5 * var(--u)) var(--wc-wrong-soft); }
.answer.is-wrong .answer-badge { background: var(--wc-wrong-soft); color: var(--wc-white); }

/* Next question: a line of text under the answers. Its space is always
   reserved, so nothing moves when it appears. */
.q-next {
  flex: none;
  height: max(24px, calc(44 * var(--u)));
  margin-top: calc(-16 * var(--u));
  display: flex; align-items: center; justify-content: center;
  visibility: hidden;
}
.q-next.is-shown { visibility: visible; }
.q-next-text {
  font-family: var(--wc-font-cond); font-weight: 700;
  font-size: max(15px, calc(28 * var(--u))); line-height: 1;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--wc-white);
}
.q-next-text b { color: var(--wc-gold-light); }

/* ---------- Result (prize won) ---------- */

.result-main {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; justify-content: space-evenly;
  gap: calc(32 * var(--u));
  padding: calc(32 * var(--u)) calc(64 * var(--u)) calc(20 * var(--u));
  position: relative;
}
.result-logo { width: calc(130 * var(--u)); height: calc(80 * var(--u)); align-self: center; }
.result-heading { position: relative; display: flex; flex-direction: column; align-items: center; gap: calc(6 * var(--u)); text-align: center; }
.result-title { text-transform: uppercase; }
.result-sub { font-family: var(--wc-font-cond); font-weight: 500; font-size: calc(40 * var(--u)); line-height: calc(44 * var(--u)); color: var(--wc-on-blue-muted); }

.prize-won {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: calc(22 * var(--u));
  padding: calc(32 * var(--u)) calc(28 * var(--u)) calc(36 * var(--u));
  border-radius: calc(26 * var(--u));
  background: var(--wc-white); color: var(--wc-ink);
  box-shadow: 0 calc(12 * var(--u)) calc(32 * var(--u)) rgba(5, 15, 45, 0.35);
}
.prize-won-pics { display: flex; align-items: center; justify-content: center; gap: calc(20 * var(--u)); }
.prize-won-pic {
  flex: none; width: calc(200 * var(--u)); height: calc(200 * var(--u));
  border-radius: calc(24 * var(--u));
  background: linear-gradient(160deg, #f4f8fc, #e3edf7);
  display: flex; align-items: center; justify-content: center;
}
.prize-won-pic img { width: 76%; height: 76%; }
.prize-won-or { font-weight: 600; font-size: max(11px, calc(22 * var(--u))); color: #5f6f8c; }
.prize-won-text { display: flex; flex-direction: column; align-items: center; gap: calc(8 * var(--u)); }
.prize-won-label { font-weight: 700; font-size: max(10px, calc(16 * var(--u))); line-height: calc(18 * var(--u)); letter-spacing: 0.14em; text-transform: uppercase; color: var(--wc-gold-on-white); }
/* Two items on one line where they fit, never more than two lines. */
.prize-won-name { font-family: var(--wc-font-cond); font-weight: 700; font-size: calc(60 * var(--u)); line-height: calc(62 * var(--u)); color: var(--wc-navy); text-wrap: balance; }
.prize-won-name-or { font-weight: 500; color: var(--wc-muted); }
.result-handback { text-align: center; color: #eaf5fd; line-height: calc(32 * var(--u)); }

.result.is-top .prize-won {
  border: calc(4 * var(--u)) solid var(--wc-gold);
  box-shadow: 0 0 0 calc(8 * var(--u)) rgba(227, 185, 99, 0.25), 0 calc(12 * var(--u)) calc(32 * var(--u)) rgba(5, 15, 45, 0.35);
}
.result.is-top .prize-won-pic { background: linear-gradient(160deg, #fdf6e6, #fbe9c4); }

.sparkles { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.sparkles svg { position: absolute; height: auto; animation: twinkle 2.4s ease-in-out infinite; }
.sparkles svg:nth-child(2) { animation-delay: 0.8s; }
.sparkles svg:nth-child(3) { animation-delay: 1.6s; }
@keyframes twinkle { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.7) rotate(20deg); } }

.ba-note { font-weight: 700; font-size: max(12px, calc(22 * var(--u))); line-height: 1.2; color: var(--wc-ink); text-align: center; }

/* ---------- Thank you (no prize) ---------- */

.thanks-main {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: space-evenly;
  gap: calc(40 * var(--u));
  padding: calc(36 * var(--u)) calc(64 * var(--u)) calc(24 * var(--u));
  text-align: center;
}
.thanks-ring {
  --ring: max(120px, calc(220 * var(--u)));
  width: var(--ring); height: var(--ring); border-radius: 50%;
  border: calc(var(--ring) * 0.027) solid rgba(255, 255, 255, 0.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--ring) * 0.02);
  color: var(--wc-on-blue-muted);
}
.thanks-ring b { font-family: var(--wc-font-cond); font-weight: 500; font-size: calc(var(--ring) * 0.436); line-height: 0.92; }
.thanks-ring .t-label { font-size: calc(var(--ring) * 0.073); }
.thanks-heading { display: flex; flex-direction: column; align-items: center; gap: calc(14 * var(--u)); }
.thanks-title { text-transform: uppercase; }
.thanks-message { max-width: calc(560 * var(--u)); font-size: max(13px, calc(28 * var(--u))); line-height: 1.22; color: #eaf5fd; }

/* ---------- Code boxes and keypad ---------- */

.code-boxes { display: flex; justify-content: center; gap: calc(12 * var(--u)); }
.code-box {
  width: calc(76 * var(--u)); height: calc(92 * var(--u));
  border-radius: calc(16 * var(--u));
  background: var(--wc-white);
  border: max(1px, calc(2 * var(--u))) solid var(--wc-line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--wc-font-cond); font-weight: 600; font-size: calc(48 * var(--u));
  color: var(--wc-navy);
}
.code-box.is-next { border: max(2px, calc(3 * var(--u))) solid var(--wc-navy); }
.code-boxes.is-error .code-box { border: max(2px, calc(3 * var(--u))) solid var(--wc-wrong-soft); }
.code-boxes.is-locked { opacity: 0.4; }
.code-boxes.is-shaking { animation: shake 0.4s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(calc(-14 * var(--u))); }
  40% { transform: translateX(calc(12 * var(--u))); }
  60% { transform: translateX(calc(-8 * var(--u))); }
  80% { transform: translateX(calc(5 * var(--u))); }
}

.keypad { align-self: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(16 * var(--u)); }
.key {
  height: max(var(--wc-min-touch), calc(104 * var(--u)));
  padding: 0;
  border-radius: calc(20 * var(--u));
  background: var(--wc-white);
  border: 1px solid var(--wc-line);
  box-shadow: 0 calc(2 * var(--u)) 0 var(--wc-line);
  color: var(--wc-navy);
  font-family: var(--wc-font-cond); font-weight: 600; font-size: calc(48 * var(--u));
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.key:active { background: var(--wc-tint); transform: translateY(1px); box-shadow: none; }
.key-delete { background: transparent; border: 0; box-shadow: none; }
.key-delete svg { width: calc(44 * var(--u)); height: calc(44 * var(--u)); }
.keypad.is-locked { opacity: 0.35; }
.keypad.is-locked .key { cursor: default; }
.keypad.is-compact { gap: calc(12 * var(--u)); }
.keypad.is-compact .key { height: max(var(--wc-min-touch), calc(80 * var(--u))); font-size: calc(40 * var(--u)); }

/* ---------- Code screen ---------- */

.code-main {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: calc(22 * var(--u));
  padding: calc(32 * var(--u)) calc(64 * var(--u));
}
.code-heading { display: flex; flex-direction: column; align-items: center; gap: calc(10 * var(--u)); text-align: center; }
.code-title { color: var(--wc-navy); }
.code-sub { color: var(--wc-muted); }
/* Fixed slot under the boxes so the keypad never moves. */
.code-msg {
  min-height: calc(28 * var(--u));
  display: flex; align-items: center; justify-content: center; gap: calc(10 * var(--u));
  font-weight: 600; font-size: max(12px, calc(22 * var(--u))); line-height: 1.27;
  color: var(--wc-wrong); text-align: center;
}
.code-msg svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); min-width: 14px; min-height: 14px; flex: none; }
.code-lock {
  align-self: stretch;
  display: flex; align-items: center; gap: calc(20 * var(--u));
  padding: calc(22 * var(--u)) calc(26 * var(--u));
  border-radius: calc(18 * var(--u));
  background: var(--wc-wrong-tint); color: #8f0b21;
}
.code-lock[hidden] { display: none; }
.code-lock-icon {
  flex: none; width: calc(56 * var(--u)); height: calc(56 * var(--u)); border-radius: 50%;
  background: var(--wc-wrong-soft); display: flex; align-items: center; justify-content: center;
}
.code-lock-icon svg { width: 54%; height: 54%; }
.code-lock b { display: block; font-size: max(13px, calc(22 * var(--u))); line-height: 1.27; }
.code-lock span span { display: block; font-size: max(12px, calc(18 * var(--u))); line-height: 1.33; }

/* ---------- Overlays: end-game sheet and "Still there?" ---------- */

/* Hold-to-end logo: no long-press menu, no text selection, no drag. */
[data-end-game] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: none; }

.overlay { position: absolute; inset: 0; z-index: 10; }
.overlay-scrim { position: absolute; inset: 0; background: var(--wc-scrim); }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: calc(18 * var(--u)) calc(64 * var(--u)) max(16px, calc(44 * var(--u)), env(safe-area-inset-bottom));
  border-radius: calc(32 * var(--u)) calc(32 * var(--u)) 0 0;
  background: var(--wc-surface-ba); color: var(--wc-ink);
  display: flex; flex-direction: column; align-items: center; gap: calc(22 * var(--u));
  box-shadow: 0 calc(-10 * var(--u)) calc(40 * var(--u)) rgba(5, 15, 45, 0.35);
  animation: sheet-in 0.22s ease-out;
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle { width: calc(64 * var(--u)); height: max(4px, calc(6 * var(--u))); border-radius: 3px; background: #c3cfde; }
.sheet-heading { display: flex; flex-direction: column; align-items: center; gap: calc(8 * var(--u)); text-align: center; }
.sheet-kicker { color: var(--wc-blue); font-size: max(10px, calc(16 * var(--u))); line-height: 1.15; }
.sheet-title {
  font-family: var(--wc-font-cond); font-weight: 700;
  font-size: calc(60 * var(--u)); line-height: calc(62 * var(--u));
  color: var(--wc-navy);
}
.sheet-text { max-width: calc(560 * var(--u)); font-size: max(13px, calc(22 * var(--u))); line-height: 1.32; color: var(--wc-muted); }
.sheet .code-box {
  width: max(34px, calc(60 * var(--u))); height: max(40px, calc(72 * var(--u)));
  font-size: max(20px, calc(38 * var(--u)));
}
.sheet .keypad { align-self: center; width: max(216px, calc(480 * var(--u))); }
.sheet-actions { align-self: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(16 * var(--u)); }
.sheet-actions .btn-ba, .btn-ba-outline {
  min-height: max(var(--wc-min-touch), calc(96 * var(--u)));
  padding: 0 calc(16 * var(--u));
  font-size: calc(34 * var(--u)); line-height: 1;
}
.btn-ba-outline {
  border: max(2px, calc(3 * var(--u))) solid var(--wc-navy);
  border-radius: calc(20 * var(--u));
  background: transparent; color: var(--wc-navy);
  font-family: var(--wc-font-cond); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  cursor: pointer;
}
.btn-ba-outline:active { background: var(--wc-tint); }
.sheet-actions .btn-ba:disabled { opacity: 0.6; cursor: default; }

.still {
  position: absolute; left: calc(80 * var(--u)); right: calc(80 * var(--u)); top: calc(300 * var(--u));
  padding: calc(48 * var(--u)) calc(48 * var(--u)) calc(44 * var(--u));
  border-radius: calc(32 * var(--u));
  background: var(--wc-white); color: var(--wc-ink);
  display: flex; flex-direction: column; align-items: center; gap: calc(24 * var(--u));
  text-align: center;
  box-shadow: 0 calc(20 * var(--u)) calc(60 * var(--u)) rgba(5, 15, 45, 0.4);
}
.still-ring { --ring: max(72px, calc(120 * var(--u))); position: relative; width: var(--ring); height: var(--ring); flex: none; }
.still-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.still-count {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--wc-font-cond); font-weight: 600; font-size: calc(var(--ring) * 0.4); color: var(--wc-navy);
}
.still-title {
  font-family: var(--wc-font-cond); font-weight: 700; text-transform: uppercase;
  font-size: calc(60 * var(--u)); line-height: calc(62 * var(--u)); color: var(--wc-navy);
}
.still-text { font-size: max(13px, calc(22 * var(--u))); line-height: 1.41; color: var(--wc-muted); }
.still-stay { align-self: stretch; }
