/* Spin & Solve — TV host screen. Designed on a fixed 1920×1080 stage that is scaled to fit. */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: radial-gradient(ellipse at 50% 35%, var(--bg-glow) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  background-color: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }

#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1920px; height: 1080px;
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  overflow: clip;
}

.screen { position: absolute; inset: 0; display: none; }
.screen.on { display: flex; }

/* ---------- shared bits ---------- */
.logo { font-family: var(--font-display); font-weight: 700; font-size: 120px; line-height: 1; letter-spacing: -1px; display: flex; align-items: baseline; gap: 18px; }
.logo-a { color: var(--gold); text-shadow: 0 6px 0 var(--gold-deep), 0 14px 30px rgba(0,0,0,.5); }
.logo-amp { color: var(--coral); font-size: .6em; transform: rotate(-8deg); display: inline-block; }
.logo-b { color: var(--ink); text-shadow: 0 6px 0 var(--surface-line), 0 14px 30px rgba(0,0,0,.5); }
.logo-small { font-size: 44px; gap: 8px; }
.logo-small .logo-a, .logo-small .logo-b { text-shadow: 0 3px 0 var(--gold-deep); }
.logo-small .logo-b { text-shadow: 0 3px 0 var(--surface-line); }

.card { background: var(--surface); border: 3px solid var(--surface-line); border-radius: var(--radius-l); box-shadow: var(--shadow); }
.label { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: 3px; color: var(--ink-dim); font-size: 26px; }
.hint { color: var(--ink-dim); font-size: 24px; font-weight: 700; }
.pill { display: inline-block; background: var(--gold); color: var(--ink-on-accent); border-radius: 999px; padding: 2px 14px; font-size: 20px; margin-left: 10px; vertical-align: middle; }
.pill:empty { display: none; }

.btn {
  font-family: var(--font-display); font-weight: 700; cursor: pointer;
  border: none; border-radius: 999px; color: var(--ink-on-accent);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 6px 0 var(--coral-deep), 0 14px 30px rgba(0,0,0,.4);
  transition: transform .12s, filter .12s, opacity .2s;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--coral-deep); }
.btn:disabled { opacity: .35; cursor: not-allowed; filter: grayscale(.6); }
.btn:focus-visible { outline: 4px solid var(--ink); outline-offset: 4px; }
.btn-start { font-size: 56px; padding: 16px 80px; }
.btn-small { font-size: 30px; padding: 12px 40px; }

/* ---------- LOBBY ---------- */
#lobby { display: none; padding: 56px 72px; gap: 40px; flex-direction: column; }
#lobby.on { display: grid; grid-template-columns: 980px 1fr; grid-template-rows: auto 1fr; gap: 40px 48px; }
.lobby-brand { grid-column: 1 / 3; display: flex; align-items: center; justify-content: space-between; }
.tagline { font-family: var(--font-display); font-size: 36px; color: var(--ink-dim); font-weight: 600; max-width: 640px; text-align: right; }

.lobby-join { display: flex; flex-direction: column; align-items: center; padding: 34px 44px 44px; gap: 6px; }
.room-code {
  font-family: var(--font-display); font-weight: 700; font-size: 230px; line-height: 1; letter-spacing: 24px; padding-left: 24px;
  color: var(--gold); text-shadow: 0 10px 0 var(--gold-deep), 0 24px 50px rgba(0,0,0,.5); margin-bottom: 26px;
}
.join-row { display: flex; gap: 44px; align-items: center; width: 100%; }
.qr { width: 360px; height: 360px; flex: none; background: #fff; border-radius: var(--radius-m); padding: 20px; display: grid; place-items: center; }
.qr svg { width: 100%; height: 100%; display: block; }
.join-text { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.join-big { font-family: var(--font-display); font-weight: 600; font-size: 46px; line-height: 1.1; margin-bottom: 18px; }
.join-url { font-family: var(--font-display); font-size: 36px; font-weight: 600; color: var(--gold-soft); word-break: break-all; background: var(--bg-0); padding: 14px 22px; border-radius: var(--radius-s); }

.lobby-players { position: relative; padding: 40px 44px; display: flex; flex-direction: column; gap: 22px; min-height: 0; }
.players-head { display: flex; justify-content: space-between; align-items: baseline; }
.player-count { font-family: var(--font-display); font-size: 40px; font-weight: 700; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; min-height: 290px; }
.chips .empty-chips { grid-column: 1 / 3; color: var(--ink-faint); font-size: 30px; font-weight: 800; padding: 40px 0; text-align: center; border: 3px dashed var(--surface-line); border-radius: var(--radius-m); }
.chip {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; border-radius: 999px;
  background: var(--bg-2); border: 3px solid var(--pc, var(--surface-line)); animation: pop-in .4s cubic-bezier(.2, 1.6, .4, 1);
}
.chip .dot { width: 54px; height: 54px; border-radius: 50%; background: var(--pc); flex: none; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 28px; color: var(--ink-on-accent); }
.chip .nm { font-family: var(--font-display); font-weight: 600; font-size: 34px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .crown { color: var(--gold); font-size: 30px; }
.chip.off { opacity: .45; border-style: dashed; }
.chip.off .nm::after { content: " (away)"; font-size: 22px; color: var(--ink-dim); }
.chip .kick { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--surface-line); color: var(--ink); font-size: 24px; font-weight: 900; cursor: pointer; flex: none; }
.chip .kick:hover { background: var(--danger); }
#startBtn { align-self: center; margin-top: 4px; }
#startHint { text-align: center; }

.source-row { display: flex; align-items: center; gap: 18px; }
.source-label { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .08em; }
.seg { display: flex; flex: 1; background: var(--bg-1); border: 2px solid var(--surface-line); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { flex: 1; font: 700 22px var(--font-display); color: var(--ink-dim); background: none; border: 0; border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--gold); color: var(--bg-0); }
.pack { background: var(--bg-1); border-radius: var(--radius-m); padding: 14px 22px; border: 2px solid var(--surface-line); }
.pack[open] { position: absolute; left: 44px; right: 44px; bottom: 40px; z-index: 5; box-shadow: 0 -20px 60px rgba(0,0,0,.6); border-color: var(--gold); }
.pack summary { cursor: pointer; font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--ink-dim); }
.pack-help { color: var(--ink-dim); font-size: 20px; margin: 10px 0; }
.pack code { background: var(--bg-0); padding: 2px 8px; border-radius: 6px; color: var(--gold-soft); }
.pack textarea { width: 100%; font: 600 20px/1.4 ui-monospace, Menlo, Consolas, monospace; background: var(--bg-0); color: var(--ink); border: 2px solid var(--surface-line); border-radius: var(--radius-s); padding: 12px; resize: vertical; }
.pack-row { display: flex; gap: 20px; align-items: flex-start; margin-top: 12px; }
.pack-result { font-size: 20px; font-weight: 700; color: var(--ink-dim); max-height: 110px; overflow: auto; flex: 1; }
.pack-result .ok { color: var(--success); }
.pack-result .err { color: var(--coral); }

/* ---------- GAME ---------- */
#game { flex-direction: column; }
.topbar { height: 104px; padding: 0 48px; display: flex; align-items: center; gap: 36px; flex: none; }
.round-ind { font-family: var(--font-display); font-weight: 700; font-size: 38px; color: var(--ink); background: var(--surface); border: 3px solid var(--surface-line); border-radius: 999px; padding: 6px 28px; white-space: nowrap; }
.round-ind span { color: var(--ink-dim); font-size: .7em; }
.round-ind.bonus { background: var(--gold); color: var(--ink-on-accent); border-color: var(--gold-deep); }
.log-line { flex: 1; font-size: 32px; font-weight: 800; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.log-line.fresh { animation: log-in .5s ease-out; }
.timer { width: 92px; height: 92px; position: relative; flex: none; opacity: 0; transition: opacity .3s; }
.timer.on { opacity: 1; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-track { fill: var(--surface); stroke: var(--surface-line); stroke-width: 9; }
.timer-arc { fill: none; stroke: var(--teal); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 276.46; stroke-dashoffset: 0; }
.timer.low .timer-arc { stroke: var(--coral); }
.timer-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 38px; }

.main { flex: 1; display: flex; gap: 32px; padding: 0 48px; min-height: 0; align-items: center; }
.left-col { width: 640px; height: 100%; position: relative; flex: none; }
.right-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 22px; min-width: 0; }

/* wheel */
.wheel-wrap { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .4s, transform .6s cubic-bezier(.2, .9, .3, 1.1); }
#wheel { width: 640px; height: 640px; filter: drop-shadow(0 18px 40px rgba(0,0,0,.55)); overflow: visible; }
.wheel-wrap.spinning #wheel { filter: drop-shadow(0 0 40px rgba(255, 200, 71, .45)) drop-shadow(0 18px 40px rgba(0,0,0,.55)); }
.wheel-wrap.spinning { transform: scale(1.04); }
.pointer { position: absolute; left: 50%; top: calc(50% - 352px); width: 60px; height: 80px; margin-left: -30px; transform-origin: 50% 8px; z-index: 2; filter: drop-shadow(0 5px 6px rgba(0,0,0,.5)); }
.pointer svg { width: 100%; height: 100%; display: block; }
.pointer path { fill: var(--pointer); stroke: var(--pointer-edge); stroke-width: 4; stroke-linejoin: round; }
.wedge-pop {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.4); opacity: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 96px; color: var(--gold);
  background: var(--bg-0); border: 5px solid var(--gold); border-radius: var(--radius-l); padding: 6px 36px;
  text-shadow: 0 5px 0 var(--gold-deep); pointer-events: none; white-space: nowrap; z-index: 3;
}
.wedge-pop.on { animation: pop-hold 1.8s cubic-bezier(.2, 1.5, .4, 1) forwards; }
.wheel-hub-text { font-family: var(--font-display); font-weight: 700; }

.panel {
  position: absolute; inset: 20px 0; border-radius: var(--radius-l); padding: 40px 40px;
  background: var(--surface); border: 4px solid var(--gold); box-shadow: var(--shadow), 0 0 60px rgba(255, 200, 71, .2);
  display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center;
  opacity: 0; transform: translateX(-40px) scale(.96); pointer-events: none; transition: opacity .35s, transform .45s cubic-bezier(.2, 1.2, .4, 1);
}
.mode-solve .solve-panel, .mode-bonus .bonus-panel { opacity: 1; transform: none; pointer-events: auto; }
.mode-solve .wheel-wrap, .mode-bonus .wheel-wrap { opacity: 0; transform: scale(.85); }
.panel-title { font-family: var(--font-display); font-weight: 700; font-size: 52px; line-height: 1.1; }
.panel-title .who { color: var(--pc, var(--gold)); }
.big-count { font-family: var(--font-display); font-weight: 700; font-size: 150px; line-height: 1; color: var(--gold); text-shadow: 0 8px 0 var(--gold-deep); font-variant-numeric: tabular-nums; }
.big-count.low { color: var(--coral); text-shadow: 0 8px 0 var(--coral-deep); animation: pulse 1s infinite; }
.big-count:empty { display: none; }
.transcript {
  width: 100%; flex: 1; min-height: 120px; background: var(--bg-0); border-radius: var(--radius-m); padding: 26px;
  font-family: var(--font-display); font-size: 52px; line-height: 1.15; display: flex; align-items: center; justify-content: center; text-transform: uppercase; overflow-wrap: anywhere;
}
.transcript .final { font-weight: 700; color: var(--ink); }
.transcript .interim { font-style: italic; font-weight: 500; color: var(--ink-dim); }
.transcript .placeholder { color: var(--ink-faint); font-size: 34px; text-transform: none; }
.transcript-src { color: var(--ink-dim); font-size: 22px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.transcript-src:empty { display: none; }

.bonus-title { font-family: var(--font-display); font-weight: 700; font-size: 60px; color: var(--gold); text-transform: uppercase; letter-spacing: 3px; text-shadow: 0 5px 0 var(--gold-deep); }
.bonus-who { font-family: var(--font-display); font-weight: 700; font-size: 46px; }
.bonus-prize { font-family: var(--font-display); font-weight: 700; font-size: 72px; color: var(--success); line-height: 1; }
.bonus-status { font-size: 30px; font-weight: 800; color: var(--ink-dim); }
.bonus-letters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.bl { width: 46px; height: 60px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-tile); font-weight: 700; font-size: 36px; background: var(--tile-face); color: var(--tile-ink); }
.bl.given { background: var(--surface-2); color: var(--ink); }
.bl.pick { background: var(--gold); color: var(--ink-on-accent); animation: pop-in .45s cubic-bezier(.2, 1.6, .4, 1); }
.bl.wait { background: transparent; border: 3px dashed var(--surface-line); color: var(--ink-faint); }
.bl.wait.vowel { border-color: var(--gold); color: var(--gold); }
.bl.sep { width: 8px; background: none; }
.bonus-letters { flex-wrap: nowrap; gap: 6px; }
.bonus-panel { gap: 14px; padding: 32px 36px; }
.bonus-panel.solving .bonus-status { display: none; }
.bonus-panel.solving .bonus-title { font-size: 44px; }
.bonus-panel.solving .bonus-who { font-size: 36px; }
.bonus-panel.solving .bonus-prize { font-size: 56px; }
.bonus-panel .big-count { font-size: 120px; }
.bonus-panel .transcript { min-height: 0; }
.bonus-panel:not(.solving) .transcript { display: none; }

/* board */
.board-wrap { position: relative; }
.board {
  background: linear-gradient(180deg, var(--board-frame), var(--bg-0));
  border: 6px solid var(--board-frame-edge); border-radius: 26px; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 7px;
  box-shadow: 0 0 0 6px var(--bg-0), 0 0 50px rgba(255, 200, 71, .25), var(--shadow);
}
.board.shake { animation: shake .5s; }
.row { display: flex; gap: 6px; justify-content: center; }
.tile {
  width: 74px; height: 104px; border-radius: 8px; position: relative; perspective: 400px;
  font-family: var(--font-tile); font-weight: 700; font-size: 76px; line-height: 1;
}
.tile .face { position: absolute; inset: 0; border-radius: 8px; display: grid; place-items: center; backface-visibility: hidden; transition: background .25s, box-shadow .25s; }
.tile.empty .face { background: var(--tile-empty); box-shadow: inset 0 0 0 2px var(--tile-empty-edge); }
.tile.blank .face, .tile.shown .face { background: var(--tile-blank); box-shadow: inset 0 -6px 0 var(--tile-edge); color: var(--tile-ink); }
.tile.shown .face { background: var(--tile-face); }
.tile.lit .face { background: var(--tile-lit); box-shadow: 0 0 26px var(--tile-lit-glow), inset 0 0 0 4px var(--tile-lit-glow); }
.tile.flip .face { animation: flip-in .45s ease-out; }
.board.intro .tile:not(.empty) .face { animation: tile-in .5s backwards cubic-bezier(.2, 1.4, .4, 1); animation-delay: calc(var(--i) * 28ms); }
.board.solved .tile.shown .face { animation: glow 1.2s ease-in-out 2; }

.callout {
  position: absolute; left: 50%; bottom: -34px; transform: translate(-50%, 20px); opacity: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 44px; padding: 8px 34px; border-radius: 999px;
  background: var(--gold); color: var(--ink-on-accent); box-shadow: var(--shadow); white-space: nowrap; z-index: 4; pointer-events: none;
  transition: opacity .3s, transform .4s cubic-bezier(.2, 1.5, .4, 1);
}
.callout.on { opacity: 1; transform: translate(-50%, 0); }
.callout.bad { background: var(--danger); color: var(--ink); }

.category {
  font-family: var(--font-display); font-weight: 700; font-size: 54px; letter-spacing: 6px; text-transform: uppercase;
  background: var(--bg-0); color: var(--gold); border: 4px solid var(--gold); border-radius: 999px; padding: 4px 64px; margin-top: 18px;
  min-width: 520px; text-align: center; box-shadow: var(--shadow);
}
.category:empty { visibility: hidden; }
.under-board { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; row-gap: 10px; max-width: 100%; }
.used-strip { display: flex; gap: 5px; }
.ul { width: 36px; height: 48px; border-radius: 7px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 30px; background: var(--surface); color: var(--ink); border: 2px solid var(--surface-line); }
.ul.v { color: var(--gold-soft); }
.ul.used { background: transparent; color: var(--ink-faint); border-color: transparent; text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: var(--coral); }
.ul.just { animation: pop-in .5s; }
.badge-vowels { font-family: var(--font-display); font-weight: 700; font-size: 30px; background: var(--coral); color: var(--ink); padding: 6px 24px; border-radius: 999px; display: none; white-space: nowrap; animation: pulse 1.6s infinite; }
.badge-vowels.on { display: block; }
.badge-spins { font-family: var(--font-display); font-weight: 700; font-size: 30px; background: var(--surface); color: var(--gold); border: 3px solid var(--gold); padding: 4px 22px; border-radius: 999px; display: none; white-space: nowrap; }
.badge-spins.on { display: block; }
.badge-spins.low { color: var(--coral); border-color: var(--coral); animation: pulse 1.6s infinite; }

/* scoreboard */
.scores { height: 196px; flex: none; display: flex; gap: 22px; padding: 18px 48px 30px; justify-content: center; }
.score {
  flex: 1; max-width: 330px; position: relative; border-radius: var(--radius-l); padding: 10px 22px 12px;
  background: var(--surface); border: 4px solid var(--surface-line); overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; transition: transform .35s cubic-bezier(.2, 1.4, .4, 1), border-color .3s, box-shadow .3s;
}
.score::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: var(--pc); }
.score.cur { border-color: var(--pc); transform: translateY(-10px); box-shadow: 0 0 0 4px var(--bg-0), 0 0 40px var(--pc); background: var(--surface-2); }
.score.off { opacity: .5; }
.score > * { flex: none; }
.score .nm { font-family: var(--font-display); font-weight: 700; font-size: 36px; line-height: 1.15; display: flex; align-items: center; gap: 10px; padding-left: 8px; white-space: nowrap; overflow: hidden; }
.score .nm .t { overflow: hidden; text-overflow: ellipsis; }
.score .nm .crown { color: var(--gold); font-size: 28px; }
.score .rm { font-family: var(--font-display); font-weight: 700; font-size: 58px; line-height: 1; color: var(--ink); padding-left: 8px; font-variant-numeric: tabular-nums; }
.score .tot { font-size: 24px; line-height: 1.2; font-weight: 800; color: var(--ink-dim); padding-left: 8px; font-variant-numeric: tabular-nums; }
.score .tot b { color: var(--gold-soft); }
.score .bar { position: absolute; left: 0; bottom: 0; height: 8px; background: var(--pc); width: 0; }
.score.flash-bad { animation: bad-flash .9s; }
.score.flash-good .rm { animation: good-pop .6s; }

/* ---------- GAME OVER ---------- */
#gameover { flex-direction: column; align-items: center; padding: 50px; gap: 20px; }
#gameover .logo { font-size: 80px; }
.go-title { font-family: var(--font-display); font-size: 64px; font-weight: 700; }
.go-bonus { font-size: 32px; font-weight: 800; color: var(--ink-dim); min-height: 40px; }
.podium { display: flex; align-items: flex-end; gap: 30px; height: 520px; }
.pod { width: 340px; display: flex; flex-direction: column; align-items: center; gap: 12px; animation: rise .9s cubic-bezier(.2, 1.2, .4, 1) backwards; }
.pod .nm { font-family: var(--font-display); font-weight: 700; font-size: 52px; }
.pod .amt { font-family: var(--font-display); font-weight: 700; font-size: 46px; color: var(--gold); }
.pod .block { width: 100%; border-radius: 22px 22px 0 0; background: var(--pc); display: grid; place-items: start center; padding-top: 18px; font-family: var(--font-display); font-weight: 700; font-size: 110px; color: var(--ink-on-accent); box-shadow: inset 0 -20px 40px rgba(0,0,0,.25); }
.pod.p1 .block { height: 300px; } .pod.p2 .block { height: 210px; } .pod.p3 .block { height: 150px; }
.pod.p1 { animation-delay: .6s; } .pod.p2 { animation-delay: .3s; }
.rest-list { display: flex; gap: 40px; font-size: 32px; font-weight: 800; color: var(--ink-dim); min-height: 40px; }
#againBtn { margin-top: 10px; }

/* ---------- OVERLAYS ---------- */
.overlay { position: absolute; inset: 0; display: none; z-index: 20; }
.overlay.on { display: grid; place-items: center; }

.intro { background: var(--scrim); }
.intro-card { text-align: center; animation: zoom-in .6s cubic-bezier(.2, 1.4, .4, 1); }
.intro-round { font-family: var(--font-display); font-weight: 700; font-size: 220px; color: var(--gold); text-shadow: 0 12px 0 var(--gold-deep), 0 30px 60px rgba(0,0,0,.6); line-height: 1; }
.intro-cat { display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: 64px; letter-spacing: 6px; text-transform: uppercase; margin-top: 40px; color: var(--gold); background: var(--bg-0); border: 4px solid var(--gold); border-radius: 999px; padding: 6px 70px; }
.intro-cat:empty { display: none; }

.modal { background: var(--scrim); }
.modal-card {
  width: 1300px; background: var(--surface); border: 5px solid var(--gold); border-radius: 36px; padding: 50px 64px;
  display: flex; flex-direction: column; align-items: center; gap: 26px; box-shadow: var(--shadow); animation: zoom-in .5s cubic-bezier(.2, 1.3, .4, 1);
}
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 60px; color: var(--gold); }
.modal-answer { font-family: var(--font-display); font-weight: 700; font-size: 80px; text-align: center; line-height: 1.05; letter-spacing: 2px; }
.modal-winner { font-size: 44px; font-weight: 900; text-align: center; }
.modal-winner .who { color: var(--pc); }
.modal-winner .amt { color: var(--success); }
.standings { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.st { display: flex; align-items: center; gap: 20px; padding: 10px 26px; border-radius: 18px; background: var(--bg-1); font-family: var(--font-display); font-size: 40px; font-weight: 600; }
.st .rk { width: 50px; color: var(--ink-dim); }
.st .sw { width: 30px; height: 30px; border-radius: 50%; background: var(--pc); }
.st .n { flex: 1; }
.st .v { color: var(--gold); font-variant-numeric: tabular-nums; }
.modal-foot { width: 100%; display: flex; justify-content: space-between; align-items: center; }

.fx-bankrupt { background: rgba(0, 0, 0, .86); flex-direction: column; }
.fx-bankrupt.on { display: flex; align-items: center; justify-content: center; animation: bk-flash 2.6s forwards; }
.fx-word { font-family: var(--font-display); font-weight: 700; font-size: 250px; color: var(--ink); letter-spacing: 10px; text-shadow: 0 0 40px var(--danger), 0 12px 0 var(--danger); animation: bk-word 2.6s forwards; }
.fx-sub { font-size: 54px; font-weight: 900; color: var(--coral); margin-top: 20px; }

.banner { position: absolute; left: 0; right: 0; top: 400px; z-index: 25; display: flex; justify-content: center; pointer-events: none; opacity: 0; }
.banner.on { animation: banner 2.2s cubic-bezier(.2, 1, .3, 1) forwards; }
.banner-inner {
  font-family: var(--font-display); font-weight: 700; font-size: 110px; padding: 24px 110px; border-radius: 30px;
  background: var(--bg-0); color: var(--ink); border: 6px solid var(--pc, var(--gold)); box-shadow: 0 0 80px var(--pc, var(--gold)), var(--shadow);
  white-space: nowrap; text-align: center; max-width: 1800px; overflow: hidden;
}
.banner-inner .who { color: var(--pc, var(--gold)); }
.banner-inner.lose { background: var(--lose-bg); color: var(--lose-ink); border-color: var(--lose-ink); }
.banner-inner.bad { border-color: var(--danger); box-shadow: 0 0 80px var(--danger), var(--shadow); }
.banner-inner .struck { text-decoration: line-through; text-decoration-color: var(--danger); text-decoration-thickness: 10px; color: var(--ink-dim); font-size: .7em; display: block; white-space: normal; }
.banner-inner .small { font-size: .5em; display: block; color: var(--ink-dim); }

#confetti { position: absolute; inset: 0; z-index: 30; pointer-events: none; }

.gate { background: var(--scrim); z-index: 50; cursor: pointer; }
.gate-card { background: var(--surface); border: 5px solid var(--gold); border-radius: 36px; padding: 60px 90px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; animation: pulse 2s infinite; }
.gate-icon { font-size: 110px; color: var(--gold); line-height: 1; }
.gate-title { font-family: var(--font-display); font-size: 72px; font-weight: 700; }

.conn { position: absolute; right: 18px; bottom: 14px; width: 16px; height: 16px; border-radius: 50%; background: var(--warning); z-index: 60; }
.conn.open { background: var(--success); opacity: .5; }
.conn.closed { background: var(--danger); animation: pulse 1s infinite; }
.mute { position: absolute; right: 44px; bottom: 6px; z-index: 60; background: none; border: none; color: var(--ink-faint); font-size: 28px; cursor: pointer; }
.mute.muted { text-decoration: line-through; color: var(--danger); }

/* ---------- keyframes ---------- */
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-hold { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.9); } }
@keyframes flip-in { 0% { transform: rotateY(90deg); } 100% { transform: rotateY(0); } }
@keyframes tile-in { from { transform: scale(.2) rotate(-10deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes glow { 50% { box-shadow: 0 0 30px var(--gold), inset 0 0 0 4px var(--gold); } }
@keyframes shake { 0%, 100% { transform: none; } 15% { transform: translateX(-22px); } 30% { transform: translateX(18px); } 45% { transform: translateX(-14px); } 60% { transform: translateX(10px); } 75% { transform: translateX(-5px); } }
@keyframes pulse { 50% { transform: scale(1.05); } }
@keyframes log-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes zoom-in { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes banner { 0% { opacity: 0; transform: translateX(-300px) skewX(-8deg); } 14% { opacity: 1; transform: none; } 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(300px) skewX(8deg); } }
@keyframes bk-flash { 0% { background: rgba(255, 77, 94, .9); } 10% { background: rgba(0,0,0,.9); } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bk-word { 0% { transform: scale(2.4); opacity: 0; } 12% { transform: scale(1); opacity: 1; } 20% { transform: scale(1) rotate(-2deg); } 28% { transform: scale(1) rotate(2deg); } 36% { transform: none; } 100% { transform: scale(.94); } }
@keyframes bad-flash { 0%, 100% { background: var(--surface); } 30% { background: var(--danger); } }
@keyframes good-pop { 50% { transform: scale(1.12); color: var(--success); } }
@keyframes rise { from { transform: translateY(300px); opacity: 0; } to { transform: none; opacity: 1; } }
