/* WeverVision replay-viewer page styles. Layered on top of styles.css. */

/* Event-type color tokens — used consistently for: filter chip accents,
   event-row dots, scrubber ticks, and killfeed row pills. */
body[data-page="wevervision"] {
  /* Event-type palette — "wheel partition": hues stepped ~36-40deg apart with
     per-hue lightness tuned for the near-black stage, so every event tick is
     easy to tell apart (the old set crowded cyan/blue/2x-green together). Each
     color has an -rgb twin so chips + fills can use rgba() cross-browser. */
  --wv-color-event-cap: #FF8A1E;     --wv-color-event-cap-rgb: 255, 138, 30;    /* Caps → orange */
  --wv-color-event-kill: #FF3B47;    --wv-color-event-kill-rgb: 255, 59, 71;    /* Kills → red */
  --wv-color-event-revive: #5FD13B;  --wv-color-event-revive-rgb: 95, 209, 59;  /* Revives → green (life) */
  --wv-color-event-swap: #3D9BFF;    --wv-color-event-swap-rgb: 61, 155, 255;   /* Swaps → azure (only blue) */
  --wv-color-event-ult: #8A6BFF;     --wv-color-event-ult-rgb: 138, 107, 255;   /* Ults → violet (power) */
  --wv-color-event-ot: #E45BFF;      --wv-color-event-ot-rgb: 228, 91, 255;     /* OT → magenta (rare/loud) */
  --wv-color-event-submap: #FFD21E;  --wv-color-event-submap-rgb: 255, 210, 30; /* Sub-map → yellow */
  --wv-color-event-spawn: #23C7A0;   --wv-color-event-spawn-rgb: 35, 199, 160;  /* Spawn doors → teal */
  --wv-color-event-round: #A6886A;   --wv-color-event-round-rgb: 166, 136, 106; /* Rounds → bronze (recedes) */
  --wv-color-event-phase: #8FA0B8;   --wv-color-event-phase-rgb: 143, 160, 184; /* phase_change → slate (structural) */
  --wv-color-event-regress: #A0606B; --wv-color-event-regress-rgb: 160, 96, 107;/* regression → muted red */
}

body[data-page="wevervision"] .wv-formula {
  grid-template-columns: minmax(190px, 0.78fr) minmax(220px, 1.4fr) repeat(4, minmax(120px, 0.7fr)) minmax(170px, 0.78fr);
}

.wv-formula input[readonly] {
  cursor: default;
  /* Match the editable fields (Find / Playback speed) instead of a darker, muted
     "disabled" look. Mode/Map/Duration are still non-editable (readonly + default
     cursor); the user just doesn't want them reading as dimmer than their neighbours. */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    rgba(255, 255, 255, 0.025);
}

.wv-surface {
  display: grid;
  gap: 12px;
  padding: 10px;
}

/* ----- STAGE: video + HUD overlay ----- */

.wv-stage-panel {
  display: grid;
  gap: 0;
}

.wv-stage-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--FG_MUTED);
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.wv-meta-sep {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: rgba(166, 186, 218, 0.32);
}

.wv-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: var(--wv-stage-width, 100%);
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
  border-bottom: 1px solid var(--BORDER_COLOR);
  resize: both;
  min-width: 320px;
  min-height: 180px;
}

#wvVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Resize handle (CSS resize: both gives a native grabber but it's tiny;
   we overlay a more visible one in the bottom-right) */
.wv-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  cursor: nwse-resize;
  z-index: 20;
  pointer-events: auto;
  background:
    linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.35) 60%, transparent 60%, transparent 70%, rgba(255,255,255,0.55) 70%, rgba(255,255,255,0.55) 80%, transparent 80%);
  border-bottom-right-radius: 4px;
}
.wv-resize-handle:hover { background-color: rgba(255,255,255,0.08); }

.wv-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 10, 18, 0.92);
  z-index: 10;
}

.wv-loading > * { display: block; }
.wv-loading strong { margin-top: 12px; color: var(--FG_COLOR); font-size: 0.92rem; }
.wv-loading small { margin-top: 4px; color: var(--FG_DIM); font-size: 0.74rem; font-weight: 600; }
.wv-loading[hidden] { display: none !important; }

/* ----- HUD overlay ----- */

.wv-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.wv-hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  /* Objective now lives in its own row ABOVE (see wevervision.html); this row
     holds only the two 6-portrait strips, a 2-col grid. Each strip keeps
     full-size cards justified toward the centre; the gap below is the centre
     channel that separates the two teams. There is ~135px of outer slack per
     column at 1920, so widening the gap pushes the rosters apart without
     shrinking any portrait. */
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: clamp(20px, 4vw, 80px);
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.18) 70%, transparent);
}

/* Character cards strip - 6 portraits per team, with ult bars */
.wv-team-strip {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.wv-team-strip.wv-team-blue { justify-content: flex-end; }
.wv-team-strip.wv-team-red { justify-content: flex-start; }

/* Team-coloured background BEHIND each team's topbar cards (user 2026-06-04) so it's easy to
   tell which side is which — a backdrop behind the whole strip, NOT a per-card edge stripe. */
.wv-team-strip.wv-team-blue {
  background: linear-gradient(180deg, rgba(var(--accent-cyan-light-rgb), 0.16), rgba(var(--accent-cyan-light-rgb), 0.04));
  border-radius: 8px;
  padding: 4px 6px;
}
.wv-team-strip.wv-team-red {
  background: linear-gradient(180deg, rgba(255, 139, 107, 0.16), rgba(255, 139, 107, 0.04));
  border-radius: 8px;
  padding: 4px 6px;
}

/* Deadpool variant role badge — top-right of the card portrait. */
.wv-card-roleicon {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 56%;
  max-width: 32px;
  height: auto;
  border-radius: 3px;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.75));
  z-index: 2;
}

.wv-card {
  display: grid;
  grid-template-rows: auto auto;
  gap: 3px;
  min-width: 64px;
  /* Cards now span more horizontal space since the team banner moved to its
     own row above (no longer competing for the cards-strip's 1fr column). */
  width: clamp(74px, 8vw, 112px);
  text-align: center;
  /* MUST be positioned so the .wv-dead::after overlay below is contained to
     THIS card. Without this, the ::after escapes to the nearest positioned
     ancestor (.wv-hud-top) and inset:0 makes it a full-HUD invisible overlay
     — and the last dead card in DOM order wins all hit-testing, sending every
     real mouse click to slot 12 (NAVI LvlCrook). Synthetic .click() bypasses
     hit-testing so the bug only repros with a real mouse, which is why headless
     tests passed. See bridge entry 2026-05-26 (O4 click-bug). */
  position: relative;
}

.wv-card-portrait-wrap {
  position: relative;
  aspect-ratio: 1;
  /* NEUTRAL border only — team identity is carried by the player-name text
     color (wv-team-blue/red below), not by a colored bracket around the
     portrait. The bracket pattern is a "vibe-code" tell per repeated user
     feedback (see CLAUDE.md rule 10 + docs/anti_vibe_code.md). */
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  overflow: hidden;
  /* Backdrop BEHIND the character icon = the team's side colour (user 2026-06-04: "bottom
     layer = side colour, then character icon"), not black. Overridden per team below; this
     dark value is only a fallback when team isn't known. */
  background: rgba(var(--surf-4), 0.85);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 4px 10px rgba(0,0,0,0.4);
}

.wv-team-strip.wv-team-blue .wv-card-portrait-wrap { background: rgba(36, 92, 156, 0.92); }
.wv-team-strip.wv-team-red  .wv-card-portrait-wrap { background: rgba(156, 58, 44, 0.92); }

.wv-card-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.08);
}

/* Dim the dead portrait IMAGE only — NOT the whole wrap — so the respawn badge
   (a child of the wrap) keeps full brightness/contrast and reads cleanly. When
   the filter was on the wrap it also dimmed the badge's white digit to grey. */
.wv-card.wv-dead .wv-card-portrait {
  filter: grayscale(0.9) brightness(0.55);
}

.wv-card.wv-dead::after {
  content: "";
  position: absolute;
  inset: 0;
  /* X overlay drawn via background */
}

/* Respawn countdown: a small dark translucent circular badge centered ON the
   (dimmed) hero portrait while the player is dead — the in-game "you'll respawn
   in N" read. NOT a colored edge/stripe (CLAUDE.md rule 10); the circle is a
   neutral dark disc so only the number carries signal. The outer wrapper is the
   absolute/centering layer; the inner ::before draws the disc behind the digits. */
.wv-card-respawn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.wv-card-respawn::before {
  content: attr(data-rs);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fixed-size disc — no container queries / percentage-of-aspect-ratio, which
     collapsed unpredictably inside the flex card strip. 34px reads well on the
     ~74-112px portraits and stays a circle at every zoom. */
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(var(--surf-1), 0.74);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16), 0 1px 4px rgba(0,0,0,0.6);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 4px rgba(0,0,0,0.9);
}

.wv-card-ult-wrap {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.18);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.7);
}

/* Live ult-charge %, centered OVER the bar in a non-clipping row so the larger
   number isn't cropped and the bar itself is unchanged. */
.wv-card-ult-row { position: relative; }
.wv-card-ult-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  text-shadow: 0 0 3px rgba(0,0,0,0.98), 0 1px 2px rgba(0,0,0,0.95);
  pointer-events: none;
}

.wv-card-ult-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #FFE186, #F8A532 70%, #FF6C2C);
  transition: width 0.25s ease;
  box-shadow: 0 0 6px rgba(248, 165, 50, 0.55);
}

.wv-card.wv-full .wv-card-ult-fill {
  background: linear-gradient(90deg, #BCFCFF, var(--ACCENT_CYAN) 60%, var(--accent-cyan-light));
  box-shadow: 0 0 12px rgba(var(--accent-cyan-rgb), 0.85);
  animation: wvUltPulse 1.1s ease-in-out infinite;
}

@keyframes wvUltPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.35); }
}

/* Ult-ready cue: character ult icon below the card with a faint electric glow
   and a sparse lightning arc that flickers in/out (kept VERY subtle — short,
   low-opacity flashes, not a constant strobe). */
.wv-card-ultready {
  position: relative;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
}
/* Rendered as a WHITE silhouette (brightness(0) invert(1)) so the icon reads
   clearly on the dark HUD; the cyan glow is layered on after via drop-shadow. */
.wv-ultready-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 0 3px rgba(140, 210, 255, 0.85));
  animation: wvUltReadyGlow 1.7s ease-in-out infinite;
}
@keyframes wvUltReadyGlow {
  0%, 100% { filter: brightness(0) invert(1) drop-shadow(0 0 2px rgba(140, 210, 255, 0.55)); }
  50%      { filter: brightness(0) invert(1) drop-shadow(0 0 7px rgba(165, 225, 255, 1)); }
}
.wv-ultarc {
  position: absolute;
  width: 40px;
  height: 40px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
}
.wv-ultarc polyline {
  fill: none;
  stroke: rgba(180, 230, 255, 0.9);
  stroke-width: 0.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 2px rgba(120, 200, 255, 0.95));
  opacity: 0;
  animation: wvUltArc 1.5s steps(1, end) infinite;
}
.wv-ultarc polyline:nth-child(2) { animation-delay: 0.75s; }
@keyframes wvUltArc {
  0%, 20%   { opacity: 0; }
  24%, 30%  { opacity: 0.9; }
  36%       { opacity: 0.12; }
  42%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wv-ultready-icon, .wv-ultarc polyline { animation: none; }
}

.wv-card-name {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.86);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Team color now lives in the player-name TEXT below the portrait, not in
   the portrait border. No colored bracket around portraits — vibe-code rule. */
.wv-team-blue .wv-card .wv-card-name { color: var(--accent-cyan-light); }
.wv-team-red  .wv-card .wv-card-name { color: #FF8B6B; }

/* Objective (center HUD) */

.wv-objective {
  /* In-game HUD layout: a top stat row (team | mode/map | team) and a FULL-WIDTH
     payload/objective track below it, spanning all three columns. */
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "blue center red"
    "bar  bar    bar";
  align-items: center;
  column-gap: 12px;
  row-gap: 7px;
  padding: 9px 16px 11px;
  background: rgba(var(--surf-1), 0.62);
  border: 1px solid rgba(var(--BORDER_COLOR), 0.30);
  border-radius: 16px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 8px 22px rgba(0,0,0,0.45);
  /* The objective now sits on its OWN full-width HUD row (below the portrait
     strips), so it no longer competes with them for horizontal space. Centre it
     and cap its width so the 2-row [team|mode/map|team]+track layout stays on a
     single visual line (max-content ~= 469px) without stretching across the
     whole stage. min-width:0 lets it shrink gracefully on narrow viewports. */
  min-width: 0;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}
.wv-obj-blue { grid-area: blue; }
.wv-obj-red  { grid-area: red; }
.wv-obj-center {
  grid-area: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  text-align: center;
}
.wv-obj-bar-wrap { grid-area: bar; min-width: 0; }
/* The center detail line is retired: distance is per-side, the point is in the map
   line, and domination "capped by" is the team-coloured owner circle. */
.wv-obj-detail { display: none; }

.wv-obj-side {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}

.wv-obj-blue { color: var(--accent-cyan-light); }
/* Team red toned down a tad (panel-scoped, not site-wide). */
.wv-obj-red { color: #e85e6c; flex-direction: row-reverse; }

/* Score in a clean team-tinted plate (in-game score-block feel). */
.wv-obj-score {
  font-size: 1.4rem;
  line-height: 1;
  display: inline-block;
  padding: 3px 11px;
  border-radius: 8px;
  border: 1px solid rgba(166,186,218,0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
}
.wv-obj-blue .wv-obj-score { background: rgba(var(--accent-cyan-rgb),0.16); border-color: rgba(var(--accent-cyan-rgb),0.36); }
.wv-obj-red  .wv-obj-score { background: rgba(232,94,108,0.16); border-color: rgba(232,94,108,0.36); }

/* Time (top) + distance/percent (bottom), paired per side like the in-game HUD. */
.wv-obj-readout { display: flex; flex-direction: column; line-height: 1.15; }
.wv-obj-red .wv-obj-readout { align-items: flex-end; }
.wv-obj-timer { font-size: 0.82rem; font-weight: 800; color: #eef3fb; }
.wv-obj-dist { font-size: 0.7rem; font-weight: 700; margin-top: 2px; }
.wv-obj-blue .wv-obj-dist { color: rgba(var(--accent-cyan-rgb),0.85); }
.wv-obj-red  .wv-obj-dist { color: rgba(232,94,108,0.92); }
.wv-obj-dist:empty { display: none; }

.wv-obj-bar-wrap {
  display: grid;
  gap: 4px;
  text-align: center;
  min-width: 0;
}

.wv-obj-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.wv-obj-bar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--ACCENT_CYAN), var(--accent-cyan-light));
  border-radius: inherit;
  transition: width 0.25s ease, background 0.25s ease;
}

.wv-obj-bar-fill.wv-fill-red {
  background: linear-gradient(90deg, #FF5A6B, #F8A532);
}

/* ---- Payload bar segments (Convoy / Convergence) ---- */
.wv-obj-bar-segmented {
  display: flex;
  gap: 0;
  height: 18px;
  position: relative;
  background: transparent;
  border: none;
  overflow: visible;
  border-radius: 0;
  box-shadow: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

/* Segments are visually unified — clean separators, no per-segment gradient stripes.
   The whole filled portion uses ONE solid team color across all segments so the bar
   looks like a continuous progress bar, not 3 repeated bars. */
.wv-obj-bar-seg {
  flex: 1 1 0;
  position: relative;
  height: 100%;
  background: rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.18);
  border-bottom: 1px solid rgba(255,255,255,0.18);
  overflow: hidden;
}
.wv-obj-bar-seg:first-child { border-left: 1px solid rgba(255,255,255,0.18); border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.wv-obj-bar-seg:last-child { border-right: 1px solid rgba(255,255,255,0.18); border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
/* No inter-segment vertical divider: every leg boundary already carries a glass
   checkpoint diamond, so a seam here only showed THROUGH the translucent diamond
   and looked rough. The track stays continuous (matches the "one continuous bar"
   intent above); the diamonds are the leg separators. */

.wv-obj-bar-seg-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: #e85e6c;            /* solid red, toned down a tad (no gradient — see header notes) */
  transition: width 0.18s linear;
}

.wv-obj-bar-seg-fill.wv-fill-blue {
  background: var(--accent-cyan-light);            /* solid blue */
}

/* Active-push cue. The fill KEEPS its solid team colour (red #e85e6c default,
   cyan via .wv-fill-blue) — no recolour. On top we lay only a soft light sheen
   that sweeps forward (push direction = left→right) so the bar reads as "moving"
   while the team colour stays the dominant read. The old version recoloured the
   fill to yellow and stacked heavy white hazard-stripes + a pale glow, which
   washed every element into one colour (user-reported). A faint team-coloured
   glow + a barely-there brightness pulse reinforce "active" without busyness. */
.wv-obj-bar-segmented.wv-payload-pushing .wv-obj-bar-seg-fill {
  background-image: linear-gradient(
    100deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.15) 50%,
    rgba(255,255,255,0) 100%
  );
  background-size: 70px 100%;
  background-repeat: repeat-x;
  animation: wvPayloadSheen 1.1s linear infinite, wvPayloadPulse 1.8s ease-in-out infinite;
  box-shadow: 0 0 7px rgba(232, 94, 108, 0.6);   /* faint glow in the red team colour */
}
.wv-obj-bar-segmented.wv-payload-pushing .wv-obj-bar-seg-fill.wv-fill-blue {
  box-shadow: 0 0 7px rgba(var(--accent-cyan-rgb), 0.6);   /* faint glow in the blue team colour */
}
/* The sheen band drifts one full tile forward each cycle (seamless loop). */
@keyframes wvPayloadSheen {
  from { background-position: 0 0; }
  to   { background-position: 70px 0; }
}

/* Angled "arrow head" tip on the LAST segment so the bar reads like a payload
   chevron in-game. A subtle taper is applied at all times so the right edge
   never ends abruptly; while a push is active the taper sharpens.
   Targets the explicit `.wv-obj-bar-seg-tail` class set by JS — `:last-child`
   doesn't match because diamonds + chevron are appended after the segs (#181). */
.wv-obj-bar-segmented .wv-obj-bar-seg-tail {
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%);
  border-right: none;
  /* Also need the right border-radius since :last-child border-radius above
     also won't apply now. The taper handles the visual shape. */
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}
.wv-obj-bar-segmented.wv-payload-pushing .wv-obj-bar-seg-tail {
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}

/* New readout layout: two-team side-by-side with logos */
.wv-payload-readout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
}
.wv-payload-team {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wv-payload-team-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.wv-payload-team-logo-placeholder {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  flex-shrink: 0;
}
.wv-payload-team.wv-payload-team-blue { color: var(--accent-cyan-light); }
.wv-payload-team.wv-payload-team-red  { color: #FF8B6B; }
.wv-payload-team.wv-payload-team-attacking { text-shadow: 0 0 8px currentColor; }
.wv-payload-divider {
  width: 1px;
  height: 14px;
  background: rgba(166, 186, 218, 0.32);
}

@keyframes wvPayloadPulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.12); }
}

/* Cart chevron — points in the push direction (right) along the bar.
   The inner <svg> carries the directional transform so the outer container
   can keep its centering translate. Regression flips the SVG horizontally
   and pulses to telegraph "enemy team is pushing the cart back". */
.wv-payload-chevron {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  color: #FFF;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.8));
  transition: left 0.25s ease, color 0.25s ease;
}
.wv-payload-chevron svg {
  width: 100%;
  height: 100%;
  transition: transform 0.2s ease;
}
.wv-payload-chevron.wv-chev-blue { color: var(--ACCENT_CYAN); }
.wv-payload-chevron.wv-chev-red  { color: #F8A532; }
.wv-payload-chevron.wv-chev-regressing svg { transform: scaleX(-1); }
.wv-payload-chevron.wv-chev-regressing {
  color: #FF5A6B;
  animation: wvChevRegressFlash 0.6s ease-in-out infinite;
}
@keyframes wvChevRegressFlash {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255,90,107,0.9)); }
  50%      { filter: drop-shadow(0 0 10px rgba(255,90,107,1)); }
}

/* Translucent "glass" checkpoint diamond on the payload track. The track behind
   it is now seamless (the inter-segment gap/divider was removed — see
   .wv-obj-bar-seg below) so the glass no longer reveals an ugly vertical slit. */
.wv-obj-bar-diamond {
  position: absolute;
  width: 13px;
  height: 13px;
  background: rgba(248, 165, 50, 0.14);
  border: 1px solid rgba(248, 165, 50, 0.6);
  border-radius: 3px;
  transform: translate(-50%, -50%) rotate(45deg);
  top: 50%;
  z-index: 2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}
.wv-obj-bar-diamond.wv-diamond-passed {
  background: rgba(248, 165, 50, 0.95);
  border-color: rgba(255, 220, 120, 1);
  box-shadow: 0 0 8px rgba(248, 165, 50, 0.55);
}
/* Final-push GOAL diamond at the end of the bar — bigger, gold-edged, with a
   soft glow so it reads as the destination marker (distinct from the smaller,
   plain leg-checkpoint diamonds between segments). */
.wv-obj-bar-diamond.wv-diamond-goal {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #FFE9A8 0%, #FFB94A 100%);
  border: 2px solid #FFD66E;
  box-shadow: 0 0 6px rgba(255,200,80,0.55), 0 0 12px rgba(255,200,80,0.35);
  z-index: 4;
}
.wv-obj-bar-diamond.wv-diamond-goal.wv-diamond-passed {
  background: linear-gradient(135deg, #FFFFFF 0%, #FFE08A 100%);
  border-color: #FFFFFF;
  box-shadow: 0 0 8px rgba(255,230,150,0.85), 0 0 16px rgba(255,200,80,0.55);
}

/* Below-bar readout retired: distance now lives in the per-side readout (paired
   with the team clock) per the in-game HUD layout. Kept in DOM/JS for the data
   path; hidden so the panel matches the redesign. */
.wv-payload-readout { display: none; }
.wv-payload-readout-legacy {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  letter-spacing: 0.04em;
  margin-top: 2px;
  text-align: center;
  transition: color 220ms ease, text-shadow 220ms ease;
}
.wv-payload-readout.wv-readout-pushing {
  animation: wvReadoutFlash 1.4s ease-in-out infinite;
}
.wv-payload-readout.wv-readout-blue.wv-readout-pushing { color: #BCFCFF; text-shadow: 0 0 6px rgba(var(--accent-cyan-rgb),0.7); }
.wv-payload-readout.wv-readout-red.wv-readout-pushing  { color: #FFE0BE; text-shadow: 0 0 6px rgba(248,165,50,0.7); }

@keyframes wvReadoutFlash {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ---- Convergence phase-1 capture circle ----
   The circle sits in the same slot as the payload bar. The wrap is sized to the
   circle (not the bar) so the ring is fully visible — when we forced an 18px
   wrap and a -36px margin-top to "overlap" the bar slot, the top of the 90px
   circle pushed past the HUD/stage and was clipped by .wv-stage{overflow:hidden}.
   svg{overflow:visible} is extra safety so the stroke never crosses the viewBox
   edge regardless of stroke-width. */
.wv-capture-circle-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: opacity 220ms ease, transform 220ms ease;
}

.wv-capture-circle {
  position: relative;
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.wv-capture-circle svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  /* NOTE: do NOT add a CSS rotate here. The SVG paths in renderCaptureCircle
     already start at (50,8) = 12 o'clock in the viewBox. A stale
     `transform: rotate(-90deg)` (round-4 M3, 2026-05-27) was shifting the
     visual start to 9 o'clock, making the arc fill appear to come from the
     left side instead of the top. Removed to honour CLAUDE.md rule 9
     (visual verification). */
}

.wv-capture-circle-track {
  fill: none;
  stroke: rgba(255,255,255,0.18);
  stroke-width: 8;
}

.wv-capture-circle-arc {
  fill: none;
  stroke-width: 8;
  stroke-linecap: butt;             /* keep 3 segments visually distinct */
  /* Round-5 M-W6.3 (2026-05-27): dropped from 0.25s → 0.1s. The 250 ms ease
     visibly lagged the in-game capture circle during phase-1 scrubs — at
     2× video speed the user was reading 500 ms of perceived lag. 100 ms
     stays smooth (no jitter on the OCR samples that arrive 8 fps = ~125 ms
     apart) while halving the perceived lag. */
  transition: stroke-dasharray 0.1s ease, stroke 0.1s ease;
}
.wv-capture-circle-arc.wv-arc-blue { stroke: var(--ACCENT_CYAN); filter: drop-shadow(0 0 4px rgba(var(--accent-cyan-rgb),0.7)); }
.wv-capture-circle-arc.wv-arc-red  { stroke: #ff425a; filter: drop-shadow(0 0 5px rgba(255,66,90,0.8)); }
.wv-capture-circle-arc.wv-arc-none { stroke: rgba(255,255,255,0.35); }

.wv-capture-circle-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 0.78rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.wv-capture-circle-text.wv-arc-blue { color: #BCFCFF; }
.wv-capture-circle-text.wv-arc-red  { color: #FFE0BE; }

/* Smooth swap between phase-1 (circle) and phase-2 (bar) */
.wv-capture-circle-wrap[hidden],
.wv-obj-bar-segmented[hidden] {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  /* note: still in layout flow because we toggle via class, not [hidden] attribute */
}

/* ---- Overtime indicator: clean white-text orange-glow PILL (no hex bolt) ---- */
.wv-obj-overtime {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  margin-bottom: 3px;
  padding: 2px 16px;
  border-radius: 999px;
  background: rgba(236,114,7,0.16);
  border: 1px solid rgba(255,150,40,0.5);
  box-shadow: 0 0 14px rgba(255,130,20,0.45);
  animation: wvObjOtPulse 1.1s ease-in-out infinite;
}
.wv-obj-overtime[hidden] { display: none; }
.wv-obj-ot-bolt { display: none; }
.wv-obj-ot-text {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 0 8px rgba(255,140,30,0.9), 0 0 2px rgba(0,0,0,0.55);
}
@keyframes wvObjOtPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(255,130,20,0.4); }
  50% { box-shadow: 0 0 20px rgba(255,150,40,0.7); }
}

/* Domination: no team clock + no score plate (the round pips carry the score);
   capture percent is shown directly on the two bars instead. */
#wvObjective[data-mode="domination"] .wv-obj-readout,
#wvObjective[data-mode="domination"] .wv-obj-score { display: none; }
.wv-dom-pct {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font: 800 0.66rem/1 "JetBrains Mono", monospace;
  color: #eef3fb;
  text-shadow: 0 1px 2px rgba(0,0,0,0.78);
  pointer-events: none;
  z-index: 2;
}
.wv-dom-half-blue .wv-dom-pct { right: 6px; }
.wv-dom-half-red  .wv-dom-pct { left: 6px; }

/* ---- Domination 2-bar layout (red + blue independent fills, owner circle in middle) ----
   6-item grid: 3 columns × 2 rows. Row 1 = point pips; row 2 = the bars + owner circle. */
.wv-obj-bar-domination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  row-gap: 4px;
  column-gap: 6px;
  align-items: center;
  position: relative;
  background: transparent;
  border: none;
  overflow: visible;
  border-radius: 0;
  box-shadow: none;
}

/* Point pips: 2 squares per team. Blue pips are LEFT-justified (1,2 left→right);
   red pips are RIGHT-justified (2,1 left→right) so the "1" lands at the outer edge. */
.wv-dom-pips {
  display: flex;
  gap: 4px;
}
.wv-dom-pips-blue { justify-content: flex-start; }
.wv-dom-pips-red  { justify-content: flex-end; }
.wv-dom-pips-spacer { width: 22px; }
.wv-dom-pip {
  width: 13px;
  height: 13px;
  transform: skewX(-18deg);   /* slanted square, matching ui/ .ro-pip (localhost:8765) */
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 2px;
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.45);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.wv-dom-pip.wv-pip-blue {
  background: var(--accent-cyan-light);
  border-color: var(--ACCENT_CYAN);
  box-shadow: 0 0 6px rgba(var(--accent-cyan-rgb),0.55), inset 0 1px 2px rgba(0,0,0,0.45);
}
.wv-dom-pip.wv-pip-red {
  background: #F8A532;
  border-color: #FF5A6B;
  box-shadow: 0 0 6px rgba(248,165,50,0.55), inset 0 1px 2px rgba(0,0,0,0.45);
}

.wv-dom-half {
  height: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

/* In-game (per user refs 2026-05-25):
   - Blue half is on the LEFT of the bar; its fill grows LEFT→RIGHT (outer edge inward toward the owner circle).
   - Red  half is on the RIGHT of the bar; its fill grows RIGHT→LEFT (outer edge inward).
   Both fills are anchored on the OUTSIDE edge so a higher % visually pushes toward the centre owner circle. */
.wv-dom-half-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: inherit;
  transition: width 0.2s ease;
}
.wv-dom-half-blue .wv-dom-half-fill { left: 0;  right: auto; background: linear-gradient(90deg, var(--ACCENT_CYAN), var(--accent-cyan-light)); }
.wv-dom-half-red  .wv-dom-half-fill { right: 0; left:  auto; background: linear-gradient(90deg, #F8A532, #FF5A6B); }

.wv-dom-owner-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(40, 50, 70, 0.85);
  border: 2px solid rgba(255,255,255,0.55);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(255,255,255,0.92);
  font-family: "JetBrains Mono", monospace;
  z-index: 2;
}
.wv-dom-owner-circle.wv-owner-blue { background: var(--accent-cyan-light); border-color: var(--ACCENT_CYAN); }
.wv-dom-owner-circle.wv-owner-red  { background: #FF5A6B; border-color: #F8A532; }
.wv-dom-owner-circle.wv-owner-none { background: rgba(40, 50, 70, 0.6); }

.wv-obj-mode {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.74);
  text-transform: uppercase;
}

.wv-obj-detail {
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  font-family: "JetBrains Mono", monospace;
}
/* Inline team logo on the domination pct / capped-by line (B0004). Sized to the
   text cap-height and baseline-aligned so it reads as part of the line, not an
   edge marker. */
.wv-obj-detail-logo {
  height: 0.9em;
  width: auto;
  vertical-align: -0.12em;
  object-fit: contain;
}

/* Objective panel team identity (logo + name) + map line. The name inherits
   the team colour from .wv-obj-blue/.wv-obj-red on the parent side. No edge
   stripes (anti_vibe_code.md): the logo + coloured name carries the team. */
.wv-obj-team {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}
.wv-obj-team-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}
.wv-obj-team-name { font-family: "JetBrains Mono", monospace; }

.wv-obj-map {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.04em;
}

.wv-ot-banner {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 22px;
  background: linear-gradient(135deg, var(--ACCENT_PINK), #B8001A);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.18em;
  box-shadow: 0 6px 20px rgba(var(--accent-pink-rgb), 0.55), 0 0 0 2px rgba(255,255,255,0.18) inset;
  animation: wvOtPulse 1.2s ease-in-out infinite;
}

@keyframes wvOtPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* Killfeed */

.wv-killfeed {
  position: absolute;
  top: 110px;
  right: 16px;
  display: grid;
  gap: 4px;
  /* Widened to fit "<name> (<hero>) ⇒ <name> (<hero>)" without ellipsis on
     common cases (e.g. "TLC shpeediry (Starlord) ⇒ Touzii (White Fox)"). */
  width: clamp(260px, 30vw, 420px);
  pointer-events: none;
  z-index: 6;
}

.wv-kill-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: rgba(var(--surf-1), 0.78);
  border: 1px solid rgba(var(--BORDER_COLOR), 0.22);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  animation: wvKillFade 240ms ease-out;
  transition: opacity 220ms ease, transform 220ms ease, border-color 220ms ease;
}

@keyframes wvKillFade {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.wv-kill-row.wv-kill-out {
  opacity: 0;
  transform: translateX(20px);
}

.wv-kill-row .wv-kill-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}

/* Per-event-type color USED to live on the left border. That's a
   "colored bracket" / vibe-code pattern per user feedback — removed.
   Event type is now conveyed by a small inside-row dot (.wv-event-dot)
   the JS adds, not by a colored edge stripe. */

/* Team identification: tint the player-name TEXT by team instead of a left-edge
   accent stripe. The accent-stripe pattern is a "vibe-code" tell per user feedback
   (2026-05-26) — colored category info should live in related text/icons, not in
   bracket-style edges. The neutral 3px left border from .wv-kill-row stays as a
   visual rhythm cue but no longer carries team meaning. */
.wv-kill-row.wv-kill-blue .wv-kill-name { color: var(--accent-cyan-light); }
.wv-kill-row.wv-kill-red  .wv-kill-name { color: #FF8B6B; }

.wv-kill-arrow {
  color: rgba(255,255,255,0.7);
  font-weight: 800;
}

/* ----- Transport / scrubber strip ----- */

.wv-transport {
  display: grid;
  grid-template-columns: auto auto auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(var(--surf-1), 0.4);
  border-top: 1px solid var(--BORDER_COLOR);
}

.wv-play-btn,
.wv-skip-btn {
  min-height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--BORDER_COLOR);
  background: var(--BUTTON_GHOST);
  color: var(--FG_COLOR);
  font-weight: 700;
  cursor: pointer;
}

.wv-play-btn:hover, .wv-skip-btn:hover {
  background: var(--BUTTON_GHOST_HOVER);
  border-color: var(--CARD_BORDER_CYAN);
}

.wv-play-icon {
  font-size: 1rem;
  display: inline-block;
}

.wv-scrub-wrap {
  position: relative;
  display: grid;
  gap: 2px;
  min-width: 0;
}

/* glass-demo slider: 10px cyan-fill rail + a chunky frosted-glass gel knob that
   scales up on grab (transform/box-shadow only, compositor-cheap). */
.wv-scrubber {
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.wv-scrubber::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ACCENT_CYAN) 0%, var(--ACCENT_CYAN) var(--wv-progress, 0%), rgba(var(--BORDER_COLOR), 0.22) var(--wv-progress, 0%));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 0 12px rgba(var(--accent-cyan-rgb), 0.18);
}
.wv-scrubber::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(var(--BORDER_COLOR), 0.22);
  border: 1px solid rgba(255,255,255,0.1);
}
.wv-scrubber::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--ACCENT_CYAN);
}

.wv-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.6);
  margin-top: -5px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 4px 12px rgba(0, 0, 0, 0.45),
    0 0 0 4px rgba(var(--accent-cyan-rgb), 0.16);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  backdrop-filter: blur(6px) saturate(140%);
  cursor: grab;
  transition: transform 0.12s var(--glass-ease), box-shadow 0.12s var(--glass-ease);
}
.wv-scrubber:active::-webkit-slider-thumb {
  transform: scale(1.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 8px 22px rgba(0, 0, 0, 0.5),
    0 0 0 6px rgba(var(--accent-cyan-rgb), 0.22);
  cursor: grabbing;
}
.wv-scrubber::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 4px 12px rgba(0, 0, 0, 0.45),
    0 0 0 4px rgba(var(--accent-cyan-rgb), 0.16);
  cursor: grab;
}

/* Event tick marks layered above the scrub track. Inset by the scrubber
   thumb's half-width (7px) on each side so 0% lines up with the scrubber's
   zero position and 100% lines up with the scrubber's max — the input
   range reserves half the thumb width as padding on each end. */
.wv-events-strip {
  position: relative;
  height: 16px;
  margin-top: -2px;
  margin-left: 10px;
  margin-right: 10px;
  pointer-events: none;
}

.wv-event-tick {
  position: absolute;
  top: 2px;
  width: 2px;
  height: 12px;
  border-radius: 1px;
  pointer-events: auto;
  cursor: pointer;
  transform: translateX(-1px);
  /* Colour comes from --tick (set per data-type below); the glow + intensity are
     tuned HERE in one place. Was `0 0 6px <colour>` at full opacity, which made
     dense clusters bloom into a neon haze that was hard on the eyes. Smaller glow
     + slightly lower opacity calms it while the colour still reads at a glance. */
  background: var(--tick, #9aa7bd);
  box-shadow: 0 0 2px var(--tick, transparent);
  opacity: 0.82;
}

.wv-event-tick:hover {
  height: 14px;
  width: 3px;
  top: 1px;
  opacity: 1;
  box-shadow: 0 0 4px var(--tick, #9aa7bd);
}

.wv-event-tick[data-type="checkpoint_cap"] { --tick: var(--wv-color-event-cap); }
.wv-event-tick[data-type="kill"] { --tick: var(--wv-color-event-kill); }
.wv-event-tick[data-type="hero_swap"] { --tick: var(--wv-color-event-swap); }
.wv-event-tick[data-type="ult"] { --tick: var(--wv-color-event-ult); }
.wv-event-tick[data-type="overtime"] { --tick: var(--wv-color-event-ot); }
.wv-event-tick[data-type="sub_map_change"] { --tick: var(--wv-color-event-submap); }
.wv-event-tick[data-type="revive"] { --tick: var(--wv-color-event-revive); }
.wv-event-tick[data-type="spawn_door"] { --tick: var(--wv-color-event-spawn); }
.wv-event-tick[data-type="round"] { --tick: var(--wv-color-event-round); }
.wv-event-tick[data-type="phase_change"] { --tick: var(--wv-color-event-phase); }
.wv-event-tick[data-type="regression"] { --tick: var(--wv-color-event-regress); }
.wv-event-tick[data-type="gameplay_start"] { --tick: var(--wv-color-event-round); }

.wv-rounds-strip {
  position: relative;
  height: 4px;
  margin-top: -2px;
  margin-left: 7px;
  margin-right: 7px;
  pointer-events: none;
}

.wv-round-band {
  position: absolute;
  top: 0;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

.wv-round-band[data-attacker="blue"] { background: rgba(var(--accent-cyan-light-rgb), 0.45); }
.wv-round-band[data-attacker="red"] { background: rgba(255, 90, 107, 0.45); }

.wv-time-display {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--FG_MUTED);
  white-space: nowrap;
  min-width: 130px;
  text-align: right;
}

/* ----- EVENTS LIST below the stage ----- */

.wv-events-panel {
  display: grid;
}

.wv-filters {
  flex-wrap: wrap;
}

/* Filter chips = frosted glass, each carrying its event color as an inside DOT
   (anti-vibe §10: inside marker, never an edge stripe). Active = a tint of that
   color filling the glass + a soft glow; inactive = dimmed. The colors are the
   same tokens the timeline ticks use, so the chips double as a color legend. */
.wv-filters .wv-filter-chip {
  position: relative;
  text-transform: capitalize;
  border: 1px solid rgba(var(--chip-rgb, 166, 186, 218), 0.30);
  background: var(--glass-fill-soft);
  color: var(--FG_MUTED);
  transition: opacity 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .wv-filters .wv-filter-chip {
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    backdrop-filter: blur(8px) saturate(130%);
  }
}
.wv-filters .wv-filter-chip::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--chip, rgba(255, 255, 255, 0.5));
  box-shadow: 0 0 5px rgba(var(--chip-rgb, 255, 255, 255), 0.6);
}
.wv-filters .wv-filter-chip[aria-pressed="true"] {
  color: #fff;
  border-color: rgba(var(--chip-rgb), 0.55);
  background: linear-gradient(180deg, rgba(var(--chip-rgb), 0.22), rgba(var(--chip-rgb), 0.07)), var(--glass-fill-soft);
  box-shadow: var(--glass-sheen), 0 2px 10px rgba(var(--chip-rgb), 0.28);
}
.wv-filters .wv-filter-chip[aria-pressed="false"] { opacity: 0.45; }
.wv-filters .wv-filter-chip[aria-pressed="false"]:hover { opacity: 0.8; }
/* Per-chip event color: drives the dot, border, active fill + glow. */
.wv-filters .wv-filter-chip[data-filter="all"]            { --chip: #F2F2F4; --chip-rgb: 242, 242, 244; }
.wv-filters .wv-filter-chip[data-filter="all"]::before    { box-shadow: none; }
.wv-filters .wv-filter-chip[data-filter="checkpoint_cap"] { --chip: var(--wv-color-event-cap);    --chip-rgb: var(--wv-color-event-cap-rgb); }
.wv-filters .wv-filter-chip[data-filter="kill"]           { --chip: var(--wv-color-event-kill);   --chip-rgb: var(--wv-color-event-kill-rgb); }
.wv-filters .wv-filter-chip[data-filter="revive"]         { --chip: var(--wv-color-event-revive); --chip-rgb: var(--wv-color-event-revive-rgb); }
.wv-filters .wv-filter-chip[data-filter="hero_swap"]      { --chip: var(--wv-color-event-swap);   --chip-rgb: var(--wv-color-event-swap-rgb); }
.wv-filters .wv-filter-chip[data-filter="ult"]            { --chip: var(--wv-color-event-ult);    --chip-rgb: var(--wv-color-event-ult-rgb); }
.wv-filters .wv-filter-chip[data-filter="overtime"]       { --chip: var(--wv-color-event-ot);     --chip-rgb: var(--wv-color-event-ot-rgb); }
.wv-filters .wv-filter-chip[data-filter="sub_map_change"] { --chip: var(--wv-color-event-submap); --chip-rgb: var(--wv-color-event-submap-rgb); }
.wv-filters .wv-filter-chip[data-filter="spawn_door"]     { --chip: var(--wv-color-event-spawn);  --chip-rgb: var(--wv-color-event-spawn-rgb); }
.wv-filters .wv-filter-chip[data-filter="round"]          { --chip: var(--wv-color-event-round);  --chip-rgb: var(--wv-color-event-round-rgb); }

/* (legacy note retained) Event colors also appear on the events themselves —
   timeline ticks, event-row dots, killfeed pills — via the same tokens. */

.wv-events-list {
  display: grid;
  gap: 1px;
  background: var(--BORDER_SUBTLE);
  max-height: 360px;
  overflow-y: auto;
}

.wv-event-row {
  display: grid;
  grid-template-columns: 90px 110px 1fr;
  gap: 12px;
  align-items: center;
  padding: 6px 14px;
  background: rgba(var(--surf-4), 0.86);
  border: 1px solid rgba(var(--BORDER_COLOR), 0.18);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.84rem;
  transition: background 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.wv-event-row:hover {
  background: var(--BG_SIDEBAR_ACTIVE);
}

/* Rich event note: character icons + team-coloured player names. Team colour lives on the
   NAME text + small inline icon, never an edge stripe (anti-vibe-code rule). Killer side and
   victim side each take their own team colour; revives use the single team colour. */
.wv-event-note {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}
.wv-ev-icon {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  object-fit: cover;
  flex: 0 0 auto;
}
.wv-ev-name { font-weight: 600; white-space: nowrap; }
.wv-ev-blue { color: var(--accent-cyan-light); }
.wv-ev-red  { color: #FF8B6B; }
.wv-ev-arrow { color: #8a93a3; margin: 0 1px; }
.wv-ev-revive { color: #6BD46B; font-weight: 700; }
.wv-ev-ult { color: #F8C43A; font-weight: 700; font-size: 0.72rem; margin-left: 3px; }
.wv-ev-ultname { color: #F8C43A; font-weight: 700; }
/* Ability / ult icons render bare — NO box (user 2026-06-04: "don't put the ability and ult
   icons in a box"). No background fill, no rounded-rect plate; just the transparent icon art. */
/* Render the ability/ult icons WHITE (user 2026-06-05: "make the ult icons white instead of
   gray"). The source art is gray; brightness(0) invert(1) flattens any icon to a clean white
   silhouette. */
.wv-ev-abilityicon { width: 26px; height: 26px; background: none; border: 0; border-radius: 0;
  filter: brightness(0) invert(1); }
/* The flowing HUD killfeed strip reuses buildEventNote(); keep its row on a single line and
   do NOT clip the leading character icons (the base .wv-kill-name sets overflow:hidden +
   text-overflow:ellipsis for the old text-only label, which would hide the flex icons). */
.wv-kill-name.wv-event-note { display: inline-flex; flex-wrap: nowrap; gap: 4px; overflow: visible; text-overflow: clip; }
.wv-kill-row .wv-ev-icon { width: 22px; height: 22px; }

/* Event-type color USED to be a left-edge stripe — removed per "no colored
   brackets" / anti-vibe-code rule. Type identification now lives in the
   uppercase .wv-event-kind text + a small inside-row dot (.wv-event-dot)
   the JS injects. */

.wv-event-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--FG_MUTED);
  font-weight: 700;
}

.wv-event-kind {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--FG_DIM);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Small inside-row dot — carries the event-type color WITHOUT being a
   left-edge stripe. The dot sits inline next to the uppercase event
   label. Per anti-vibe-code rule, color goes in iconography not in
   bracket-style edges. */
.wv-event-kind::before,
.wv-kill-row[data-type]::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wv-event-dot-color, rgba(255,255,255,0.4));
  flex: 0 0 auto;
  margin-right: 4px;
}

/* Per-type dot color (was the left-border color). */
.wv-event-row[data-type="checkpoint_cap"] .wv-event-kind,
.wv-event-row[data-type="timer_bonus"] .wv-event-kind { --wv-event-dot-color: var(--wv-color-event-cap); }
.wv-event-row[data-type="kill"] .wv-event-kind,
.wv-kill-row[data-type="kill"] { --wv-event-dot-color: var(--wv-color-event-kill); }
.wv-event-row[data-type="hero_swap"] .wv-event-kind,
.wv-kill-row[data-type="hero_swap"] { --wv-event-dot-color: var(--wv-color-event-swap); }
.wv-event-row[data-type="ult"] .wv-event-kind,
.wv-event-row[data-type="ult_used"] .wv-event-kind,
.wv-event-row[data-type="ultimate"] .wv-event-kind,
.wv-kill-row[data-type="ult"],
.wv-kill-row[data-type="ult_used"],
.wv-kill-row[data-type="ultimate"] { --wv-event-dot-color: var(--wv-color-event-ult); }
.wv-event-row[data-type="overtime_on"] .wv-event-kind,
.wv-event-row[data-type="overtime_off"] .wv-event-kind,
.wv-kill-row[data-type="overtime_on"],
.wv-kill-row[data-type="overtime_off"] { --wv-event-dot-color: var(--wv-color-event-ot); }
.wv-event-row[data-type="sub_map_change"] .wv-event-kind,
.wv-event-row[data-type="sub_map_start"] .wv-event-kind,
.wv-kill-row[data-type="sub_map_change"] { --wv-event-dot-color: var(--wv-color-event-submap); }
.wv-event-row[data-type="spawn_door"] .wv-event-kind,
.wv-kill-row[data-type="spawn_door"] { --wv-event-dot-color: var(--wv-color-event-spawn); }
.wv-event-row[data-type="round_end"] .wv-event-kind,
.wv-event-row[data-type="round_start"] .wv-event-kind,
.wv-event-row[data-type="gameplay_start"] .wv-event-kind,
.wv-kill-row[data-type="round_start"],
.wv-kill-row[data-type="round_end"],
.wv-kill-row[data-type="gameplay_start"] { --wv-event-dot-color: var(--wv-color-event-round); }
.wv-event-row[data-type="phase_change"] .wv-event-kind,
.wv-kill-row[data-type="phase_change"] { --wv-event-dot-color: var(--wv-color-event-phase); }
.wv-event-row[data-type="regression"] .wv-event-kind,
.wv-kill-row[data-type="regression"] { --wv-event-dot-color: var(--wv-color-event-regress); }

.wv-event-note {
  color: var(--FG_COLOR);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.wv-event-row.wv-row-active {
  background: rgba(var(--accent-cyan-rgb), 0.14);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-cyan-rgb), 0.35);
}

/* ----- Compact layout under 980px ----- */

@media (max-width: 980px) {
  body[data-page="wevervision"] .wv-formula {
    grid-template-columns: 1fr;
  }

  .wv-card { width: clamp(34px, 6vw, 48px); }
  .wv-objective { min-width: 200px; }
  .wv-objective { grid-template-columns: auto minmax(120px, 1fr) auto; gap: 6px; padding: 6px 10px; }
  .wv-obj-score { font-size: 1.2rem; }

  .wv-killfeed { width: clamp(160px, 38vw, 240px); top: 92px; right: 8px; }
  .wv-kill-row { font-size: 0.68rem; padding: 3px 5px; }

  .wv-event-row { grid-template-columns: 70px 84px 1fr; }
}

/* ----- Pro-team overlay (matchup badge + team-strip banners) ----- */

.wv-matchup-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--FG_COLOR);
  letter-spacing: 0.01em;
}

.wv-matchup-label {
  color: var(--FG_MUTED);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wv-matchup-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(var(--surf-4), 0.55);
  border: 1px solid var(--BORDER_SUBTLE);
}

.wv-matchup-blue {
  border-color: rgba(var(--accent-cyan-light-rgb), 0.4);
  background: rgba(var(--accent-cyan-light-rgb), 0.08);
}

.wv-matchup-red {
  border-color: rgba(255, 90, 107, 0.4);
  background: rgba(255, 90, 107, 0.08);
}

.wv-matchup-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.4);
}

.wv-matchup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.wv-matchup-blue .wv-matchup-dot { background: var(--accent-cyan-light); }
.wv-matchup-red .wv-matchup-dot { background: #FF5A6B; }

.wv-matchup-vs {
  font-size: 0.7rem;
  color: var(--FG_MUTED);
  text-transform: uppercase;
}

.wv-matchup-name {
  color: var(--FG_COLOR);
}

/* Team banners above the in-HUD portraits. Inserted via JS into .wv-hud-top. */

/* Team banners sit on a dedicated row above the cards strip — out of the
   horizontal axis the 6 portraits use. The .wv-hud-banners row is a 3-col
   flex with blue slot | spacer | red slot. */
.wv-hud-banners {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px 4px;
}
.wv-team-banner-slot {
  display: flex;
  align-items: center;
  min-height: 26px;
}
.wv-team-banner-slot.wv-team-blue  { justify-content: flex-start; }
.wv-team-banner-slot.wv-team-red   { justify-content: flex-end; }
.wv-team-banner-spacer { flex: 1 1 auto; }

.wv-team-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(var(--surf-1), 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  flex: 0 0 auto;
  align-self: flex-start;
}

/* Team color lives in the BANNER NAME text, not the border. */
.wv-team-banner.wv-team-blue .wv-team-banner-name { color: var(--accent-cyan-light); }
.wv-team-banner.wv-team-red  .wv-team-banner-name { color: #FF8B6B; }

.wv-team-banner-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
}

.wv-team-banner-name {
  letter-spacing: 0.02em;
}

/* ---------- Post-match player summary modal ---------- */
.wv-player-summary {
  position: fixed;
  inset: 0;
  background: rgba(var(--surf-1), 0.78);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.wv-player-summary.is-open { display: flex; }
.wv-player-summary-card {
  width: min(880px, 94vw);
  max-height: 88vh;
  background: linear-gradient(180deg, rgba(var(--surf-3), 0.96), rgba(var(--surf-2), 0.96));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wv-player-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.wv-player-summary-id {
  display: flex;
  align-items: center;
  gap: 14px;
}
.wv-player-summary-portrait {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}
.wv-player-summary-id h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}
.wv-player-summary-sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wv-player-summary-close {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.7);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  /* Center the × glyph in both axes. Without flex centering the line-height
     and font metrics leave the character slightly above the optical centre. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.wv-player-summary-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.wv-player-summary-now {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}
.wv-ps-now-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.wv-ps-now-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.86);
}
.wv-ps-now-stats strong {
  color: var(--ACCENT_CYAN);
}
.wv-player-summary-ults {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.015);
}
.wv-ps-ult-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.86);
}
.wv-ps-ult-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 12px;
  background: rgba(var(--accent-cyan-rgb), 0.16);
  color: var(--ACCENT_CYAN);
  font-weight: 800;
}
.wv-ps-ult-dash {
  color: rgba(255, 255, 255, 0.4);
}
.wv-ps-ult-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wv-ps-ult-stamp {
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
}
.wv-ps-ult-none {
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
}
.wv-player-summary-heroes {
  padding: 16px 20px 20px;
  overflow-y: auto;
}
.wv-player-summary-heroes h4 {
  margin: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
}
.wv-player-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.92);
}
.wv-player-summary-table th {
  text-align: left;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.wv-player-summary-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.wv-player-summary-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}
.wv-ps-hero {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wv-ps-hero img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
}
.wv-ps-hero small {
  margin-left: 4px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.68rem;
}
.wv-ps-empty {
  text-align: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.45);
}

/* ===================================================================
 * Standalone HUD layout (2026-05-26)
 * ===================================================================
 * Previously the HUD (team cards, objective bar, killfeed, OT banner)
 * was absolutely-positioned over the video. Per user mandate, the HUD
 * now lives ABOVE the video as a static block so the layout works even
 * when no video is loaded (future extractions may not store the source
 * video).
 *
 * Override strategy: change layout containment without touching the
 * original rules. All overlay rules above stay intact — we just unpin
 * the absolute positioning and let the elements flow.
 * =================================================================== */
body[data-page="wevervision"] .wv-stage {
  /* Was: position:relative; aspect-ratio:16/9; overflow:hidden;
     Now: vertical flow, height grows to fit HUD + video. */
  aspect-ratio: auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: auto;
  min-height: 0;
  /* The stage itself flows freely; the video element below has its own
     resize handle so the user can scale playback for testing. */
  resize: none;
}

body[data-page="wevervision"] .wv-stage > #wvVideo {
  position: relative;
  inset: auto;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 100%;          /* JS resize sets an explicit px width (<= HUD width) */
  height: auto;
  align-self: flex-start;   /* left-aligned; the video is the ONLY thing that resizes */
  order: 2;          /* video sits BELOW the HUD */
  flex: 0 0 auto;
}

body[data-page="wevervision"] .wv-stage > .wv-hud {
  position: relative;
  inset: auto;
  order: 1;          /* HUD sits ABOVE the video */
  pointer-events: auto;
  background: rgba(var(--surf-1), 0.65);
  border: 1px solid var(--BORDER_COLOR);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body[data-page="wevervision"] .wv-hud-top {
  position: relative;
  top: auto; left: auto; right: auto;
  padding: 0;
  background: none;
  /* Cards strip + objective bar still grid-of-three: keep that. */
}

body[data-page="wevervision"] .wv-killfeed {
  position: relative;
  top: auto; right: auto; left: auto;
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
}

body[data-page="wevervision"] .wv-ot-banner {
  position: relative;
  top: auto; left: auto; right: auto;
  transform: none;
  margin: 4px auto;
}

/* Resize handle: lives below the video in flow. wevervision.js#bindResize() drags it to set
   ONLY the <video> width -- the HUD bar (objective + portrait strips) is NOT linked and stays
   full width. JS keeps the grabber pinned to the video's bottom-right via margin-left. */
body[data-page="wevervision"] .wv-resize-handle {
  display: block;
  position: relative;
  bottom: auto;
  right: auto;
  margin-top: -22px;     /* overlap the video's bottom-right corner */
  order: 3;              /* below the video */
  z-index: 21;
  align-self: flex-start;  /* margin-left (set by JS) positions it at the video's right edge */
}

/* Loading spinner still covers the video portion when active — keep
   it absolute, but contain it to the video block, not the whole stage. */
body[data-page="wevervision"] .wv-stage > .wv-loading {
  position: absolute;
  /* The loading element is a SIBLING of #wvVideo in the DOM; in flex
     column layout it would push other content. Lock it on top of the
     video area by making the video block a positioning context. */
}

body[data-page="wevervision"] .wv-stage > #wvVideo {
  position: relative;
  z-index: 1;
}

/* ===================================================================
 * Gameplay ↔ Scoreboard view toggle (2026-05-26)
 * =================================================================== */
.wv-build-tag {
  font-size: 0.6rem;
  font-family: "JetBrains Mono", monospace;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.05em;
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
}

.wv-view-toggle {
  display: inline-flex;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 5px;
  overflow: hidden;
}
.wv-view-btn {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.6);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.wv-view-btn + .wv-view-btn { border-left: 1px solid rgba(255,255,255,0.12); }
.wv-view-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.wv-view-btn.is-active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* Standalone "Hide video" toggle — same chrome as the view tabs but lives
   outside the segmented toggle group so it has its own border. */
#wvHideVideoBtn {
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 5px;
}
#wvHideVideoBtn[aria-pressed="true"] {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* When the video is hidden, .wv-stage keeps its 16:9 aspect-ratio box so the
   absolutely-positioned HUD overlay stays in place. The video is just
   removed from the visual stack. */
.wv-stage.wv-video-hidden > #wvVideo {
  display: none;
}

/* Two-tab toggle: Gameplay shows the live HUD over the gameplay video.
   Stats shows the recreated scoreboard ABOVE the stats footage so the user
   can verify the recreation mirrors the in-game post-match screen on the
   same tab. */
body[data-page="wevervision"] .wv-stage[data-view="stats"] > .wv-hud {
  display: none;
}
body[data-page="wevervision"] .wv-stage[data-view="gameplay"] > .wv-scoreboard {
  display: none;
}
body[data-page="wevervision"] .wv-stage[data-view="stats"] > .wv-scoreboard {
  order: 1;
}
body[data-page="wevervision"] .wv-stage[data-view="stats"] > #wvVideo {
  order: 3;     /* stats footage sits BELOW the recreated scoreboard */
}

/* Scoreboard panel — recreation of the in-game TAB scoreboard, scrub-driven. */
.wv-scoreboard {
  order: 2;
  background: linear-gradient(180deg, rgba(13, 18, 32, 0.96), rgba(8, 12, 22, 0.96));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 14px 18px;
  color: #fff;
  font-size: 0.84rem;
}
.wv-sb-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.wv-sb-team-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.wv-sb-team-head.wv-sb-team-blue { justify-content: flex-start; color: var(--accent-cyan-light); }
.wv-sb-team-head.wv-sb-team-red  { justify-content: flex-end;   color: #FF8B6B; }
.wv-sb-team-score {
  font-size: 2.2rem;
  font-weight: 900;
  font-family: "JetBrains Mono", monospace;
  color: #fff;
}
.wv-sb-clock {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  color: rgba(255,255,255,0.85);
}
.wv-sb-table {
  width: 100%;
  border-collapse: collapse;
  /* Locked column widths so cells don't reflow as values (5,722 vs 0) change
     during scrub. Without table-layout:fixed, browsers re-fit per-cell every
     tick which makes the dashboard jitter. */
  table-layout: fixed;
}
.wv-sb-table th {
  text-align: left;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  padding: 4px 6px;
}
.wv-sb-table td {
  padding: 5px 6px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Fixed widths: hero (with portrait) widest, player (with avatar + name) wide,
   stat cells narrow + uniform. Team col absorbs ID badge + label. */
.wv-sb-table col.wv-sb-col-team   { width: 60px; }
.wv-sb-table col.wv-sb-col-hero   { width: 180px; }
.wv-sb-table col.wv-sb-col-name   { width: 200px; }
.wv-sb-table col.wv-sb-col-stat   { width: 60px; }
.wv-sb-table col.wv-sb-col-bignum { width: 80px; }
.wv-sb-table col.wv-sb-col-ult    { width: 80px; }
.wv-sb-table col.wv-sb-col-acc    { width: 80px; }
.wv-sb-table tbody tr.wv-sb-team1 td:first-child::before {
  content: "1";
  display: inline-block;
  background: rgba(var(--accent-cyan-light-rgb), 0.18);
  color: var(--accent-cyan-light);
  font-weight: 800;
  width: 18px;
  text-align: center;
  border-radius: 3px;
  margin-right: 6px;
}
.wv-sb-table tbody tr.wv-sb-team2 td:first-child::before {
  content: "2";
  display: inline-block;
  background: rgba(255, 139, 107, 0.18);
  color: #FF8B6B;
  font-weight: 800;
  width: 18px;
  text-align: center;
  border-radius: 3px;
  margin-right: 6px;
}
.wv-sb-row-divider td { border-top: 2px solid rgba(255,255,255,0.18); }
.wv-sb-hero-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wv-sb-hero-cell img {
  width: 44px;
  height: 44px;
  border-radius: 5px;
  object-fit: cover;
  flex: 0 0 auto;
}
.wv-sb-hero-cell .wv-sb-hero-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wv-sb-hero-cell .wv-sb-hero-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wv-sb-hero-cell .wv-sb-hero-role {
  font-size: 0.66rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Player name column now carries the player's avatar next to the name. */
.wv-sb-player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.wv-sb-player-cell img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.12);
}
.wv-sb-player-cell .wv-sb-player-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wv-sb-row.wv-sb-dead td {
  opacity: 0.55;
}

/* Bump row height now that we have 44px hero portraits. */
.wv-sb-table tbody tr {
  height: 52px;
}

/* ===================================================================
 * Always-dark board under global Day mode (audit 2026-06-17)
 * ===================================================================
 * The replay viewer is an always-dark video/HUD surface. The global
 * Day-mode toggle flips the shell tokens to light values, which wraps
 * this dark board in a light shell. The board's panels mostly draw from
 * --surf-* (NOT flipped in day mode) and explicit dark rgba, so the SAFE
 * fix is to re-pin the day-flipped shell tokens back to their night
 * values for THIS page only — the whole page stays dark regardless of
 * the toggle. (Token values mirror the night :root in styles.css.) No
 * colored edge stripes are introduced.
 *
 * The toggle itself is hidden on this page so users aren't offered a
 * no-op control. */
:root[data-theme="day"] body[data-page="wevervision"] {
  --BG_DARK: #070B13;
  --BG_MID: #0F1625;
  --BG_PANEL: #141B2B;
  --BG_INPUT: #0B111D;
  --BG_CARD: #111A2C;
  --BG_CONSOLE: #080D17;
  --BG_SIDEBAR: #0B111D;
  --BG_SIDEBAR_BUTTON: #111A2C;
  --BG_SIDEBAR_ACTIVE: #18243A;
  --FG_COLOR: #E6EDF3;
  --FG_DIM: #8794AF;
  --FG_MUTED: #A0ABC2;
  --CARD_BORDER_PINK: #8B1E56;
  --CARD_BORDER_CYAN: #197D99;
  --BORDER_COLOR: #243149;
  --BORDER_SUBTLE: #22314A;
  --BUTTON_GHOST: #171D2A;
  --BUTTON_GHOST_HOVER: #1D2638;
  --BUTTON_MUTED: #20283B;
  color-scheme: dark;
}

body[data-page="wevervision"] #themeToggle { display: none; }
