:root {
  --bg: #0b0d26;
  --bg2: #151845;
  --card: #1c2058;
  --card2: #232869;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f6ff;
  --muted: #a4a9dc;
  --t0: #ff5d73;
  --t1: #22d3c5;
  --gold: #ffc93c;
  --violet: #8b7bff;
  --ok: #3ddc84;
  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --display: "Outfit", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh; min-height: 100dvh;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  background-attachment: fixed;
  overflow-x: hidden;
}
/* Slow drifting colour blobs behind everything. */
body::before, body::after {
  content: ""; position: fixed; z-index: -1; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(90px); opacity: 0.28; pointer-events: none;
}
body::before { background: var(--t0); top: -30vmax; left: -20vmax; animation: drift 22s ease-in-out infinite alternate; }
body::after { background: var(--t1); top: -32vmax; right: -22vmax; animation: drift 26s ease-in-out infinite alternate-reverse; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, .logo, .btn, .tile b, .score-num { font-family: var(--display); }

#app {
  max-width: 1200px; margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  transition: opacity 0.19s ease, transform 0.19s ease;
}
#app.leave { opacity: 0; transform: scale(0.985) translateY(6px); }

.logo { font-size: clamp(2.4rem, 8vw, 4.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; }
.logo b { color: var(--gold); font-weight: 800; }
.logo .bolt { display: inline-block; margin-right: 0.12em; animation: zap 3.2s ease-in-out infinite; transform-origin: 50% 80%; }
.logo.small { font-size: 1.3rem; white-space: nowrap; }

.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4); }

.btn {
  position: relative; overflow: hidden; border: 0; border-radius: 999px; padding: 11px 20px; min-height: 44px;
  font-weight: 700; letter-spacing: 0.01em;
  transition: transform 0.18s var(--spring), filter 0.15s, opacity 0.15s, box-shadow 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.96); }
.btn:disabled { opacity: 0.38; }
.btn.primary { background: linear-gradient(180deg, #ffd766, var(--gold)); color: #2a1d00; box-shadow: 0 8px 24px rgba(255, 201, 60, 0.28); }
.btn.primary::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
}
.btn.ghost { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); }
.btn.big { padding: 14px 34px; font-size: 1.1rem; }
.btn.nudge { animation: nudge 1.2s ease-in-out infinite; }
@media (hover: hover) {
  .btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
  .btn.primary:hover:not(:disabled)::after { transform: translateX(120%) skewX(-20deg); transition: transform 0.6s ease; }
  .btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
}

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.top-actions { display: flex; gap: 8px; }
.top-actions .btn { padding: 8px 16px; min-height: 40px; font-size: 0.9rem; }

/* ---------- home ---------- */
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.home { position: relative; text-align: center; padding-top: clamp(8px, 4vh, 48px); }
.hero, .setup, .marquee, .how, .credits { position: relative; z-index: 1; }

.floaters { position: absolute; inset: 0 -16px auto; height: 620px; pointer-events: none; overflow: hidden; }
.fl { position: absolute; font-size: clamp(1.5rem, 4vw, 2.8rem); opacity: 0.55; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45)); animation: floaty 7s ease-in-out infinite; }
.fl0 { left: 4%; top: 6%; animation-delay: -1s; } .fl1 { left: 14%; top: 34%; animation-delay: -3s; animation-duration: 9s; }
.fl2 { left: 7%; top: 62%; animation-delay: -5s; } .fl3 { left: 1.5%; top: 84%; animation-delay: -2s; animation-duration: 8s; }
.fl4 { right: 5%; top: 8%; animation-delay: -4s; } .fl5 { right: 15%; top: 36%; animation-delay: -1.5s; animation-duration: 9s; }
.fl6 { right: 8%; top: 64%; animation-delay: -6s; } .fl7 { right: 2%; top: 86%; animation-delay: -2.5s; animation-duration: 8s; }
.fl8 { left: 30%; top: 78%; animation-delay: -3.5s; } .fl9 { right: 31%; top: 80%; animation-delay: -0.5s; animation-duration: 10s; }

.badge { display: inline-flex; align-items: center; gap: 9px; padding: 7px 15px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; backdrop-filter: blur(6px); }
.badge i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6); animation: ping 1.8s ease-out infinite; }
.title { font-size: clamp(2.9rem, 11vw, 6.6rem); font-weight: 800; letter-spacing: -0.045em; line-height: 0.95; margin: 18px 0 0; }
.title span { display: inline-block; }
.title .w1 { color: #fff; text-shadow: 0 6px 30px rgba(255, 255, 255, 0.18); }
.title .w2 { background: linear-gradient(90deg, var(--t0), var(--gold), var(--t1), var(--violet), var(--t0)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: hue 7s linear infinite; padding-bottom: 0.08em; }
.title .bolt { font-size: 0.55em; margin-left: 0.08em; animation: zap 3.2s ease-in-out infinite; transform-origin: 50% 80%; }
.tagline { color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.25rem); max-width: 560px; margin: 16px auto 0; }
.stats { display: flex; justify-content: center; gap: clamp(18px, 6vw, 56px); margin: 22px 0 30px; }
.stats div { display: grid; gap: 2px; }
.stats b { font-family: var(--display); font-size: clamp(1.7rem, 5vw, 2.8rem); line-height: 1; font-variant-numeric: tabular-nums; color: var(--gold); }
.stats div:nth-child(2) b { color: var(--t1); }
.stats div:nth-child(3) b { color: var(--t0); }
.stats span { color: var(--muted); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; }

.setup { max-width: 760px; margin: 0 auto; padding: 3px; border-radius: 26px; background: conic-gradient(from var(--ang), var(--t0), var(--gold), var(--t1), var(--violet), var(--t0)); animation: spin 6s linear infinite; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(139, 123, 255, 0.25); }
.setup-body { border-radius: 23px; background: linear-gradient(180deg, var(--card2), var(--card)); padding: clamp(16px, 4vw, 28px); display: grid; gap: 18px; justify-items: center; }
.setup-in { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: end; }
.field { display: grid; gap: 8px; text-align: left; font-weight: 700; }
.field span { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.74rem; }
.field.t0 span { color: var(--t0); }
.field.t1 span { color: var(--t1); }
.field input { width: 100%; padding: 14px 16px; border-radius: 14px; font-size: 1.1rem; font-weight: 600; background: rgba(0, 0, 0, 0.3); border: 2px solid var(--line); outline: none; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--spring), background 0.2s; }
.field.t0 input { border-color: rgba(255, 93, 115, 0.4); }
.field.t1 input { border-color: rgba(34, 211, 197, 0.4); }
.field input:focus { transform: translateY(-2px) scale(1.01); }
.field.t0 input:focus { border-color: var(--t0); background: rgba(255, 93, 115, 0.1); box-shadow: 0 0 0 5px rgba(255, 93, 115, 0.2); }
.field.t1 input:focus { border-color: var(--t1); background: rgba(34, 211, 197, 0.08); box-shadow: 0 0 0 5px rgba(34, 211, 197, 0.18); }
.vs { position: relative; width: 52px; height: 52px; display: grid; place-content: center; border-radius: 50%; background: linear-gradient(135deg, var(--t0), var(--t1)); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }
.vs::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, 0.45); animation: rotate 9s linear infinite; }
.vs b { font-family: var(--display); font-weight: 800; color: #14163c; font-size: 1.05rem; animation: pulse 2s ease-in-out infinite; }
.btn.go { font-size: 1.15rem; padding: 15px 38px; animation: nudge 2.2s ease-in-out infinite; }
.btn.go i { display: inline-block; font-style: normal; margin-left: 6px; transition: transform 0.25s var(--spring); }
@media (hover: hover) { .btn.go:hover i { transform: translateX(6px); } }

.marquee { display: grid; gap: 12px; margin: clamp(34px, 6vh, 56px) -16px 0; padding: 14px 0; overflow: hidden; transform: rotate(-2deg) scale(1.04); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.mq-row { display: flex; gap: 12px; width: max-content; animation: marquee 110s linear infinite; }
.mq-row.rtl { animation-direction: reverse; }
.mq-card { position: relative; flex: none; width: clamp(140px, 17vw, 200px); aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(135deg, var(--violet), var(--t1)); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); }
.mq-card:nth-child(3n) { background: linear-gradient(135deg, var(--t0), var(--gold)); }
.mq-card:nth-child(3n + 1) { background: linear-gradient(135deg, #4f8cff, var(--violet)); }
.mq-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mq-card span { position: absolute; inset: auto 0 0; padding: 22px 10px 8px; text-align: left; font-weight: 700; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: linear-gradient(180deg, transparent, rgba(8, 9, 30, 0.92)); }

.how { list-style: none; padding: 0; margin: clamp(30px, 6vh, 52px) auto 0; max-width: 1040px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; text-align: left; }
.how li { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 8px; align-content: start; transition: transform 0.25s var(--spring), border-color 0.2s, background 0.2s; }
.how i { font-style: normal; width: 46px; height: 46px; display: grid; place-content: center; font-size: 1.45rem; border-radius: 13px; background: linear-gradient(135deg, var(--t0), #ff9a5c); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3); }
.how li:nth-child(2) i { background: linear-gradient(135deg, var(--gold), #ff9a3c); }
.how li:nth-child(3) i { background: linear-gradient(135deg, var(--t1), #4f8cff); }
.how li:nth-child(4) i { background: linear-gradient(135deg, var(--violet), #f47fc0); }
.how b { font-family: var(--display); font-size: 1.1rem; }
.how span { color: var(--muted); line-height: 1.45; font-size: 0.94rem; }
@media (hover: hover) {
  .how li:hover { transform: translateY(-6px) rotate(-1deg); border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.09); }
  .how li:hover i { animation: wobble 0.6s ease; }
}
.credits { margin: 28px 0 0; font-size: 0.82rem; }
.credits a { color: var(--muted); }

.enter .badge { animation: drop 0.5s var(--ease) both; }
.enter .title .w1 { animation: slideL 0.7s var(--spring) 0.05s both; }
.enter .title .w2 { animation: slideR 0.7s var(--spring) 0.12s both, hue 7s linear infinite; }
.enter .title .bolt { animation: pop 0.5s var(--spring) 0.55s both, zap 3.2s 1.2s ease-in-out infinite; }
.enter .tagline { animation: rise 0.6s var(--ease) 0.25s both; }
.enter .stats div { animation: rise 0.6s var(--ease) both; }
.enter .stats div:nth-child(1) { animation-delay: 0.32s; }
.enter .stats div:nth-child(2) { animation-delay: 0.4s; }
.enter .stats div:nth-child(3) { animation-delay: 0.48s; }
.enter .setup { animation: flipin 0.7s var(--ease) 0.45s both, spin 6s linear infinite; }
.enter .marquee { animation: fadein 1s ease 0.7s both; }
.enter .how li { animation: rise 0.6s var(--ease) both; }
.enter .how li:nth-child(1) { animation-delay: 0.8s; }
.enter .how li:nth-child(2) { animation-delay: 0.88s; }
.enter .how li:nth-child(3) { animation-delay: 0.96s; }
.enter .how li:nth-child(4) { animation-delay: 1.04s; }
.enter .fl { animation: pop 0.6s var(--spring) both, floaty 7s 0.6s ease-in-out infinite; }

@media (max-width: 900px) { .how { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) {
  .setup-in { grid-template-columns: 1fr; justify-items: stretch; }
  .setup-in .vs { justify-self: center; width: 44px; height: 44px; margin: -2px 0 -6px; }
  .btn.go { width: 100%; padding-left: 12px; padding-right: 12px; }
  .fl1, .fl2, .fl3, .fl5, .fl6, .fl7, .fl8, .fl9 { display: none; }
  .title { font-size: clamp(3.2rem, 17vw, 4.8rem); }
  .title .w1, .title .w2 { display: block; }
  .title .bolt { display: none; }
  .fl { opacity: 0.35; }
  .marquee { margin-top: 30px; }
}

/* ---------- screen wipe ---------- */
#wipe { position: fixed; inset: 0; z-index: 60; pointer-events: none; visibility: hidden; overflow: hidden; }
#wipe.go { visibility: visible; }
#wipe i { position: absolute; top: -10%; bottom: -10%; width: 62%; }
#wipe i:nth-child(1) { left: -8%; background: linear-gradient(135deg, var(--t0), #ff9a5c); transform: translateX(-115%) skewX(-8deg); }
#wipe i:nth-child(2) { right: -8%; background: linear-gradient(135deg, #4f8cff, var(--t1)); transform: translateX(115%) skewX(-8deg); }
#wipe b { position: absolute; left: 50%; top: 50%; font-size: clamp(4rem, 16vw, 9rem); line-height: 1; transform: translate(-50%, -50%) scale(0); filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5)); }
#wipe.go i:nth-child(1) { animation: wipeL 0.9s var(--ease) both; }
#wipe.go i:nth-child(2) { animation: wipeR 0.9s var(--ease) both; }
#wipe.go b { animation: wipeB 0.9s var(--ease) both; }

/* ---------- pick ---------- */
.banner { text-align: center; font-size: clamp(1.05rem, 2.6vw, 1.35rem); padding: 14px; border-radius: 14px; margin-bottom: 14px; border: 2px solid; animation: drop 0.35s var(--ease) both; }
.banner.t0 { background: rgba(255, 93, 115, 0.15); border-color: var(--t0); }
.banner.t1 { background: rgba(34, 211, 197, 0.13); border-color: var(--t1); }
.banner.done { background: rgba(255, 201, 60, 0.14); border-color: var(--gold); }
.pick-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.pick-team { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border-left: 5px solid; opacity: 0.6; transition: opacity 0.3s, background 0.3s; }
.pick-team.active { opacity: 1; background: rgba(255, 255, 255, 0.09); }
.pick-team.t0 { border-color: var(--t0); }
.pick-team.t1 { border-color: var(--t1); }
.pick-team h3 { margin: 0 6px 0 0; font-size: 1rem; }
.slot { min-width: 34px; text-align: center; padding: 6px 10px; border-radius: 999px; border: 1px dashed var(--line); color: var(--muted); font-size: 0.88rem; }
.slot.filled { border-style: solid; color: var(--text); background: rgba(255, 255, 255, 0.09); }
.slot.just { animation: pop 0.4s var(--spring) both; }
.groups { display: grid; gap: 22px; }
.group-title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.group-title small { font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); letter-spacing: 0; }
.enter .group-title { animation: rise 0.4s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.cat-card {
  position: relative; display: grid; gap: 8px; justify-items: center; align-content: center; padding: 20px 12px; min-height: 124px;
  background: linear-gradient(180deg, var(--card2), var(--card)); border: 2px solid var(--line); border-radius: var(--radius);
  transition: transform 0.22s var(--spring), border-color 0.15s, box-shadow 0.2s, opacity 0.3s;
}
.cat-card .icon { font-size: 2.3rem; transition: transform 0.3s var(--spring); }
.cat-card .name { font-weight: 700; text-align: center; }
.cat-card:disabled:not(.picked) { opacity: 0.32; }
.cat-card.picked.t0 { border-color: var(--t0); background: rgba(255, 93, 115, 0.18); }
.cat-card.picked.t1 { border-color: var(--t1); background: rgba(34, 211, 197, 0.16); }
.cat-card.just { animation: stamp 0.45s var(--spring) both; }
.cat-card .owner { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.cat-card.t0 .owner { color: var(--t0); }
.cat-card.t1 .owner { color: var(--t1); }
.cat-card:active:not(:disabled) { transform: scale(0.96); }
@media (hover: hover) {
  .cat-card:hover:not(:disabled) { transform: translateY(-5px); border-color: var(--gold); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35); }
  .cat-card:hover:not(:disabled) .icon { transform: scale(1.25) rotate(-8deg); }
}
.enter .cat-card { animation: rise 0.45s var(--ease) both; animation-delay: calc(var(--i) * 14ms); }
.pick-actions {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 20px -16px 0; padding: 14px 16px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(11, 13, 38, 0.92) 40%);
}

/* ---------- game shell: strip, team rails, centre ---------- */
#app.screen-board, #app.screen-question { max-width: 1500px; padding-top: 14px; padding-bottom: 16px; }

.strip { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.dots { flex: 1; display: flex; gap: 4px; min-width: 0; }
.dots i { flex: 1; max-width: 22px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); transition: background 0.4s; }
.dots i.t0 { background: var(--t0); }
.dots i.t1 { background: var(--t1); }
.dots i.both { background: linear-gradient(90deg, var(--t0) 50%, var(--t1) 50%); }
.dots i.none { background: rgba(255, 255, 255, 0.35); }
.dots i.now { background: var(--gold); animation: glowdot 1.4s ease-in-out infinite; }
.round { color: var(--muted); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.round b { color: var(--text); font-size: 1.15rem; }

.stage { display: grid; grid-template-columns: clamp(124px, 13vw, 190px) 1fr clamp(124px, 13vw, 190px); gap: 14px; align-items: stretch; min-height: calc(100dvh - 96px); }
.center { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.rail {
  --t: var(--t0);
  position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 10px; border-radius: var(--radius); text-align: center;
  background: linear-gradient(180deg, var(--card2), var(--card)); border: 2px solid var(--line);
}
.rail.t1 { --t: var(--t1); }
.rail.active {
  border-color: var(--t);
  background: linear-gradient(180deg, color-mix(in srgb, var(--t) 80%, #0e1030), color-mix(in srgb, var(--t) 26%, #0e1030));
  animation: railglow 2.4s ease-in-out infinite alternate;
}
.rail-top { display: grid; gap: 10px; justify-items: center; }
.rail h2 { margin: 0; font-size: clamp(1.15rem, 2vw, 1.7rem); font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; overflow-wrap: anywhere; color: var(--t); }
.rail.active h2 { color: #fff; }
.turn-tag { font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.rail.active .turn-tag { background: #fff; color: #14163c; animation: pop 0.4s var(--spring) both; }
.rail-score { position: relative; display: grid; justify-items: center; gap: 4px; }
.rail-score small { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.68rem; color: var(--muted); font-weight: 700; }
.rail.active .rail-score small { color: rgba(255, 255, 255, 0.8); }
.score-num { font-size: clamp(2.2rem, 4.6vw, 4rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.rail.bump .score-num { animation: bump 0.7s var(--spring); }
.float { position: absolute; top: -6px; left: 50%; font-family: var(--display); font-weight: 800; font-size: 1.3rem; pointer-events: none; animation: floatup 1.3s var(--ease) forwards; }
.float.up { color: var(--gold); }
.float.down { color: #fff; opacity: 0.8; }
.status { margin-top: 8px; font-size: 0.76rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); white-space: nowrap; }
.rail-adj { display: flex; gap: 8px; }
.adj { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.24); font-weight: 800; line-height: 1; transition: transform 0.15s var(--spring), background 0.15s; }
.adj:active { transform: scale(0.88); }
@media (hover: hover) { .adj:hover { background: rgba(255, 255, 255, 0.2); } }

.enter .strip { animation: drop 0.4s var(--ease) both; }
.enter .rail.t0 { animation: slideL 0.5s var(--ease) both; }
.enter .rail.t1 { animation: slideR 0.5s var(--ease) both; }
.enter .rail.active { animation: slideL 0.5s var(--ease) both, railglow 2.4s 0.5s ease-in-out infinite alternate; }
.enter .rail.t1.active { animation: slideR 0.5s var(--ease) both, railglow 2.4s 0.5s ease-in-out infinite alternate; }

.turn-banner {
  --t: var(--t0);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 20px; border-radius: var(--radius);
  background: linear-gradient(90deg, color-mix(in srgb, var(--t) 88%, #0e1030), color-mix(in srgb, var(--t) 38%, #0e1030));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--t) 25%, transparent);
  animation: drop 0.45s var(--ease) both;
}
.turn-banner.t1 { --t: var(--t1); }
.turn-banner div { display: grid; }
.turn-banner small { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.68rem; font-weight: 800; opacity: 0.85; }
.turn-banner b { font-family: var(--display); font-size: clamp(1.25rem, 2.6vw, 2rem); font-weight: 800; text-transform: uppercase; line-height: 1.1; }
.pill { background: #fff; color: #14163c; font-weight: 800; padding: 8px 16px; border-radius: 999px; white-space: nowrap; }
.pill i { display: inline-block; font-style: normal; animation: tap 1.3s ease-in-out infinite; }

/* ---------- insane cards ---------- */
.gamble { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g-card {
  --t: var(--t0);
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 9px 16px; min-height: 54px; text-align: left;
  border-radius: 14px; border: 2px solid #ff7a3d; color: #fff;
  background: linear-gradient(100deg, #3a0f24, #7a1836 45%, #c2410c);
  background-size: 200% 100%; animation: ember 5s ease-in-out infinite alternate;
  box-shadow: 0 0 24px rgba(255, 90, 40, 0.35); transition: transform 0.2s var(--spring), box-shadow 0.2s, opacity 0.3s, filter 0.3s;
}
.g-card.t1 { --t: var(--t1); }
.g-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--t); }
.g-card i { font-style: normal; font-size: 1.6rem; animation: flame 1.1s ease-in-out infinite alternate; }
.g-card span { display: grid; min-width: 0; }
.g-card small { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-card b { font-family: var(--display); font-size: clamp(1rem, 1.8vw, 1.3rem); font-weight: 800; }
.g-card:disabled { opacity: 0.45; filter: saturate(0.5); animation: none; box-shadow: none; }
.g-card:disabled i { animation: none; }
.g-card.used { animation: none; box-shadow: none; background: rgba(0, 0, 0, 0.28); border-color: var(--line); color: var(--muted); }
.g-card.used i { animation: none; }
.g-card.used.won b { color: var(--gold); }
.g-card.used.lost b { color: var(--t0); }
button.g-card:active:not(:disabled) { transform: scale(0.97); }
@media (hover: hover) { button.g-card:hover:not(:disabled) { transform: translateY(-3px) scale(1.01); box-shadow: 0 0 44px rgba(255, 110, 40, 0.65); } }
.enter .g-card { animation: rise 0.5s var(--ease) 0.1s both, ember 5s 0.6s ease-in-out infinite alternate; }
.enter .g-card:disabled, .enter .g-card.used { animation: rise 0.5s var(--ease) 0.1s both; }
.question.insane { box-shadow: 0 0 70px rgba(255, 70, 60, 0.35), 0 24px 60px rgba(0, 0, 0, 0.4); }
.question.insane .q-art { background: radial-gradient(circle at 50% 120%, #ffb347, transparent 60%), linear-gradient(120deg, #2a0a1c, #8a1538 50%, #d9480f); }
.award-btn.lose { background: #2b1020; border: 2px solid var(--t0); color: var(--t0); }
@media (max-width: 620px) { .gamble { gap: 8px; } .g-card { padding: 8px 10px 8px 14px; gap: 8px; } .g-card i { font-size: 1.25rem; } .g-card small { font-size: 0.6rem; } }

/* ---------- board ---------- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; flex: 1; align-content: start; }
.cat {
  --c: var(--violet);
  border-radius: var(--radius); overflow: hidden;
  background: color-mix(in srgb, var(--c) 15%, var(--card));
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
  transition: opacity 0.4s, transform 0.3s var(--ease), filter 0.4s;
}
.cat.complete { opacity: 0.5; filter: saturate(0.6); }
.cat-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 88%, #fff), var(--c)); color: #14163c; }
.cat-head .icon { font-size: 1.3rem; }
.cat-head h3 { flex: 1; margin: 0; font-size: clamp(0.8rem, 1.3vw, 1.08rem); font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.count { font-size: 0.74rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.78); font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
.tile {
  display: grid; place-content: center; justify-items: center; gap: 1px;
  height: clamp(46px, 7.2vh, 72px); border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #ecebfb); color: #14163c; border: 0; border-bottom: 4px solid rgba(20, 22, 60, 0.3);
  transition: transform 0.18s var(--spring), box-shadow 0.18s;
}
.tile small { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.62; }
.tile b { font-size: clamp(1.15rem, 2vw, 1.6rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tile.p200 b { color: #128a55; }
.tile.p400 b { color: #c57a00; }
.tile.p600 b { color: #d42a4c; }
button.tile:active { transform: translateY(2px) scale(0.97); border-bottom-width: 2px; }
button.tile.launch { transform: scale(1.35); opacity: 0; transition: transform 0.2s ease-in, opacity 0.2s ease-in; z-index: 2; }
@media (hover: hover) {
  button.tile:hover { transform: translateY(-4px) rotate(-1.5deg); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.38), 0 0 0 3px var(--c); }
}
.tile.used { background: rgba(0, 0, 0, 0.26); color: var(--muted); border-bottom-color: transparent; }
.tile.used.t0 { background: color-mix(in srgb, var(--t0) 26%, #14163c); color: var(--t0); }
.tile.used.t1 { background: color-mix(in srgb, var(--t1) 22%, #14163c); color: var(--t1); }
.tile.used.both { background: linear-gradient(90deg, color-mix(in srgb, var(--t0) 30%, #14163c), color-mix(in srgb, var(--t1) 26%, #14163c)); color: var(--gold); }
.tile.used small { opacity: 0.9; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; }
.tile.used.just { animation: stamp 0.6s var(--spring) 0.35s both; }

.enter .cat { animation: dealin 0.5s var(--ease) both; animation-delay: calc(var(--i) * 60ms + 80ms); }
.enter .tile { animation: pop 0.4s var(--spring) both; animation-delay: calc(var(--j) * 22ms + 260ms); }
.enter .tile.used.just { animation: pop 0.4s var(--spring) both, stamp 0.6s var(--spring) 0.6s; }

/* ---------- question ---------- */
.question {
  --c: var(--gold); --pad: clamp(16px, 4vw, 40px);
  width: 100%; max-width: 900px; margin: auto; padding: 0 0 var(--pad); overflow: hidden; text-align: center;
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
}
.question > :not(.q-art) { margin-left: var(--pad); margin-right: var(--pad); }
.enter .question { animation: flipin 0.55s var(--ease) both; }

.q-art {
  position: relative; height: clamp(88px, 17vh, 150px); overflow: hidden;
  background:
    radial-gradient(circle at 22% 0%, color-mix(in srgb, var(--c) 60%, #fff), transparent 55%),
    linear-gradient(120deg, color-mix(in srgb, var(--c) 80%, #0e1030), color-mix(in srgb, var(--c) 30%, #0e1030));
}
.q-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(rgba(255, 255, 255, 0.22) 1.5px, transparent 1.6px) 0 0 / 18px 18px; opacity: 0.5; animation: pan 30s linear infinite; }
.q-art::after { content: ""; position: absolute; inset: auto 0 0; height: 45%; background: linear-gradient(180deg, transparent, rgba(11, 13, 38, 0.45)); }
.q-art .e { position: absolute; z-index: 1; line-height: 1; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35)); animation: pop 0.5s var(--spring) both, bob 4s ease-in-out infinite; }
.q-art .e0 { font-size: clamp(3rem, 11vh, 5.4rem); left: 50%; top: 50%; margin: -0.5em 0 0 -0.5em; animation-delay: 0.15s, 0.65s; }
.q-art .e1 { font-size: clamp(1.6rem, 5vh, 2.6rem); left: 9%; top: 18%; rotate: -14deg; animation-delay: 0.25s, 1s; }
.q-art .e2 { font-size: clamp(1.4rem, 4.4vh, 2.2rem); left: 27%; bottom: 10%; rotate: 10deg; animation-delay: 0.33s, 1.6s; }
.q-art .e3 { font-size: clamp(1.4rem, 4.4vh, 2.2rem); right: 27%; top: 12%; rotate: -8deg; animation-delay: 0.41s, 0.3s; }
.q-art .e4 { font-size: clamp(1.6rem, 5vh, 2.6rem); right: 9%; bottom: 14%; rotate: 16deg; animation-delay: 0.49s, 2.1s; }

.q-art .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fadein 0.6s ease both, kenburns 24s ease-in-out infinite alternate; }
.q-art:has(.photo) { height: clamp(104px, 22vh, 210px); }
.q-art:has(.photo) .e, .q-art:has(.photo)::before { display: none; }
.q-art:has(.photo)::after { z-index: 1; height: 70%; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--c) 35%, rgba(11, 13, 38, 0.85))); }
.q-meta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: -16px; position: relative; z-index: 2; }
.chip { padding: 7px 14px; border-radius: 999px; background: #262b70; border: 1px solid var(--line); font-weight: 700; font-size: 0.92rem; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.chip.pts.p200 { background: #1f9d63; }
.chip.pts.p400 { background: #d68a00; }
.chip.pts.p600 { background: #e03a5a; }
.q-text { font-size: clamp(1.35rem, 3.8vw, 2.4rem); line-height: 1.25; margin-top: clamp(14px, 3vh, 28px); margin-bottom: clamp(14px, 3vh, 28px); text-wrap: balance; }
.enter .q-meta { animation: rise 0.45s var(--ease) 0.2s both; }
.enter .q-text { animation: rise 0.5s var(--ease) 0.3s both; }
.enter .clock, .enter .q-actions { animation: rise 0.5s var(--ease) 0.42s both; }

.clock { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 3vw, 28px); margin-bottom: clamp(14px, 3vh, 24px); }
.answerer { --t: var(--t0); display: grid; gap: 2px; text-align: left; padding: 10px 18px; border-radius: 14px; border-left: 6px solid var(--t); background: color-mix(in srgb, var(--t) 18%, transparent); animation: slideL 0.4s var(--ease) both; min-width: 0; }
.answerer.t1 { --t: var(--t1); }
.answerer small { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.68rem; font-weight: 800; color: var(--t); }
.answerer b { font-family: var(--display); font-size: clamp(1.1rem, 2.6vw, 1.6rem); text-transform: uppercase; overflow-wrap: anywhere; }
.answerer.steal { animation: shake 0.5s ease both; }

.ring { position: relative; width: clamp(84px, 14vh, 108px); aspect-ratio: 1; flex: none; color: var(--ok); animation: pop 0.45s var(--spring) both; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: rgba(255, 255, 255, 0.1); }
.ring .fill { stroke: currentColor; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke 0.4s; filter: drop-shadow(0 0 6px currentColor); }
.ring span { position: absolute; inset: 0; display: grid; place-content: center; font-family: var(--display); font-size: clamp(1.6rem, 4vh, 2.2rem); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.ring.low { color: var(--t0); }
.ring.low span, .ring.over span { color: var(--t0); }
.ring.over { color: var(--t0); animation: shake 0.5s ease both; }
.ring span.tick { animation: tick 0.5s var(--spring); }

.q-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; align-items: center; }
.answer { background: rgba(255, 201, 60, 0.12); border: 2px solid var(--gold); border-radius: 16px; padding: 16px; animation: flipin 0.5s var(--ease) both; box-shadow: 0 0 40px rgba(255, 201, 60, 0.18); }
.answer small { color: var(--gold); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 800; font-size: 0.72rem; }
.answer div { font-family: var(--display); font-size: clamp(1.3rem, 3.8vw, 2.1rem); font-weight: 800; margin-top: 6px; text-wrap: balance; }
.who { color: var(--muted); margin-top: clamp(12px, 2.5vh, 22px); margin-bottom: 10px; font-weight: 600; animation: rise 0.4s var(--ease) 0.25s both; }
.award { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.award-btn { border-radius: 16px; padding: 14px 12px; font-size: 1.08rem; display: grid; gap: 2px; animation: rise 0.45s var(--spring) both; }
.award-btn:nth-child(1) { animation-delay: 0.3s; }
.award-btn:nth-child(2) { animation-delay: 0.38s; }
.award-btn:nth-child(3) { animation-delay: 0.46s; }
.award-btn:nth-child(4) { animation-delay: 0.54s; }
.award-btn small { font-weight: 700; opacity: 0.85; }
.award-btn.t0 { background: var(--t0); color: #3a0010; }
.award-btn.t1 { background: var(--t1); color: #00302c; }
.award-btn.none { background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); }
.award-btn.both { background: linear-gradient(90deg, var(--t0), var(--t1)); color: #14163c; }
.award-btn.both, .award-btn.none { padding: 10px 12px; font-size: 0.98rem; }

/* ---------- end ---------- */
.end { text-align: center; padding-top: 4vh; display: grid; justify-items: center; gap: 8px; }
.enter .end > * { animation: rise 0.6s var(--ease) both; }
.enter .end > :nth-child(3) { animation-delay: 0.25s; }
.enter .end > :nth-child(4) { animation-delay: 0.4s; }
.enter .end > :nth-child(5) { animation-delay: 0.6s; }
.trophy { font-size: clamp(4.5rem, 16vw, 7rem); line-height: 1.1; }
.enter .end > .trophy { animation: trophy 0.9s var(--spring) both, bob 3s 0.9s ease-in-out infinite; }
.end h1 { font-size: clamp(2rem, 7vw, 3.6rem); margin: 0 0 18px; }
.t0-text { color: var(--t0); }
.t1-text { color: var(--t1); }
.final { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: min(680px, 100%); }
.final-team { padding: 20px; border-radius: var(--radius); background: linear-gradient(180deg, var(--card2), var(--card)); border: 2px solid; display: grid; gap: 4px; }
.final-team.t0 { border-color: var(--t0); }
.final-team.t1 { border-color: var(--t1); }
.final-team.winner { box-shadow: 0 0 44px rgba(255, 201, 60, 0.35); border-color: var(--gold); }
.final-team span { font-weight: 700; overflow-wrap: anywhere; }
.final-team > b { font-family: var(--display); font-size: clamp(2rem, 7vw, 2.8rem); font-variant-numeric: tabular-nums; }
.end-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; justify-content: center; align-items: center; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall 4s linear infinite; }

/* ---------- keyframes ---------- */
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-22px) rotate(8deg); } }
@keyframes hue { to { background-position: 300% 0; } }
@keyframes spin { to { --ang: 360deg; } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes ping { to { box-shadow: 0 0 0 12px rgba(61, 220, 132, 0); } }
@keyframes marquee { to { transform: translateX(calc(-50% - 6px)); } }
@keyframes wobble { 0%, 100% { transform: none; } 30% { transform: rotate(-12deg) scale(1.1); } 60% { transform: rotate(10deg) scale(1.1); } }
@keyframes wipeL { 0% { transform: translateX(-115%) skewX(-8deg); } 38%, 58% { transform: translateX(0) skewX(-8deg); } 100% { transform: translateX(-115%) skewX(-8deg); } }
@keyframes wipeR { 0% { transform: translateX(115%) skewX(-8deg); } 38%, 58% { transform: translateX(0) skewX(-8deg); } 100% { transform: translateX(115%) skewX(-8deg); } }
@keyframes wipeB { 0%, 24% { transform: translate(-50%, -50%) scale(0) rotate(-30deg); } 44% { transform: translate(-50%, -50%) scale(1.25) rotate(8deg); } 58% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 80%, 100% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } }
@keyframes ember { from { background-position: 0 0; } to { background-position: 100% 0; } }
@keyframes flame { from { transform: scale(1) rotate(-6deg); } to { transform: scale(1.22) rotate(6deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes slideL { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes slideR { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes dealin { from { opacity: 0; transform: translateY(26px) scale(0.94) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
@keyframes flipin { from { opacity: 0; transform: perspective(900px) rotateX(-18deg) translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes stamp { 0% { transform: scale(1.5); opacity: 0.2; } 60% { transform: scale(0.92); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes floatup { from { opacity: 0; transform: translate(-50%, 10px) scale(0.7); } 20% { opacity: 1; transform: translate(-50%, -14px) scale(1.1); } to { opacity: 0; transform: translate(-50%, -64px) scale(1); } }
@keyframes tick { from { transform: scale(1.35); } to { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px) rotate(-2deg); } 40% { transform: translateX(7px) rotate(2deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.14) translateY(-2%); } }
@keyframes pan { to { background-position: 180px 90px; } }
@keyframes tap { 0%, 100% { transform: none; } 50% { transform: translateY(3px) scale(0.9); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes nudge { 0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(255, 201, 60, 0.28); } 50% { transform: scale(1.05); box-shadow: 0 8px 36px rgba(255, 201, 60, 0.6); } }
@keyframes zap { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-14deg) scale(1.15); } 94% { transform: rotate(10deg) scale(1.1); } }
@keyframes glowdot { 0%, 100% { box-shadow: 0 0 4px var(--gold); } 50% { box-shadow: 0 0 14px var(--gold); } }
@keyframes railglow { from { box-shadow: 0 0 22px color-mix(in srgb, var(--t) 28%, transparent); } to { box-shadow: 0 0 52px color-mix(in srgb, var(--t) 55%, transparent); } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(8vmax, 6vmax) scale(1.15); } }
@keyframes trophy { 0% { opacity: 0; transform: scale(0.2) rotate(-25deg); } 70% { transform: scale(1.15) rotate(6deg); } 100% { opacity: 1; transform: none; } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- responsive ---------- */
/* Tablets in portrait and small laptops: rails stay, tighter. */
@media (max-width: 1100px) {
  .stage { grid-template-columns: 118px 1fr 118px; gap: 10px; }
  .board { gap: 10px; }
  .strip .logo { font-size: 1.1rem; }
}
/* Below tablet width: rails become a two-up scoreboard above the board. */
@media (max-width: 820px) {
  .stage { grid-template-columns: 1fr 1fr; min-height: 0; }
  .center { grid-column: 1 / -1; order: 3; }
  .rail { flex-direction: row; padding: 10px 14px; gap: 10px; }
  .rail-top { justify-items: start; gap: 4px; text-align: left; min-width: 0; }
  .rail h2 { font-size: 1.05rem; }
  .rail .status, .rail-score small { display: none; }
  .score-num { font-size: 2rem; }
  .board { grid-template-columns: repeat(2, 1fr); }
  .tile { height: 60px; }
  .dots { display: none; }
  .strip { justify-content: space-between; }
  .enter .rail.t0, .enter .rail.t1, .enter .rail.active, .enter .rail.t1.active { animation-name: drop; }
  .question { margin: 0 auto; }
}
@media (max-width: 620px) {
  #app { padding-top: 14px; }
  .setup { grid-template-columns: 1fr; }
  .vs { padding: 0; text-align: center; }
  .how { grid-template-columns: 1fr; margin-top: 28px; }
  .pick-teams { grid-template-columns: 1fr; gap: 8px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-card { min-height: 0; padding: 14px 10px; grid-template-columns: auto 1fr; justify-items: start; text-align: left; column-gap: 10px; }
  .cat-card .icon { font-size: 1.7rem; grid-row: span 2; }
  .cat-card .name { text-align: left; font-size: 0.92rem; }
  .cat-card .owner { grid-column: 2; }
  .pick-actions .btn { flex: 1; padding-left: 12px; padding-right: 12px; }
  .rail-adj { display: none; }
  .strip .logo { display: none; }
  .turn-banner { padding: 10px 14px; }
  .turn-banner .pill { font-size: 0.8rem; padding: 6px 12px; }
  .board { gap: 8px; }
  .tiles { padding: 8px; gap: 6px; }
  .cat-head { padding: 8px 10px; gap: 6px; }
  .cat-head .icon { font-size: 1.05rem; }
  .tile { height: 54px; border-radius: 10px; }
  .q-actions .btn.primary { flex: 1 1 100%; }
  .q-actions .btn.ghost { flex: 1; }
  .q-art .e2, .q-art .e3 { display: none; }
  .final { gap: 10px; }
  .final-team { padding: 14px 10px; }
}
@media (max-width: 380px) {
  .cat-head .count { display: none; }
  .tile small { font-size: 0.58rem; }
  .clock { flex-direction: column-reverse; }
  .answerer { text-align: center; border-left: 0; border-bottom: 4px solid var(--t); }
}
/* Short landscape screens (phones on their side). */
@media (max-height: 520px) and (min-width: 621px) {
  .q-art, .q-art:has(.photo) { height: 64px; }
  .q-art .e0 { font-size: 2.6rem; }
  .tile { height: 44px; }
}
/* ---------- tools: sound, full screen ---------- */
.tool { width: 40px; height: 40px; flex: none; display: grid; place-content: center; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.07); font-size: 1.05rem; line-height: 1; transition: transform 0.18s var(--spring), background 0.15s; }
.tool:active { transform: scale(0.9); }
@media (hover: hover) { .tool:hover { background: rgba(255, 255, 255, 0.18); transform: translateY(-2px); } }
.top-actions { align-items: center; }
.home-tools { position: absolute; top: 0; right: 0; z-index: 3; display: flex; gap: 8px; }
.keys { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 0.8rem; }
kbd { display: inline-block; min-width: 1.7em; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: rgba(255, 255, 255, 0.08); font: 700 0.75rem/1.3 var(--display); color: var(--text); text-align: center; }
@media (max-width: 900px), (hover: none) { .keys { display: none; } }

/* ---------- picker: search, theme chips, photo cards ---------- */
.pick-tools { display: grid; grid-template-columns: minmax(200px, 300px) 1fr auto; gap: 10px; align-items: center; margin-bottom: 18px; }
#pick-search { width: 100%; min-height: 44px; padding: 10px 16px; border-radius: 999px; background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
#pick-search:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 201, 60, 0.18); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chips::-webkit-scrollbar { display: none; }
.chipbtn { flex: none; padding: 8px 14px; min-height: 38px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); font-weight: 700; font-size: 0.85rem; white-space: nowrap; transition: background 0.15s, color 0.15s, transform 0.18s var(--spring); }
.chipbtn.on { background: var(--gold); border-color: var(--gold); color: #2a1d00; }
.chipbtn:active { transform: scale(0.94); }
.no-match { text-align: center; color: var(--muted); padding: 30px 0; }
.cat-card[hidden], .group[hidden], .no-match[hidden] { display: none; }
.cat-card { display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 2px; min-height: 116px; padding: 10px 12px; overflow: hidden; text-align: left; isolation: isolate; background: linear-gradient(135deg, var(--card2), var(--violet)); }
.cat-card .cc-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.cat-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11, 13, 38, 0.1) 20%, rgba(11, 13, 38, 0.92)); transition: background 0.3s; }
.cat-card .icon { font-size: 1.35rem; }
.cat-card .name { text-align: left; font-family: var(--display); font-size: 1rem; line-height: 1.15; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); }
.cat-card .owner { color: #fff !important; background: rgba(0, 0, 0, 0.35); padding: 2px 8px; border-radius: 999px; }
.cat-card.picked.t0::before { background: linear-gradient(180deg, rgba(255, 93, 115, 0.5), rgba(150, 25, 50, 0.94)); }
.cat-card.picked.t1::before { background: linear-gradient(180deg, rgba(34, 211, 197, 0.45), rgba(8, 100, 100, 0.94)); }
.cat-card.picked::after { content: "✓"; position: absolute; top: 8px; right: 10px; width: 26px; height: 26px; display: grid; place-content: center; border-radius: 50%; background: #fff; color: #14163c; font-weight: 900; animation: pop 0.35s var(--spring) both; }
@media (hover: hover) { .cat-card:hover:not(:disabled) .cc-img { transform: scale(1.12); } .cat-card:hover:not(:disabled) .icon { transform: none; } }

/* ---------- board: photo behind each category header ---------- */
.cat-head { background: linear-gradient(90deg, var(--c) 34%, color-mix(in srgb, var(--c) 40%, transparent)), var(--img, none) center / cover, var(--c); }
.count { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }

/* ---------- end: per-team stats ---------- */
.t-stats { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 5px; font-size: 0.85rem; color: var(--muted); text-align: left; }
.t-stats li { display: flex; justify-content: space-between; gap: 10px; }
.t-stats em { font-style: normal; font-weight: 700; color: var(--text); text-align: right; }
.enter .t-stats li { animation: rise 0.5s var(--ease) both; animation-delay: 1.2s; }

/* ---------- home: recent results ---------- */
.recent { position: relative; z-index: 1; max-width: 620px; margin: 36px auto 0; }
.recent h3 { margin: 0 0 10px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.recent ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recent li { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); font-weight: 700; }
.recent li span:first-child { text-align: right; }
.recent li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.75; }
.recent li span.win { opacity: 1; }
.recent li b { font-family: var(--display); font-variant-numeric: tabular-nums; }
.recent small { color: var(--muted); font-weight: 600; }
.enter .recent { animation: rise 0.6s var(--ease) 1.1s both; }

@media (max-width: 820px) {
  .pick-tools { grid-template-columns: 1fr auto; }
  .chips { grid-column: 1 / -1; order: 3; }
}
@media (max-width: 620px) {
  .cat-card { min-height: 92px; padding: 8px 10px; }
  .cat-card .icon { font-size: 1.1rem; grid-row: auto; }
  .cat-card .name { font-size: 0.9rem; }
  .top-actions { gap: 5px; }
  .top-actions .btn { padding: 6px 10px; min-height: 36px; font-size: 0.8rem; }
  .tool { width: 36px; height: 36px; }
  .strip { gap: 8px; }
  .round { font-size: 0.85rem; }
  .final { grid-template-columns: 1fr; }
  .recent li { grid-template-columns: 1fr auto 1fr; }
  .recent small { display: none; }
}

/* ---------- account, store and sign-in ---------- */
.acct { min-height: 40px; padding: 8px 16px; font-size: 0.9rem; white-space: nowrap; background: rgba(255, 201, 60, 0.14); border-color: rgba(255, 201, 60, 0.5); }
.acct b { color: var(--gold); font-family: var(--display); font-size: 1.05rem; }
.btn.demo { margin-top: -6px; }
.price-note { margin: -4px 0 0; color: var(--muted); font-size: 0.86rem; max-width: 460px; }
#modal { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 16px; }
#modal.open { display: grid; }
.m-back { position: absolute; inset: 0; background: rgba(6, 7, 24, 0.72); backdrop-filter: blur(6px); animation: fadein 0.2s ease both; }
.m-card { position: relative; width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: clamp(20px, 5vw, 32px); border-radius: 24px; text-align: center;
  background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6); animation: flipin 0.35s var(--ease) both; }
.m-card h2 { margin: 0 0 8px; font-size: 1.6rem; }
.m-card p { color: var(--muted); line-height: 1.5; margin: 0 0 16px; }
.m-card p b { color: var(--text); }
.m-x { position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.08); font-size: 1.4rem; line-height: 1; }
#g-btn { display: grid; justify-content: center; min-height: 44px; margin-bottom: 14px; }
.m-note { font-size: 0.85rem; }
.m-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bal { font-size: 1.05rem; }
.bal b { color: var(--gold) !important; font-family: var(--display); font-size: 1.3rem; }
.bundles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.bundle { position: relative; display: grid; gap: 2px; padding: 16px 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 2px solid var(--line); }
.bundle b { font-family: var(--display); font-size: 1.05rem; }
.bundle .price { font-family: var(--display); font-weight: 800; font-size: 1.9rem; color: var(--gold); line-height: 1.1; }
.bundle small { color: var(--muted); font-size: 0.78rem; }
.bundle.best { border-color: var(--gold); background: rgba(255, 201, 60, 0.1); box-shadow: 0 0 30px rgba(255, 201, 60, 0.18); }
.bundle .tag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; padding: 3px 10px; border-radius: 999px; background: var(--gold); color: #2a1d00; }
.pay { text-align: left; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); margin-bottom: 14px; }
.pay h3 { margin: 0 0 4px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); }
.pay p { margin: 0; font-size: 0.92rem; white-space: pre-line; }
#redeem-form { display: flex; gap: 8px; }
#redeem-form input { flex: 1; min-width: 0; min-height: 46px; padding: 10px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line); outline: none; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; text-align: center; }
#redeem-form input:focus { border-color: var(--gold); }
.m-msg { min-height: 1.4em; margin: 10px 0 0 !important; font-weight: 700; }
.m-msg.bad { color: var(--t0) !important; }
.m-msg.good { color: var(--ok) !important; }
.m-foot { margin: 12px 0 0 !important; font-size: 0.8rem; }
.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font-size: inherit; }
#toast { position: fixed; left: 50%; bottom: 28px; z-index: 90; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 999px; background: #14163c; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); font-weight: 700; transition: transform 0.3s var(--spring), opacity 0.3s; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 620px) { .acct { padding: 6px 12px; font-size: 0.82rem; min-height: 36px; } .home-tools { position: static; justify-content: flex-end; margin-bottom: 10px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.top-actions .btn { white-space: nowrap; }
@media (max-width: 620px) { .strip [data-act="full"] { display: none; } }
