:root {
  --bg: #06060a; --panel: rgba(18, 18, 26, 0.78); --line: rgba(255, 255, 255, 0.08);
  --text: #f2f3f7; --dim: #8b8fa3; --red: #ff2d55; --blue: #1e9bff; --gold: #ffcc33; --mog: #b14cff;
  --heat: 0;
  --display: "Anton", Impact, sans-serif; --body: "Inter", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 var(--body); overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }

/* ---------- background: perspective grid + heat glow ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-grid {
  position: absolute; left: -50%; right: -50%; bottom: -10%; height: 70%;
  background-image: linear-gradient(rgba(177, 76, 255, 0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(177, 76, 255, 0.35) 1px, transparent 1px);
  background-size: 60px 60px; transform: perspective(500px) rotateX(62deg); transform-origin: bottom;
  mask-image: linear-gradient(to top, black 10%, transparent 90%);
  animation: grid-run calc(6s - 4s * var(--heat)) linear infinite;
  opacity: calc(0.35 + 0.5 * var(--heat));
}
@keyframes grid-run { to { background-position: 0 60px; } }
.bg-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 100%, rgba(255, 45, 85, calc(0.18 + 0.35 * var(--heat))), transparent 55%),
              radial-gradient(ellipse at 80% 100%, rgba(30, 155, 255, calc(0.18 + 0.35 * var(--heat))), transparent 55%),
              radial-gradient(ellipse at 50% 0%, rgba(177, 76, 255, calc(0.08 + 0.4 * var(--heat))), transparent 60%);
  box-shadow: inset 0 0 calc(80px + 220px * var(--heat)) rgba(255, 40, 0, calc(0.6 * var(--heat)));
}
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 50; pointer-events: none; }
#app { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 18px; padding: 12px 22px; border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.logo { position: relative; font: 34px/1 var(--display); letter-spacing: 0.06em; background: linear-gradient(90deg, var(--red), var(--mog), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo::before, .logo::after { content: attr(data-text); position: absolute; inset: 0; background: inherit; -webkit-background-clip: text; background-clip: text; opacity: 0.7; }
.logo::before { animation: glitch 2.4s infinite steps(1); color: transparent; text-shadow: -2px 0 var(--red); }
.logo::after { animation: glitch 3.1s infinite steps(1) reverse; color: transparent; text-shadow: 2px 0 var(--blue); }
@keyframes glitch { 0%, 92%, 100% { transform: none; clip-path: none; } 93% { transform: translate(-3px, 1px); clip-path: inset(20% 0 50% 0); } 96% { transform: translate(3px, -1px); clip-path: inset(60% 0 10% 0); } }
.season { font: 12px var(--mono); color: var(--dim); letter-spacing: 0.2em; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pill { font: 11px var(--mono); padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--dim); }
.pill.ok { color: #3dff9a; border-color: rgba(61, 255, 154, 0.4); }
.pill.err { color: var(--red); border-color: var(--red); }
a.icon { color: inherit; text-decoration: none; }
.icon { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; }

/* ---------- 3-column layout ---------- */
.layout { flex: 1; display: grid; grid-template-columns: 300px 1fr 320px; gap: 18px; padding: 18px 22px 26px; }
.section-title { font: 18px var(--display); letter-spacing: 0.25em; margin: 0 0 12px; color: var(--dim); }
.join, .board { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; backdrop-filter: blur(10px); }

/* fighter cards */
.fighter { position: relative; border-radius: 14px; padding: 14px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)); border: 1px solid var(--line); overflow: hidden; transition: transform 0.3s, box-shadow 0.3s, filter 0.5s; }
.fighter.red { --c: var(--red); } .fighter.blue { --c: var(--blue); }
.fighter::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, transparent), transparent 60%); opacity: 0.5; pointer-events: none; }
.fighter.locked { box-shadow: 0 0 0 2px var(--c), 0 0 30px color-mix(in srgb, var(--c) 60%, transparent); }
.fighter.winner { transform: scale(1.04); box-shadow: 0 0 0 3px var(--gold), 0 0 60px rgba(255, 204, 51, 0.7); }
.fighter.loser { filter: grayscale(1) brightness(0.55); transform: scale(0.96) rotate(-1deg); }
.corner-tag { font: 11px var(--mono); letter-spacing: 0.25em; color: var(--c); margin-bottom: 10px; }
.fighter-head { display: flex; gap: 12px; align-items: center; }
.avatar { width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; font: 28px var(--display); background: color-mix(in srgb, var(--c) 35%, #111); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 70%, transparent); }
.fighter-meta { flex: 1; min-width: 0; }
.name { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font: 20px var(--display); letter-spacing: 0.04em; padding: 2px 0; outline: none; }
.name:focus { border-color: var(--c); }
.rank { font: 11px var(--mono); color: var(--dim); margin-top: 4px; }
.source { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0 8px; }
.src { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 8px; padding: 7px; font: 12px var(--mono); letter-spacing: 0.1em; }
.dv { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 8px; padding: 7px; font: 12px var(--mono); letter-spacing: 0.1em; }
.dv.active { border-color: var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.division { margin-top: 0; }
.division.need { outline: 1px dashed var(--c); outline-offset: 3px; border-radius: 8px; }
.src.active { border-color: var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.lock { width: 100%; padding: 10px; border-radius: 10px; border: 0; font: 18px var(--display); letter-spacing: 0.15em; background: var(--c); color: #fff; box-shadow: 0 6px 20px color-mix(in srgb, var(--c) 50%, transparent); transition: transform 0.1s; }
.lock:active { transform: scale(0.97); }
.fighter.locked .lock { background: transparent; box-shadow: inset 0 0 0 1px var(--c); color: var(--c); }
.stamp { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font: 54px var(--display); letter-spacing: 0.05em; opacity: 0; transform: scale(3) rotate(-14deg); }
.stamp.show { animation: stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
.stamp.mogged { color: var(--red); text-shadow: 0 0 20px rgba(255, 0, 60, 0.9); -webkit-text-stroke: 2px #fff; }
.stamp.mogs { color: var(--gold); text-shadow: 0 0 30px rgba(255, 204, 51, 0.9); }
@keyframes stamp { to { opacity: 1; transform: scale(1) rotate(-14deg); } }
.versus { text-align: center; font: 30px var(--display); margin: 10px 0; background: linear-gradient(90deg, var(--red), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rules { font-size: 11px; color: var(--dim); margin: 14px 0 0; }

/* ---------- arena ---------- */
.arena { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.callout { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.round-pips { display: flex; gap: 8px; min-height: 10px; }
.pip { width: 34px; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); }
.pip.now { background: #fff; box-shadow: 0 0 12px #fff; }
.pip.A { background: var(--red); } .pip.B { background: var(--blue); } .pip.T { background: var(--dim); }
.pose-call { font: clamp(26px, 3.4vw, 46px)/1 var(--display); letter-spacing: 0.06em; text-align: center; text-shadow: 0 0 calc(10px + 30px * var(--heat)) rgba(177, 76, 255, 0.8); }
.pose-call.flash { animation: callin 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes callin { from { transform: scale(1.8); opacity: 0; filter: blur(8px); } }
.stage { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; max-height: 58vh; margin: 0 auto; width: 100%;
  box-shadow: 0 0 0 1px var(--line), 0 0 calc(20px + 80px * var(--heat)) rgba(177, 76, 255, calc(0.25 + 0.5 * var(--heat))); }
.stage canvas { width: 100%; height: 100%; display: block; object-fit: contain; }
.stage-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; background: radial-gradient(ellipse, transparent 40%, rgba(0, 0, 0, 0.55)); }
.stage-overlay .who { font: 22px var(--display); letter-spacing: 0.2em; }
.stage-overlay .big { font: clamp(40px, 7vw, 110px)/1 var(--display); text-shadow: 0 0 30px rgba(0, 0, 0, 0.9); }
.stage-overlay .count { font: clamp(80px, 14vw, 200px)/1 var(--display); color: var(--gold); text-shadow: 0 0 40px rgba(255, 204, 51, 0.8); animation: callin 0.35s; }
.stage-overlay .hint { color: var(--dim); font-size: 13px; max-width: 420px; }
.stage-overlay input[type=url] { width: min(420px, 90%); background: rgba(0, 0, 0, 0.6); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 10px; }
.stage-overlay .file { font-size: 12px; }
.go { padding: 12px 30px; border: 0; border-radius: 12px; font: 22px var(--display); letter-spacing: 0.15em; color: #111; background: var(--gold); box-shadow: 0 0 30px rgba(255, 204, 51, 0.6); }
.go.red { background: var(--red); color: #fff; box-shadow: 0 0 30px rgba(255, 45, 85, 0.6); }
.go.blue { background: var(--blue); color: #fff; box-shadow: 0 0 30px rgba(30, 155, 255, 0.6); }
.holdbar { width: min(420px, 80%); height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.holdbar > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); }

/* meters */
.meters { display: grid; grid-template-columns: 1fr 90px 1fr; gap: 12px; align-items: stretch; }
.meter { position: relative; height: 112px; border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); --lvl: 0; --mh: 0; }
.meter.red { --c: var(--red); } .meter.blue { --c: var(--blue); }
.meter-fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--lvl)); transition: transform 0.08s linear;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 50%, transparent), var(--c) 70%, color-mix(in srgb, var(--gold) calc(var(--mh) * 100%), var(--c)));
  box-shadow: 0 0 calc(10px + 50px * var(--mh)) var(--c); }
.meter.blue .meter-fill { transform-origin: right; }
.meter.hot .meter-fill { animation: fire 0.18s infinite alternate; }
@keyframes fire { to { filter: brightness(1.35) saturate(1.4); } }
.meter-score { position: absolute; left: 16px; top: 8px; font: 48px/1 var(--display); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.meter.blue .meter-score { left: auto; right: 16px; }
.meter-tier { position: absolute; left: 16px; bottom: 24px; font: 15px var(--display); letter-spacing: 0.15em; }
.meter.blue .meter-tier { left: auto; right: 16px; }
.meter-sub { position: absolute; left: 16px; bottom: 8px; font: 10px var(--mono); color: rgba(255, 255, 255, 0.75); }
.meter.blue .meter-sub { left: auto; right: 16px; }
.meter-groups { position: absolute; right: 14px; top: 10px; display: grid; gap: 2px; text-align: right; font: 11px var(--mono); color: rgba(255, 255, 255, 0.9); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }
.meter.blue .meter-groups { right: auto; left: 14px; text-align: left; }
.meter-groups b { font-weight: 700; color: #fff; }
.meter-groups .na { opacity: 0.45; }
.meter-tier.up { animation: tierup 0.35s cubic-bezier(0.2, 1.8, 0.4, 1); }
@keyframes tierup { from { transform: scale(1.9); } }
.meter-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; font: 38px/1 var(--display); }
.meter-mid small { font: 10px var(--mono); color: var(--dim); letter-spacing: 0.2em; margin: 4px 0; }
.meter-mid span:first-child { color: var(--red); } .meter-mid span:last-child { color: var(--blue); }
.enter { align-self: center; padding: 16px 48px; border: 0; border-radius: 14px; font: 28px var(--display); letter-spacing: 0.18em; color: #fff;
  background: linear-gradient(90deg, var(--red), var(--mog), var(--blue)); background-size: 200% 100%; animation: shimmer 3s linear infinite; box-shadow: 0 10px 40px rgba(177, 76, 255, 0.5); }
.enter:disabled { filter: grayscale(1) brightness(0.5); animation: none; box-shadow: none; }
@keyframes shimmer { to { background-position: 200% 0; } }
.refcall { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; font-size: 12px; color: var(--dim); min-height: 30px; align-items: center; }
.refcall button { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 12px; }
.refcall button.chosen { border-color: var(--gold); color: var(--gold); }

/* ---------- leaderboard ---------- */
.board-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.btab { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 8px; padding: 7px; font: 12px var(--mono); letter-spacing: 0.1em; }
.btab.active { border-color: var(--mog); color: var(--mog); }
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow: auto; }
.row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid transparent; animation: rowin 0.4s both; }
@keyframes rowin { from { opacity: 0; transform: translateX(20px); } }
.row .pos { font: 20px var(--display); color: var(--dim); text-align: center; }
.row.p1 { border-color: rgba(255, 204, 51, 0.6); background: linear-gradient(90deg, rgba(255, 204, 51, 0.16), transparent); }
.row.p1 .pos { color: var(--gold); } .row.p2 .pos { color: #d7dbe6; } .row.p3 .pos { color: #e09a5a; }
.row .who { min-width: 0; }
.row .nm { font: 16px var(--display); letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font: 10px var(--mono); color: var(--dim); }
.row .val { font: 20px var(--display); text-align: right; }
.row .val small { display: block; font: 9px var(--mono); color: var(--dim); }
.badge { display: inline-block; font: 9px var(--mono); padding: 1px 6px; border-radius: 99px; margin-left: 4px; vertical-align: middle; letter-spacing: 0.05em; }
.badge.Bronze { background: #6b3e1e; } .badge.Silver { background: #5d6475; } .badge.Gold { background: #8a6d12; } .badge.Platinum { background: #1f6f7a; }
.badge.Diamond { background: #3348b8; } .badge[class*="Mog"] { background: linear-gradient(90deg, var(--red), var(--mog)); }
.streak { color: #ff8a3d; }
.empty { color: var(--dim); font-size: 13px; padding: 20px 6px; text-align: center; }

/* ---------- match splash ---------- */
.splash { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.92)); animation: fadein 0.3s; }
.splash[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } }
.splash-inner { text-align: center; }
.splash .kicker { font: 14px var(--mono); letter-spacing: 0.4em; color: var(--dim); }
.splash .headline { font: clamp(48px, 9vw, 140px)/0.95 var(--display); letter-spacing: 0.02em; animation: slam 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
.splash .headline .w { color: var(--gold); text-shadow: 0 0 40px rgba(255, 204, 51, 0.8); }
.splash .headline .verb { display: block; font-size: 0.55em; color: var(--mog); text-shadow: 0 0 30px rgba(177, 76, 255, 0.9); }
@keyframes slam { from { transform: scale(2.4); opacity: 0; filter: blur(10px); } }
.splash .elo { font: 20px var(--mono); margin: 16px 0 24px; }
.splash .elo .up { color: #3dff9a; } .splash .elo .down { color: var(--red); }
.splash .btns { display: flex; gap: 12px; justify-content: center; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .board-list { max-height: none; }
}

/* ---------- arena meters during capture (app.js live tension coaching) ---------- */
:root { --slow: 1; }
.meter.beat { animation: meterbeat 0.25s ease-out; }
@keyframes meterbeat { 30% { box-shadow: 0 0 0 3px var(--c), 0 0 40px var(--c); } }
.meter.neutral { --c: var(--gold); }
.meter.tension .meter-score { font-size: 22px; top: 14px; letter-spacing: 0.2em; }

/* ======================================================================================================
   BATTLE VIEW (battle_reveal.js): a full-viewport live-stream battle. The two fighters are the hero.
   Rows: top bar / callout (banner) / arena (two panels) / bottom stats. Never scrolls; sized with vh/vw/clamp.
   Theatre classes (spot, dim, tease, sway, clutch, veil) never draw a number.
   ====================================================================================================== */
.bv-root { position: fixed; inset: 0; z-index: 30; will-change: transform; } /* shake / zoom punch stay on the compositor */
.bv-root[hidden] { display: none; }
body.in-battle { overflow: hidden; }
.bv { position: absolute; inset: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: clamp(4px, 0.9vh, 10px);
  padding: clamp(6px, 1.2vh, 14px) clamp(8px, 1.6vw, 22px); overflow: hidden; font-family: var(--body);
  background: radial-gradient(ellipse at 50% 35%, rgba(60, 20, 90, 0.9) 0%, rgba(6, 6, 10, 0.97) 70%), #06060a; --slow: 1; }
.bv.slowmo { --slow: 2; }
.bv.blackout::after { content: ""; position: absolute; inset: 0; background: #000; z-index: 40; } /* overlay, not a filter: no full re-raster */
.bv.veil .bv-top { filter: brightness(0.35); transition: filter 0.4s; }

/* top bar */
.bv-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; min-width: 0; }
.bv-top > .bv-titlebox { grid-column: 2; text-align: center; min-width: 0; max-width: 60vw; }
.bv-top > .bv-actions { grid-column: 3; justify-self: end; display: flex; gap: 6px; }
.bv-top > .bv-sim { grid-column: 1; justify-self: start; font: clamp(10px, 1.4vh, 13px) var(--mono); letter-spacing: 0.35em; color: #111; background: var(--gold); padding: 2px 10px; border-radius: 4px; transform: rotate(-2deg); }
.bv-title { font: clamp(15px, 2.6vh, 28px)/1.05 var(--display); letter-spacing: 0.08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-cap { font: clamp(9px, 1.25vh, 11px) var(--mono); color: var(--dim); letter-spacing: 0.08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-btn { white-space: nowrap; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; font: clamp(10px, 1.3vh, 12px) var(--mono); }
.bv-btn:disabled { opacity: 0.35; }

/* callout row: the floating banner lives here, so it never covers a fighter or the stats */
.bv-call { height: clamp(36px, 6.6vh, 62px); display: grid; place-items: center; min-width: 0; }
.bv-banner { opacity: 0; transform: scale(0.6); text-align: center; max-width: 100%; padding: 4px 18px; border-radius: 12px; background: rgba(0, 0, 0, 0.6);
  font: clamp(16px, 3.3vh, 34px)/1 var(--display); letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-banner small { display: block; font: clamp(9px, 1.25vh, 11px) var(--mono); letter-spacing: 0.06em; color: var(--dim); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.bv-banner.show { animation: bvin calc(0.35s * var(--slow)) cubic-bezier(0.2, 1.6, 0.4, 1) forwards, bvout calc(0.4s * var(--slow)) calc(1.6s * var(--slow)) forwards; }
.bv-banner.show.gold, .bv-banner.show.hot, .bv-banner.show.neutral, .bv-banner.show.cold { animation: bvin calc(0.35s * var(--slow)) cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
@keyframes bvin { to { opacity: 1; transform: scale(1); } }
@keyframes bvout { to { opacity: 0; transform: scale(0.9); } }
.bv-banner.sideA { color: var(--red); } .bv-banner.sideB { color: var(--blue); }
.bv-banner.gold, .bv-banner.neutral { color: var(--gold); }
.bv-banner.hot { color: #ff6b3d; } .bv-banner.cold { color: var(--dim); }

/* arena: two hero panels and the clash seam */
.bv-arena { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) clamp(26px, 3.6vw, 60px) minmax(0, 1fr); min-height: 0; }
.bv-panel { --c: var(--red); position: relative; min-height: 0; min-width: 0; border-radius: clamp(10px, 1.6vh, 18px); overflow: hidden; background: #000;
  box-shadow: 0 0 0 2px var(--c), 0 0 calc(18px + 40px * var(--heat)) color-mix(in srgb, var(--c) 45%, transparent); transition: filter 0.35s, box-shadow 0.35s, transform 0.35s; }
.bv-panel.B { --c: var(--blue); }
.bv-panel.bv-in.A { animation: panelinA 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) backwards; }
.bv-panel.bv-in.B { animation: panelinB 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) backwards; }
@keyframes panelinA { from { transform: translateX(-30%); opacity: 0; } }
@keyframes panelinB { from { transform: translateX(30%); opacity: 0; } }
.bv-media { position: absolute; inset: 0; will-change: transform; }
.bv-bgimg { position: absolute; inset: -30px; width: calc(100% + 60px); height: calc(100% + 60px); object-fit: cover; filter: blur(22px) brightness(0.42) saturate(1.3); }
.bv-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.bv-img.mirror { transform: scaleX(-1); }
.bv-media::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 38%), linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 24%),
              linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, transparent), transparent 45%); }
.bv-noimg { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; color: var(--dim); font: 11px var(--mono); padding: 12px; }
.bv-initial { font: clamp(60px, 16vh, 180px)/1 var(--display); color: color-mix(in srgb, var(--c) 70%, #fff); }
.bv-plate { position: absolute; top: clamp(6px, 1vh, 12px); left: clamp(8px, 1vw, 14px); max-width: 60%; z-index: 2; }
.bv-corner { font: clamp(9px, 1.2vh, 11px) var(--mono); letter-spacing: 0.25em; color: var(--c); text-shadow: 0 1px 4px #000; }
.bv-name { font: clamp(17px, 3.2vh, 34px)/1.05 var(--display); letter-spacing: 0.04em; text-shadow: 0 2px 10px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-imgtag { display: inline-block; margin-top: 3px; font: clamp(9px, 1.2vh, 11px) var(--mono); letter-spacing: 0.2em; color: #111; background: var(--gold); padding: 1px 6px; border-radius: 3px; }
.bv-stage-slot { position: absolute; top: clamp(6px, 1vh, 12px); right: clamp(6px, 1vw, 12px); width: clamp(54px, 18%, 150px); aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; z-index: 2;
  background: rgba(0, 0, 0, 0.5); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent); display: grid; place-items: center; }
.bv-stage-slot:empty { display: none; }
.bv-stage-slot img { width: 100%; height: 100%; object-fit: cover; }
.bv-stage-slot .why { font: 9px var(--mono); color: var(--dim); padding: 4px; text-align: center; }

/* theatre on the panels */
.bv-panel.spot { box-shadow: 0 0 0 3px var(--gold), 0 0 50px rgba(255, 204, 51, 0.6); transform: scale(1.015); transition-duration: calc(0.25s * var(--slow)); }
.bv-panel.dim { filter: brightness(0.45) saturate(0.6); }
.bv-panel.beat { animation: panelbeat 0.25s ease-out; }
@keyframes panelbeat { 30% { box-shadow: 0 0 0 4px var(--c), 0 0 60px var(--c); } }
.bv-panel.hit { animation: panelhit 0.45s ease-out; }
@keyframes panelhit { 20% { transform: translateX(-10px) rotate(-1deg); filter: brightness(1.8); } 45% { transform: translateX(8px); } 70% { transform: translateX(-4px); } }
.bv-panel.winner { box-shadow: 0 0 0 4px var(--gold), 0 0 70px rgba(255, 204, 51, 0.75); }
.bv-panel.loser .bv-media, .bv-panel.noscore .bv-media { filter: grayscale(1) brightness(0.5); transition: filter 0.6s; }
.bv.clutch .bv-arena::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 18px; background: radial-gradient(ellipse, transparent 50%, rgba(120, 0, 20, 0.55)); animation: clutchpulse calc(0.66s * var(--slow)) ease-in-out infinite alternate; z-index: 6; }
@keyframes clutchpulse { to { opacity: 0.35; } }
.bv-tease { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; z-index: 4;
  font: clamp(38px, 9vh, 110px)/1 var(--display); letter-spacing: 0.04em; color: var(--c); text-shadow: 0 0 30px var(--c), 0 4px 20px #000; }
.bv-tease.show { animation: teasein calc(0.35s * var(--slow)) cubic-bezier(0.2, 1.7, 0.4, 1) both; }
@keyframes teasein { from { opacity: 0; transform: scale(2); filter: blur(6px); } to { opacity: 1; transform: scale(1); } }

/* gifts: pop over the fighter, count up, then drift into the feed */
.bv-gifts { position: absolute; left: 0; right: 0; top: 30%; height: 46%; display: grid; place-items: center; pointer-events: none; z-index: 3; }
.gift { --gs: 1; --hs: 1; grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 0.15em; padding: 0.45em 1.1em 0.5em; border-radius: 1.2em;
  font-size: clamp(11px, 2vh, 20px); background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--c) 55%, rgba(0, 0, 0, 0.5)), rgba(0, 0, 0, 0.72));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 70%, transparent), 0 0 30px color-mix(in srgb, var(--c) 55%, transparent);
  transform: scale(calc(var(--gs) * var(--hs))); transition: transform 0.25s cubic-bezier(0.2, 1.6, 0.4, 1), opacity 0.25s, box-shadow 0.25s;
  animation: giftin 0.55s cubic-bezier(0.2, 1.8, 0.4, 1) backwards; }
@keyframes giftin { from { transform: translateY(40%) scale(0.2) rotate(-12deg); opacity: 0; } 60% { transform: scale(calc(var(--gs) * 1.15)) rotate(3deg); opacity: 1; } }
.gift.t1 { --gs: 1.22; }
.gift.t2 { --gs: 1.45; background: radial-gradient(ellipse at 50% 30%, rgba(255, 204, 51, 0.55), color-mix(in srgb, var(--c) 35%, rgba(0, 0, 0, 0.75)));
  box-shadow: 0 0 0 2px var(--gold), 0 0 50px rgba(255, 204, 51, 0.7); }
.gift.hi { --hs: 1.08; } .gift.lo { --hs: 0.86; opacity: 0.78; }
.gift.neck { box-shadow: 0 0 0 2px var(--gold), 0 0 30px rgba(255, 204, 51, 0.55); }
.gift-ic { font-size: 2.5em; line-height: 1; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--c) 80%, #fff)); animation: giftbob 0.9s ease-in-out infinite alternate; }
.gift.t2 .gift-ic { filter: drop-shadow(0 0 16px rgba(255, 204, 51, 0.95)); }
@keyframes giftbob { to { transform: translateY(-6%) rotate(4deg); } }
.gift-val { font: 2.1em/1 var(--display); color: #fff; text-shadow: 0 0 16px var(--c), 0 2px 6px #000; }
.gift-lab { font: 0.72em var(--mono); letter-spacing: 0.25em; color: #fff; background: color-mix(in srgb, var(--c) 70%, #000); padding: 0 0.6em; border-radius: 99px; }
.gift-sub { font: 0.62em var(--mono); color: rgba(255, 255, 255, 0.75); max-width: 18em; text-align: center; }
.gift.wrapped { animation: giftin 0.55s cubic-bezier(0.2, 1.8, 0.4, 1) both, wiggle 0.5s 0.6s ease-in-out infinite alternate; background: repeating-linear-gradient(45deg, rgba(255, 204, 51, 0.28) 0 10px, rgba(0, 0, 0, 0.6) 10px 20px); box-shadow: 0 0 0 2px var(--gold), 0 0 30px rgba(255, 204, 51, 0.45); }
@keyframes wiggle { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.gift.fly { animation: giftfly 0.42s ease-in forwards; }
@keyframes giftfly { to { transform: translate(var(--tx), var(--ty)) scale(0.22); opacity: 0.15; } }

/* the gift feed along the panel's outer edge (newest at the bottom) */
.bv-ticker { position: absolute; bottom: clamp(6px, 1.2vh, 12px); display: flex; flex-direction: column; justify-content: flex-end; gap: clamp(2px, 0.5vh, 5px); max-height: 52%; z-index: 3; max-width: 58%; }
.bv-panel.A .bv-ticker { left: clamp(6px, 1vw, 12px); align-items: flex-start; }
.bv-panel.B .bv-ticker { right: clamp(6px, 1vw, 12px); align-items: flex-end; }
.pill { position: relative; display: flex; align-items: center; gap: 0.4em; padding: 0.15em 0.75em 0.15em 0.2em; border-radius: 99px; white-space: nowrap;
  font: clamp(10px, 1.6vh, 15px)/1.2 var(--display); letter-spacing: 0.04em; color: #fff;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 65%, #000), rgba(0, 0, 0, 0.55)); animation: pillin 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.bv-panel.B .pill { flex-direction: row-reverse; padding: 0.15em 0.2em 0.15em 0.75em; background: linear-gradient(270deg, color-mix(in srgb, var(--c) 65%, #000), rgba(0, 0, 0, 0.55)); }
@keyframes pillin { from { transform: scale(0.4); opacity: 0; } }
.pill .pi { width: 1.55em; height: 1.55em; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, 0.4); font-size: 1.15em; }
.pill.t1 { box-shadow: 0 0 0 1px rgba(255, 120, 60, 0.7); }
.pill.t2 { box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(255, 204, 51, 0.5); }
.pill.unwrap { animation: unwrap 0.6s cubic-bezier(0.2, 1.8, 0.4, 1) both; }
@keyframes unwrap { from { transform: scale(1.8); filter: brightness(2.5); } }
.pill.tappable { cursor: help; pointer-events: auto; }
.pill .tipb { display: none; position: absolute; bottom: calc(100% + 4px); left: 0; z-index: 9; width: max-content; max-width: min(320px, 70vw); white-space: normal;
  font: 10px/1.35 var(--mono); letter-spacing: 0; color: var(--text); background: rgba(0, 0, 0, 0.92); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.bv-panel.B .pill .tipb { left: auto; right: 0; }
.pill.open .tipb { display: block; }
.bv-note { position: absolute; bottom: clamp(6px, 1.2vh, 12px); max-width: 44%; z-index: 3; display: none; font: clamp(9px, 1.3vh, 12px)/1.3 var(--mono); padding: 4px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.75); }
.bv-panel.A .bv-note { right: clamp(6px, 1vw, 12px); text-align: right; }
.bv-panel.B .bv-note { left: clamp(6px, 1vw, 12px); }
.bv-note.show { display: block; animation: pillin 0.35s both; }
.bv-note.bad { color: #ff8aa0; box-shadow: inset 0 0 0 1px rgba(255, 45, 85, 0.6); }
.bv-note.consol { color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent); }

/* verdict stamp: sized to sit on the winner's panel */
.bv-stamp { position: absolute; left: 4%; right: 4%; top: 47%; text-align: center; pointer-events: none; opacity: 0; z-index: 5;
  font: clamp(30px, 7.5vh, 92px)/0.95 var(--display); letter-spacing: 0.03em; transform: rotate(-8deg) scale(2.6); }
.bv-stamp small { display: block; font: clamp(11px, 1.8vh, 18px) var(--mono); letter-spacing: 0.2em; margin-top: 0.3em; }
.bv-stamp.show { animation: bvstamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
@keyframes bvstamp { to { opacity: 1; transform: rotate(-8deg) scale(1); } }
.bv-stamp.win { color: var(--gold); text-shadow: 0 0 30px rgba(255, 204, 51, 0.9), 0 4px 0 #000; }
.bv-stamp.win.mog { color: #fff; text-shadow: 0 0 20px var(--gold), 0 0 50px #ff4d2e, 0 4px 0 #000; }
.bv-stamp.lose { font-size: clamp(22px, 4.6vh, 56px); color: var(--red); -webkit-text-stroke: 1.5px #fff; text-shadow: 0 0 18px rgba(255, 0, 60, 0.8); }
.bv-stamp.even { color: var(--gold); text-shadow: 0 0 30px rgba(255, 204, 51, 0.9); }

/* seam + clash */
.bv-seam { position: relative; display: grid; place-items: center; z-index: 7; }
.bv-vs { font: clamp(18px, 3.6vh, 42px)/1 var(--display); background: linear-gradient(180deg, var(--red), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bv-clash { position: absolute; left: 50%; top: 50%; opacity: 0; pointer-events: none; white-space: nowrap; transform: translate(-50%, -50%);
  font: clamp(20px, 4.2vh, 50px)/1 var(--display); letter-spacing: 0.06em; padding: 0.15em 0.5em; border-radius: 10px; background: rgba(0, 0, 0, 0.8); }
.bv-clash.show { animation: clash 1.5s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
.bv-clash.A { color: var(--red); box-shadow: 0 0 0 2px var(--red), 0 0 40px var(--red); } .bv-clash.B { color: var(--blue); box-shadow: 0 0 0 2px var(--blue), 0 0 40px var(--blue); }
@keyframes clash { 0% { opacity: 0; transform: translate(-50%, -50%) scale(3) rotate(-10deg); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-4deg); } 75% { opacity: 1; transform: translate(-50%, -50%) scale(1.04) rotate(-4deg); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9) rotate(-4deg); } }

/* bottom stats: big TOTAL + one category line per fighter, the running gap in the middle */
.bv-bottom { display: grid; grid-template-columns: minmax(0, 1fr) clamp(120px, 17vw, 260px) minmax(0, 1fr); gap: clamp(6px, 1vw, 14px); align-items: stretch; }
.bv-stat { --c: var(--red); --lvl: 0; --mh: 0; position: relative; overflow: hidden; min-width: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  padding: clamp(4px, 0.8vh, 10px) clamp(8px, 1vw, 14px); display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "score head" "score tier" "line line"; column-gap: 12px; align-items: center; }
.bv-stat.B { --c: var(--blue); grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head score" "tier score" "line line"; text-align: right; }
.bv-stat.neutral { --c: var(--gold); }
.bv-stat.winner { box-shadow: 0 0 0 2px var(--gold), 0 0 30px rgba(255, 204, 51, 0.5); }
.bv-bar { position: absolute; inset: 0; pointer-events: none; }
.bv-barfill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--lvl)); transition: transform 0.08s linear; opacity: 0.4;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 40%, transparent), var(--c) 70%, color-mix(in srgb, var(--gold) calc(var(--mh) * 100%), var(--c))); }
.bv-stat.B .bv-barfill { transform-origin: right; }
.bv-stat.hot .bv-barfill { animation: fire 0.18s infinite alternate; }
.bv-score { grid-area: score; position: relative; font: clamp(28px, 6.4vh, 66px)/1 var(--display); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); min-width: 2.2em; }
.bv-stathead { grid-area: head; position: relative; display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.bv-stat.B .bv-stathead { justify-content: flex-end; flex-direction: row-reverse; }
.bv-statname { font: clamp(13px, 2.2vh, 22px)/1 var(--display); letter-spacing: 0.05em; color: color-mix(in srgb, var(--c) 45%, #fff); text-shadow: 0 1px 6px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-statlab { font: clamp(9px, 1.2vh, 11px) var(--mono); letter-spacing: 0.2em; color: var(--dim); }
.bv-tier { grid-area: tier; position: relative; font: clamp(11px, 1.8vh, 16px) var(--display); letter-spacing: 0.15em; min-height: 1em; }
.bv-tier.up { animation: tierup 0.35s cubic-bezier(0.2, 1.8, 0.4, 1); }
.bv-line { grid-area: line; position: relative; display: flex; flex-wrap: wrap; gap: 0 clamp(6px, 0.9vw, 14px); font: clamp(9px, 1.45vh, 13px)/1.35 var(--mono); color: rgba(255, 255, 255, 0.9); }
.bv-stat.B .bv-line { justify-content: flex-end; }
.bv-line { text-shadow: 0 1px 3px #000; }
.bv-line .seg b { color: color-mix(in srgb, var(--c) 55%, #fff); font-weight: 700; margin-right: 2px; }
.bv-line .seg small { color: var(--dim); cursor: help; }
.bv-line .seg.cap { color: #ff8aa0; }
.bv-mid { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.bv-midlab { text-align: center; font: clamp(8px, 1.15vh, 10px) var(--mono); letter-spacing: 0.25em; color: var(--dim); }
.tug.off { opacity: 0.3; }

/* details drawer (after the verdict) */
.bv-details { position: absolute; inset: 6% max(4%, calc(50% - 360px)); z-index: 20; background: rgba(6, 6, 12, 0.97); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.bv-details > .bv-btn { align-self: flex-end; }
.dt { display: flex; flex-direction: column; gap: 2px; font: 12px var(--mono); }
.dr { display: grid; grid-template-columns: 1fr 150px 1fr; gap: 8px; padding: 3px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); }
.dr .da { text-align: right; color: #ff8aa0; } .dr .db { color: #8ccaff; } .dr .dl { text-align: center; color: var(--dim); }
.dr.names, .dr.total { font: 16px var(--display); letter-spacing: 0.06em; background: rgba(255, 255, 255, 0.08); }
.dr.sub { font-size: 10px; background: none; }

/* phone portrait: panels stacked, stats side by side under the running gap */
@media (max-aspect-ratio: 4/5) {
  .bv-arena { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) clamp(22px, 3.2vh, 34px) minmax(0, 1fr); }
  .bv-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "mid mid" "a b"; row-gap: 4px; }
  .bv-stat.A { grid-area: a; } .bv-stat.B { grid-area: b; } .bv-mid { grid-area: mid; flex-direction: row; align-items: center; }
  .bv-mid .tug { flex: 1; }
  .bv-stat { grid-template-columns: auto minmax(0, 1fr); }
  .bv-score { font-size: clamp(26px, 4.6vh, 44px); }
  .bv-gifts { top: 26%; height: 56%; }
  .gift { font-size: clamp(9px, 1.45vh, 15px); }
  .bv-top { grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; }
  .bv-top > .bv-titlebox { max-width: none; }
  .bv-top > .bv-sim { font-size: 9px; letter-spacing: 0.15em; padding: 1px 5px; }
  .bv-cap { display: none; }
  .bv-call { height: clamp(44px, 6.2vh, 56px); }
  .bv-banner { font-size: clamp(14px, 2.6vh, 24px); padding: 3px 10px; }
  .pill { font-size: clamp(9px, 1.3vh, 12px); }
  .bv-ticker { max-width: 66%; }
  .bv-statlab { display: none; }
  .bv-score { min-width: 1.5em; }
  .bv-stamp { top: 44%; }
}

/* tug bar (running gap; sealed + sway theatre never draws a number) */
.tug { position: relative; height: clamp(16px, 2.6vh, 24px); border-radius: 12px; background: linear-gradient(90deg, rgba(255, 45, 85, 0.15), rgba(30, 155, 255, 0.15)); overflow: hidden; }
.tug-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, 0.6); }
.tug-fill { --d: 0; position: absolute; top: 3px; bottom: 3px; border-radius: 8px; transition: all calc(0.35s * var(--slow)) cubic-bezier(0.3, 1.4, 0.5, 1);
  left: calc(50% - max(0, var(--d)) * 50%); right: calc(50% + min(0, var(--d)) * 50%); background: var(--red); }
.tug.b .tug-fill { background: var(--blue); }
.tug-num { position: absolute; inset: 0; display: grid; place-items: center; font: clamp(9px, 1.4vh, 12px) var(--mono); letter-spacing: 0.1em; text-shadow: 0 1px 4px #000; }
.tug.sealed { background: repeating-linear-gradient(45deg, rgba(255, 204, 51, 0.12) 0 8px, rgba(255, 204, 51, 0.04) 8px 16px); }
.tug.sealed .tug-num { color: var(--gold); letter-spacing: 0.3em; }
.tug.swayA .tug-fill, .tug.swayB .tug-fill { background: repeating-linear-gradient(90deg, rgba(255, 204, 51, 0.7) 0 6px, rgba(255, 204, 51, 0.25) 6px 12px); }
.tug.swayA .tug-fill { left: 22.5%; right: 50%; }
.tug.swayB .tug-fill { left: 50%; right: 22.5%; }

/* ---------- fit-to-window pass (3 Dec): nothing may overflow its box ---------- */
html, body { max-width: 100%; }
.top { flex-wrap: wrap; row-gap: 8px; padding: 10px clamp(10px, 2vw, 22px); }
.logo { font-size: clamp(22px, 2.6vw, 34px); }
.top-actions { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.top-actions > * { white-space: nowrap; }
.layout { grid-template-columns: minmax(220px, 290px) minmax(0, 1fr) minmax(220px, 300px); gap: clamp(10px, 1.4vw, 18px); padding: 14px clamp(10px, 2vw, 22px) 20px; }
.join, .board { min-width: 0; overflow: hidden; }
.join *, .board * { min-width: 0; overflow-wrap: anywhere; }
.btab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(10px, 0.85vw, 12px); letter-spacing: 0.06em; }
.name { min-width: 0; width: 100%; text-overflow: ellipsis; }
.pose-call { font-size: clamp(20px, 3vw, 44px); overflow-wrap: anywhere; }
.enter { font-size: clamp(18px, 2.2vw, 28px); padding: 12px clamp(18px, 3vw, 48px); max-width: 100%; }

/* stage text scales with the stage box itself (container query units), so it always fits inside it */
.stage { container-type: size; }
.stage-overlay { justify-content: center; overflow: hidden; padding: 3cqh 3cqw; gap: 1.6cqh; }
.stage-overlay .who { font-size: clamp(11px, 3.6cqh, 22px); letter-spacing: 0.14em; }
.stage-overlay .big { font-size: clamp(18px, 12cqh, 110px); max-width: 100%; overflow-wrap: anywhere; }
.stage-overlay .count { font-size: clamp(40px, 34cqh, 200px); }
.stage-overlay .hint { font-size: clamp(10px, 2.8cqh, 14px); max-width: 90cqw; }
.stage-overlay input[type=url] { padding: 1.2cqh 10px; }

/* pre-turn card: title, example (shrinks to fit), button - the button never leaves the stage */
.turn-pre { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto auto auto; justify-items: center; gap: 1.4cqh; height: 100%; max-height: 100%; width: min(100%, 640px); padding: 1cqh 2cqw; }
.turn-pre .who { margin: 0; }
.turn-pre .pose-title { font: clamp(18px, 9cqh, 56px)/1 var(--display); text-shadow: 0 0 24px rgba(0,0,0,.9); max-width: 100%; overflow-wrap: anywhere; }
.pose-example { display: flex; align-items: center; gap: 2cqw; min-height: 0; max-width: 100%; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.15); border-radius: 12px; padding: 1cqh 2cqw; }
.pose-example img { height: 100%; max-height: 42cqh; min-height: 0; aspect-ratio: 3 / 4; object-fit: contain; border-radius: 8px; background: #808080; }
.pose-cue { font: 600 clamp(11px, 3.4cqh, 16px)/1.3 system-ui, sans-serif; color: #eee; text-align: left; max-width: 34cqw; }
.turn-pre .go { font-size: clamp(14px, 4.4cqh, 24px); padding: 1.4cqh 4cqw; }
.turn-pre .file { font-size: clamp(10px, 2.6cqh, 12px); }
.turn-pre input[type=url] { width: min(420px, 90%); }
.turn-pre .pose-title { line-height: 1.12; }
/* narrow windows / phones: one column (must come after the fit-to-window grid rule above) */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .board-list { max-height: none; }
  .stage { max-height: 62vh; }
}
#instantBtn { cursor: pointer; }
#instantBtn.on { border-color: var(--gold); color: var(--gold); }

/* ---------- insane FX layer (fx.js; BATTLE.md section 15) ---------- */
.fx-words { position: fixed; inset: 0; z-index: 55; pointer-events: none; overflow: hidden; }
.fx-word { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 45%, transparent 75%); opacity: 0; }
.fx-word.go { animation: fxw-life var(--ms) linear forwards; }
.fx-word-t { will-change: transform, opacity; font-family: var(--display); line-height: 0.92; letter-spacing: 0.02em; white-space: pre; display: inline-block;
  -webkit-text-stroke: 0.025em #000; paint-order: stroke fill;
  text-shadow: -0.045em 0 rgba(255, 0, 70, 0.9), 0.045em 0 rgba(0, 230, 255, 0.9), 0 0 0.25em currentColor; }
.fx-word.go .fx-word-t { animation: fxw-slam calc(var(--ms) * 0.2) cubic-bezier(0.15, 1.4, 0.35, 1) both, fxw-rgb 0.12s steps(2) calc(var(--ms) * 0.2) 6; }
.fx-word-sub { font: clamp(11px, 2vh, 20px) var(--mono); letter-spacing: 0.3em; color: #fff; margin-top: 0.6em; }
@keyframes fxw-life { 0% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
/* transform / opacity only, so the giant text is rasterised once and the slam runs on the compositor */
@keyframes fxw-slam { 0% { transform: scale(2.8) rotate(-4deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(-2deg); } }
@keyframes fxw-rgb { 0% { transform: rotate(-2deg) translate(-0.015em, 0.008em) scale(1.01); } 100% { transform: rotate(-2deg) translate(0.015em, -0.008em); } }
.fx-calm .fx-word.go .fx-word-t { animation: fxw-calm calc(var(--ms) * 0.2) ease-out both; text-shadow: 0 0 0.2em currentColor; }
@keyframes fxw-calm { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: scale(1); } }

.bv-burns { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.scorch { position: absolute; width: clamp(40px, 9vh, 90px); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 4, 0, 0.92) 0%, rgba(40, 10, 0, 0.75) 35%, rgba(255, 110, 20, 0.55) 52%, transparent 70%);
  animation: scorch-in 0.3s ease-out both, scorch-glow 1.2s ease-in-out 0.3s 3 alternate; }
@keyframes scorch-in { from { scale: 0.2; } to { scale: 1; } }
@keyframes scorch-glow { to { filter: brightness(0.7) saturate(0.6); } }

/* loser glitch: position / slice jumps only (no brightness change, so it is not a flash) */
.bv-panel.glitch .bv-media { animation: glitch 0.9s steps(1) 3; }
@keyframes glitch {
  0% { transform: translate(0); clip-path: none; } 10% { transform: translate(-8px, 2px); clip-path: inset(10% 0 55% 0); }
  20% { transform: translate(7px, -3px); clip-path: inset(48% 0 12% 0); } 30% { transform: translate(-3px, 0) skewX(6deg); clip-path: none; }
  45% { transform: translate(10px, 1px); clip-path: inset(70% 0 5% 0); } 55% { transform: translate(0); clip-path: none; }
  70% { transform: translate(-6px, -2px) skewX(-8deg); clip-path: inset(25% 0 40% 0); } 85% { transform: translate(4px, 0); clip-path: none; } 100% { transform: none; clip-path: none; } }
.fx-calm .bv-panel.glitch .bv-media { animation: none; }
.bv-panel.loser.glitch { filter: saturate(0.4) contrast(1.15); }
@media (prefers-reduced-motion: reduce) { .fx-word.go .fx-word-t, .bv-panel.glitch .bv-media { animation-duration: 0.01s; } }

/* shirt check (shirt.js): live warning in the camera pre-turn card, and with the result of a covered turn.
   Reserved space (visibility, not display) so the pre-turn card does not jump when it toggles. */
.stage-overlay .shirt-warn { visibility: hidden; font: clamp(12px, 4.2cqh, 26px)/1.1 var(--display); letter-spacing: 0.04em; color: var(--gold);
  background: rgba(0, 0, 0, 0.72); border: 2px solid var(--red); border-radius: 10px; padding: 0.8cqh 2.4cqw; max-width: 90cqw; white-space: nowrap; }
.stage-overlay .shirt-warn.on { visibility: visible; }
.stage-overlay .shirt-warn.big-warn { font-size: clamp(16px, 9cqh, 64px); white-space: normal; text-align: center; }
/* Photo v photo: pose picker */
.pose-pick { grid-template-rows: auto auto minmax(0, 1fr); }
.pose-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1.6cqh; width: 100%; align-content: center; }
.pose-grid .go { font-size: clamp(13px, 4cqh, 22px); padding: 1.6cqh 1cqw; white-space: normal; }
.photo-preview { height: 100%; max-height: 42cqh; min-height: 0; aspect-ratio: 3 / 4; object-fit: contain; border-radius: 8px; background: #111; outline: 2px solid var(--gold, #ffcc33); }
.photo-preview[hidden] { display: none; }
