@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-style: normal; font-display: swap; src: url(/fonts/barlow-condensed-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 900; font-style: italic; font-display: swap; src: url(/fonts/barlow-condensed-latin-900-italic.woff2) format('woff2'); }
@font-face { font-family: 'Permanent Marker'; font-weight: 400; font-display: swap; src: url(/fonts/permanent-marker-latin-400-normal.woff2) format('woff2'); }

:root {
  --ink: #141414; --accent: #f6c324; --accent-edge: #fff8de; --cream: #f4eedf; --paper: #fbfaf5; --black: #1a1a1a;
  --red: #e2412e; --green: #2f9a46; --kraft: #c9a46c; --muted: #8d877a;
  --bg: var(--phone-bg, #121212); --bar: 52px; /* the theme's colours (/theme/theme.css) load after and win */
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  font-family: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif; color: var(--cream);
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; touch-action: manipulation;
  background: radial-gradient(ellipse at 50% 0%, #2a2a2a 0%, var(--bg) 60%) fixed, var(--bg);
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input { font: inherit; }
#app { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding-top: var(--safe-t); }
.noscript { color: #fff; text-align: center; padding: 40px; }

/* ---------- top bar ---------- */
#bar { height: var(--bar); flex: 0 0 var(--bar); display: flex; align-items: center; gap: 10px; padding: 0 14px; }
#bar-logo { height: 38px; width: 38px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
#bar-title { flex: 1; min-width: 0; font-weight: 900; font-style: italic; font-size: 22px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#me-chip { display: flex; align-items: center; gap: 8px; background: var(--black); border: 2px solid #3a3a3a; border-radius: 30px;
  padding: 3px 12px 3px 3px; font-weight: 800; font-size: 18px; color: var(--cream); max-width: 55%; }
#me-chip .avatar { flex: 0 0 auto; }
#me-chip .pts { color: var(--accent); }
#me-chip .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- sponsor: "Presented by" strip under the bar, and the full-screen card ---------- */
#spon { flex: 0 0 auto; padding: 0 14px 4px; }
#spon .strip { display: flex; align-items: center; justify-content: center; gap: 10px; height: 34px; padding: 0 12px;
  background: var(--paper); color: var(--ink); text-decoration: none; transform: rotate(-.5deg); filter: drop-shadow(1px 3px 2px rgba(0,0,0,.5)); }
#spon .k { min-width: 0; font-weight: 800; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: #5b564c;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#spon img { flex: 0 1 auto; height: 26px; max-width: 48%; object-fit: contain; }
#spon .go { font-weight: 900; font-size: 16px; color: #5b564c; }
.spcard { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 6px 0; }
.spcard .sp-k { max-width: 100%; background: var(--black); color: var(--accent); border: 2px solid #3a3a3a; padding: 6px 18px 4px; transform: rotate(-2deg);
  font-weight: 900; font-style: italic; font-size: 28px; line-height: 1; letter-spacing: .5px; text-transform: uppercase; }
.spcard .sp-tap { display: block; width: 100%; color: inherit; text-decoration: none; }
.spcard .sp-board { transform: rotate(1deg); animation: sp-in .4s steps(4) both; }
.spcard .sp-board > .in { display: flex; align-items: center; justify-content: center; height: min(40vh, 280px); padding: 22px; }
.spcard .sp-board img { max-width: 100%; max-height: 100%; object-fit: contain; }
.spcard .sp-s { max-width: 100%; background: var(--accent); color: var(--ink); padding: 4px 14px; transform: rotate(1.5deg); font-weight: 800; font-size: 20px; }
.spcard .sp-hint { font-weight: 700; font-size: 17px; color: var(--cream); opacity: .85; }
@keyframes sp-in { 0% { transform: rotate(-6deg) scale(.6); opacity: 0; } 100% { transform: rotate(1deg) scale(1); opacity: 1; } }

#view, #logohold { flex: 1; display: flex; flex-direction: column; padding: 6px 14px 12px; gap: 14px; }
#view[hidden], #logohold[hidden] { display: none; }
/* white-label: the client's brand everywhere, and this one quiet line under every screen */
#powered { flex: none; padding: 2px 14px calc(10px + var(--safe-b)); text-align: center; font-weight: 700; font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: #fff; opacity: .5; }

/* ---------- paper ---------- */
.pp { position: relative; filter: drop-shadow(2px 5px 3px rgba(0,0,0,.55)); }
.pp > .in { position: relative; background: var(--cream); color: var(--ink); padding: 18px 18px; }
.pp.white > .in { background: var(--paper); }
.pp.accent > .in { background: var(--accent); }
.pp.black > .in { background: var(--black); color: var(--cream); }
.pp.tilt-l { transform: rotate(-1.2deg); }
.pp.tilt-r { transform: rotate(1deg); }
.tape { position: absolute; width: 74px; height: 22px; background: rgba(238,228,196,.85); z-index: 3; box-shadow: 0 1px 1px rgba(0,0,0,.25);
  clip-path: polygon(0 0, 100% 0, 97% 25%, 100% 50%, 97% 75%, 100% 100%, 0 100%, 3% 75%, 0 50%, 3% 25%); }
.tape.tl { left: -14px; top: -6px; transform: rotate(-28deg); }
.tape.tr { right: -14px; top: -6px; transform: rotate(28deg); }
.tape.tc { left: calc(50% - 37px); top: -11px; transform: rotate(-3deg); }

h1, h2, h3 { margin: 0; }
.kicker { font-family: 'Permanent Marker', cursive; font-size: 20px; color: #8a5a12; line-height: 1.1; }
.big { font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 40px; line-height: .95; letter-spacing: .5px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.marker { font-family: 'Permanent Marker', cursive; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 58px; width: 100%;
  font-weight: 900; font-style: italic; font-size: 26px; text-transform: uppercase; letter-spacing: 1px;
  background: var(--accent); color: var(--ink); filter: drop-shadow(2px 4px 2px rgba(0,0,0,.5)); }
.btn > span { display: block; }
.btn.dark { background: var(--black); color: var(--accent); border: 2px solid #3a3a3a; }
.btn.small { min-height: 44px; font-size: 20px; }
.btn:active { transform: translateY(2px) scale(.99); }
.btn[disabled] { opacity: .5; }

/* ---------- connecting ---------- */
.splash { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 20px 0; }
.splash img { width: 160px; height: 160px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,.6)); animation: bob 1.4s steps(6) infinite; }
.splash img.bump-img { width: 100%; max-width: 320px; height: min(32vh, 240px); } /* a bumper's own image gets more room */
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
.splash .big { color: var(--accent); }
.splash p { margin: 0; font-size: 20px; font-weight: 700; color: var(--cream); max-width: 320px; }

/* ---------- join ---------- */
.join .in { display: flex; flex-direction: column; gap: 12px; }
.field label { display: block; font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.field input { width: 100%; height: 56px; padding: 0 14px; font-size: 26px; font-weight: 800; color: var(--ink); background: #fff;
  border: 3px solid var(--ink); border-radius: 0; outline: none; }
.field input:focus { border-color: #8a5a12; }
.field .err { min-height: 22px; color: var(--red); font-weight: 800; font-size: 18px; margin-top: 4px; }
.avgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.avgrid.few { grid-template-columns: repeat(3, 1fr); } /* the 9 team logos: a 3×3 grid, bigger so the logos read */
.avgrid button { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%; padding: 3px; }
.avgrid button[aria-pressed="true"] { background: var(--ink); box-shadow: 0 0 0 3px var(--accent); }
.avgrid .avatar { width: 100% !important; height: 100% !important; flex: 1 1 auto !important; }
.avgrid .avatar svg { width: 100%; height: 100%; }
.live-banner { background: var(--red); color: #fff; font-weight: 900; font-style: italic; text-transform: uppercase; text-align: center;
  padding: 8px 10px; font-size: 20px; letter-spacing: .5px; animation: pulse 1s steps(2) infinite; }
@keyframes pulse { 50% { opacity: .75; } }

/* ---------- lobby ---------- */
.lobby { display: flex; flex-direction: column; gap: 14px; }
.hello { display: flex; align-items: center; gap: 14px; }
.hello .big { font-size: 34px; }
.standing { display: flex; justify-content: space-around; text-align: center; }
.standing .n { font-weight: 900; font-style: italic; font-size: 42px; line-height: 1; }
.standing .l { font-weight: 800; font-size: 15px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.watch { text-align: center; font-family: 'Permanent Marker', cursive; font-size: 22px; color: var(--accent); }
.count { text-align: center; font-weight: 800; font-size: 18px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- board ---------- */
.board .in { padding: 14px 10px; }
.board h2 { font-weight: 900; font-style: italic; font-size: 30px; text-transform: uppercase; text-align: center; margin-bottom: 8px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 10px; padding: 6px 6px; font-weight: 800; font-size: 21px; border-bottom: 2px dashed rgba(20,20,20,.15); }
.rows li:last-child { border-bottom: 0; }
.rows .r { width: 42px; flex: 0 0 auto; text-align: center; font-weight: 900; font-style: italic; font-size: 24px; }
.rows .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .s { font-variant-numeric: tabular-nums; }
.rows li.me { background: var(--accent); }
.rows li.top1 .r { color: #b8860b; }
.mine { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--black); color: var(--cream); font-weight: 800; font-size: 20px; margin-top: 10px; }
.mine .r { color: var(--accent); font-weight: 900; font-style: italic; font-size: 26px; }
.rows li.more { justify-content: center; font-size: 18px; text-transform: uppercase; letter-spacing: 1px; }
/* your place, pinned to the bottom of the screen while the list scrolls */
.dock { position: sticky; bottom: calc(8px + var(--safe-b)); z-index: 5; }
.dock .mine { width: 100%; margin-top: 0; text-align: left; box-shadow: 0 -4px 14px rgba(0,0,0,.55); border: 2px solid #3a3a3a; }
.near-box { background: var(--black); color: var(--cream); padding: 8px 8px 4px; border: 2px solid #3a3a3a; box-shadow: 0 -4px 14px rgba(0,0,0,.55); }
.near-h { font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .5px; font-size: 18px; color: var(--accent); padding: 0 4px 2px; }
.rows.near li { font-size: 18px; padding: 3px 4px; gap: 8px; border-bottom-color: rgba(244,238,223,.12); }
.rows.near li.me { background: var(--accent); color: var(--ink); }
.rows.near .r { width: auto; min-width: 42px; font-size: 20px; }

/* "you" card over a board the fan opened, with the nickname editor */
.me-card > .in { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.me-card .who { flex: 1; min-width: 0; }
.me-card .nm { font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 30px; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card .note { font-weight: 800; font-size: 15px; letter-spacing: 1px; text-transform: uppercase; color: #6b4a10; }
.edit-btn { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; background: var(--ink); color: var(--accent);
  font-weight: 900; font-style: italic; font-size: 20px; text-transform: uppercase; letter-spacing: .5px; }
.edit-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.edit-btn:active { transform: translateY(2px); }
.me-card.editing > .in { flex-direction: column; align-items: stretch; gap: 8px; }
.me-card .field .err { margin-top: 2px; color: #9e1b0f; } /* the usual red is too faint on the accent */
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); filter: none; }

/* podium card above the big screen's board for a fan in the top 3 (re-renders sync its animations to the first showing) */
.pp.kraft > .in { background: var(--kraft); }
.cheer > .in { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 112px; padding: 14px 14px 14px 116px; }
.cheer .big { font-size: 38px; transform-origin: left center; }
.cheer .sub { font-weight: 800; font-size: 19px; }
.cheer.p3 .kicker { color: #4a3210; }
.cheer .emb { position: absolute; left: 14px; top: calc(50% - 46px); width: 92px; height: 92px; z-index: 2; pointer-events: none; }
.cheer .emb span, .cheer .emb i { position: absolute; display: block; }
.cheer .big { animation: big-in 320ms steps(4) 520ms both; }
@keyframes big-in { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: none; opacity: 1; } }
/* 1st: crown drop on a spinning sunburst */
.cheer .rays { inset: -10px; background: #fff8de; animation: rays 6s steps(24) infinite; }
@keyframes rays { to { transform: rotate(360deg); } }
.cheer .crown { inset: 0; transform-origin: 50% 100%; }
.cheer .band { left: 8px; right: 8px; top: 22px; bottom: 14px; background: var(--ink); clip-path: polygon(0 100%, 0 0, 26% 52%, 50% 0, 74% 52%, 100% 0, 100% 100%); }
.cheer .emb .band i { inset: 4px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 1px; background: #e0a81a; clip-path: inherit;
  font-weight: 900; font-style: italic; font-size: 26px; color: var(--ink); }
.cheer .jewel { top: 13px; width: 15px; height: 15px; border-radius: 50%; background: var(--accent-edge); border: 3px solid var(--ink); }
.cheer .jewel.j1 { left: 1px; }
.cheer .jewel.j2 { left: calc(50% - 7.5px); }
.cheer .jewel.j3 { right: 1px; }
.cheer.p1 { animation: cheer-pop 380ms steps(4) both; }
@keyframes cheer-pop { 0% { transform: scale(.5) rotate(-6deg); opacity: 0; } 70% { transform: scale(1.05) rotate(-2deg); opacity: 1; } 100% { transform: rotate(-1.2deg); opacity: 1; } }
.cheer .crown { animation: crown-drop 700ms steps(8) 250ms both; }
@keyframes crown-drop { 0% { transform: translateY(-150px) rotate(-25deg); opacity: 0; } 15% { opacity: 1; } 60% { transform: translateY(0) rotate(5deg) scale(1.12, .82); }
  80% { transform: translateY(-12px) rotate(-3deg); } 100% { transform: none; opacity: 1; } }
/* 2nd: a silver medal swings in on its ribbon, and glints */
.cheer .medal { inset: 0; transform-origin: 50% 0; }
.cheer .ribbon { top: -4px; left: calc(50% - 9px); width: 18px; height: 46px; background: linear-gradient(90deg, var(--ink) 0 30%, var(--accent) 30% 70%, var(--ink) 70%); }
.cheer .ribbon.l { transform: translateX(-10px) rotate(-18deg); }
.cheer .ribbon.r { transform: translateX(10px) rotate(18deg); }
.cheer .emb .disc { left: calc(50% - 30px); top: 30px; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #dcdcdc; border: 3px solid var(--ink); box-shadow: inset 0 0 0 4px #f4f4f4, inset 0 0 0 6px #a9a9a9;
  font-weight: 900; font-style: italic; font-size: 32px; color: var(--ink); }
.cheer .spark { width: 18px; height: 18px; background: var(--accent); transform: scale(0); animation: twinkle 1.8s steps(6) infinite;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.cheer .spark.s1 { left: -2px; top: 34px; animation-delay: 1.2s; }
.cheer .spark.s2 { right: -4px; top: 24px; width: 14px; height: 14px; animation-delay: 1.6s; }
.cheer .spark.s3 { right: 4px; bottom: -8px; animation-delay: 2.1s; }
@keyframes twinkle { 0%, 55%, 100% { transform: scale(0); } 75% { transform: scale(1.2) rotate(45deg); } }
.cheer.p2 { animation: cheer-slide 420ms steps(5) both; }
@keyframes cheer-slide { 0% { transform: translateX(110%) rotate(8deg); } 100% { transform: rotate(1deg); } }
.cheer .medal { animation: medal-swing 1600ms steps(16) 300ms both; }
@keyframes medal-swing { 0% { transform: translateY(-40px) rotate(-70deg); opacity: 0; } 12% { opacity: 1; } 25% { transform: rotate(38deg); } 45% { transform: rotate(-22deg); }
  62% { transform: rotate(12deg); } 78% { transform: rotate(-6deg); } 90% { transform: rotate(3deg); } 100% { transform: none; opacity: 1; } }
/* 3rd: a bronze rosette stamped down, shaking the card */
.cheer .rosette { inset: 0; }
.cheer .tail { top: 50px; width: 20px; height: 40px; background: var(--ink); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); }
.cheer .tail.l { left: calc(50% - 24px); transform: rotate(16deg); }
.cheer .tail.r { left: calc(50% + 4px); transform: rotate(-16deg); }
.cheer .petals { left: 6px; top: 0; width: 80px; height: 80px; background: var(--ink); }
.cheer .petals i { inset: 4px; background: #a8642a; clip-path: inherit; }
.cheer .emb .core { left: calc(50% - 22px); top: 18px; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--cream); border: 3px solid var(--ink); font-weight: 900; font-style: italic; font-size: 26px; color: var(--ink); }
.cheer .rosette { animation: slam 340ms steps(4) 220ms both; }
@keyframes slam { 0% { transform: scale(3.2) rotate(-35deg); opacity: 0; } 65% { transform: scale(.86) rotate(5deg); opacity: 1; } 100% { transform: none; opacity: 1; } }
.cheer.p3 { animation: cheer-thud 300ms steps(5) 470ms both; }
@keyframes cheer-thud { 0%, 100% { transform: rotate(-1.2deg); } 25% { transform: translate(-5px, 3px) rotate(-2.5deg); } 50% { transform: translate(5px, -2px) rotate(0); }
  75% { transform: translate(-3px, 1px) rotate(-1.8deg); } }

/* ---------- question ---------- */
.q-head { display: flex; align-items: center; gap: 10px; }
.q-tag { background: var(--black); color: var(--accent); font-weight: 900; font-style: italic; font-size: 20px; padding: 4px 12px;
  transform: rotate(-2deg); border: 2px solid #3a3a3a; }
.q-cat { font-family: 'Permanent Marker', cursive; font-size: 18px; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.q-secs { width: 52px; height: 52px; border-radius: 50%; background: var(--black); border: 3px solid #3a3a3a; display: flex; align-items: center;
  justify-content: center; font-weight: 900; font-style: italic; font-size: 28px; color: var(--accent); flex: 0 0 auto; }
.q-secs.hurry { color: #ff6a52; border-color: #ff6a52; }
.timer { height: 14px; background: var(--black); border: 2px solid #3a3a3a; position: relative; overflow: hidden; }
.timer .fill { position: absolute; left: 0; right: 0; top: 0; bottom: 0; background: var(--accent); transform-origin: 0 50%; }
.timer.hurry .fill { background: #ff6a52; }
.q-card .in { padding: 20px 18px 18px; }
.q-text { font-weight: 800; font-size: 28px; line-height: 1.08; }
.q-img { display: block; width: 100%; max-height: 28vh; object-fit: contain; margin-top: 10px; background: #fff; }
.pts-line { display: flex; align-items: baseline; justify-content: center; gap: 8px; min-height: 40px; }
.pts-line .v { font-weight: 900; font-style: italic; font-size: 38px; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1; }
.pts-line .l { font-weight: 800; font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.tiles { display: flex; flex-direction: column; gap: 10px; position: relative; }
.tile { position: relative; display: block; width: 100%; text-align: left; filter: drop-shadow(2px 4px 2px rgba(0,0,0,.5)); }
.tile > .in { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 14px 8px 8px; background: var(--accent); color: var(--ink); }
.tile .badge { flex: 0 0 46px; height: 46px; border-radius: 50%; background: var(--black); color: var(--accent); display: flex; align-items: center;
  justify-content: center; font-weight: 900; font-style: italic; font-size: 30px; }
.tile .atext { flex: 1; font-weight: 800; font-size: 24px; line-height: 1.05; overflow-wrap: anywhere; }
.tile .aimg { flex: 0 0 52px; height: 52px; background: #fff; object-fit: contain; padding: 2px; }
.tile .aimg.cover { object-fit: cover; padding: 0; }
.tile:active > .in { transform: translateY(2px); }
.tiles.wait .tile { opacity: .55; }
.tiles.locked .tile:not(.pick) { opacity: .35; }
.tile.pick > .in { background: var(--paper); box-shadow: inset 0 0 0 4px var(--ink); }
.tile.pick .badge { background: var(--accent); color: var(--ink); }
.tile .lock { display: none; font-weight: 900; font-style: italic; font-size: 16px; text-transform: uppercase; background: var(--ink); color: var(--accent);
  padding: 2px 8px; position: absolute; right: 8px; top: -10px; transform: rotate(3deg); }
.tile.pick .lock { display: block; }
.tile.gone { visibility: hidden; }
.tile.right > .in { background: var(--green); color: #fff; }
.tile.right .badge { background: #fff; color: var(--green); }
.tile.wrongpick > .in { background: var(--red); color: #fff; }
.tile.wrongpick { visibility: visible; opacity: 1 !important; }
.tile.dim { opacity: .3; }

/* torn halves of a ripped tile */
.rip { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 5; animation: ripfall 900ms steps(11) forwards; }
.rip.r { animation-name: ripfallR; }
@keyframes ripfall { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 20% { transform: translate(-14px,-16px) rotate(-8deg); }
  100% { transform: translate(-90px,420px) rotate(-40deg); opacity: 0; } }
@keyframes ripfallR { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 20% { transform: translate(14px,-16px) rotate(8deg); }
  100% { transform: translate(90px,420px) rotate(40deg); opacity: 0; } }
.shake { animation: shake 260ms steps(5); }
@keyframes shake { 25% { transform: translate(-4px,1px) rotate(-1deg); } 50% { transform: translate(4px,-1px) rotate(1deg); } 75% { transform: translate(-3px,0); } }

.status-line { text-align: center; font-weight: 900; font-style: italic; font-size: 24px; text-transform: uppercase; min-height: 30px; color: var(--cream); }
.status-line.good { color: var(--accent); }

/* ---------- result ---------- */
.result { display: flex; flex-direction: column; gap: 10px; }
.stamp { align-self: center; font-weight: 900; font-style: italic; font-size: 48px; text-transform: uppercase; line-height: 1; padding: 8px 20px;
  transform: rotate(-4deg); background: var(--accent); color: var(--ink); animation: stamp 330ms steps(4); }
.stamp.no { background: var(--red); color: #fff; }
@keyframes stamp { 0% { transform: rotate(-30deg) scale(2.4); opacity: 0; } 100% { transform: rotate(-4deg) scale(1); opacity: 1; } }
.result .line { text-align: center; font-weight: 800; font-size: 21px; }
.result .line b { color: var(--accent); }
.fastest { align-self: center; display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 0 6px; }
.fastest .star { position: relative; flex: 0 0 60px; height: 60px; background: var(--cream); animation: wiggle 700ms steps(2) infinite; }
.fastest .face { position: absolute; inset: 3px; display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--ink);
  font-weight: 900; font-style: italic; font-size: 19px; text-transform: uppercase; }
.fastest .t { font-weight: 900; font-style: italic; font-size: 23px; line-height: 1.05; text-transform: uppercase; color: var(--accent); }
.fastest.pop { animation: fastest-in 360ms steps(4) 260ms both; }
@keyframes fastest-in { 0% { transform: scale(.3) rotate(-10deg); opacity: 0; } 70% { transform: scale(1.08) rotate(2deg); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes wiggle { 0% { transform: rotate(-8deg); } 100% { transform: rotate(8deg); } }
.confetti { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; display: block; }
.fact .in { padding: 14px 16px; }
.fact .t { font-weight: 700; font-size: 20px; line-height: 1.15; }

/* ---------- misc ---------- */
.notice .in { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.notice .big { color: var(--ink); }
.codebox .in { display: flex; flex-direction: column; gap: 6px; }
.codebox .field .err { color: #9e1c0c; }
.codebox .field input { height: 64px; text-align: center; font-size: 36px; font-weight: 900; letter-spacing: 6px; text-transform: uppercase; }
#net { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); z-index: 40; background: rgba(0,0,0,.85); color: var(--accent);
  font-weight: 800; font-size: 17px; padding: 8px 14px; border-radius: 20px; display: flex; align-items: center; gap: 8px; letter-spacing: .5px; }
#net .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse .8s steps(2) infinite; }
#toast { position: fixed; left: 50%; top: calc(var(--bar) + var(--safe-t) + 6px); transform: translate(-50%, -20px); opacity: 0; z-index: 50;
  background: var(--ink); color: var(--accent); border: 2px solid var(--accent); padding: 8px 16px; font-weight: 800; font-size: 19px;
  transition: opacity .15s steps(2), transform .15s steps(2); pointer-events: none; max-width: 92vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-height: 640px) { .q-text { font-size: 24px; } .tile > .in { min-height: 54px; } .tile .atext { font-size: 21px; } .big { font-size: 34px; } }
@media (prefers-reduced-motion: reduce) { .rip, .stamp, .splash img, .live-banner, .shake, .spcard .sp-board, .fastest, .fastest .star, .cheer, .cheer * { animation: none !important; } .rip, .confetti { display: none; } }
