/* Spin Trivia — shared styles (host stage, phone controller, setup screens) */
:root {
  --bg1: #2B0A5E; --bg2: #8A1FBF;
  --red: #FF3B5C; --blue: #2D9CFF; --yellow: #FFC93C; --green: #2EE59D;
  --pink: #FF4FD8; --orange: #FF8A00; --cyan: #00E5FF;
  --ink: #FFFFFF; --ink-soft: rgba(255,255,255,.78); --ink-dim: rgba(255,255,255,.55);
  --card: rgba(255,255,255,.10); --card-strong: rgba(255,255,255,.18); --line: rgba(255,255,255,.22);
  --dark: #170530;
  --radius: 24px;
  --shadow: 0 10px 30px rgba(10,0,30,.45);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --display: "Baloo 2", "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body); color: var(--ink);
  background: linear-gradient(135deg, var(--bg1), var(--bg2)) fixed;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
.hidden { display: none !important; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 800; line-height: 1.05; margin: 0; }

/* ---------- generic controls ---------- */
.btn {
  border: 0; border-radius: 16px; padding: 12px 20px; font-family: var(--display); font-weight: 800; font-size: 18px;
  background: var(--pink); color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.25); transition: transform .12s, filter .12s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.btn.big { font-size: 24px; padding: 16px 28px; border-radius: 20px; }
.btn.ghost { background: var(--card-strong); box-shadow: none; }
.btn.green { background: var(--green); color: #053; }
.btn.yellow { background: var(--yellow); color: #4a2a00; }
.btn.blue { background: var(--blue); }
.btn.red { background: var(--red); }
.btn.small { font-size: 14px; padding: 7px 12px; border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.notice { padding: 12px 16px; border-radius: 14px; margin: 12px 0; font-weight: 700; }
.notice.ok { background: rgba(46,229,157,.2); border: 2px solid var(--green); }
.notice.bad { background: rgba(255,59,92,.2); border: 2px solid var(--red); }

.form label { display: block; font-weight: 700; margin: 12px 0; color: var(--ink-soft); }
.form input, .form select, .field {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line);
  background: rgba(0,0,0,.25); color: #fff; font-size: 17px; outline: none;
}
.form input:focus, .field:focus { border-color: var(--cyan); }
.form h2 { font-size: 22px; margin: 26px 0 4px; color: var(--yellow); }

.tb-plain { min-height: 100%; padding: 24px 16px; }
.setup-card { max-width: 640px; margin: 0 auto; background: rgba(0,0,0,.22); padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow); }
.logo { font-size: 44px; letter-spacing: -.5px; }
.logo small { font-size: 18px; color: var(--ink-dim); font-weight: 700; }

/* ---------- answer colours + shapes ---------- */
.c0 { --c: var(--red); } .c1 { --c: var(--blue); } .c2 { --c: var(--yellow); --cink: #3a2400; } .c3 { --c: var(--green); --cink: #00331f; }
.shape { width: 1em; height: 1em; display: inline-block; flex: none; background: currentColor; }
.shape.s0 { clip-path: polygon(50% 6%, 96% 92%, 4% 92%); }
.shape.s1 { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.shape.s2 { border-radius: 50%; }
.shape.s3 { border-radius: 12%; transform: scale(.86); }

/* =====================================================================
   HOST STAGE — fixed 1920×1080 canvas scaled to the window
   ===================================================================== */
body.host { overflow: hidden; }
#stageWrap { position: fixed; inset: 0; overflow: hidden; background: #12032a; }
#stage {
  width: 1920px; height: 1080px; position: absolute; left: 50%; top: 50%; overflow: hidden; transform-origin: center center; transform: translate(-50%, -50%);
  background: radial-gradient(1200px 700px at 20% 10%, rgba(255,79,216,.25), transparent 60%),
              radial-gradient(900px 600px at 90% 90%, rgba(0,229,255,.18), transparent 60%),
              linear-gradient(135deg, var(--bg1), var(--bg2));
}
#stage.theme-tint::before { content: ""; position: absolute; inset: 0; background: var(--tint, transparent); opacity: .35; transition: background .8s; pointer-events: none; }
.scene { position: absolute; inset: 0; padding: 60px 80px; display: flex; flex-direction: column; }
.scene.enter { animation: sceneIn .55s var(--spring) both; }
@keyframes sceneIn { from { opacity: 0; transform: scale(.94) translateY(30px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-family: var(--display); font-size: 44px; font-weight: 800; display: flex; gap: 10px; align-items: center; }
.brand .bolt { color: var(--yellow); filter: drop-shadow(0 0 12px rgba(255,201,60,.7)); }
.pill { max-width: 1100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--card-strong); border-radius: 999px; padding: 10px 22px; font-weight: 800; font-size: 26px; font-family: var(--display); }

/* ---------- lobby (first screen) ---------- */
.lobby { display: grid; grid-template-columns: 1fr 560px; gap: 48px; height: 100%; }
.lobby-left { display: flex; flex-direction: column; min-height: 0; }
.lobby-count { font-family: var(--display); font-size: 40px; font-weight: 800; margin: 18px 0 18px; display: flex; align-items: baseline; gap: 14px; }
.lobby-count .big { font-size: 84px; color: var(--yellow); line-height: .9; }
.slots { display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(5, 1fr); gap: 14px; flex: 1; min-height: 0; }
.slot {
  border-radius: 20px; border: 3px dashed rgba(255,255,255,.25); background: rgba(0,0,0,.14);
  display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; min-width: 0;
}
.slot .num { position: absolute; top: 6px; left: 10px; font-family: var(--display); font-weight: 800; font-size: 20px; color: rgba(255,255,255,.35); }
.slot.filled { border: 3px solid var(--tc, rgba(255,255,255,.7)); background: var(--card-strong); animation: popIn .6s var(--spring) both; }
.slot.filled .num { color: rgba(255,255,255,.75); }
.slot .av { font-size: 54px; line-height: 1; }
.slot .nm { font-weight: 800; font-size: 19px; max-width: 92%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.slot.offline { opacity: .45; }
@keyframes popIn { 0% { transform: scale(.2) rotate(-12deg); opacity: 0; } 70% { transform: scale(1.12) rotate(3deg); opacity: 1; } 100% { transform: none; } }

.join-card { background: rgba(255,255,255,.96); color: var(--dark); border-radius: 36px; padding: 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: var(--shadow); }
.join-step { font-family: var(--display); font-weight: 800; font-size: 28px; color: #6b2fb3; text-transform: uppercase; letter-spacing: 1px; }
.join-url { font-family: var(--display); font-weight: 800; font-size: 46px; line-height: 1.05; white-space: nowrap; margin: 4px 0 22px; color: var(--dark); }
.join-code { font-family: var(--display); font-weight: 800; font-size: 104px; letter-spacing: 4px; white-space: nowrap; line-height: .95; background: linear-gradient(90deg, #8A1FBF, #FF4FD8); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 4px 0 18px; }
.qr { width: 250px; height: 250px; padding: 10px; background: #fff; border-radius: 18px; border: 4px solid #eee; }
.qr svg, .qr img { width: 100%; height: 100%; display: block; }
.join-or { font-weight: 800; color: #8a7aa5; margin-top: 10px; font-size: 20px; }
.gen-bar { margin-top: 22px; width: 100%; }
.gen-bar .track { height: 18px; border-radius: 99px; background: #eadff7; overflow: hidden; }
.gen-bar .fill { height: 100%; background: linear-gradient(90deg, var(--pink), var(--orange)); width: 0; transition: width .6s; border-radius: 99px; }
.gen-bar .lbl { font-weight: 800; color: #6b2fb3; margin-bottom: 6px; font-size: 18px; }
.lobby-teams { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.team-chip { border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 18px; background: var(--tc); color: #160430; }

/* ---------- round intro ---------- */
.intro { align-items: center; justify-content: center; text-align: center; gap: 22px; }
.round-badge { font-family: var(--display); font-size: 48px; font-weight: 800; color: var(--ink-soft); }
.round-type { font-family: var(--display); font-size: 150px; font-weight: 800; line-height: .9; text-shadow: 0 8px 0 rgba(0,0,0,.25); animation: slam .7s var(--spring) both .2s; }
.round-type.wager { color: var(--yellow); } .round-type.showdown { color: var(--orange); } .round-type.final { color: var(--pink); }
.cat-banner { display: inline-flex; align-items: center; gap: 22px; background: var(--catc, var(--card-strong)); color: #fff; padding: 18px 40px; border-radius: 999px; font-family: var(--display); font-weight: 800; font-size: 58px; box-shadow: var(--shadow); animation: slam .7s var(--spring) both .45s; }
.cat-banner .ico { font-size: 70px; }
.diff-tag { font-weight: 800; font-size: 30px; text-transform: uppercase; letter-spacing: 3px; color: var(--ink-soft); animation: fadeUp .5s both .8s; }
@keyframes slam { from { transform: scale(2.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* spinning wheel for showdown */
.wheel-wrap { position: relative; width: 520px; height: 520px; margin-top: 10px; }
.wheel { width: 100%; height: 100%; border-radius: 50%; border: 10px solid #fff; box-shadow: var(--shadow); transition: transform 3.6s cubic-bezier(.12,.75,.12,1); }
.wheel-pointer { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 28px solid transparent; border-right: 28px solid transparent; border-top: 54px solid #fff; filter: drop-shadow(0 4px 4px rgba(0,0,0,.4)); z-index: 2; }

/* ---------- question ---------- */
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.q-cat { display: inline-flex; align-items: center; gap: 12px; background: var(--catc, var(--card-strong)); padding: 10px 26px; border-radius: 999px; font-family: var(--display); font-weight: 800; font-size: 32px; }
.q-text { font-family: var(--display); font-weight: 800; font-size: 76px; line-height: 1.08; text-align: center; margin: 40px 60px 30px; min-height: 250px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; text-shadow: 0 4px 0 rgba(0,0,0,.2); }
.q-text .w { display: inline-block; margin: 0 .14em; opacity: 0; animation: wordIn .45s var(--spring) forwards; }
.hold .q-text .w, .hold .opt, .hold #opts { animation: none !important; opacity: 0 !important; }
@keyframes wordIn { from { opacity: 0; transform: translateY(30px) scale(.7); } to { opacity: 1; transform: none; } }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: auto; }
.opts.n3 { grid-template-columns: 1fr 1fr 1fr; }
.opt { background: var(--c); color: var(--cink, #fff); border-radius: 28px; padding: 26px 34px; display: flex; align-items: center; gap: 24px; font-family: var(--display); font-weight: 800; font-size: 50px; min-height: 140px; box-shadow: 0 8px 0 rgba(0,0,0,.25); animation: bounceIn .6s var(--spring) both; position: relative; transition: transform .4s, opacity .5s, filter .5s; }
.opt .shape { font-size: 56px; color: rgba(255,255,255,.92); }
.c2 .shape, .c3 .shape { color: rgba(0,0,0,.55); }
.opt .lbl { flex: 1; line-height: 1.05; }
.opt .cnt { font-size: 40px; background: rgba(0,0,0,.2); border-radius: 18px; padding: 4px 16px; min-width: 70px; text-align: center; }
.opt .bar { position: absolute; left: 0; bottom: 0; height: 12px; background: rgba(255,255,255,.75); border-radius: 0 0 0 28px; width: 0; transition: width 1s ease-out; }
.opt.correct { transform: scale(1.04); box-shadow: 0 0 0 10px #fff, 0 0 60px 20px rgba(255,255,255,.55); animation: glow 1.2s ease-in-out infinite alternate; z-index: 1; }
.opt.wrong { opacity: .28; filter: grayscale(.8); transform: scale(.95) rotate(-1deg); }
.opt.shatter { animation: shatter .6s ease-in forwards; }
@keyframes shatter { 0% { transform: none; } 30% { transform: translateX(-10px) rotate(-2deg); } 60% { transform: translateX(10px) rotate(2deg); } 100% { transform: scale(.95) rotate(-1deg); opacity: .28; filter: grayscale(.8); } }
@keyframes bounceIn { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }
@keyframes glow { from { box-shadow: 0 0 0 8px #fff, 0 0 40px 10px rgba(255,255,255,.4); } to { box-shadow: 0 0 0 12px #fff, 0 0 80px 30px rgba(255,255,255,.7); } }

.timer { position: relative; width: 150px; height: 150px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 14; }
.timer .bg { stroke: rgba(255,255,255,.18); }
.timer .fg { stroke: var(--cyan); stroke-linecap: round; transition: stroke .3s; }
.timer.urgent .fg { stroke: var(--red); }
.timer.urgent { animation: pulse .5s ease-in-out infinite alternate; }
.timer .t { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 62px; }
@keyframes pulse { to { transform: scale(1.08); } }
.answers-in { display: flex; align-items: center; gap: 16px; font-family: var(--display); font-weight: 800; font-size: 34px; }
.answers-in .meter { width: 260px; height: 22px; background: rgba(255,255,255,.18); border-radius: 99px; overflow: hidden; }
.answers-in .meter i { display: block; height: 100%; background: var(--green); width: 0; transition: width .4s; border-radius: 99px; }
.get-ready { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 200px; z-index: 5; background: rgba(23,5,48,.35); }
.get-ready span { animation: slam .5s var(--spring) both; }

.number-prompt { margin: auto; text-align: center; font-family: var(--display); font-weight: 800; font-size: 58px; background: var(--card-strong); padding: 40px 60px; border-radius: 36px; }
.number-prompt .big { font-size: 160px; color: var(--yellow); display: block; line-height: 1; margin-top: 10px; }

/* showdown versus layout */
.versus { display: grid; grid-template-columns: 1fr 140px 1fr; align-items: center; gap: 20px; margin: 10px 0 0; }
.vs-side { background: var(--card-strong); border-radius: 28px; padding: 18px 26px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 40px; border: 4px solid var(--sc, #fff); }
.vs-side small { display: block; font-size: 22px; color: var(--ink-soft); }
.vs-mid { font-family: var(--display); font-weight: 800; font-size: 90px; text-align: center; color: var(--yellow); text-shadow: 0 6px 0 rgba(0,0,0,.3); }
.tug { height: 34px; border-radius: 99px; background: var(--blue); overflow: hidden; margin-top: 16px; border: 4px solid #fff; }
.tug i { display: block; height: 100%; background: var(--orange); width: 50%; transition: width .5s var(--spring); }

/* ---------- reveal ---------- */
.reveal-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; margin-top: 28px; align-items: start; }
.fact-card { background: rgba(255,255,255,.95); color: var(--dark); border-radius: 28px; padding: 26px 32px; font-size: 32px; font-weight: 700; box-shadow: var(--shadow); animation: fadeUp .6s both 1.2s; display: flex; gap: 20px; align-items: flex-start; }
.fact-card .ico { font-size: 56px; line-height: 1; }
.fact-card b { font-family: var(--display); display: block; color: #8A1FBF; font-size: 26px; text-transform: uppercase; letter-spacing: 2px; }
.stat-cards { display: grid; gap: 14px; animation: fadeUp .6s both 1.5s; }
.stat { background: var(--card-strong); border-radius: 22px; padding: 16px 24px; font-size: 30px; font-weight: 800; display: flex; gap: 14px; align-items: center; }
.stat .v { font-family: var(--display); color: var(--yellow); font-size: 44px; }
.big-answer { text-align: center; font-family: var(--display); font-weight: 800; font-size: 150px; color: var(--yellow); line-height: 1; margin: 20px 0 10px; animation: slam .7s var(--spring) both; }
.closest-list { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.closest-list .stat { font-size: 28px; }
.outcome { text-align: center; font-family: var(--display); font-weight: 800; font-size: 64px; margin-top: 18px; animation: slam .6s var(--spring) both 1s; }

/* ---------- leaderboard ---------- */
.board { position: relative; margin-top: 26px; flex: 1; }
.board-row { position: absolute; left: 0; right: 0; height: 74px; display: flex; align-items: center; gap: 20px; padding: 0 26px; border-radius: 22px; background: var(--card-strong); font-family: var(--display); font-weight: 800; font-size: 38px; transition: top .9s var(--spring), background .4s; }
.board-row.leader { background: linear-gradient(90deg, rgba(255,201,60,.55), rgba(255,138,0,.35)); }
.board-row .rk { width: 70px; text-align: center; font-size: 42px; color: var(--yellow); }
.board-row .av { font-size: 48px; width: 60px; text-align: center; position: relative; }
.board-row .crown { position: absolute; top: -30px; left: 50%; transform: translateX(-50%) rotate(-12deg); font-size: 34px; }
.board-row .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-row .move { width: 80px; font-size: 30px; text-align: center; }
.board-row .move.up { color: var(--green); } .board-row .move.down { color: var(--red); }
.board-row .delta { width: 110px; text-align: right; font-size: 30px; color: var(--green); }
.board-row .delta.neg { color: var(--red); }
.board-row .sc { width: 140px; text-align: right; }
.board-row .fire { margin-left: 6px; animation: flicker .4s infinite alternate; }
.board-row.rocket::after { content: "🚀"; position: absolute; left: -60px; font-size: 40px; animation: rocket 1.2s ease-out both; }
@keyframes rocket { from { transform: translateY(80px); opacity: 0; } 50% { opacity: 1; } to { transform: translateY(-30px); opacity: 0; } }
@keyframes flicker { to { transform: scale(1.2) rotate(6deg); } }
.board-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; flex: 1; }
.mvp h3 { font-size: 34px; color: var(--yellow); margin: 26px 0 10px; }
.mini-row { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: 16px; padding: 10px 16px; margin-bottom: 10px; font-weight: 800; font-size: 28px; }
.mini-row .sc { margin-left: auto; font-family: var(--display); }
.halftime-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 22px; }
.halftime-grid .mini-row { font-size: 22px; padding: 8px 12px; }

/* ---------- final ---------- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 30px; margin-top: 20px; height: 520px; }
.pod { width: 360px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.pod .who { font-family: var(--display); font-weight: 800; font-size: 42px; margin-bottom: 10px; animation: fadeUp .6s both; }
.pod .who .av { font-size: 90px; display: block; line-height: 1; }
.pod .block { width: 100%; border-radius: 28px 28px 0 0; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 110px; color: rgba(0,0,0,.35); box-shadow: var(--shadow); animation: rise 1s var(--spring) both; transform-origin: bottom; }
.pod.p1 .block { height: 330px; background: linear-gradient(#FFE27A, var(--yellow)); animation-delay: 1.6s; } .pod.p1 .who { animation-delay: 2.2s; }
.pod.p2 .block { height: 240px; background: linear-gradient(#E9EEF5, #B9C3D3); animation-delay: .9s; } .pod.p2 .who { animation-delay: 1.4s; }
.pod.p3 .block { height: 170px; background: linear-gradient(#F1B47E, #C77B3E); animation-delay: .3s; } .pod.p3 .who { animation-delay: .8s; }
.pod .score { font-size: 30px; color: var(--ink-soft); }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.awards { display: flex; gap: 18px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.award { background: rgba(255,255,255,.95); color: var(--dark); border-radius: 22px; padding: 14px 22px; min-width: 300px; display: flex; gap: 14px; align-items: center; animation: fadeUp .6s both 2.8s; }
.award .i { font-size: 46px; }
.award b { font-family: var(--display); font-size: 26px; display: block; color: #8A1FBF; }
.award span { font-weight: 800; font-size: 22px; }

/* ---------- mascot, reactions, fx ---------- */
#mascot { position: absolute; left: 30px; bottom: 24px; width: 130px; height: 150px; z-index: 6; pointer-events: none; transition: transform .3s; }
#mascot.cheer { animation: cheer .5s ease-in-out 3; }
#mascot.facepalm { animation: droop 1.4s ease-in-out; }
#mascot.dance { animation: dance .6s ease-in-out 5; }
@keyframes cheer { 50% { transform: translateY(-40px) scale(1.1); } }
@keyframes droop { 30%, 70% { transform: rotate(-14deg) translateY(10px) scale(.95); } }
@keyframes dance { 25% { transform: rotate(12deg); } 75% { transform: rotate(-12deg); } }
#reactions { position: absolute; right: 30px; bottom: 0; width: 160px; height: 100%; pointer-events: none; z-index: 7; }
.react { position: absolute; bottom: -80px; font-size: 64px; animation: floatUp 3.6s ease-out forwards; }
.react small { font-size: 34px; position: absolute; left: -22px; bottom: -6px; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(-950px) translateX(var(--dx, 0)) scale(1.2); opacity: 0; } }
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
#particles { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.pt { position: absolute; font-size: 80px; will-change: transform; }
.shake { animation: shake .5s; }
@keyframes shake { 20% { transform: translate(-14px, 6px); } 40% { transform: translate(12px, -8px); } 60% { transform: translate(-8px, 4px); } 80% { transform: translate(6px, -2px); } }
.paused-veil { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(23,5,48,.7); z-index: 9; font-family: var(--display); font-weight: 800; font-size: 140px; }
.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }

/* ---------- host dock + drawer (not part of the show) ---------- */
#dock {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 50; display: flex; gap: 8px; align-items: center;
  background: rgba(15,3,35,.92); border: 1px solid var(--line); border-radius: 18px; padding: 8px 10px; box-shadow: var(--shadow);
  transition: opacity .3s, transform .3s; font-size: 14px; max-width: calc(100vw - 20px); flex-wrap: wrap; justify-content: center;
}
#dock.idle { opacity: 0; transform: translate(-50%, 30px); pointer-events: none; }
#dock .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
#dock .kbd { font-size: 11px; opacity: .6; margin-left: 2px; }
#dock input[type=range] { width: 80px; accent-color: var(--pink); }
#dock label { display: flex; gap: 4px; align-items: center; font-weight: 700; }
#drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #1d0840; z-index: 60; overflow-y: auto; padding: 22px; box-shadow: -10px 0 40px rgba(0,0,0,.5); transform: translateX(105%); transition: transform .35s var(--spring); }
#drawer.open { transform: none; }
#drawer h2 { font-size: 26px; margin: 20px 0 10px; color: var(--yellow); }
#drawer .close { position: absolute; top: 14px; right: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 40px 10px 0; }
.tabs button { background: var(--card); border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 800; }
.tabs button.on { background: var(--pink); }
.row { display: flex; gap: 10px; align-items: center; }
.list-item { background: var(--card); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item small { color: var(--ink-dim); }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: #fff; color: var(--dark); padding: 12px 20px; border-radius: 14px; font-weight: 800; z-index: 100; box-shadow: var(--shadow); animation: fadeUp .3s both; max-width: 90vw; }
.toast.bad { background: var(--red); color: #fff; }

/* setup / dashboard */
.dash { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel { background: rgba(0,0,0,.22); border-radius: var(--radius); padding: 24px; margin-top: 20px; }
.panel h2 { font-size: 26px; margin-bottom: 12px; color: var(--yellow); }
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span { display: inline-block; padding: 10px 16px; border-radius: 14px; background: var(--card); border: 2px solid transparent; font-weight: 800; }
.choice input:checked + span { background: var(--pink); border-color: #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--cyan); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.toggle { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-weight: 700; }
.toggle input { width: 22px; height: 22px; accent-color: var(--pink); }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }

/* =====================================================================
   PHONE CONTROLLER
   ===================================================================== */
body.play { min-height: 100%; overscroll-behavior: none; }
.phone { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 14px 16px 20px; }
.p-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 800; }
.p-me { display: flex; align-items: center; gap: 8px; font-size: 17px; min-width: 0; }
.p-me .av { font-size: 30px; }
.p-me .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-score { font-family: var(--display); font-size: 24px; background: var(--card-strong); border-radius: 999px; padding: 4px 14px; white-space: nowrap; }
.p-main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 12px 0; }
.p-title { font-family: var(--display); font-size: 38px; font-weight: 800; text-align: center; line-height: 1.05; }
.p-sub { text-align: center; color: var(--ink-soft); font-weight: 700; font-size: 18px; }
.p-card { background: rgba(0,0,0,.22); border-radius: var(--radius); padding: 18px; }
.p-logo { text-align: center; font-family: var(--display); font-size: 48px; font-weight: 800; }
.p-logo .bolt { color: var(--yellow); }
.code-input { text-align: center; font-family: var(--display); font-weight: 800; font-size: 40px !important; letter-spacing: 8px; text-transform: uppercase; }
.avatars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatars button { font-size: 32px; padding: 6px 0; border-radius: 14px; border: 3px solid transparent; background: var(--card); line-height: 1.2; }
.avatars button.on { border-color: #fff; background: var(--pink); transform: scale(1.06); }
.p-btn { min-height: 64px; font-size: 24px; width: 100%; }
.answer-pad { display: grid; gap: 12px; flex: 1; }
.answer-pad.n4 { grid-template-columns: 1fr 1fr; }
.ans { background: var(--c); color: var(--cink, #fff); border: 0; border-radius: 24px; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; font-weight: 800; font-size: 19px; box-shadow: 0 6px 0 rgba(0,0,0,.25); transition: transform .1s, opacity .3s; text-align: center; }
.ans .shape { font-size: 52px; color: rgba(255,255,255,.95); }
.c2 .shape, .c3 .shape { color: rgba(0,0,0,.55); }
.ans:active { transform: translateY(4px) scale(.98); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.ans:disabled { opacity: .35; }
.ans.picked { outline: 6px solid #fff; outline-offset: 2px; opacity: 1; }
.p-q { font-size: 16px; font-weight: 700; color: var(--ink-soft); text-align: center; line-height: 1.3; }
.p-timer { height: 10px; border-radius: 99px; background: rgba(255,255,255,.2); overflow: hidden; }
.p-timer i { display: block; height: 100%; background: var(--cyan); border-radius: 99px; width: 100%; }
.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.chip { aspect-ratio: 1; border-radius: 50%; border: 6px dashed rgba(255,255,255,.75); font-family: var(--display); font-weight: 800; font-size: 22px; display: grid; place-items: center; box-shadow: 0 5px 0 rgba(0,0,0,.3); }
.chip:nth-child(1) { background: #2D9CFF; } .chip:nth-child(2) { background: #2EE59D; color: #033; } .chip:nth-child(3) { background: #FFC93C; color: #402; } .chip:nth-child(4) { background: #FF8A00; } .chip:nth-child(5) { background: #FF3B5C; }
.chip.on { transform: scale(1.15); outline: 5px solid #fff; }
.result { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; z-index: 20; animation: sceneIn .4s var(--spring) both; }
.result.good { background: linear-gradient(160deg, #19c27f, #0b8a5a); }
.result.bad { background: linear-gradient(160deg, #ff3b5c, #a3122f); }
.result.meh { background: linear-gradient(160deg, #6b2fb3, #2B0A5E); }
.result .big { font-family: var(--display); font-size: 64px; font-weight: 800; line-height: 1; }
.result .pts { font-family: var(--display); font-size: 92px; font-weight: 800; margin: 10px 0; }
.result .rk { font-weight: 800; font-size: 20px; background: rgba(0,0,0,.2); border-radius: 999px; padding: 8px 18px; margin-top: 10px; }
.result .fact { margin-top: 18px; font-weight: 700; font-size: 17px; opacity: .95; max-width: 420px; }
.emoji-bar { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.emoji-bar button { font-size: 30px; background: var(--card); border: 0; border-radius: 14px; padding: 6px 10px; }
.emoji-bar button:active { transform: scale(1.3); }
.tap-game { width: 140px; height: 140px; border-radius: 50%; border: 0; font-size: 70px; background: radial-gradient(circle at 30% 30%, #fff6, transparent 60%), var(--yellow); box-shadow: 0 8px 0 #b8860b; margin: 0 auto; display: block; transition: transform .08s; }
.tap-game:active { transform: scale(.92) translateY(4px); box-shadow: 0 3px 0 #b8860b; }
.team-list .list-item { cursor: pointer; border: 3px solid transparent; }
.team-list .list-item.mine { border-color: #fff; }
.team-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--tc); flex: none; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.picks span { background: var(--card-strong); border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: 14px; }
.p-err { background: var(--red); border-radius: 14px; padding: 10px 14px; font-weight: 800; text-align: center; }
.num-input { text-align: center; font-family: var(--display); font-weight: 800; font-size: 54px !important; }
.spot-banner { text-align: center; font-family: var(--display); font-weight: 800; font-size: 30px; background: var(--orange); border-radius: 18px; padding: 10px; animation: pulse .6s ease-in-out infinite alternate; }

/* ---------- Spin brand lockup ---------- */
.spin-brand { display: inline-flex; align-items: center; gap: .3em; vertical-align: middle; }
.spin-brand img { height: 1.5em; width: auto; display: block; filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
.spin-brand .word { font-family: var(--display); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; line-height: 1; }
.brand .spin-brand img { height: 70px; }
.brand .spin-brand .word { font-size: 52px; }
.p-logo .spin-brand { flex-direction: column; gap: 6px; }
.p-logo .spin-brand img { height: auto; width: min(78vw, 340px); }
.p-logo .spin-brand .word { font-size: 1em; letter-spacing: .3em; }

.hurry { position: absolute; left: 50%; top: 210px; transform: translateX(-50%); background: var(--red); color: #fff; font-family: var(--display); font-weight: 800; font-size: 54px; padding: 10px 40px; border-radius: 999px; box-shadow: var(--shadow); animation: slam .5s var(--spring) both, pulse .4s ease-in-out .5s infinite alternate; z-index: 6; white-space: nowrap; }
