:root {
  --bg0: #07041a;
  --bg1: #120838;
  --ink: #f7f3ff;
  --ink2: #cfc6f7;
  --ink3: #9188c9;
  --pink: #ff3d9a;
  --violet: #8b5cf6;
  --violet2: #a78bfa;
  --cyan: #22e3ff;
  --gold: #ffcf4a;
  --green: #2ee59d;
  --red: #ff4d5e;
  --glass: rgba(255, 255, 255, 0.06);
  --glass2: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.14);
  --grad: linear-gradient(100deg, #ff3d9a 0%, #a855f7 45%, #22e3ff 100%);
  --ease: cubic-bezier(.2, .9, .25, 1.15);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg0);
  color: var(--ink);
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ───────────── Stage background ───────────── */
#bg {
  position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1100px 700px at 50% 115%, rgba(124, 58, 237, 0.55), transparent 65%),
    radial-gradient(800px 600px at 0% 0%, rgba(255, 61, 154, 0.18), transparent 60%),
    radial-gradient(800px 600px at 100% 0%, rgba(34, 227, 255, 0.14), transparent 60%),
    linear-gradient(180deg, #08041f 0%, #120838 55%, #1c0a4a 100%);
}
.beam {
  position: absolute; top: -10%; width: 34vmax; height: 140vmax; left: 50%; margin-left: -17vmax;
  transform-origin: 50% 0;
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.32), rgba(167, 139, 250, 0) 75%);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  animation: sweep 13s ease-in-out infinite alternate;
  will-change: transform;
}
.beam.b2 { background: linear-gradient(180deg, rgba(255, 61, 154, 0.26), rgba(255, 61, 154, 0) 70%); animation-duration: 17s; animation-delay: -6s; }
.beam.b3 { background: linear-gradient(180deg, rgba(34, 227, 255, 0.2), rgba(34, 227, 255, 0) 70%); animation-duration: 21s; animation-delay: -11s; }
@keyframes sweep { from { transform: rotate(-32deg); } to { transform: rotate(32deg); } }
.floor-rings {
  position: absolute; left: 50%; bottom: -52vmax; width: 110vmax; height: 110vmax; margin-left: -55vmax;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(167, 139, 250, 0.16) 0 2px, transparent 3px 46px);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%);
  mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.04); opacity: .75; } }
#sparks { position: absolute; inset: 0; width: 100%; height: 100%; }
body.flash-good #bg::after, body.flash-bad #bg::after { content: ''; position: absolute; inset: 0; animation: flash 1.2s ease-out forwards; }
body.flash-good #bg::after { background: radial-gradient(circle at 50% 60%, rgba(46, 229, 157, 0.35), transparent 70%); }
body.flash-bad #bg::after { background: radial-gradient(circle at 50% 60%, rgba(255, 77, 94, 0.35), transparent 70%); }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

#app { position: relative; z-index: 1; height: 100%; }

/* ───────────── Logo ───────────── */
.badge {
  --size: 220px;
  position: relative; flex: none; width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #2a1470, #0d0630 70%);
  box-shadow: 0 0 60px rgba(168, 85, 247, 0.55), inset 0 0 40px rgba(255, 255, 255, 0.06);
}
.badge::before {
  content: ''; position: absolute; inset: -6px; border-radius: 50%; padding: 6px;
  background: conic-gradient(from 0deg, #ff3d9a, #a855f7, #22e3ff, #ffcf4a, #ff3d9a);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 6s linear infinite;
}
.badge::after {
  content: ''; position: absolute; inset: 12%; border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.18);
  animation: spin 30s linear infinite reverse;
}
.badge b {
  font-weight: 900; font-size: calc(var(--size) * 0.42); letter-spacing: -0.04em; line-height: 1;
  background: linear-gradient(180deg, #fff 20%, #e9d5ff 60%, #f0abfc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 61, 154, 0.55));
  transform: translateY(-2%);
}
.badge b small { font-size: 0.6em; }
@keyframes spin { to { transform: rotate(360deg); } }
.wordmark { font-weight: 900; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink2); }
.wordmark em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ───────────── Shared bits ───────────── */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(4, 0, 20, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.chip { display: inline-flex; align-items: center; gap: .4em; padding: .35em .9em; border-radius: 999px; background: var(--glass2); border: 1px solid var(--line); font-weight: 700; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.avatar {
  --c: var(--violet); position: relative; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 60%, #000));
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12), 0 10px 30px color-mix(in srgb, var(--c) 45%, transparent);
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .avatar { background: var(--c); }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 1em 1.6em; border-radius: 18px; font-weight: 800; font-size: 1.1rem; letter-spacing: .01em;
  color: #fff; background: var(--grad); box-shadow: 0 10px 30px rgba(168, 85, 247, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform .15s var(--ease), filter .15s, box-shadow .2s;
  outline: none;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { box-shadow: 0 0 0 4px #fff, 0 0 0 9px rgba(255, 61, 154, .6); }
.btn.ghost { background: var(--glass2); border: 1px solid var(--line); box-shadow: none; }
.btn.gold { background: linear-gradient(100deg, #ffcf4a, #ff9f43); color: #2b1300; box-shadow: 0 10px 30px rgba(255, 191, 74, .4); }
.btn.green { background: linear-gradient(100deg, #2ee59d, #10b981); color: #032015; }
.btn.red { background: linear-gradient(100deg, #ff4d5e, #e11d48); }
.btn[disabled] { filter: grayscale(.8) brightness(.7); pointer-events: none; }

@keyframes pop-in { from { opacity: 0; transform: scale(.6) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(2.6); filter: blur(12px); } 60% { opacity: 1; filter: blur(0); } to { opacity: 1; transform: scale(1); } }
@keyframes shake { 10%, 90% { transform: translateX(-3px); } 20%, 80% { transform: translateX(5px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@keyframes pulse-glow { 50% { box-shadow: 0 0 0 10px rgba(46, 229, 157, 0), 0 0 50px rgba(46, 229, 157, .8); } }
@keyframes bob { 50% { transform: translateY(-8px); } }
.pop { animation: pop-in .55s var(--ease) both; }
.rise { animation: rise .7s var(--ease) both; }

/* ───────────── Landing ───────────── */
.landing { height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 28px; padding: 32px 16px; text-align: center; }
.landing > :first-child { margin-top: auto; }
.landing > :last-child { margin-bottom: auto; }
.landing .badge { --size: min(46vw, 24vh, 220px); }
@media (max-height: 600px) and (min-aspect-ratio: 4/3) { .landing { gap: 16px; padding: 18px 16px; } .landing h1 { font-size: 2.6rem; } }
.landing h1 { margin: 0; font-size: clamp(2.2rem, 7vw, 4rem); font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.landing p.sub { margin: 0; color: var(--ink2); font-size: 1.1rem; max-width: 34em; }
.landing .choices { display: grid; gap: 14px; width: min(100%, 440px); }
.landing .choices .btn { width: 100%; font-size: 1.25rem; padding: 1.05em; }
.landing .choices .btn span.small { display: block; font-weight: 600; font-size: .78rem; opacity: .85; }
.landing .choices .btn .stack { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.landing .choices .btn .ico { font-size: 1.8rem; }
.landing .foot { color: var(--ink3); font-size: .85rem; max-width: 40em; }
.rejoin { width: min(100%, 440px); padding: 14px 16px; border-radius: 18px; display: flex; gap: 12px; align-items: center; text-align: left; }
.rejoin .avatar { width: 48px; height: 48px; font-size: 26px; flex: none; }
.rejoin .grow { flex: 1; }

/* ───────────── TV stage ───────────── */
.tv-wrap { position: fixed; inset: 0; overflow: hidden; }
.stage {
  position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px;
  transform: translate(-50%, -50%) scale(var(--s, 1)); transform-origin: 50% 50%;
}
.tv-top { position: absolute; left: 48px; right: 48px; top: 28px; height: 96px; display: flex; align-items: center; gap: 24px; }
.tv-top .badge { --size: 84px; box-shadow: 0 0 30px rgba(168, 85, 247, 0.5); }
.tv-top .badge::before { inset: -4px; padding: 4px; }
.tv-top .wordmark { font-size: 26px; }
.tv-top .spacer { flex: 1; }
.pot { display: flex; align-items: center; gap: 16px; padding: 12px 28px 12px 16px; border-radius: 999px; }
.pot .coin { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: radial-gradient(circle at 35% 30%, #fff3b0, #ffcf4a 45%, #c98a00); box-shadow: 0 0 24px rgba(255, 207, 74, .6); color: #4a2a00; font-weight: 900; }
.pot .lbl { font-size: 16px; letter-spacing: .2em; color: var(--ink3); font-weight: 800; text-transform: uppercase; }
.pot .val { font-size: 40px; font-weight: 900; line-height: 1; color: var(--gold); text-shadow: 0 0 20px rgba(255, 207, 74, .5); }
.pot.bump .val { animation: bump .7s var(--ease); }
@keyframes bump { 30% { transform: scale(1.25); } }
.roomtag { padding: 10px 22px; border-radius: 999px; font-size: 22px; color: var(--ink2); font-weight: 700; }
.roomtag b { color: #fff; letter-spacing: .12em; font-size: 28px; margin-left: 6px; }
.net { position: absolute; right: 30px; bottom: 16px; font-size: 16px; color: var(--ink3); display: flex; gap: 8px; align-items: center; z-index: 5; }
.net i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); display: inline-block; }
.net.bad i { background: var(--red); box-shadow: 0 0 10px var(--red); }
.mute { position: absolute; left: 30px; bottom: 14px; font-size: 18px; color: var(--ink3); z-index: 5; }

/* ladder */
.ladder { position: absolute; left: 48px; top: 160px; width: 190px; bottom: 270px; display: flex; flex-direction: column; justify-content: space-between; }
.ladder .rung {
  position: relative; display: flex; align-items: center; justify-content: center; height: 100%; max-height: 56px; margin: 3px 0;
  border-radius: 16px; font-weight: 900; font-size: 28px; color: var(--ink3);
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all .5s var(--ease);
}
.ladder .rung.done { color: rgba(255, 255, 255, .28); background: transparent; border-color: transparent; text-decoration: line-through; text-decoration-thickness: 2px; }
.ladder .rung.now { color: #fff; background: var(--grad); border-color: transparent; transform: scale(1.12); box-shadow: 0 0 40px rgba(255, 61, 154, .55); }
.ladder .rung.passline::after { content: 'PASS'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; letter-spacing: .1em; padding: 3px 6px; border-radius: 6px; color: #00222a; background: var(--cyan); font-weight: 900; text-decoration: none; }
.ladder .rung.passline.now::after { background: #fff; color: #1b1140; }

/* scene */
.scene { position: absolute; left: 280px; right: 48px; top: 150px; bottom: 270px; }
.scene.wide { left: 48px; }
.scene.full { left: 48px; bottom: 48px; top: 150px; }
.scene > * { animation: rise .7s var(--ease) both; }

/* tiles */
.tiles { position: absolute; left: 48px; right: 48px; bottom: 40px; height: 210px; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 14px 18px; }
.tile { --sz: 92px; position: relative; width: calc(var(--sz) + 34px); display: flex; flex-direction: column; align-items: center; gap: 8px; transition: opacity .6s, filter .6s, transform .5s var(--ease); }
.tiles.small .tile { --sz: 64px; }
.tiles.tiny .tile { --sz: 46px; }
.tile .avatar { width: var(--sz); height: var(--sz); font-size: calc(var(--sz) * .56); transition: box-shadow .4s, transform .4s var(--ease); }
.tile .nm { font-size: 20px; font-weight: 800; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.tiles.small .tile .nm { font-size: 16px; }
.tiles.tiny .tile .nm { font-size: 13px; }
.tile .mark { position: absolute; top: -6px; right: 4px; min-width: 34px; height: 34px; border-radius: 17px; padding: 0 8px; display: grid; place-items: center; font-weight: 900; font-size: 18px; transform: scale(0); transition: transform .4s var(--ease); }
.tiles.small .tile .mark, .tiles.tiny .tile .mark { min-width: 26px; height: 26px; font-size: 14px; top: -6px; right: 0; }
.tile.ans .mark { transform: scale(1); background: #fff; color: #1b1140; }
.tile.ans .mark::after { content: '✓'; }
.tile.ans .avatar { box-shadow: 0 0 0 4px #fff, 0 0 30px rgba(255, 255, 255, .5); }
.tile.correct .avatar { box-shadow: 0 0 0 5px var(--green), 0 0 40px rgba(46, 229, 157, .8); animation: pulse-glow 1.6s ease-in-out 2; }
.tile.correct .mark { transform: scale(1); background: var(--green); color: #032015; }
.tile.correct .mark::after { content: '✓'; }
.tile.pass .avatar { box-shadow: 0 0 0 5px var(--cyan), 0 0 40px rgba(34, 227, 255, .7); }
.tile.pass .mark { transform: scale(1); background: var(--cyan); color: #00222a; font-size: 13px; }
.tile.pass .mark::after { content: 'PASS'; }
.tile.wrong .avatar { box-shadow: 0 0 0 5px var(--red), 0 0 40px rgba(255, 77, 94, .8); animation: shake .6s; }
.tile.wrong .mark { transform: scale(1); background: var(--red); }
.tile.wrong .mark::after { content: '✕'; }
.tile.isout { opacity: .32; filter: grayscale(1); }
.tile.isout .nm::after { content: ' · out'; color: var(--ink3); font-weight: 600; }
.tile.walked { opacity: .55; }
.tile.walked .nm::after { content: ' · £'; color: var(--gold); }
.tile.offline .avatar { filter: grayscale(.8) brightness(.6); }
.tile.offline .nm { opacity: .5; }
.tile .crown { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 26px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.tiles.small .tile .crown, .tiles.tiny .tile .crown { font-size: 18px; top: -16px; }
.tile.joined { animation: pop-in .6s var(--ease) both; }

/* lobby */
.lobby { display: grid; grid-template-columns: 760px 1fr; gap: 48px; height: 100%; }
.lobby .left { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 26px; padding: 30px; border-radius: 40px; }
.lobby .left .badge { --size: 200px; }
.lobby .title { font-size: 72px; font-weight: 900; line-height: .95; letter-spacing: -0.02em; margin: 0; }
.lobby .joinbox { display: flex; gap: 32px; align-items: center; }
.lobby .qr { width: 250px; height: 250px; padding: 14px; border-radius: 22px; background: #fff; box-shadow: 0 0 50px rgba(34, 227, 255, .35); }
.lobby .qr svg { width: 100%; height: 100%; display: block; }
.lobby .how { text-align: left; }
.lobby .how .step { font-size: 22px; color: var(--ink2); font-weight: 600; }
.lobby .how .url { font-size: 30px; font-weight: 800; color: #fff; word-break: break-all; margin: 4px 0 14px; }
.lobby .how .code { font-size: 112px; font-weight: 900; letter-spacing: .14em; line-height: 1; }
.lobby .right { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.lobby .right h2 { margin: 0; font-size: 44px; font-weight: 900; display: flex; align-items: center; gap: 18px; }
.lobby .right h2 .count { font-size: 30px; padding: 4px 18px; border-radius: 999px; background: var(--grad); }
.lobby .crowd { flex: 1; border-radius: 40px; padding: 30px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 26px 22px; overflow: hidden; }
.lobby .crowd .tile { --sz: 104px; }
.lobby .crowd.small .tile { --sz: 76px; }
.lobby .empty { margin: auto; text-align: center; color: var(--ink3); font-size: 30px; font-weight: 600; }
.lobby .empty .big { font-size: 90px; display: block; animation: bob 2.4s ease-in-out infinite; }
.lobby .settings { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.lobby .settings .opt { font-size: 22px; padding: 14px 22px; border-radius: 16px; background: var(--glass2); border: 1px solid var(--line); font-weight: 700; }
.lobby .settings .opt b { color: var(--cyan); }
.lobby .settings .opt:focus-visible { outline: 4px solid #fff; }
.lobby .startrow { display: flex; align-items: center; gap: 22px; font-size: 24px; color: var(--ink2); }
.lobby .startrow .btn { font-size: 30px; padding: 22px 46px; }
.lobby .other { font-size: 19px; color: var(--ink3); }

/* intro */
.intro { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 30px; }
.intro .badge { --size: 330px; animation: zoom-in 1.2s var(--ease) both; }
.intro h1 { margin: 0; font-size: 110px; font-weight: 900; line-height: .9; letter-spacing: -0.02em; animation: rise .8s .5s var(--ease) both; }
.intro p { margin: 0; font-size: 40px; color: var(--ink2); font-weight: 600; animation: rise .8s 1s var(--ease) both; }
.intro p b { color: var(--gold); }

/* level */
.level { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; }
.level .halo { position: absolute; width: 760px; height: 760px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .1); animation: halo 2.4s ease-out infinite; }
.level .halo.h2 { animation-delay: .8s; }
.level .halo.h3 { animation-delay: 1.6s; }
@keyframes halo { from { transform: scale(.3); opacity: 1; border-color: rgba(255, 61, 154, .7); } to { transform: scale(1.4); opacity: 0; } }
.level .pre { font-size: 40px; letter-spacing: .3em; font-weight: 800; color: var(--ink2); animation: rise .6s var(--ease) both; }
.level .big { font-size: 330px; font-weight: 900; line-height: .9; letter-spacing: -0.04em; animation: zoom-in 1s .15s var(--ease) both; filter: drop-shadow(0 10px 50px rgba(255, 61, 154, .5)); }
.level .big small { font-size: .5em; }
.level .post { font-size: 38px; font-weight: 600; color: var(--ink2); animation: rise .7s .7s var(--ease) both; }
.level .post b { color: #fff; }

/* question */
.qwrap { height: 100%; display: grid; grid-template-columns: 1fr 250px; gap: 36px; }
.qcard { position: relative; border-radius: 40px; padding: 40px 50px; display: flex; flex-direction: column; gap: 24px; min-height: 0; overflow: hidden; }
.qcard .meta { display: flex; gap: 14px; align-items: center; font-size: 22px; }
.qcard .meta .chip { font-size: 20px; }
.qcard .meta .lv { background: var(--grad); border: 0; }
.qcard .prompt { font-size: 54px; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.qcard .prompt.long { font-size: 42px; }
.qcard .prompt.xlong { font-size: 34px; }
.qcard .display { font-size: 88px; font-weight: 900; letter-spacing: .02em; text-align: center; white-space: pre-line; line-height: 1.12; padding: 8px 0; color: #fff; text-shadow: 0 0 30px rgba(167, 139, 250, .6); font-variant-numeric: tabular-nums; }
.qcard .display.long { font-size: 64px; }
.qcard .display.multi { font-size: 62px; }
.qcard .pic { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.qcard .pic img { width: 100%; height: 100%; max-height: 470px; object-fit: contain; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .5)); }
.qcard .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: auto; }
.qcard .opts.three { grid-template-columns: repeat(3, 1fr); }
.qcard .opts.two { grid-template-columns: 1fr 1fr; }
.opt-tile { position: relative; display: flex; align-items: center; gap: 22px; padding: 22px 28px; border-radius: 24px; font-size: 38px; font-weight: 800; background: rgba(255, 255, 255, .07); border: 2px solid rgba(255, 255, 255, .14); transition: all .6s var(--ease); min-height: 104px; overflow: hidden; }
.opt-tile .L { flex: none; width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; font-weight: 900; font-size: 34px; background: var(--grad); }
.opt-tile .txt { flex: 1; line-height: 1.1; }
.opt-tile .bar { position: absolute; left: 0; bottom: 0; height: 8px; width: 0; background: rgba(255, 255, 255, .5); transition: width 1.2s var(--ease); }
.opt-tile .cnt { font-size: 26px; font-weight: 800; color: var(--ink2); opacity: 0; transition: opacity .5s; }
.reveal-on .opt-tile .cnt { opacity: 1; }
.reveal-on .opt-tile.no { opacity: .35; transform: scale(.97); }
.reveal-on .opt-tile.yes { background: linear-gradient(100deg, rgba(46, 229, 157, .35), rgba(46, 229, 157, .12)); border-color: var(--green); box-shadow: 0 0 50px rgba(46, 229, 157, .5); transform: scale(1.03); }
.reveal-on .opt-tile.yes .L { background: var(--green); color: #032015; }
.reveal-on .opt-tile.yes .bar { background: var(--green); }
.answer-input { margin-top: auto; text-align: center; font-size: 34px; color: var(--ink2); font-weight: 600; }
.answer-input .kind { display: inline-flex; gap: 12px; align-items: center; padding: 14px 28px; border-radius: 999px; background: var(--glass2); border: 1px solid var(--line); }

.side { display: flex; flex-direction: column; gap: 26px; align-items: center; }
.timer { position: relative; width: 230px; height: 230px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .track { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 16; }
.timer .arc { fill: none; stroke: url(#tgrad); stroke-width: 16; stroke-linecap: round; transition: stroke .3s; }
.timer.hurry .arc { stroke: var(--red); }
.timer .t { position: absolute; inset: 0; display: grid; place-items: center; font-size: 92px; font-weight: 900; font-variant-numeric: tabular-nums; }
.timer.hurry .t { color: var(--red); animation: tick-pulse 1s ease-in-out infinite; }
@keyframes tick-pulse { 15% { transform: scale(1.12); } }
.answered { text-align: center; font-size: 26px; color: var(--ink2); font-weight: 700; }
.answered b { display: block; font-size: 72px; color: #fff; line-height: 1; font-weight: 900; }
.locked-stamp { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 4; }
.locked-stamp span { font-size: 110px; font-weight: 900; letter-spacing: .06em; color: #fff; padding: 18px 60px; border: 10px solid #fff; border-radius: 30px; transform: rotate(-8deg); background: rgba(255, 61, 154, .85); box-shadow: 0 0 80px rgba(255, 61, 154, .8); animation: stamp .5s var(--ease) both; }
@keyframes stamp { from { opacity: 0; transform: rotate(-8deg) scale(2.2); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }

/* reveal extras */
.reveal-panel { border-radius: 30px; padding: 22px 30px; display: flex; gap: 24px; align-items: center; animation: rise .7s var(--ease) both; }
.reveal-panel .ans { font-size: 30px; color: var(--ink2); font-weight: 700; white-space: nowrap; }
.reveal-panel .ans b { display: block; font-size: 64px; color: var(--green); line-height: 1; font-weight: 900; text-shadow: 0 0 30px rgba(46, 229, 157, .6); }
.reveal-panel .why { font-size: 28px; line-height: 1.3; color: var(--ink); font-weight: 500; }
.toplist { display: flex; gap: 14px; flex-wrap: wrap; }
.toplist .chip { font-size: 22px; }
.toplist .chip.ok { background: rgba(46, 229, 157, .2); border-color: var(--green); }
.outcome { text-align: center; }
.outcome .n { font-size: 96px; font-weight: 900; line-height: 1; }
.outcome .l { font-size: 24px; font-weight: 800; letter-spacing: .12em; color: var(--ink2); text-transform: uppercase; }
.outcome.bad .n { color: var(--red); text-shadow: 0 0 30px rgba(255, 77, 94, .6); }
.outcome.good .n { color: var(--green); text-shadow: 0 0 30px rgba(46, 229, 157, .6); }
.nextnote { font-size: 20px; color: var(--ink3); text-align: center; }
.stagger > * { animation: rise .6s var(--ease) both; }

/* decision */
.decision { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; text-align: center; }
.decision h1 { font-size: 96px; margin: 0; font-weight: 900; line-height: .95; }
.decision p { font-size: 38px; margin: 0; color: var(--ink2); max-width: 1300px; }
.decision .finalists { display: flex; gap: 36px; flex-wrap: wrap; justify-content: center; }
.decision .finalists .tile { --sz: 130px; }
.decision .finalists .nm { font-size: 26px; }

/* final */
.final { height: 100%; display: grid; grid-template-columns: 1fr 640px; gap: 40px; }
.final .hero { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 22px; border-radius: 40px; padding: 40px; }
.final .hero h1 { margin: 0; font-size: 86px; font-weight: 900; line-height: .95; letter-spacing: -0.02em; }
.final .hero .who { display: flex; gap: 36px; flex-wrap: wrap; justify-content: center; }
.final .hero .who .tile { --sz: 150px; width: 200px; }
.final .hero .who .nm { font-size: 30px; }
.final .hero .money { font-size: 64px; font-weight: 900; color: var(--gold); text-shadow: 0 0 30px rgba(255, 207, 74, .6); }
.final .hero p { margin: 0; font-size: 32px; color: var(--ink2); }
.final .board { border-radius: 40px; padding: 30px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.final .board h2 { margin: 0 0 8px; font-size: 34px; }
.row { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-radius: 18px; background: rgba(255, 255, 255, .05); font-size: 26px; font-weight: 700; animation: rise .6s var(--ease) both; }
.row .pos { width: 46px; font-weight: 900; color: var(--ink3); }
.row .avatar { width: 50px; height: 50px; font-size: 28px; flex: none; }
.row .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .v { font-weight: 900; color: var(--gold); }
.row .v.dim { color: var(--ink3); font-weight: 700; font-size: 22px; }
.row.first { background: linear-gradient(100deg, rgba(255, 207, 74, .3), rgba(255, 207, 74, .05)); border: 1px solid rgba(255, 207, 74, .5); }
.final .hint { font-size: 22px; color: var(--ink3); text-align: center; }
.podium { display: flex; align-items: flex-end; gap: 22px; justify-content: center; }
.podium .step { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.podium .block { width: 190px; border-radius: 22px 22px 0 0; display: grid; place-items: center; font-size: 60px; font-weight: 900; background: var(--grad); }
.podium .step:nth-child(1) .block { height: 160px; opacity: .85; }
.podium .step:nth-child(2) .block { height: 230px; background: linear-gradient(180deg, #ffcf4a, #ff9f43); color: #3a1d00; }
.podium .step:nth-child(3) .block { height: 110px; opacity: .7; }
.podium .tile { --sz: 120px; }
.podium .pts { font-size: 26px; font-weight: 900; color: var(--gold); }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5, 2, 20, .7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 16px; animation: fade .3s both; }
.overlay .box { max-width: 560px; width: 100%; padding: 30px; border-radius: 28px; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.overlay h2 { margin: 0; font-size: 1.8rem; }
.overlay p { margin: 0; color: var(--ink2); }
.spinner { width: 56px; height: 56px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, .15); border-top-color: var(--pink); animation: spin 1s linear infinite; }

/* confetti canvas */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* ───────────── Phone ───────────── */
.phone { height: 100%; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom)); }
.ph-top { display: flex; align-items: center; gap: 10px; padding: 6px 4px 10px; }
.ph-top .avatar { width: 44px; height: 44px; font-size: 24px; flex: none; }
.ph-top .me { flex: 1; min-width: 0; }
.ph-top .me .n { font-weight: 800; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-top .me .s { font-size: .8rem; color: var(--ink3); font-weight: 600; }
.status-pill { font-size: .78rem; font-weight: 800; padding: .35em .8em; border-radius: 999px; background: var(--glass2); border: 1px solid var(--line); white-space: nowrap; }
.status-pill.in { background: rgba(46, 229, 157, .16); border-color: rgba(46, 229, 157, .5); color: #b9ffe2; }
.status-pill.out { background: rgba(255, 77, 94, .16); border-color: rgba(255, 77, 94, .5); color: #ffc3ca; }
.status-pill.gold { background: rgba(255, 207, 74, .16); border-color: rgba(255, 207, 74, .5); color: #ffe9a8; }
.ph-pot { font-weight: 900; color: var(--gold); font-size: 1rem; white-space: nowrap; }
.ph-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; overflow-x: hidden; padding: 4px 2px; -webkit-overflow-scrolling: touch; }
.ph-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 10px; }
.ph-center h2 { margin: 0; font-size: 1.9rem; font-weight: 900; line-height: 1.05; }
.ph-center p { margin: 0; color: var(--ink2); font-size: 1.05rem; }
.ph-center .avatar.hero { width: 120px; height: 120px; font-size: 66px; animation: pop-in .6s var(--ease) both, bob 3s 1s ease-in-out infinite; }
.ph-big-level { font-size: 7rem; font-weight: 900; line-height: .9; letter-spacing: -0.04em; animation: zoom-in .9s var(--ease) both; }
.ph-big-level small { font-size: .5em; }
.ph-card { border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ph-card .meta { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--ink3); font-weight: 700; }
.ph-card .prompt { font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.ph-card .display { font-size: 1.8rem; font-weight: 900; text-align: center; white-space: pre-line; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ph-card .display.long { font-size: 1.35rem; }
.ph-card .pic { display: flex; justify-content: center; }
.ph-card .pic img { max-width: 100%; max-height: 32vh; }
.tbar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.tbar i { display: block; height: 100%; width: 100%; background: var(--grad); transform-origin: left; }
.tbar.hurry i { background: var(--red); }
.ph-timer { display: flex; align-items: center; gap: 10px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ph-timer .tbar { flex: 1; }

.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: 18px; font-size: 1.12rem; font-weight: 700; background: rgba(255, 255, 255, .07); border: 2px solid rgba(255, 255, 255, .14); transition: transform .12s, background .2s, border-color .2s; }
.choice .L { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; background: var(--grad); }
.choice:active { transform: scale(.98); }
.choice.sel { border-color: #fff; background: rgba(255, 255, 255, .18); box-shadow: 0 0 0 3px rgba(255, 61, 154, .5); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { padding: 14px 0; border-radius: 16px; font-size: 1.6rem; font-weight: 800; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); }
.keypad button:active { background: rgba(255, 255, 255, .2); }
.keypad button.fn { font-size: 1.1rem; color: var(--ink2); }
.entry { text-align: center; font-size: 2.6rem; font-weight: 900; min-height: 1.4em; padding: 4px 10px; border-radius: 16px; background: rgba(0, 0, 0, .25); border: 2px solid var(--line); font-variant-numeric: tabular-nums; letter-spacing: .03em; overflow: hidden; }
.entry.empty { color: var(--ink3); font-size: 1.1rem; font-weight: 600; display: grid; place-items: center; }
.letters { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.letters button { padding: 10px 0; border-radius: 12px; font-size: 1.25rem; font-weight: 800; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); }
.letters button.sel { background: var(--grad); border-color: transparent; }
.ph-actions { display: flex; gap: 10px; }
.ph-actions .btn { flex: 1; }
.lockbtn { width: 100%; font-size: 1.3rem; padding: 1em; }
.passbtn { width: 100%; }

.result { border-radius: 26px; padding: 22px 18px; text-align: center; display: flex; flex-direction: column; gap: 8px; animation: pop-in .6s var(--ease) both; }
.result .emo { font-size: 4rem; line-height: 1; }
.result h2 { margin: 0; font-size: 2rem; font-weight: 900; }
.result.good { background: linear-gradient(160deg, rgba(46, 229, 157, .3), rgba(46, 229, 157, .06)); border: 1px solid rgba(46, 229, 157, .6); }
.result.bad { background: linear-gradient(160deg, rgba(255, 77, 94, .3), rgba(255, 77, 94, .06)); border: 1px solid rgba(255, 77, 94, .6); }
.result.neutral { background: var(--glass2); border: 1px solid var(--line); }
.result.cyan { background: linear-gradient(160deg, rgba(34, 227, 255, .25), rgba(34, 227, 255, .05)); border: 1px solid rgba(34, 227, 255, .6); }
.result .yours { font-size: .95rem; color: var(--ink2); }
.explain { border-radius: 18px; padding: 14px 16px; font-size: 1rem; color: var(--ink2); line-height: 1.4; }
.explain b { color: #fff; }
.vipbar { border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.vipbar .lbl { font-size: .78rem; font-weight: 800; letter-spacing: .14em; color: var(--gold); text-transform: uppercase; }
.seg { display: flex; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.seg button { flex: 1; padding: 10px 6px; border-radius: 10px; font-weight: 800; font-size: .92rem; color: var(--ink2); }
.seg button.on { background: var(--grad); color: #fff; }
.form { display: flex; flex-direction: column; gap: 14px; width: min(100%, 440px); }
.field label { display: block; font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); margin: 0 0 6px 4px; text-align: left; }
.field input { width: 100%; padding: 16px 18px; border-radius: 16px; font-size: 1.3rem; font-weight: 800; background: rgba(0, 0, 0, .3); border: 2px solid var(--line); outline: none; }
.field input:focus { border-color: var(--violet2); }
.field input.code { text-transform: uppercase; letter-spacing: .4em; text-align: center; font-size: 2rem; }
.avs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.avs button { aspect-ratio: 1; padding: 0; border-radius: 12px; font-size: clamp(1.1rem, 5.4vw, 1.5rem); background: rgba(255, 255, 255, .06); border: 2px solid transparent; }
.avs button.sel { border-color: #fff; background: rgba(255, 255, 255, .2); }
.err { color: #ffb3bd; font-weight: 700; min-height: 1.2em; }
.mini-players { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mini-players .avatar { width: 34px; height: 34px; font-size: 19px; }
.mini-players .avatar.off { filter: grayscale(1); opacity: .5; }
.dim { color: var(--ink3); }
.center { text-align: center; }

/* Lite mode for TV sticks: no live blur behind panels, calmer background. */
body.lite .glass { backdrop-filter: none; -webkit-backdrop-filter: none; background: linear-gradient(180deg, rgba(46, 26, 104, .94), rgba(28, 15, 70, .94)); }
body.lite .overlay { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(5, 2, 20, .9); }
body.lite .beam { animation-duration: 45s; }
body.lite .floor-rings { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .beam { display: none; }
}
@media (max-height: 640px) {
  .ph-card .prompt { font-size: 1.05rem; }
  .choice { padding: 10px; font-size: 1rem; }
  .keypad button { padding: 10px 0; }
}
