/* Match page broadcast stage. Stays dark in both themes, like the video. Blue and red belong to this stage only
   (exception to the site's "no blue backgrounds" rule, BK 2026-11-06, see CLAUDE.md). All layers are clipped by the stage. */
:root {
  --st-bg: #05070d; --st-card: rgba(7, 12, 21, .88); --st-line: rgba(200, 216, 235, .22); --st-text: #f5f5f5; --st-muted: #a8b4c4;
  --st-p1: #2bb8ff; --st-p1-a: #31bdff; --st-p1-b: #0a5ccb; --st-p2: #ff5a4f; --st-p2-a: #ff6052; --st-p2-b: #b5172c;
  --st-cell: #1f2839; --st-cell-line: #33415a; --st-wall-a: #262d3b; --st-wall-b: #10141d; --st-gold: #ffd166;
}
.watch-tabs { margin-bottom: 14px; }
.watch-panel[hidden] { display: none; }
.watch .block { margin-top: 0; }
.watch .yt h2 { display: none; }
.hl-video { display: inline-block; font-size: .85rem; font-weight: 700; }
.yt-hint { margin: 10px 0 0; font-size: .9rem; color: var(--text-2); }
.yt-hint:empty { display: none; }

.replay.replay-stage { display: block; }
.stage {
  --text: var(--st-text); --muted: var(--st-muted); --card: var(--st-card); --line: var(--st-line); --band: var(--st-card); --text-2: var(--st-text);
  --cell: var(--st-cell); --cell-line: var(--st-cell-line); --board: rgba(5, 7, 13, .72); --wall-a: var(--st-wall-a); --wall-b: var(--st-wall-b);
  position: relative; overflow: clip; contain: paint; color: var(--st-text);
  display: grid; gap: 12px; padding: 14px; border: 1px solid #000;
  background: var(--st-bg) var(--stage-img, none) center / cover no-repeat;
}
.stage .tally { background: rgba(5, 7, 13, .86); color: var(--st-text); }
.stage .tl-n.p1 { color: var(--st-p1); } .stage .tl-n.p2 { color: var(--st-p2); }
.stage .tl-bar i.p1 { background: linear-gradient(90deg, var(--st-p1-b), var(--st-p1)); box-shadow: 0 0 12px var(--st-p1); }
.stage .tl-bar i.p2 { background: linear-gradient(270deg, var(--st-p2-b), var(--st-p2)); box-shadow: 0 0 12px var(--st-p2); }
.stage-floor { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 620px) minmax(150px, 230px); gap: 12px; justify-content: center; align-items: start; }
.stage-board { position: relative; overflow: clip; min-width: 0; aspect-ratio: 1; }
.stage-camera { position: absolute; inset: 0; transform-origin: 0 0; transition: transform .52s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
.stage-camera .board { height: 100%; }
.stage .cell.n { background: linear-gradient(160deg, #3c4a60, #1f2839); }
.stage .cell.p1 { background: linear-gradient(160deg, var(--st-p1-a), var(--st-p1-b)); border-color: var(--st-p1); }
.stage .cell.p2 { background: linear-gradient(160deg, var(--st-p2-a), var(--st-p2-b)); border-color: var(--st-p2); }
.stage .cell.base { box-shadow: 0 0 0 2px var(--st-text) inset; }
.stage .cell.p1.base, .stage .cell.p2.base { box-shadow: 0 0 0 2px #fff inset, 0 0 12px rgba(255, 255, 255, .45); }
.stage .cell.res::before { background: var(--st-gold); box-shadow: 0 0 8px var(--st-gold); }
.stage .cell.mark { outline: 3px solid var(--st-gold); outline-offset: -3px; }
/* walls: nobody can take them. Grey stripes like the site's other boards, so they never read as empty land (BK 2026-11-11, option B) */
.stage .cell.wall { background: repeating-linear-gradient(135deg, #4a5263 0 6px, #232833 6px 14px); border-color: #4a5263; }

/* side panel numbers, like the video's player panels */
.stage .say-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 10px; margin: 0; font-size: .74rem; }
.stage .say-stats > div { min-width: 0; padding: 5px 7px; background: rgba(255, 255, 255, .05); }
.stage .say-stats dt { color: var(--st-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage .say .say-stats dd { font: 800 1.3rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.stage .say.p1 [data-st="cells"] { color: var(--st-p1); } .stage .say.p2 [data-st="cells"] { color: var(--st-p2); }
.stage .say-stats [data-st="res"]::after { content: " \25C6"; color: var(--st-gold); font-size: .7em; }
.stage .say-stats small { display: block; margin-top: 2px; font-size: .64rem; line-height: 1.25; color: var(--st-muted); }
.stage .say-stats .wp { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.stage .say .say-stats .wp dd { font: 700 1rem/1.2 var(--sans); }

.stage-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0 2px; list-style: none; font-size: .8rem; color: var(--st-muted); }
.stage-legend li { display: inline-flex; align-items: center; gap: 7px; }
.stage-legend i { display: inline-block; width: 18px; height: 18px; flex: none; }
.stage-legend .lg-wall { background: repeating-linear-gradient(135deg, #4a5263 0 3px, #232833 3px 7px); outline: 1px solid #4a5263; }
.stage-legend .lg-res { width: 10px; height: 10px; margin: 0 4px; transform: rotate(45deg); background: var(--st-gold); }
.stage-legend .lg-base { border: 2px solid #fff; background: var(--st-p1-b); }
.stage-legend .lg-num { font-style: normal; font: 800 .72rem/18px var(--sans); text-align: center; color: #fff; background: var(--st-cell); }
.fx-layer { position: absolute; overflow: visible; pointer-events: none; z-index: 2; }
.fx-beam { fill: none; stroke-linecap: round; }
.fx-spark { mix-blend-mode: screen; }

/* players */
.stage .say { background: var(--st-card); padding: 10px 12px; min-width: 0; }
.stage .say.p1 { border-left-color: var(--st-p1); } .stage .say.p2 { border-left-color: var(--st-p2); }
.stage .say.cast { border-left-color: var(--st-gold); }
.stage .say.cast dd.p1 { color: var(--st-p1); } .stage .say.cast dd.p2 { color: var(--st-p2); }
.stage .say[data-side] .say-head > .avatar { display: none; }
.stage .say-head { gap: 4px 8px; margin-bottom: 6px; }
.stage .say-idx { display: none; }
.stage .say[data-side] .say-text { font-size: .9rem; line-height: 1.4; min-height: 5.6em; margin-bottom: 8px; }
.say-face { position: relative; aspect-ratio: 1; margin: 0 0 8px; overflow: hidden; background: #000; }
.say-face img, .say-face video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.say-face video { z-index: 1; }
.stage .say dd { font-size: .95rem; }
.stage .say.cast .say-text { min-height: 2.9em; margin-bottom: 6px; font-size: .96rem; line-height: 1.45; }
.stage .say.cast { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 18px; }
.stage .say.cast .say-head { grid-column: 1 / -1; }
.stage-event { margin: 0; padding: 8px 12px; background: var(--st-card); border-left: 4px solid var(--st-gold); font-weight: 700; }
.stage-event[hidden] { display: none; }
.stage .controls button { background: rgba(5, 7, 13, .8); }
.stage .controls .play { background: var(--st-text); color: #05070d; border-color: var(--st-text); }
.stage .controls .tool { font-size: .95rem; font-weight: 800; }
.stage .controls input[type="range"] { min-width: 90px; accent-color: var(--st-gold); }
.stage .controls output { color: var(--st-text); min-width: 6.5em; }
.stage-start { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border: 2px solid #fff; background: rgba(5, 7, 13, .9); color: #fff; font: 800 1.25rem/1 var(--serif); text-transform: uppercase; letter-spacing: .05em; cursor: pointer; white-space: nowrap; max-width: 92%; }
:lang(ko) .stage-start { font: 800 1.02rem/1 var(--sans); letter-spacing: 0; }
.stage-start:hover { background: #000; border-color: var(--st-gold); }
.stage-start[hidden] { display: none; }
.video-turn { font-size: .85rem; color: var(--st-text); white-space: nowrap; }
.video-turn[hidden] { display: none; }

/* cut-in */
.fx-cutin { position: absolute; left: 0; right: 0; height: clamp(72px, 25%, 150px); z-index: 3; pointer-events: none; overflow: hidden; opacity: 0; clip-path: polygon(0 10%, 100% 0, 100% 90%, 0 100%); }
.fx-cutin[data-at="top"] { top: 4px; } .fx-cutin[data-at="bottom"] { bottom: 4px; }
.fx-cutin .bg { position: absolute; inset: 0; background: linear-gradient(90deg, #0a5ccbf2, #0b2c62e6 60%, #05070df0); }
.fx-cutin[data-side="P2"] .bg { background: linear-gradient(270deg, #b5172cf2, #5a0c1de6 60%, #05070df0); }
.fx-cutin .streak { position: absolute; inset: 0; background: center / cover no-repeat; opacity: .32; mix-blend-mode: screen; }
.fx-cutin[data-side="P2"] .streak { transform: scaleX(-1); }
.fx-cutin .who { position: absolute; top: 0; bottom: 0; width: 26%; background: #000; overflow: hidden; }
.fx-cutin[data-side="P1"] .who { left: 0; clip-path: polygon(0 0, 100% 0, 84% 100%, 0 100%); }
.fx-cutin[data-side="P2"] .who { right: 0; clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%); }
.fx-cutin .who img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
.fx-cutin .txt { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; color: #fff; min-width: 0; text-shadow: 0 3px 0 rgba(0, 0, 0, .55); }
.fx-cutin[data-side="P1"] .txt { left: 29%; right: 3%; text-align: left; } .fx-cutin[data-side="P2"] .txt { right: 29%; left: 3%; text-align: right; }
.fx-cutin .txt b { font: italic 800 clamp(1.25rem, 4.6vw, 3.1rem)/1 var(--serif); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: clip; }
:lang(ko) .fx-cutin .txt b { font: italic 800 clamp(1.15rem, 4vw, 2.6rem)/1.1 var(--sans); }
.fx-cutin .txt small { font-size: clamp(.72rem, 1.6vw, 1rem); font-weight: 800; color: #ffe9b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px #000, 0 0 8px #000; }
.fx-wash { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

/* opening and ending */
.fx-overlay { position: absolute; inset: 0; z-index: 5; display: grid; background: rgba(3, 5, 10, .86); }
.fx-overlay[hidden] { display: none; }
.fx-overlay.is-open { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; justify-items: center; gap: 8px; padding: 12px; }
.vs-side { display: grid; gap: 10px; justify-items: center; text-align: center; min-width: 0; animation: vs-l .32s cubic-bezier(.2, .8, .2, 1) both; }
.vs-side.p2 { animation-name: vs-r; }
.vs-side img { width: min(100%, 300px); aspect-ratio: 1; object-fit: cover; background: #000; border: 3px solid var(--st-p1); }
.vs-side.p2 img { border-color: var(--st-p2); }
.vs-side b { font: 800 clamp(1rem, 2.6vw, 2rem)/1.05 var(--serif); text-transform: uppercase; overflow-wrap: anywhere; }
.vs-badge { width: clamp(84px, 20vw, 240px); height: auto; animation: vs-b .3s .2s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes vs-l { from { opacity: 0; transform: translateX(-60%); } }
@keyframes vs-r { from { opacity: 0; transform: translateX(60%); } }
@keyframes vs-b { from { opacity: 0; transform: scale(1.8); } }
.fx-overlay.is-end { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; justify-items: center; gap: 10px; padding: 12px; }
.end-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
/* no blend mode on the effect videos: their black is true black, and full-size blending made the ending stutter on phones */
.end-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.end-face { position: relative; width: min(100%, 320px); aspect-ratio: 1; background: #000; overflow: hidden; z-index: 1; }
.end-face.p1 { outline: 3px solid var(--st-p1); outline-offset: -3px; } .end-face.p2 { outline: 3px solid var(--st-p2); outline-offset: -3px; }
.end-face img, .end-face video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.end-face video { z-index: 1; }
.end-mid { position: relative; z-index: 1; display: grid; gap: 10px; justify-items: center; text-align: center; min-width: 0; padding: 14px 16px; background: rgba(3, 5, 10, .78); }
.end-mid .ko { width: min(100%, 260px); height: auto; animation: vs-b .32s cubic-bezier(.2, 1.5, .4, 1) both; }
.end-mid b { font: 800 clamp(1.3rem, 3vw, 2.5rem)/1.05 var(--serif); text-transform: uppercase; overflow-wrap: anywhere; }
:lang(ko) .end-mid b { font: 800 clamp(1.1rem, 2.4vw, 2rem)/1.2 var(--sans); }
.end-score { margin: 0; display: flex; gap: 10px; align-items: baseline; font: 800 clamp(1.8rem, 4vw, 3.2rem)/1 var(--serif); font-variant-numeric: tabular-nums; }
.end-score .p1 { color: var(--st-p1); } .end-score .p2 { color: var(--st-p2); } .end-score i { font-style: normal; color: var(--st-muted); }
.end-close { all: unset; cursor: pointer; padding: 8px 16px; border: 1px solid var(--st-text); font-weight: 700; font-size: .9rem; }
.end-close:hover { background: #000; } .end-close:focus-visible { outline: 2px solid var(--st-gold); outline-offset: 2px; }

@media (max-width: 1100px) { .stage-floor { grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) minmax(120px, 170px); } }
/* phone and small tablet: board, caster, then both players, all within one screen */
@media (max-width: 860px) {
  .stage { padding: 8px; gap: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background-image: var(--stage-img-phone, var(--stage-img, none)); }
  .stage-floor { display: contents; }
  .stage > .tally, .stage-board, .stage > .say.cast, .stage-event, .stage > .controls, .stage-legend { grid-column: 1 / -1; }
  .stage-legend { order: 6; font-size: .72rem; gap: 4px 12px; }
  .stage .say-stats { gap: 4px; font-size: .66rem; }
  .stage .say-stats > div { padding: 3px 5px; }
  .stage .say .say-stats dd { font-size: 1.05rem; }
  .stage .say-stats dt { white-space: normal; line-height: 1.2; }
  .stage .say-stats small { display: none; }
  .stage > .tally { order: 1; } .stage-board { order: 2; } .stage > .say.cast, .stage-event { order: 3; }
  .stage .say[data-side] { order: 4; } .stage > .controls { order: 5; }
  .stage .say { padding: 8px; }
  .stage .say[data-side] { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 8px; align-content: start; }
  .say-face { grid-row: 1 / span 2; width: 44px; margin: 0; }
  .stage .say[data-side] .say-head { margin: 0; flex-wrap: nowrap; overflow: hidden; }
  .stage .say[data-side] .say-head strong { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .stage .say[data-side] .say-head .chip { display: none; }
  .stage .say[data-side] dl { grid-column: 1 / -1; margin-top: 4px; }
  .stage .say .say-stats .wp dd { font-size: .86rem; }
  .stage .say[data-side] .say-text { grid-column: 1 / -1; font-size: .8rem; line-height: 1.35; min-height: 4.05em; margin: 4px 0 0; }
  .is-playing .say[data-side] .say-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .stage .say.cast { display: block; } .stage .say.cast .say-head { display: none; }
  .stage .say.cast .say-text { min-height: 4.05em; margin: 0; font-size: .82rem; line-height: 1.35; }
  .stage .say.cast dl { display: none; }
  .is-playing .say.cast .say-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .stage .controls { gap: 6px; }
  .stage .controls button { width: 36px; height: 36px; }
  .stage .controls input[type="range"] { order: 9; flex-basis: 100%; }
  .stage .controls output { min-width: 0; margin-left: auto; font-size: .8rem; }
  .video-turn { order: 10; }
  .fx-overlay.is-end { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; }
  .end-mid { grid-column: 1 / -1; grid-row: 1; }
  .end-face { width: min(100%, 150px); }
  .end-mid .ko { width: 150px; }
  .vs-side img { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .stage-camera { transition: none; }
  .vs-side, .vs-badge, .end-mid .ko { animation: none; }
}
