/* Family Games. A neon game show in a living room: midnight stage, marquee bulbs, two team
   colours (pink for Team 1, cyan for Team 2) carried through every screen.

   Layout notes
   - The big screen sizes everything from --u, a unit tied to the smaller side of the screen, so
     a laptop and a 75 inch TV show the same picture.
   - Phones use ordinary rem sizes and safe-area padding.
   - body.calm (host switched flashing lights off) and prefers-reduced-motion both quiet the
     strobe, shake and chase effects. Nothing ever flashes faster than three times a second. */

@font-face { font-family: 'Bungee'; src: url('../fonts/bungee.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Bungee Shade'; src: url('../fonts/bungee-shade.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Rubik'; font-weight: 500; src: url('../fonts/rubik-500.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Rubik'; font-weight: 700; src: url('../fonts/rubik-700.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Rubik'; font-weight: 900; src: url('../fonts/rubik-900.woff2') format('woff2'); font-display: swap; }

:root {
  --bg0: #06031a; --bg1: #130a3d; --bg2: #2a0f5c;
  --ink: #ffffff; --dim: #b8b1e8; --line: rgba(255, 255, 255, .16);
  --a: #ff2e88; --a2: #ff8cc0;
  --b: #19e3ff; --b2: #9af4ff;
  --gold: #ffd23f; --lime: #9dff5c; --red: #ff3b4e; --violet: #8b5cff;
  --panel: rgba(255, 255, 255, .07);
  --display: 'Bungee', 'Arial Black', Impact, system-ui, sans-serif;
  --body: 'Rubik', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --u: clamp(7px, 1.6vmin, 24px);
  --tc: var(--gold); --tc2: #fff1a8;
}
.team-a { --tc: var(--a); --tc2: var(--a2); }
.team-b { --tc: var(--b); --tc2: var(--b2); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
body {
  background: radial-gradient(120% 90% at 50% -10%, var(--bg2) 0%, var(--bg1) 42%, var(--bg0) 100%) fixed;
  color: var(--ink); font-family: var(--body); font-weight: 500; line-height: 1.35;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; touch-action: pan-x pan-y;
}
h1, h2, h3, h4, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
b { font-weight: 900; }
#app { min-height: 100%; }

.boot { position: fixed; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 1.6rem; color: var(--gold); letter-spacing: .04em; animation: breathe 1.4s ease-in-out infinite; }
.kicker { font-size: .78em; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); }
.muted { color: var(--dim); }
.center { text-align: center; }

/* ---------------------------------------------------------------- shared parts */

.btn {
  display: flex; align-items: center; justify-content: center; gap: .5em; width: 100%;
  padding: .85em 1em; border-radius: 16px; border: 2px solid var(--line); background: var(--panel);
  font-weight: 900; font-size: 1rem; text-align: center; transition: transform .08s, filter .15s, background .15s;
}
.btn:active { transform: translateY(2px) scale(.985); filter: brightness(1.15); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: linear-gradient(180deg, #ffe169, var(--gold) 55%, #ff9f1c); color: #2a1500; border-color: #fff3b0; box-shadow: 0 6px 0 #a85d00, 0 12px 28px rgba(255, 190, 40, .35); }
.btn.primary:active { box-shadow: 0 3px 0 #a85d00; transform: translateY(3px); }
.btn.huge { font-family: var(--display); font-size: 1.35rem; padding: 1em .8em; letter-spacing: .02em; }
.btn.ghost { background: transparent; color: var(--dim); }
.btn.small { width: auto; padding: .55em .85em; font-size: .88rem; border-radius: 12px; }
.btn.square { width: 3.4rem; flex: none; font-size: 1.4rem; padding: .5em; }
.btn.gold { border-color: var(--gold); color: var(--gold); }
.btn.good { background: linear-gradient(180deg, #c6ff8f, var(--lime)); color: #0f2b00; border-color: #e3ffc4; }
.btn.bad { background: linear-gradient(180deg, #ff7785, var(--red)); color: #2b0005; border-color: #ffc2c8; }
.btn.team-a, .btn.team-b { border-color: var(--tc); color: var(--tc2); background: color-mix(in srgb, var(--tc) 18%, transparent); }
.link { background: none; border: 0; color: var(--gold); font-weight: 700; padding: .3em .2em; }

.field {
  width: 100%; padding: .8em .9em; border-radius: 14px; border: 2px solid var(--line);
  background: rgba(0, 0, 0, .35); font-size: 1.15rem; font-weight: 700; outline: none; min-width: 0;
}
.field:focus { border-color: var(--tc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tc) 30%, transparent); }
.field::placeholder { color: rgba(255, 255, 255, .35); }

.chips { display: flex; flex-wrap: wrap; gap: .6em; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: .4em; padding: .35em .9em; border-radius: 999px; background: var(--panel); border: 2px solid var(--line); font-weight: 700; white-space: nowrap; }
.chip.gold { border-color: var(--gold); color: var(--gold); }
.chip.finale { background: var(--gold); color: #2a1500; animation: breathe 1s ease-in-out infinite; }
.chip.warn { border-color: #ff9f1c; color: #ffc46b; }

.stamp {
  display: inline-block; padding: .2em .7em; border: .16em solid var(--lime); color: var(--lime); border-radius: .35em;
  font-family: var(--display); letter-spacing: .04em; text-transform: uppercase; transform: rotate(-6deg);
  animation: stamp .4s cubic-bezier(.2, 1.7, .4, 1) both; text-shadow: 0 0 18px currentColor; background: rgba(0, 0, 0, .35);
}
.hint { color: var(--dim); font-weight: 700; letter-spacing: .04em; }
.pulse { animation: breathe 1.6s ease-in-out infinite; }
.dots { display: inline-flex; gap: .18em; margin-left: .25em; }
.dots b { width: .22em; height: .22em; border-radius: 50%; background: currentColor; animation: dot 1s infinite; }
.dots b:nth-child(2) { animation-delay: .15s; }
.dots b:nth-child(3) { animation-delay: .3s; }

.dot { width: .7em; height: .7em; border-radius: 50%; background: #777; flex: none; display: inline-block; }
.dot.online { background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.dot.offline { background: var(--red); animation: breathe .8s infinite; }
.dot.connecting { background: var(--gold); animation: breathe .8s infinite; }

.ring { position: relative; width: 1em; height: 1em; font-size: calc(var(--u) * 30); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: rgba(0, 0, 0, .35); stroke: rgba(255, 255, 255, .12); stroke-width: 6; }
.ring-fill { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .12s linear, stroke .3s; filter: drop-shadow(0 0 6px currentColor); color: var(--gold); }
.ring.red .ring-fill { stroke: var(--red); color: var(--red); }
.ring.team-a .ring-fill, .ring.team-b .ring-fill { stroke: var(--tc); color: var(--tc); }
.ring-in { position: absolute; inset: 0; display: grid; place-items: center; font-size: .5em; }
.count-n { font-family: var(--display); line-height: 1; display: block; animation: count .9s cubic-bezier(.2, 1.4, .4, 1) both; text-shadow: 0 0 .25em rgba(255, 210, 63, .6); }

.lines { width: 100%; display: grid; gap: .3em; }
.lines li { display: flex; justify-content: space-between; gap: 1em; padding: .35em .7em; border-radius: .6em; background: rgba(0, 0, 0, .3); font-weight: 700; animation: rise .35s both; }
.lines li b { color: var(--lime); }
.lines li.neg b { color: var(--red); }
.lines li.pending b, .lines li.zero b { color: var(--dim); }

.progress { width: 100%; height: .7em; border-radius: 999px; background: rgba(0, 0, 0, .4); overflow: hidden; border: 1px solid var(--line); }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--a), var(--gold), var(--b)); transition: width .12s linear; }

.veil { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(4, 2, 18, .9); animation: fade .25s both; padding: 1.5rem; }
.veil-card { max-width: 34rem; text-align: center; display: grid; gap: .8rem; padding: 2rem; border-radius: 24px; border: 2px solid var(--line); background: rgba(20, 10, 60, .9); }
.veil-card h2 { font-family: var(--display); font-size: 1.6rem; color: var(--gold); }
.veil-big { font-family: var(--display); font-size: clamp(2rem, 9vmin, 7rem); color: var(--gold); animation: breathe 1.4s infinite; }
.veil.paused { z-index: 55; }
.arm-ic { font-size: 4rem; animation: bob 1.2s ease-in-out infinite; }
.toast-top, .toast { position: fixed; left: 50%; transform: translateX(-50%); z-index: 90; padding: .55em 1.1em; border-radius: 999px; background: #2b0d14; border: 2px solid var(--red); font-weight: 700; white-space: nowrap; animation: rise .25s both; }
.toast-top { top: .8rem; }
.toast { bottom: 5.2rem; max-width: 92vw; white-space: normal; text-align: center; }

#flash { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0; }
#flash.flash-white { background: #fff; animation: flash .55s ease-out; }
#flash.flash-gold { background: radial-gradient(circle, #fff 0, var(--gold) 45%, transparent 85%); animation: flash .8s ease-out; }
#flash.flash-red { background: radial-gradient(circle, transparent 35%, rgba(255, 20, 50, .75) 100%); animation: flash .7s ease-out; }
#flash.flash-a { background: var(--a); animation: flash-team .7s ease-out; }
#flash.flash-b { background: var(--b); animation: flash-team .7s ease-out; }
#flash.soft { animation-name: flash-soft; animation-duration: 1.4s; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 70; pointer-events: none; }

/* ---------------------------------------------------------------- backdrop */

.backdrop { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
/* Spotlights: soft-edged cones drawn with a conic gradient and faded with a mask. No blend modes
   or blur filters, which some TV browsers render badly (or slowly). */
.beam { position: absolute; top: -6vmax; left: 50%; width: 220vmax; height: 220vmax; margin-left: -110vmax; transform-origin: 50% 0; opacity: .55; -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 62%); mask-image: linear-gradient(to bottom, #000 0, transparent 62%); will-change: transform; }
.beam.b1 { background: conic-gradient(from 170deg at 50% 0, transparent 0deg, rgba(255, 46, 136, .5) 10deg, transparent 20deg); animation: sweep1 11s ease-in-out infinite alternate; }
.beam.b2 { background: conic-gradient(from 170deg at 50% 0, transparent 0deg, rgba(25, 227, 255, .45) 10deg, transparent 20deg); animation: sweep2 13s ease-in-out infinite alternate; }
.beam.b3 { background: conic-gradient(from 172deg at 50% 0, transparent 0deg, rgba(255, 210, 63, .32) 8deg, transparent 16deg); animation: sweep3 9s ease-in-out infinite alternate; }

.bulbs { position: fixed; inset: 0; z-index: 3; pointer-events: none; --s: calc(var(--u) * 2.6); --d: calc(var(--u) * 1.3); }
.bulbs::before, .bulbs::after { content: ''; position: absolute; inset: calc(var(--u) * .35); }
.bulbs::before {
  --dot: radial-gradient(circle, rgba(255, 210, 63, .32) 0 26%, transparent 32%);
  background: var(--dot) 0 0 / var(--s) var(--d) repeat-x, var(--dot) 0 100% / var(--s) var(--d) repeat-x, var(--dot) 0 0 / var(--d) var(--s) repeat-y, var(--dot) 100% 0 / var(--d) var(--s) repeat-y;
}
.bulbs::after {
  --dot: radial-gradient(circle, #fffbe0 0 22%, rgba(255, 210, 63, .85) 26% 34%, transparent 46%);
  --s2: calc(var(--s) * 2);
  background: var(--dot) 0 0 / var(--s2) var(--d) repeat-x, var(--dot) var(--s) 100% / var(--s2) var(--d) repeat-x, var(--dot) 0 var(--s) / var(--d) var(--s2) repeat-y, var(--dot) 100% 0 / var(--d) var(--s2) repeat-y;
  filter: drop-shadow(0 0 calc(var(--u) * .5) rgba(255, 200, 60, .9));
  animation: chase 1s step-end infinite;
}

/* ---------------------------------------------------------------- the front door */

.door { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; overflow: hidden; }
.door-in { position: relative; z-index: 2; width: min(60rem, 100%); display: grid; gap: 1.2rem; text-align: center; justify-items: center; }
.logo { font-family: 'Bungee Shade', var(--display); font-weight: 400; text-transform: uppercase; line-height: .95; color: var(--gold); text-shadow: 0 0 .35em rgba(255, 190, 40, .55), 0 .06em 0 #ff2e88; font-size: clamp(2.6rem, 11vw, 7rem); letter-spacing: .01em; }
.door-tag { font-size: 1.15rem; color: var(--dim); font-weight: 700; }
.door-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; width: 100%; text-align: left; }
.door-card { display: grid; gap: .8rem; align-content: start; padding: 1.3rem; border-radius: 22px; border: 2px solid var(--line); background: rgba(10, 5, 40, .86); }
.door-card h2 { font-family: var(--display); font-size: 1.2rem; }
.door-card p { color: var(--dim); }
.code-field { font-family: var(--display); font-size: 2rem; text-align: center; letter-spacing: .35em; text-transform: uppercase; padding-left: .35em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; }
.door-msg { min-height: 1.4em; color: #ff9aa5; font-weight: 700; }
.door-how { color: var(--dim); font-size: .92rem; max-width: 36rem; }
.hostcode { display: grid; gap: .35rem; font-weight: 700; }
.hostcode .code-field { letter-spacing: .3em; }
.fine { color: var(--dim); font-size: .88rem; }
.door-games { color: var(--dim); font-weight: 700; }

/* ---------------------------------------------------------------- big screen: frame */

.stage { position: fixed; inset: 0; overflow: hidden; display: flex; flex-direction: column; font-size: calc(var(--u) * 1.55); }
.stage .viz { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 0; transition: opacity .7s; pointer-events: none; }
.stage.viz-on .viz { opacity: .3; }
.stage.viz-full .viz { opacity: 1; }
.stage.on-listen .beam, .stage.on-huddle .beam, .stage.on-answer .beam { opacity: .22; }

.scorebar { position: relative; z-index: 6; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: 'a mid b'; align-items: center; gap: calc(var(--u) * 2); padding: calc(var(--u) * 2.4) calc(var(--u) * 4) 0; }
.score-side { position: relative; display: flex; align-items: center; gap: calc(var(--u) * 1.1); padding: calc(var(--u) * .7) calc(var(--u) * 1.6); border-radius: calc(var(--u) * 1.6); border: calc(var(--u) * .28) solid var(--tc); background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 30%, rgba(6, 3, 26, .85)), rgba(6, 3, 26, .85)); min-width: 0; transition: box-shadow .4s, opacity .4s; }
.score-side.team-a { grid-area: a; justify-self: start; }
.score-side.team-b { grid-area: b; justify-self: end; flex-direction: row-reverse; background: linear-gradient(270deg, color-mix(in srgb, var(--tc) 30%, rgba(6, 3, 26, .85)), rgba(6, 3, 26, .85)); }
.score-side.lead { box-shadow: 0 0 calc(var(--u) * 2.4) color-mix(in srgb, var(--tc) 70%, transparent); }
.score-side.away { opacity: .45; }
.score-ic { font-size: calc(var(--u) * 3.6); line-height: 1; }
.score-name { font-weight: 900; font-size: calc(var(--u) * 1.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 24vw; }
.score-n { font-family: var(--display); font-size: calc(var(--u) * 4); line-height: 1; color: var(--tc2); min-width: 2.2ch; text-align: center; text-shadow: 0 0 .4em color-mix(in srgb, var(--tc) 70%, transparent); }
.score-pop { position: absolute; top: 100%; left: 50%; font-family: var(--display); font-size: calc(var(--u) * 3); color: var(--lime); animation: float-up 1.8s ease-out both; pointer-events: none; text-shadow: 0 0 .4em rgba(0, 0, 0, .8); }
.score-pop.neg { color: var(--red); }
.score-mid { grid-area: mid; text-align: center; display: grid; gap: .1em; }
.score-mid b { font-family: var(--display); font-size: calc(var(--u) * 2.1); color: var(--gold); }
.score-mid small { font-size: .7em; color: var(--dim); }
.score-mid span { font-size: calc(var(--u) * 1.4); color: var(--dim); font-weight: 700; }

.corner { position: fixed; right: calc(var(--u) * 2.2); bottom: calc(var(--u) * 2); z-index: 75; display: flex; align-items: center; gap: .6em; font-size: max(11px, calc(var(--u) * 1.05)); }
.corner-chip { padding: .3em .8em; border-radius: 999px; background: rgba(0, 0, 0, .55); border: 1px solid var(--line); color: var(--dim); font-weight: 700; }
.corner-chip.warn { color: #ffc46b; border-color: #ff9f1c; }
.corner-chip.btnish { opacity: .55; }
.corner-chip.btnish:hover { opacity: 1; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(26rem, 92vw); z-index: 85; background: #0d0730; border-left: 2px solid var(--line); overflow-y: auto; box-shadow: -20px 0 60px rgba(0, 0, 0, .6); animation: drawer .25s both; font-size: 16px; }
.drawer-x { display: block; margin: .6rem .8rem 0 auto; background: none; border: 0; color: var(--dim); font-weight: 700; }
/* The drawer is on the screen the whole room watches: answers stay blank until pressed and held. */
.drawer .keycard h3, .drawer .keycard p, .drawer .draft b, .drawer .box > p > b { color: transparent; }
.drawer .keycard:active h3, .drawer .keycard:active p, .drawer .draft:active b, .drawer .box > p:active > b { color: inherit; }
.drawer .keycard::after { content: 'Hidden on the big screen. Press and hold to peek.'; font-size: .8rem; font-weight: 700; color: var(--dim); }

.scene { position: relative; z-index: 5; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 2.2); padding: calc(var(--u) * 3) calc(var(--u) * 6) calc(var(--u) * 4.5); text-align: center; animation: scene-in .55s cubic-bezier(.2, .9, .3, 1.15) both; }
.scene.shake { animation: shake .45s both; }
.big-label { font-family: var(--display); font-size: calc(var(--u) * 4.6); text-transform: uppercase; letter-spacing: .02em; color: var(--gold); text-shadow: 0 0 .5em rgba(255, 190, 40, .5); line-height: 1.1; }
.big-label.dim { color: var(--dim); text-shadow: none; font-size: calc(var(--u) * 3); }
.big-label.live { color: #ff5a6a; animation: breathe .9s ease-in-out infinite; text-shadow: 0 0 .6em rgba(255, 60, 80, .8); }
.stage .hint { font-size: calc(var(--u) * 2); }
.stage .chip { font-size: calc(var(--u) * 2); border-width: calc(var(--u) * .2); }
.stage .kicker { font-size: calc(var(--u) * 1.7); }

/* lobby */
.lobby { justify-content: space-between; padding-top: calc(var(--u) * 3.6); padding-bottom: calc(var(--u) * 3.4); gap: calc(var(--u) * 1.6); }
.lobby-head { display: grid; gap: calc(var(--u) * .6); }
.stage .logo { font-size: calc(var(--u) * 8.6); }
.lobby .logo { animation: logo-glow 2.4s ease-in-out infinite alternate; }
.join-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: calc(var(--u) * 3.5); width: 100%; max-width: calc(var(--u) * 118); align-items: stretch; }
.seat { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 1.3); padding: calc(var(--u) * 3.2) calc(var(--u) * 2) calc(var(--u) * 1.8); border-radius: calc(var(--u) * 2.6); border: calc(var(--u) * .4) solid var(--tc); background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 22%, rgba(6, 3, 26, .88)), rgba(6, 3, 26, .88)); box-shadow: 0 0 calc(var(--u) * 3) color-mix(in srgb, var(--tc) 45%, transparent), inset 0 0 calc(var(--u) * 3) color-mix(in srgb, var(--tc) 18%, transparent); min-height: calc(var(--u) * 28); }
.seat.host { --tc: var(--gold); --tc2: #fff1a8; }
.seat-tag { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); padding: .15em 1em; border-radius: 999px; background: var(--tc); color: #0a0524; font-family: var(--display); font-size: calc(var(--u) * 2.2); white-space: nowrap; }
.seat-qr { width: calc(var(--u) * 18.5); padding: calc(var(--u) * .6); background: #fff; border-radius: calc(var(--u) * 1.4); line-height: 0; }
.seat-qr.small { width: calc(var(--u) * 11); }
.qr { width: 100%; height: auto; display: block; }
.seat-cta { font-weight: 900; font-size: calc(var(--u) * 1.8); color: var(--tc2); }
.seat-face { display: grid; justify-items: center; gap: calc(var(--u) * .9); animation: pop-in .5s cubic-bezier(.2, 1.5, .4, 1) both; }
.seat-icon { font-size: calc(var(--u) * 10); line-height: 1.05; animation: bob 2.4s ease-in-out infinite; }
.seat-name { font-family: var(--display); font-size: calc(var(--u) * 3.2); line-height: 1.1; color: var(--tc2); overflow-wrap: anywhere; }
.seat-wait, .seat-away { font-size: calc(var(--u) * 1.7); color: var(--dim); font-weight: 700; }
.seat-away { color: #ffc46b; }
.seat .stamp { font-size: calc(var(--u) * 2.6); }
.lobby-foot { display: grid; gap: calc(var(--u) * 1.3); justify-items: center; }
.lineup { display: flex; gap: calc(var(--u) * 1.4); flex-wrap: nowrap; justify-content: center; }
.lineup-item { display: flex; align-items: center; gap: calc(var(--u) * .8); text-align: left; font-size: calc(var(--u) * 1.3); padding: calc(var(--u) * .6) calc(var(--u) * 1.3); border-radius: calc(var(--u) * 1.6); background: rgba(6, 3, 26, .7); border: calc(var(--u) * .2) solid var(--line); }
.lineup-item small { display: block; color: var(--dim); font-size: .72em; }
.lineup-item.played { border-color: var(--lime); }
.lineup-n { font-family: var(--display); color: var(--gold); font-size: 1.3em; }
.lineup-ic { font-size: 1.7em; }
.manual { font-size: calc(var(--u) * 1.7); color: var(--dim); }
.manual b { color: var(--ink); }
.manual .code { font-family: var(--display); color: var(--gold); font-size: 1.5em; letter-spacing: .14em; margin-left: .2em; }

/* rules */
.rules { justify-content: flex-start; padding-top: calc(var(--u) * 3.6); padding-bottom: calc(var(--u) * 3.2); gap: calc(var(--u) * 1.4); }
.rules-head { display: flex; align-items: center; gap: calc(var(--u) * 2); text-align: left; }
.rules-head h1 { font-family: var(--display); font-size: calc(var(--u) * 5); color: var(--gold); line-height: 1; text-shadow: 0 0 .4em rgba(255, 190, 40, .45); }
.rules-icon { font-size: calc(var(--u) * 7); line-height: 1; animation: bob 2s ease-in-out infinite; }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 1.5) calc(var(--u) * 2.2); width: 100%; max-width: calc(var(--u) * 122); flex: 1; align-content: center; }
.rule-grid li { display: flex; gap: calc(var(--u) * 1.5); align-items: center; text-align: left; padding: calc(var(--u) * 1.5) calc(var(--u) * 2); border-radius: calc(var(--u) * 1.8); background: rgba(6, 3, 26, .72); border: calc(var(--u) * .2) solid var(--line); animation: rule-in .5s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: calc(var(--i) * .13s + .2s); }
.rule-grid li b { font-family: var(--display); font-size: calc(var(--u) * 2.3); color: var(--gold); font-weight: 400; }
.rule-grid li p { font-size: calc(var(--u) * 1.75); color: #e6e2ff; }
.rule-grid.dense { gap: calc(var(--u) * 1) calc(var(--u) * 2); }
.rule-grid.dense li { padding: calc(var(--u) * .9) calc(var(--u) * 1.6); }
.rule-grid.dense li b { font-size: calc(var(--u) * 2); }
.rule-grid.dense li p { font-size: calc(var(--u) * 1.5); line-height: 1.28; }
.rule-grid.dense .rule-ic { font-size: calc(var(--u) * 3.6); }
.rule-ic { font-size: calc(var(--u) * 4.4); line-height: 1; flex: none; }
.rules-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: calc(var(--u) * 1.2); }
.rules-foot .chip { font-size: calc(var(--u) * 1.6); }
.rules-foot .hint { margin-left: calc(var(--u) * 1); }

/* the slate before a round */
.slate { flex-direction: row; gap: calc(var(--u) * 6); }
.slate-main { display: grid; gap: calc(var(--u) * 1.6); justify-items: center; }
.slate-n { display: flex; align-items: baseline; gap: calc(var(--u) * 1.5); }
.slate-n span { font-family: var(--display); font-size: calc(var(--u) * 26); line-height: .9; background: linear-gradient(180deg, #fff 10%, var(--gold) 55%, #ff7a1a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 calc(var(--u) * 2) rgba(255, 170, 40, .55)); animation: slam .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.slate-n small { font-family: var(--display); font-size: calc(var(--u) * 3.4); color: var(--dim); text-transform: uppercase; }
.slate.has-card .slate-n span { font-size: calc(var(--u) * 19); }

.offer { display: grid; gap: calc(var(--u) * 1.2); justify-items: center; perspective: 1200px; }
.offer-tag { font-family: var(--display); font-size: calc(var(--u) * 2.6); color: var(--tc2); text-transform: uppercase; letter-spacing: .05em; animation: breathe 1.2s infinite; }
.offer-for { font-weight: 900; font-size: calc(var(--u) * 2); }
.card-face { width: calc(var(--u) * 38); display: grid; gap: calc(var(--u) * 1); justify-items: center; padding: calc(var(--u) * 2.6) calc(var(--u) * 2.4); border-radius: calc(var(--u) * 2.4); background: linear-gradient(160deg, #fffdf2, #ffe9b8); color: #1b0b3a; border: calc(var(--u) * .5) solid var(--tc); box-shadow: 0 calc(var(--u) * 1.6) calc(var(--u) * 4) rgba(0, 0, 0, .55), 0 0 calc(var(--u) * 4) color-mix(in srgb, var(--tc) 60%, transparent); transform: rotate(-3deg); animation: card-flip .8s cubic-bezier(.2, 1.1, .3, 1) both; }
.card-ic { font-size: calc(var(--u) * 8); line-height: 1; }
.card-face h2 { font-family: var(--display); font-size: calc(var(--u) * 3.2); line-height: 1.05; }
.card-face p { font-size: calc(var(--u) * 1.8); font-weight: 700; }
.offer-status { font-weight: 900; font-size: calc(var(--u) * 2); color: var(--dim); }
.offer.is-accepted .offer-status { color: var(--lime); font-family: var(--display); font-size: calc(var(--u) * 2.6); }
.offer.is-accepted .card-face { animation: card-win .6s both; }
.offer.is-declined .card-face { filter: grayscale(1) brightness(.6); transform: rotate(-3deg) scale(.92); transition: all .4s; }
.card-strip { position: absolute; left: 50%; bottom: calc(var(--u) * 1.5); transform: translateX(-50%); padding: .35em 1.1em; border-radius: 999px; border: calc(var(--u) * .2) solid var(--tc); background: rgba(6, 3, 26, .85); color: var(--tc2); font-size: calc(var(--u) * 1.7); white-space: nowrap; }

/* music: the clock */
.clock { justify-content: space-between; }
.listen-top { position: absolute; left: calc(var(--u) * 5); top: 46%; transform: translateY(-50%); display: grid; gap: calc(var(--u) * 1); justify-items: start; text-align: left; max-width: calc(var(--u) * 24); }
.listen-top .big-label { font-size: calc(var(--u) * 4.2); display: grid; }
.listen-top .big-label span { font-size: 1.9em; line-height: 1.1; animation: bob 1s ease-in-out infinite; }
.listen-top .chip { font-size: calc(var(--u) * 1.5); white-space: normal; }
.listen-bottom { width: 100%; max-width: calc(var(--u) * 100); display: grid; gap: calc(var(--u) * 1.2); margin: auto 0 calc(var(--u) * 8); }
.listen-bottom .progress { height: calc(var(--u) * 1.3); }
.count-wrap { display: grid; justify-items: center; gap: calc(var(--u) * 1.6); margin: auto 0; }
.clock.danger .count-n { color: var(--red); text-shadow: 0 0 .3em rgba(255, 40, 60, .9); }
.clock.danger .big-label { color: var(--red); }
.status-row { position: absolute; left: calc(var(--u) * 4); right: calc(var(--u) * 4); bottom: calc(var(--u) * 4); display: flex; justify-content: space-between; pointer-events: none; }
.status { display: flex; align-items: center; gap: calc(var(--u) * 1); padding: calc(var(--u) * .8) calc(var(--u) * 1.8); border-radius: calc(var(--u) * 1.6); border: calc(var(--u) * .25) solid var(--tc); background: rgba(6, 3, 26, .82); transition: all .25s; }
.status-ic { font-size: calc(var(--u) * 3.2); }
.status-name { font-weight: 900; }
.status-what { color: var(--dim); font-weight: 700; display: inline-flex; align-items: center; }
.status.typing { box-shadow: 0 0 calc(var(--u) * 2.5) var(--tc); }
.status.typing .status-what { color: var(--tc2); }
.status.locked { background: var(--tc); color: #0a0524; animation: pop-in .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.status.locked .status-what { color: #0a0524; font-weight: 900; }

/* reveals */
.reveal { justify-content: flex-start; padding-top: calc(var(--u) * 3); padding-bottom: calc(var(--u) * 5); }
.slam { margin: auto; font-family: var(--display); font-size: calc(var(--u) * 24); color: var(--red); text-shadow: 0 0 .3em rgba(255, 40, 60, .8); animation: slam .5s cubic-bezier(.2, 1.5, .4, 1) both; text-transform: uppercase; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 3); width: 100%; max-width: calc(var(--u) * 124); }
.answer { position: relative; display: grid; gap: calc(var(--u) * 1); align-content: start; justify-items: center; padding: calc(var(--u) * 1.4) calc(var(--u) * 2); border-radius: calc(var(--u) * 2.2); border: calc(var(--u) * .35) solid var(--tc); background: rgba(6, 3, 26, .85); animation: flip-in .6s cubic-bezier(.2, 1.1, .3, 1) both; min-height: calc(var(--u) * 15); gap: calc(var(--u) * .7); }
.answer:nth-child(2) { animation-delay: .18s; }
.answer-who { font-weight: 900; color: var(--tc2); font-size: calc(var(--u) * 2); }
.answer-text { font-family: var(--display); font-size: calc(var(--u) * 3); line-height: 1.1; overflow-wrap: anywhere; }
.answer-text em { color: var(--dim); font-family: var(--body); font-size: .7em; }
.answer .stamp { font-size: calc(var(--u) * 2.4); }
.answer.is-exact { box-shadow: 0 0 calc(var(--u) * 3.5) rgba(157, 255, 92, .55); }
.answer.is-close .stamp { border-color: var(--gold); color: var(--gold); }
.answer.is-wrong .stamp, .answer.is-empty .stamp { border-color: var(--red); color: var(--red); }
.answer.is-wrong, .answer.is-empty { filter: saturate(.55); }
.answer .lines { font-size: calc(var(--u) * 1.55); gap: .2em; }
.answer .lines li { padding: .22em .7em; }
.title-wait { font-family: var(--display); font-size: calc(var(--u) * 5); color: var(--dim); margin: auto 0; display: flex; align-items: baseline; justify-content: center; }
.title-card { display: grid; gap: calc(var(--u) * .6); justify-items: center; margin: auto 0; animation: slam .55s cubic-bezier(.2, 1.4, .4, 1) both; }
.title-card h1 { font-family: var(--display); font-size: calc(var(--u) * 8.5); line-height: 1; background: linear-gradient(180deg, #fff 15%, var(--gold) 60%, #ff7a1a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 calc(var(--u) * 1.6) rgba(255, 170, 40, .6)); padding: 0 .1em; }
.title-card h1 { text-wrap: balance; }
.title-card h1.long { font-size: calc(var(--u) * 5.8); }
.title-card h1.xlong { font-size: calc(var(--u) * 4.5); }
.movie-reveal .title-card h1 { font-size: calc(var(--u) * 12); }
.movie-reveal .title-card h1.long { font-size: calc(var(--u) * 8); }
.movie-reveal .title-card h1.xlong { font-size: calc(var(--u) * 5.6); }
.title-card p { font-size: calc(var(--u) * 2.6); font-weight: 700; color: #e6e2ff; }
.title-card .year { font-family: var(--display); font-size: calc(var(--u) * 5); color: var(--b2); animation: slam .45s both; }
.movie-reveal { justify-content: center; }
.movie-reveal .title-card { margin: 0; }
.clue-recap { max-width: calc(var(--u) * 100); font-size: calc(var(--u) * 1.9); color: var(--dim); font-style: italic; }
.movie-result { width: 100%; max-width: calc(var(--u) * 60); }
.movie-result .answer { min-height: 0; }

/* music: finish the lyric */
.bonus { gap: calc(var(--u) * 1.6); }
.bonus-head { display: flex; align-items: center; gap: calc(var(--u) * 2); }
.bonus-song { font-size: calc(var(--u) * 2.2); color: var(--dim); font-weight: 700; }
.buzz-call { display: grid; gap: calc(var(--u) * 1); margin: auto 0; }
.buzz-call h1 { font-family: var(--display); font-size: calc(var(--u) * 15); color: #ff5a6a; text-shadow: 0 0 .35em rgba(255, 60, 80, .8); animation: breathe .8s ease-in-out infinite; text-transform: uppercase; line-height: 1; }
.buzz-call p { font-size: calc(var(--u) * 2.4); font-weight: 700; }
.takeover { display: grid; gap: calc(var(--u) * .6); justify-items: center; margin: auto 0; padding: calc(var(--u) * 3) calc(var(--u) * 7); border-radius: calc(var(--u) * 3.5); background: linear-gradient(180deg, var(--tc), color-mix(in srgb, var(--tc) 55%, #06031a)); color: #0a0524; box-shadow: 0 0 calc(var(--u) * 7) color-mix(in srgb, var(--tc) 80%, transparent); animation: slam .45s cubic-bezier(.2, 1.5, .4, 1) both; }
.takeover-ic { font-size: calc(var(--u) * 11); line-height: 1; animation: bob 1s ease-in-out infinite; }
.takeover h1 { font-family: var(--display); font-size: calc(var(--u) * 7.5); line-height: 1; }
.takeover-sub { font-weight: 900; font-size: calc(var(--u) * 2.6); }
.takeover.none { background: rgba(6, 3, 26, .85); color: var(--dim); box-shadow: none; border: calc(var(--u) * .3) solid var(--line); }

/* movies */
.movie { display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr auto; align-items: center; gap: calc(var(--u) * 2.5) calc(var(--u) * 4); padding-bottom: calc(var(--u) * 5); }
.clue-card { position: relative; text-align: left; padding: calc(var(--u) * 3.4) calc(var(--u) * 4); border-radius: calc(var(--u) * 2.4); background: linear-gradient(180deg, rgba(10, 5, 40, .92), rgba(6, 3, 26, .92)); border: calc(var(--u) * .35) solid var(--gold); box-shadow: 0 0 calc(var(--u) * 4) rgba(255, 190, 40, .3); animation: clue-in .7s cubic-bezier(.2, 1, .3, 1) both; }
.clue-card::before, .clue-card::after { content: ''; position: absolute; left: calc(var(--u) * 1.2); right: calc(var(--u) * 1.2); height: calc(var(--u) * 1); background: repeating-linear-gradient(90deg, rgba(255, 210, 63, .55) 0 calc(var(--u) * 1.4), transparent calc(var(--u) * 1.4) calc(var(--u) * 2.8)); border-radius: 2px; }
.clue-card::before { top: calc(var(--u) * .9); }
.clue-card::after { bottom: calc(var(--u) * .9); }
.clue-tag { font-weight: 900; color: var(--gold); letter-spacing: .14em; text-transform: uppercase; font-size: calc(var(--u) * 1.6); margin-bottom: calc(var(--u) * 1); }
/* The vw cap keeps long clues on screen when the picture is narrower than 16:9. */
.clue { font-size: min(calc(var(--u) * 4.5), 4vw); font-weight: 900; line-height: 1.18; }
.clue.long { font-size: min(calc(var(--u) * 3.7), 3.3vw); }
.movie-side .ring { font-size: calc(var(--u) * 22); }
.movie-status { grid-column: 1 / -1; min-height: calc(var(--u) * 6); }
.movie.danger .count-n { color: var(--red); }
.floor-band { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 2.5); text-align: left; padding: calc(var(--u) * 1.6) calc(var(--u) * 4); border-radius: calc(var(--u) * 2.6); background: linear-gradient(180deg, var(--tc), color-mix(in srgb, var(--tc) 55%, #06031a)); color: #0a0524; box-shadow: 0 0 calc(var(--u) * 6) color-mix(in srgb, var(--tc) 80%, transparent); animation: slam .4s cubic-bezier(.2, 1.5, .4, 1) both; }
.floor-ic { font-size: calc(var(--u) * 8); line-height: 1; animation: bob 1s ease-in-out infinite; }
.floor-band h1 { font-family: var(--display); font-size: calc(var(--u) * 5.4); line-height: 1; }
.floor-sub { font-weight: 900; font-size: calc(var(--u) * 2.6); }
.movie.is-floor .clue-card, .movie.is-year .clue-card { opacity: .75; }

/* ballpark: the question, then a number line */
.ballpark { padding-bottom: calc(var(--u) * 11); }
.ballpark-reveal { justify-content: center; gap: calc(var(--u) * 1.6); }
.ballpark-reveal .clue-recap { font-style: normal; font-weight: 700; color: #e6e2ff; font-size: calc(var(--u) * 2.2); }
.line { position: relative; width: 100%; max-width: calc(var(--u) * 118); height: calc(var(--u) * 17); flex: none; margin-bottom: calc(var(--u) * 1.5); }
.line-track { position: absolute; left: 0; right: 0; top: 50%; height: calc(var(--u) * .7); margin-top: calc(var(--u) * -.35); border-radius: 999px; background: linear-gradient(90deg, var(--a), var(--gold) 50%, var(--b)); box-shadow: 0 0 calc(var(--u) * 2) rgba(255, 190, 40, .5); }
.line-track::after { content: ''; position: absolute; inset: calc(var(--u) * -.9) 0; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .35) 0 2px, transparent 2px 5%); border-radius: 2px; opacity: .6; }
.pin { position: absolute; transform: translateX(-50%); display: grid; justify-items: center; gap: .1em; padding: calc(var(--u) * .5) calc(var(--u) * 1.3); border-radius: calc(var(--u) * 1.4); border: calc(var(--u) * .3) solid var(--tc); background: rgba(6, 3, 26, .92); font-size: calc(var(--u) * 2.4); white-space: nowrap; transition: left .8s cubic-bezier(.2, 1, .3, 1), box-shadow .4s; animation: pop-in .5s cubic-bezier(.2, 1.5, .4, 1) both; z-index: 2; }
.pin b { font-family: var(--display); font-weight: 400; color: var(--tc2); line-height: 1; }
.pin-ic { font-size: 1.1em; line-height: 1; }
.pin.team-a { bottom: 58%; }
.pin.team-b { top: 58%; animation-delay: .25s; }
.pin.team-a::after, .pin.team-b::after { content: ''; position: absolute; left: 50%; width: calc(var(--u) * .3); height: calc(var(--u) * 1.3); margin-left: calc(var(--u) * -.15); background: var(--tc); }
.pin.team-a::after { top: 100%; }
.pin.team-b::after { bottom: 100%; }
.pin.far { border-style: dashed; opacity: .8; }
.pin.win { box-shadow: 0 0 calc(var(--u) * 3) var(--tc); }
.pin.answer { left: 50%; top: 50%; transform: translate(-50%, -50%); --tc: var(--gold); --tc2: #fff1a8; background: linear-gradient(180deg, #2a1a00, #120a00); font-size: calc(var(--u) * 3.4); z-index: 3; animation: slam .5s cubic-bezier(.2, 1.5, .4, 1) both; box-shadow: 0 0 calc(var(--u) * 4) rgba(255, 190, 40, .7); }
.pin.answer.wait { animation: breathe .7s ease-in-out infinite; }
.pin.answer small { font-size: .42em; color: var(--dim); font-weight: 700; }
.ballpark-reveal .answer { min-height: 0; }

/* scoreboard */
.veil.board { z-index: 50; padding: calc(var(--u) * 3.5); background: rgba(4, 2, 18, .97); }
.board-in { display: grid; gap: calc(var(--u) * 1.4); justify-items: center; width: 100%; }
.board-title { font-family: 'Bungee Shade', var(--display); font-weight: 400; font-size: calc(var(--u) * 8); color: var(--gold); line-height: 1; text-transform: uppercase; }
.board-bars { display: flex; gap: calc(var(--u) * 10); align-items: flex-end; height: calc(var(--u) * 36); }
.board-col { display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; gap: calc(var(--u) * .8); height: 100%; width: calc(var(--u) * 26); }
.board-n { font-family: var(--display); font-size: calc(var(--u) * 5); color: var(--tc2); }
.board-bar { width: 70%; height: 100%; display: flex; align-items: flex-end; }
.board-bar i { display: block; width: 100%; border-radius: calc(var(--u) * 1.6) calc(var(--u) * 1.6) 0 0; background: linear-gradient(180deg, var(--tc2), var(--tc)); box-shadow: 0 0 calc(var(--u) * 4) color-mix(in srgb, var(--tc) 70%, transparent); transition: height 1.4s cubic-bezier(.2, 1, .3, 1); }
.board-ic { font-size: calc(var(--u) * 4.4); line-height: 1; }
.board-col.lead .board-ic { animation: bob 1s ease-in-out infinite; }
.board-name { font-weight: 900; font-size: calc(var(--u) * 2.4); }
.board-note { font-family: var(--display); font-size: calc(var(--u) * 3); color: var(--gold); }
.board .kicker { font-size: calc(var(--u) * 1.8); }

/* endings */
.final { gap: calc(var(--u) * 1.5); padding-top: calc(var(--u) * 3.4); padding-bottom: calc(var(--u) * 5.5); }
.final-wait h1 { font-family: var(--display); font-size: calc(var(--u) * 8); color: var(--gold); display: flex; align-items: baseline; justify-content: center; animation: breathe .5s ease-in-out infinite; }
.final-win { display: grid; justify-items: center; gap: calc(var(--u) * .4); animation: slam .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.trophy { font-size: calc(var(--u) * 10); line-height: 1; animation: bob 1.1s ease-in-out infinite; filter: drop-shadow(0 0 calc(var(--u) * 3) rgba(255, 200, 60, .8)); }
.final-win h1 { font-family: var(--display); font-size: calc(var(--u) * 8); line-height: 1; color: var(--gold); text-shadow: 0 0 .4em rgba(255, 190, 40, .7); overflow-wrap: anywhere; }
.final.win-a .final-win h1 { color: var(--a2); text-shadow: 0 0 .4em var(--a); }
.final.win-b .final-win h1 { color: var(--b2); text-shadow: 0 0 .4em var(--b); }
.final-sub { font-size: calc(var(--u) * 2.4); font-weight: 900; color: #e6e2ff; }
.final-stats { display: flex; gap: calc(var(--u) * 3); justify-content: center; flex-wrap: wrap; width: 100%; animation: rise .5s both; }
.stat-col { width: calc(var(--u) * 46); padding: calc(var(--u) * 1) calc(var(--u) * 1.8); border-radius: calc(var(--u) * 2); border: calc(var(--u) * .3) solid var(--tc); background: rgba(6, 3, 26, .85); }
.stat-col.lead { box-shadow: 0 0 calc(var(--u) * 3) color-mix(in srgb, var(--tc) 70%, transparent); }
.stat-head { display: flex; justify-content: space-between; gap: 1em; font-weight: 900; font-size: calc(var(--u) * 1.9); color: var(--tc2); margin-bottom: calc(var(--u) * .4); }
.stat-head b { font-family: var(--display); }
.stat-col li { display: flex; justify-content: space-between; gap: 1em; padding: .14em 0; border-top: 1px solid var(--line); font-size: calc(var(--u) * 1.55); }
.stat-col li span { color: var(--dim); }
.final-foot { display: flex; gap: calc(var(--u) * 1.5); flex-wrap: wrap; justify-content: center; animation: rise .5s both; }

/* ---------------------------------------------------------------- phones */

.phone { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); max-width: 34rem; margin: 0 auto; }
.phone .veil, .phone #fx, .phone #flash { position: fixed; }
.phone-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 55%, #0a0524), color-mix(in srgb, var(--tc) 22%, #0a0524)); border-bottom: 3px solid var(--tc); }
.phone-ic { font-size: 1.8rem; line-height: 1; }
.phone-name { font-weight: 900; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-score { font-family: var(--display); font-size: 1.5rem; color: var(--tc2); }
.phone-body { flex: 1; display: flex; flex-direction: column; padding: 1.1rem 1rem 1.5rem; }
.stack { display: grid; gap: .9rem; align-content: start; animation: rise .3s both; }
.stack.grow { flex: 1; align-content: center; }
.stack.center { justify-items: center; text-align: center; }
.stack h1 { font-family: var(--display); font-size: clamp(1.8rem, 8.5vw, 2.8rem); line-height: 1.05; color: var(--tc2); overflow-wrap: anywhere; }
.stack h2 { font-family: var(--display); font-size: 1.25rem; line-height: 1.15; }
.stack h4 { margin-top: .4rem; }
.hero-ic { font-size: clamp(4.5rem, 26vw, 8rem); line-height: 1; animation: pop-in .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.phone .stamp { font-size: 1.5rem; }
.name-row { display: flex; gap: .6rem; }
.icons { display: grid; grid-template-columns: repeat(6, 1fr); gap: .45rem; }
.icons button { aspect-ratio: 1; font-size: 1.7rem; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); padding: 0; transition: transform .12s; }
.icons button.on { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 35%, transparent); transform: scale(1.12); box-shadow: 0 0 16px var(--tc); }
.icons button.taken { opacity: .2; }
.rules-mini { display: grid; gap: .55rem; }
.rules-mini li { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .8rem; border-radius: 14px; background: var(--panel); }
.rules-mini li span { font-size: 1.5rem; line-height: 1.1; }
.rules-mini li p { color: var(--dim); font-size: .92rem; }
.big-n small { font-size: .5em; color: var(--dim); }
.phone .offer { width: 100%; gap: .7rem; }
.phone .offer .grid2 { width: 100%; }
.phone .offer-tag { font-size: 1.05rem; }
.phone .card-face { width: 100%; padding: 1.1rem 1rem; border-radius: 20px; border-width: 5px; gap: .4rem; }
.phone .card-ic { font-size: 3.4rem; }
.phone .card-face h2 { font-size: 1.4rem; }
.phone .card-face p { font-size: 1rem; }
.phone .offer-status { font-size: 1.1rem; }
.mycard { padding: .7rem .9rem; border-radius: 14px; border: 2px dashed var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); font-size: .92rem; text-align: left; }
.clockline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.clockline.slim { width: 100%; }
.bigsecs { font-family: var(--display); font-size: 2.6rem; line-height: 1; color: var(--gold); min-width: 1.4ch; text-align: right; }
.bigsecs.small { font-size: 1.6rem; }
.answerbox.danger .bigsecs { color: var(--red); animation: breathe .5s infinite; }
.answer-field { font-size: 1.45rem; padding: 1em .8em; text-align: center; }
.hintline { font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: .08em; padding: .6rem .8rem; border-radius: 12px; background: rgba(0, 0, 0, .4); border: 2px dashed var(--gold); color: var(--gold); text-align: center; overflow-wrap: anywhere; }
.numshow { display: flex; align-items: baseline; justify-content: center; gap: .5rem; min-height: 4.2rem; padding: .5rem .8rem; border-radius: 16px; border: 2px solid var(--tc); background: rgba(0, 0, 0, .4); font-family: var(--display); font-size: clamp(2rem, 11vw, 3rem); line-height: 1.1; color: var(--tc2); overflow: hidden; }
.numshow small { font-family: var(--body); font-size: 1rem; font-weight: 700; color: var(--dim); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; touch-action: manipulation; }
.keys button { padding: .55em 0; border-radius: 16px; border: 2px solid var(--line); background: var(--panel); font-family: var(--display); font-size: 1.7rem; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.keys button:active { background: var(--tc); color: #0a0524; transform: scale(.96); }
.keys button.soft { color: var(--dim); font-size: 1.3rem; }
.numpad.danger .bigsecs { color: var(--red); animation: breathe .5s infinite; }
.applelink { display: block; padding: .7rem 1rem; border-radius: 14px; border: 2px solid var(--line); color: var(--ink); font-weight: 700; text-decoration: none; }
.chipsel { display: flex; flex-wrap: wrap; gap: .4rem; }
.chipsel button { padding: .55em .95em; border-radius: 999px; border: 2px solid var(--line); background: rgba(0, 0, 0, .3); font-weight: 900; }
.chipsel button.on { background: var(--gold); border-color: var(--gold); color: #2a1500; }
.chipsel.cats button { font-weight: 700; }
.chipsel.cats button small { opacity: .7; font-weight: 500; }
.chipsel.cats button.on { background: color-mix(in srgb, var(--lime) 30%, transparent); border-color: var(--lime); color: var(--ink); }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 40%; }
.typed { font-weight: 700; overflow-wrap: anywhere; }
.typed.big { font-family: var(--display); font-size: 1.5rem; }
.result.is-exact h1 { color: var(--lime); }
.result.is-close h1 { color: var(--gold); }
.result.is-wrong h1, .result.is-empty h1 { color: #ff8b97; }
.keycard { width: 100%; padding: .9rem 1rem; border-radius: 16px; background: rgba(0, 0, 0, .4); border: 2px solid var(--gold); text-align: left; display: grid; gap: .25rem; }
.keycard h3 { font-family: var(--display); font-size: 1.35rem; line-height: 1.1; color: var(--gold); }
.clue-small { font-size: 1rem; font-style: italic; color: #e6e2ff; }
.takeover-phone h1 { color: #fff; }
.takeover-phone { background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 70%, transparent), transparent); margin: -1.1rem -1rem -1.5rem; padding: 1.1rem 1.2rem 1.5rem; animation: slam .4s both; }

.buzzer { --size: min(78vw, 46vh, 22rem); width: var(--size); height: var(--size); border-radius: 50%; border: 0; padding: 0; background: radial-gradient(circle at 50% 60%, #2a2440, #100a26); box-shadow: 0 10px 30px rgba(0, 0, 0, .6), inset 0 -10px 20px rgba(0, 0, 0, .6); position: relative; touch-action: none; user-select: none; -webkit-user-select: none; }
@supports (height: 1dvh) { .buzzer { --size: min(78vw, 46dvh, 22rem); } }
.buzzer-cap { position: absolute; inset: 9%; border-radius: 50%; display: grid; place-content: center; gap: .2rem; background: radial-gradient(circle at 35% 28%, #7d7a8c, #45415a 60%, #2c2840); box-shadow: 0 14px 0 #1d1a2c, inset 0 6px 14px rgba(255, 255, 255, .25); transform: translateY(-10px); transition: transform .07s, box-shadow .07s; color: #c9c5dd; }
.buzzer-cap b { font-family: var(--display); font-size: calc(var(--size) * .2); line-height: 1; }
.buzzer-cap small { font-weight: 700; font-size: calc(var(--size) * .055); padding: 0 1em; }
.buzzer.live .buzzer-cap { background: radial-gradient(circle at 35% 28%, #ff9aa5, #ff2b45 55%, #b10020); box-shadow: 0 14px 0 #6e0014, inset 0 6px 14px rgba(255, 255, 255, .45), 0 0 50px rgba(255, 40, 70, .7); color: #fff; }
.buzzer.live { animation: buzz-glow 1s ease-in-out infinite; }
.buzzer.down .buzzer-cap { transform: translateY(2px); box-shadow: 0 2px 0 #1d1a2c, inset 0 6px 14px rgba(255, 255, 255, .25); }
.buzzer.live.down .buzzer-cap { box-shadow: 0 2px 0 #6e0014, inset 0 6px 14px rgba(255, 255, 255, .45), 0 0 70px rgba(255, 40, 70, 1); }

/* ---------------------------------------------------------------- host remote */

.pad { flex: 1; display: grid; justify-items: center; align-content: center; gap: .7rem; padding: 2rem 1rem; text-align: center; }
.pad-ic { font-size: 3.2rem; }
.pad h1 { font-family: var(--display); font-size: 1.8rem; color: var(--gold); }
.pad-dots { display: flex; gap: .9rem; margin: .6rem 0 0; }
.pad-dots i { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--gold); transition: background .1s; }
.pad-dots i.on { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.pad-dots.bad { animation: shake .4s both; }
.pad-dots.bad i { border-color: var(--red); }
.pad-msg { min-height: 1.4em; color: #ff9aa5; font-weight: 700; }
.pad-keys { display: grid; grid-template-columns: repeat(3, 4.6rem); gap: .7rem; }
.pad-keys button { height: 4.6rem; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); font-family: var(--display); font-size: 1.6rem; }
.pad-keys button:active { background: var(--gold); color: #2a1500; }
.pad-keys button.ghost { border-color: transparent; background: none; }

.remote { flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.remote.embedded { min-height: 0; }
.remote-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem 1rem; background: #170c4a; border-bottom: 2px solid var(--gold); }
.remote-room { font-weight: 700; display: flex; align-items: center; gap: .4rem; min-width: 0; white-space: nowrap; overflow: hidden; }
.remote-room b { font-family: var(--display); color: var(--gold); letter-spacing: .08em; }
.remote-scores { display: flex; gap: .4rem; flex: none; }
.mini { padding: .2rem .55rem; border-radius: 999px; border: 2px solid var(--tc); font-weight: 700; white-space: nowrap; }
.mini b { color: var(--tc2); }
.mini.away { opacity: .45; border-style: dashed; }
.remote-body { flex: 1; padding: 1rem 1rem 6rem; }
.remote-body.hold { pointer-events: none; }
.remote-foot { position: sticky; bottom: 0; z-index: 20; display: flex; gap: .4rem; padding: .5rem .6rem calc(.5rem + env(safe-area-inset-bottom)); background: rgba(13, 7, 48, .96); border-top: 1px solid var(--line); }
.remote-foot .btn { padding: .65em .3em; font-size: .85rem; border-width: 1px; border-radius: 12px; white-space: nowrap; background: var(--panel); color: var(--ink); }
.checks { display: grid; gap: .4rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .75rem; border-radius: 12px; background: var(--panel); font-weight: 700; }
.check span { font-weight: 900; width: 1.2em; text-align: center; color: var(--dim); }
.check.ok span { color: var(--lime); }
.check.no { color: var(--dim); }
.btn.game { justify-content: space-between; text-align: left; padding: .9rem 1rem; border-color: var(--gold); }
.btn.game > span:nth-child(2) { flex: 1; display: grid; }
.btn.game small { color: var(--dim); font-weight: 500; font-size: .85rem; }
.btn.game.played { border-color: var(--line); }
.game-ic { font-size: 2rem; }
.box { display: grid; gap: .6rem; padding: .8rem .9rem; border-radius: 16px; border: 2px solid var(--line); background: var(--panel); }
.box.team-a, .box.team-b { border-color: var(--tc); }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.tag { padding: .12rem .6rem; border-radius: 999px; background: rgba(0, 0, 0, .4); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.seg { display: flex; gap: .35rem; }
.seg button { flex: 1; padding: .7em .3em; border-radius: 12px; border: 2px solid var(--line); background: rgba(0, 0, 0, .3); font-weight: 900; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg button.on { background: var(--ink); color: #0a0524; border-color: var(--ink); }
.seg button.on.good { background: var(--lime); border-color: var(--lime); }
.seg button.on.bad { background: var(--red); border-color: var(--red); }
.seg button.on.team-a, .seg button.on.team-b { background: var(--tc); border-color: var(--tc); }
.deck { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.deck button { padding: .7em .5em; border-radius: 12px; border: 2px solid var(--line); background: rgba(0, 0, 0, .3); font-weight: 700; text-align: left; }
.drafts { display: grid; gap: .4rem; }
.draft { display: grid; gap: .1rem; padding: .55rem .8rem; border-radius: 12px; border-left: 5px solid var(--tc); background: var(--panel); }
.draft span { color: var(--dim); font-size: .85rem; font-weight: 700; }
.draft b { overflow-wrap: anywhere; }
.settings { display: grid; gap: .4rem; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem .8rem; border-radius: 12px; background: var(--panel); border: 0; width: 100%; text-align: left; font-weight: 700; }
.setting small { display: block; color: var(--dim); font-weight: 500; font-size: .82rem; }
.stepper { display: flex; align-items: center; gap: .5rem; }
.stepper button { width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 2px solid var(--line); background: rgba(0, 0, 0, .3); font-weight: 900; font-size: 1.1rem; }
.stepper b { min-width: 3ch; text-align: center; }
.toggle i { width: 2.9rem; height: 1.6rem; border-radius: 999px; background: rgba(0, 0, 0, .45); border: 2px solid var(--line); position: relative; flex: none; transition: background .15s; }
.toggle i::after { content: ''; position: absolute; top: 2px; left: 2px; width: calc(1.6rem - 8px); height: calc(1.6rem - 8px); border-radius: 50%; background: var(--dim); transition: transform .15s, background .15s; }
.toggle.on i { background: color-mix(in srgb, var(--lime) 40%, transparent); border-color: var(--lime); }
.toggle.on i::after { transform: translateX(1.3rem); background: var(--lime); }
.sheet-wrap { position: fixed; inset: 0; z-index: 95; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s both; }
.sheet { width: min(34rem, 100%); max-height: 86vh; max-height: 86dvh; overflow-y: auto; display: grid; gap: .8rem; padding: 1rem 1rem calc(1.2rem + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: #170c4a; border-top: 2px solid var(--gold); animation: sheet .25s both; }
.adjust { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; }
.adjust button { padding: .65em 0; border-radius: 10px; border: 2px solid var(--line); background: rgba(0, 0, 0, .3); font-weight: 900; color: var(--lime); font-size: .9rem; }
.adjust button.neg { color: #ff8b97; }

/* ---------------------------------------------------------------- motion */

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes breathe { 50% { opacity: .55; } }
@keyframes bob { 50% { transform: translateY(-7%) rotate(3deg); } }
@keyframes dot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-60%); } }
@keyframes scene-in { from { opacity: 0; transform: scale(.94); filter: blur(6px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.4); } }
@keyframes slam { 0% { opacity: 0; transform: scale(3.2) rotate(-5deg); } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes stamp { 0% { opacity: 0; transform: scale(3) rotate(-22deg); } 100% { opacity: 1; transform: rotate(-6deg); } }
@keyframes count { 0% { transform: scale(1.5); opacity: .4; } 35% { transform: scale(.94); opacity: 1; } 100% { transform: none; } }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }
@keyframes flash-team { 0% { opacity: .6; } 100% { opacity: 0; } }
@keyframes flash-soft { 0% { opacity: .2; } 100% { opacity: 0; } }
@keyframes shake { 0%, 100% { transform: none; } 15% { transform: translate(-1.2%, .6%) rotate(-.6deg); } 30% { transform: translate(1.1%, -.5%) rotate(.5deg); } 45% { transform: translate(-.8%, .4%); } 60% { transform: translate(.6%, -.3%); } 80% { transform: translate(-.3%, .1%); } }
@keyframes float-up { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 10%) scale(1.25); } 100% { opacity: 0; transform: translate(-50%, 120%) scale(1); } }
@keyframes rule-in { from { opacity: 0; transform: translateX(-6%) scale(.9); } }
@keyframes flip-in { from { opacity: 0; transform: perspective(900px) rotateX(-85deg); } }
@keyframes card-flip { 0% { opacity: 0; transform: rotateY(180deg) rotate(8deg) scale(.5); } 100% { opacity: 1; transform: rotate(-3deg); } }
@keyframes card-win { 0% { transform: rotate(-3deg); } 40% { transform: rotate(4deg) scale(1.12); } 100% { transform: rotate(-3deg); } }
@keyframes clue-in { from { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateX(-3%); } to { clip-path: inset(0 -5% 0 0); } }
@keyframes drawer { from { transform: translateX(100%); } }
@keyframes sheet { from { transform: translateY(100%); } }
@keyframes chase { 0%, 100% { background-position: 0 0, var(--s) 100%, 0 var(--s), 100% 0; } 50% { background-position: var(--s) 0, 0 100%, 0 0, 100% var(--s); } }
@keyframes logo-glow { from { text-shadow: 0 0 .25em rgba(255, 190, 40, .45), 0 .06em 0 #ff2e88; } to { text-shadow: 0 0 .7em rgba(255, 190, 40, .95), 0 .06em 0 #19e3ff; } }
@keyframes buzz-glow { 0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 40, 70, .5)); } 50% { filter: drop-shadow(0 0 34px rgba(255, 40, 70, 1)); } }
@keyframes sweep1 { from { transform: rotate(-34deg); } to { transform: rotate(8deg); } }
@keyframes sweep2 { from { transform: rotate(30deg); } to { transform: rotate(-12deg); } }
@keyframes sweep3 { from { transform: rotate(-9deg); } to { transform: rotate(13deg); } }

/* Calm mode (host switched flashing lights off) and reduced-motion preferences. */
body.calm .bulbs::after, body.calm .beam, body.calm .chip.finale, body.calm .big-label.live, body.calm .buzz-call h1, body.calm .final-wait h1 { animation: none; }
body.calm .scene.shake { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .bulbs::after, .beam, .scene.shake, .chip.finale, .big-label.live, .buzz-call h1 { animation: none !important; }
  #flash { animation-duration: 1.4s !important; animation-name: flash-soft !important; }
}

/* Small or portrait big screens (a tablet, a phone used as the stage in a pinch). */
@media (max-aspect-ratio: 1/1) {
  .join-row { grid-template-columns: 1fr; gap: calc(var(--u) * 4); }
  .seat { min-height: 0; flex-direction: row; flex-wrap: wrap; }
  .slate { flex-direction: column; }
  .answers, .rule-grid { grid-template-columns: 1fr; }
  .movie { grid-template-columns: 1fr; justify-items: center; }
  .score-name { display: none; }
  .listen-top { position: static; transform: none; justify-items: center; text-align: center; max-width: none; }
}
