/* Replay page chrome. Panels float over the canvas, so they use a translucent token surface; colours, type and
   components otherwise come from design-system.css. */
:root { --replay-panel: var(--game-glass); --rnav: 52px; }
#radioPanel { position: static; pointer-events: auto; max-width: 320px; padding: 8px 12px; color: var(--game-text); background: var(--replay-panel); border: 1px solid var(--game-line); border-radius: 10px; box-shadow: var(--game-shadow); backdrop-filter: blur(14px) saturate(1.12); }
#radioFeed, #radioMarkers { max-height: 150px; overflow-y: auto; padding-left: 20px; }
@media (min-width: 721px) and (max-width: 1100px) { :root { --rnav: 101px; } }
body { font-family: var(--ds-font); }
#load { position: fixed; z-index: 5; left: 50%; top: calc(var(--rnav) + var(--ds-space-4)); transform: translateX(-50%); width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - var(--rnav) - 32px); overflow: auto; display: grid; gap: var(--ds-space-3); padding: var(--ds-space-5); background: linear-gradient(160deg, var(--ds-surface-2), var(--ds-surface)); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-2); }
#load h1 { margin: 0; }
#load .language-switch { margin: 0; }
#load label { display: grid; gap: var(--ds-space-2); color: var(--ds-text); font-size: var(--ds-fs-sm); font-weight: 700; }
#load .ds-input { min-width: 0; }
#loadError { margin: 0; min-height: 1.4em; color: var(--ds-hot); font-weight: 700; }
#load .hint { margin: 0; color: var(--ds-text-muted); font-size: var(--ds-fs-sm); }
#rhud { position: fixed; inset: 0; pointer-events: none; }
/* Lobby look (#1323): one left column of equal-width panels, the minimap and feed on the right, the timeline bar along the bottom. */
#rtop { position: absolute; top: 12px; left: 16px; display: grid; align-content: start; gap: 8px; width: min(380px, calc(100vw - 32px)); /* stays above the match-analysis panel (bottom 96px) and scrolls when the stack is taller */ max-height: calc(100dvh - 12px - 96px - 48px); overflow-y: auto; scrollbar-width: thin; pointer-events: auto; }
#rhud:has(#ranalytics[open]) #rtop { max-height: calc(100dvh - 12px - 96px - min(36vh, 280px) - 12px); }
#rctl, #rutility, #rsnd { color: var(--game-text); background: var(--replay-panel); border: 1px solid var(--game-line); border-radius: 12px; padding: 8px 12px; box-shadow: var(--game-shadow); backdrop-filter: blur(14px) saturate(1.12); font-size: 13px; }
#rctl { display: flex; flex-wrap: wrap; gap: 4px 12px; }
#rctl .ctl-hud-note { color: var(--game-muted); }
#rzombie { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--game-text); background: var(--replay-panel); border: 1px solid var(--game-line); border-radius: 12px; padding: 8px 12px; box-shadow: var(--game-shadow); font-weight: 700; }
#rzombie[hidden] { display: none; }
#rzombie .zombie-hud-round { color: var(--game-cyan); font: 800 15px/1 var(--ds-font-mono); letter-spacing: .06em; text-transform: uppercase; }
#rzombie .zombie-hud-points { color: var(--game-warning); font-variant-numeric: tabular-nums; }
#rzombie .zombie-hud-alert-downed, #rzombie .zombie-hud-alert-out { color: var(--game-pink); }
#rzombie .zombie-hud-squad { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; }
#rzombie .zombie-hud-chip { padding: 1px 8px; border: 1px solid var(--game-line); border-radius: 999px; font-size: 12px; }
#rzombie .zombie-hud-chip[data-state="down"] { border-color: var(--game-pink); color: var(--game-pink); }
#rzombie .zombie-hud-chip[data-state="dead"] { color: var(--game-muted); text-decoration: line-through; }
#rtop > #zombieMoment { position: static; width: auto; max-width: none; transform: none; text-align: left; }
.zombie-banner { position: fixed; top: 22%; left: 50%; z-index: 6; max-width: 90vw; padding: 10px 22px; transform: translateX(-50%); border: 1px solid var(--game-line); border-radius: 12px; background: var(--game-glass); color: var(--game-text); font: 800 clamp(18px, 4vw, 30px)/1.2 var(--ds-font-display); letter-spacing: .06em; text-align: center; text-transform: uppercase; pointer-events: none; }
#rsnd p { margin: 0 0 8px; color: var(--game-cyan); font-variant-numeric: tabular-nums; }
#roundTimeline { display: flex; flex-wrap: wrap; gap: 5px; }
#roundTimeline button { min-width: 44px; min-height: 36px; padding: 5px 8px; color: var(--game-text); background: var(--game-raised); border: 1px solid var(--game-line); border-radius: 7px; font: 750 11px/1.2 var(--ds-font-display); cursor: pointer; }
#roundTimeline button:hover, #roundTimeline button:focus-visible { border-color: var(--game-cyan); }
#rutility label { color: var(--game-muted); font: 750 11px/1.4 var(--ds-font-display); letter-spacing: .12em; text-transform: uppercase; }
#rutility select { display: block; width: 100%; margin-top: 6px; min-height: 44px; padding: 6px 8px; color: var(--game-text); background: var(--game-raised); border: 1px solid var(--game-line); border-radius: 7px; font: inherit; }
#rutility { pointer-events: auto; }
#utilityViewNote { margin: 4px 0; color: var(--game-muted); font-size: 12px; }
#rblind { position: fixed; inset: 0; pointer-events: none; }
#rblindVeil { position: absolute; inset: 0; background: var(--game-text); }
#rblindCount { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); padding: 8px 18px; border-radius: 9px; background: var(--game-bg); color: var(--game-text); border: 1px solid var(--game-line); font: 800 22px/1.2 var(--ds-font-mono); }
#rtitle, #rscore { color: var(--game-text); background: var(--replay-panel); border: 1px solid var(--game-line); border-radius: 12px; padding: 8px 12px; box-shadow: var(--game-shadow); backdrop-filter: blur(14px) saturate(1.12); }
#rtitle { padding: 12px 14px; color: var(--game-text); border-color: var(--game-frame); font: 800 15px/1.3 var(--ds-font-display); letter-spacing: .08em; text-transform: uppercase; overflow-wrap: anywhere; }
#directorShot { justify-self: start; margin: 0; padding: 6px 12px; color: var(--game-cyan); background: var(--replay-panel); border: 1px solid var(--game-line); border-radius: 999px; box-shadow: var(--game-shadow); font: 700 12px/1.2 var(--ds-font-display); letter-spacing: .06em; }
#directorShot[hidden] { display: none; }
#rtitle::before { display: block; width: 36px; height: 3px; margin-bottom: 6px; content: ""; border-radius: 2px; background: var(--game-pink); }
#replayParticipants { padding: 8px 12px; color: var(--game-text); background: var(--replay-panel); border: 1px solid var(--game-line); border-radius: 12px; box-shadow: var(--game-shadow); backdrop-filter: blur(14px) saturate(1.12); overflow-wrap: anywhere; }
#replayParticipants h2 { margin: 0 0 4px; color: var(--game-cyan); font: 750 11px/1.4 var(--ds-font-display); letter-spacing: .12em; text-transform: uppercase; }
#replayParticipants ul { margin: 0; padding-left: 18px; font-size: 12px; }
#replayActivity { padding: 0 10px; color: var(--game-text); background: var(--replay-panel); border: 1px solid var(--game-line); border-radius: 12px; box-shadow: var(--game-shadow); pointer-events: auto; }
#replayActivity > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--game-cyan); font: 750 11px/1.35 var(--ds-font-display); letter-spacing: .1em; text-transform: uppercase; }
#replayActivityContents { display: grid; gap: 8px; padding-bottom: 8px; }
#rshare { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; background: var(--replay-panel); border: 1px solid var(--game-line); border-radius: 12px; box-shadow: var(--game-shadow); backdrop-filter: blur(14px) saturate(1.12); pointer-events: auto; }
#replayAudioSettings { padding: 8px 12px; color: var(--game-text); background: var(--replay-panel); border: 1px solid var(--game-line); border-radius: 12px; box-shadow: var(--game-shadow); backdrop-filter: blur(14px) saturate(1.12); font-size: 13px; pointer-events: auto; }
#replayAudioSettings summary { min-height: 44px; cursor: pointer; font-weight: 600; }
#replayAudioControls { margin-top: 6px; }
#replayAudioSettings button { min-height: 44px; padding: 6px 10px; background: var(--game-raised); color: var(--game-text); border: 1px solid var(--game-line); border-radius: 7px; font: inherit; cursor: pointer; }
#replayAudioSettings button:hover, #replayAudioSettings button:focus-visible { border-color: var(--game-cyan); }
#replayAudioSettings input { accent-color: var(--game-pink); }
#replaySoundNote { margin: 4px 0 0; color: var(--game-muted); font-size: 12px; }
#rshare button, #shareUrl { min-width: 0; min-height: 44px; padding: 6px 10px; background: var(--game-raised); color: var(--game-text); border: 1px solid var(--game-line); border-radius: 8px; font: inherit; }
#rshare button, #rshare a { padding: 6px 12px; font: 800 11px/1.2 var(--ds-font-display); letter-spacing: .08em; text-transform: uppercase; }
#rshare button { cursor: pointer; }
#rshare button:hover, #rshare button:focus-visible { border-color: var(--game-cyan); }
#rshare button[aria-pressed="true"] { border-color: var(--game-pink); color: var(--game-pink); }
#rshare a { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; color: var(--game-cyan); border: 1px solid var(--game-line); border-radius: 8px; text-decoration: none; }
#rshare a:hover, #rshare a:focus-visible { border-color: var(--game-cyan); }
#rshare label { display: inline-flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; padding-inline: 4px; font-size: 14px; color: var(--game-muted); }
#rshare label input { width: 24px; height: 24px; margin: 0; accent-color: var(--game-pink); }
#rshare label input:focus-visible { outline: 3px solid var(--game-cyan); outline-offset: 3px; }
#rshare label:has(#followCameraStyle) { display: grid; align-items: stretch; }
#followCameraStyle { min-height: 44px; max-width: 100%; padding: 6px 8px; color: var(--game-text); background: var(--game-raised); border: 1px solid var(--game-line); border-radius: 7px; font: inherit; }
#shareUrl { flex: 1 1 100%; width: 100%; resize: none; overflow-wrap: anywhere; }
#shareStatus { color: var(--game-muted); font-size: 11px; }
#rscore { width: 100%; box-sizing: border-box; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; font-size: 13px; }
#rscore th, #rscore td { padding: 4px 8px; color: var(--game-text); text-align: left; }
#rscore tbody tr + tr > * { border-top: 1px solid var(--game-line); }
#rscore th { color: var(--game-muted); font: 750 10px/1.3 var(--ds-font-display); letter-spacing: .12em; text-transform: uppercase; }
#rscore th[scope="row"] { font: inherit; letter-spacing: normal; text-transform: none; }
#rscore td.dead { color: var(--game-muted); text-decoration: line-through; }
#rscore th.dead { text-decoration: line-through; }
#rmap { position: fixed; z-index: 8; top: 64px; right: 16px; width: min(220px, calc(100vw - 32px)); margin: 0; padding: 6px; color: var(--game-text); background: var(--replay-panel); border: 1px solid var(--game-frame); border-radius: 12px; box-shadow: var(--game-shadow); backdrop-filter: blur(14px) saturate(1.12); }
#rminimap { display: block; width: 100%; height: auto; background: var(--game-bg); border: 1px solid var(--game-line); border-radius: 6px; }
#rmap figcaption { padding-top: 5px; color: var(--game-muted); font: 650 10px/1.4 var(--ds-font-display); }
#rfeed { position: fixed; right: 16px; top: 264px; max-height: calc(100dvh - 280px); overflow-y: auto; margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; justify-items: stretch; width: min(280px, calc(100vw - 32px)); }
#rfeed li { display: flex; min-height: 44px; align-items: center; color: var(--game-text); background: var(--replay-panel); border: 1px solid var(--game-line); border-left: 3px solid var(--game-pink); border-radius: 8px; padding: 6px 10px; font: 700 12px/1.35 var(--ds-font-display); box-shadow: var(--game-shadow); backdrop-filter: blur(14px) saturate(1.12); }
#ranalytics { position: absolute; left: 16px; bottom: 96px; width: min(380px, calc(100vw - 32px)); max-height: min(36vh, 280px); overflow: auto; pointer-events: auto; color: var(--game-text); background: var(--replay-panel); border: 1px solid var(--game-line); border-radius: 12px; box-shadow: var(--game-shadow); backdrop-filter: blur(14px) saturate(1.12); }
#ranalytics summary { padding: 10px 12px; cursor: pointer; color: var(--game-cyan); font: 750 12px/1.3 var(--ds-font-display); letter-spacing: .12em; text-transform: uppercase; }
.ranalytics-body { display: grid; gap: 8px; padding: 0 12px 12px; }
.ranalytics-body > label { color: var(--game-muted); font-size: 12px; }
#analysisPlayer { width: 100%; min-height: 44px; padding: 6px 8px; background: var(--game-raised); color: var(--game-text); border: 1px solid var(--game-line); border-radius: 7px; font: inherit; }
#ranalytics figure { margin: 0; }
#rheatmap { display: block; width: 100%; height: auto; background: var(--game-bg); border: 1px solid var(--game-line); border-radius: 6px; }
#rheatmapCaption { margin-top: 4px; color: var(--game-muted); font-size: 11px; }
#rstats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#rstats div { min-width: 0; padding: 6px 8px; background: var(--game-raised); border: 1px solid var(--game-line); border-radius: 6px; }
#rstats dt { color: var(--game-muted); font-size: 11px; }
#rstats dd { margin: 2px 0 0; font-size: 13px; font-variant-numeric: tabular-nums; }
#killcamHeading { margin: 2px 0 5px; font-size: 13px; }
#rkillcams { display: grid; gap: 4px; max-height: 120px; overflow: auto; margin: 0; padding: 0; list-style: none; }
#rkillcams li { display: flex; gap: 4px; }
#rkillcams li button:first-child { flex: 1; min-width: 0; }
#rkillcams button { min-height: 44px; padding: 6px 8px; text-align: left; background: var(--game-raised); color: var(--game-text); border: 1px solid var(--game-line); border-radius: 7px; font: inherit; cursor: pointer; }
#rkillcams button:disabled, #rshare button:disabled { opacity: .5; cursor: default; }
#rkillcams button:hover, #rkillcams button:focus-visible { border-color: var(--game-cyan); }
#rkillcamStatus { min-height: 1.2em; margin: 4px 0 0; color: var(--game-muted); font-size: 11px; }
#rbar { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; gap: 10px; align-items: center; color: var(--game-text); background: var(--replay-panel); border: 1px solid var(--game-frame); border-radius: 12px; padding: 6px 14px; box-shadow: var(--game-shadow); backdrop-filter: blur(14px) saturate(1.12); pointer-events: auto; }
#camGroup { display: contents; }
#rbar > button, #rbar select { min-height: 44px; background: var(--game-raised); color: var(--game-text); border: 1px solid var(--game-line); border-radius: 8px; padding: 6px 10px; font: 700 12px/1.2 var(--ds-font-display); letter-spacing: .06em; }
/* Play/pause is the bar's one primary control, in the lobby's pink. */
#rbar > #playBtn { min-width: 48px; color: var(--game-pink-ink); background: var(--game-pink); border-color: var(--game-pink); font-size: 15px; }
#rbar > #playBtn:hover { border-color: var(--game-pink); box-shadow: var(--game-pink-glow); }
#rbar button:hover, #rbar select:hover { border-color: var(--game-cyan); }
#scrubTimeline { position: relative; display: flex; flex: 1; align-items: flex-end; min-width: 80px; height: 54px; padding: 0 8px; }
#scrub { flex: 1; width: 100%; min-width: 0; height: 20px; margin: 0; accent-color: var(--game-pink); }
#timelineMarkers { position: absolute; z-index: 2; inset: 0 8px auto; height: 34px; pointer-events: none; }
#scrubTimeline:has(#timelineMarkers:empty) { align-items: center; height: 44px; }
#timelineMarkers button { position: absolute; top: 2px; display: inline-flex; width: 22px; height: 22px; min-width: 22px; min-height: 22px; align-items: center; justify-content: center; transform: translateX(-50%); padding: 0; border: 2px solid var(--game-bg); border-radius: 50%; color: var(--game-pink-ink); font: 800 10px/1 var(--ds-font-display); box-shadow: 0 1px 4px #0009; cursor: pointer; pointer-events: auto; }
#timelineMarkers button::after { position: absolute; top: 100%; left: 50%; width: 2px; height: 12px; margin-left: -1px; content: ""; background: inherit; opacity: .75; }
#timelineMarkers .timeline-marker-kill { background: var(--game-pink); }
#timelineMarkers .timeline-marker-multikill { width: 28px; min-width: 28px; border-radius: 7px; background: var(--game-warning); color: var(--game-bg); }
#timelineMarkers .timeline-marker-capture { background: var(--game-cyan); color: var(--game-bg); }
#timelineMarkers .timeline-marker-grenade-hit { background: var(--game-blue); color: var(--game-bg); }
#timelineMarkers .timeline-marker-wave { background: var(--game-warning); color: var(--game-bg); }
#timelineMarkers .timeline-marker-down { background: var(--game-pink); color: var(--game-bg); }
#timelineMarkers button:hover, #timelineMarkers button:focus-visible { outline: 2px solid var(--game-cyan); outline-offset: 2px; }
#rtime { font-variant-numeric: tabular-nums; color: var(--game-cyan); font: 700 13px/1.2 var(--ds-font-mono); white-space: nowrap; }
/* Desktop: the panel stack and Match analysis share one left column, so a tall stack scrolls instead of running under analysis. */
@media (min-width: 821px) and (min-height: 501px) {
  #rhud { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 16px 96px; box-sizing: border-box; }
  #rtop { position: static; flex: 0 1 auto; min-height: 0; overflow-y: auto; pointer-events: auto; }
  /* Analysis gives up its height first (it scrolls itself) and keeps at least its summary row. */
  #ranalytics { position: static; flex: 0 1000 auto; min-height: 40px; margin-top: auto; }
}
@media (max-width: 600px) {
  #rtop { top: 8px; left: 8px; gap: 4px; }
  #rmap { width: min(184px, calc(100vw - 16px)); }
  #rscore { font-size: 11px; }
  #ranalytics { left: 8px; right: 8px; bottom: calc(248px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: 42vh; }
  #rbar { grid-template-columns: 48px minmax(72px, 88px) minmax(0, 1fr); }
  #scrubTimeline { grid-column: 1 / -1; }
  #rtime { grid-column: 3; grid-row: 1; justify-self: end; }
  #camGroup { grid-column: 1 / -1; grid-row: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  #camGroup select { width: 100%; min-height: 44px; }
  #timelineMarkers button { width: 12px; min-width: 12px; height: 12px; min-height: 12px; border-width: 1px; font-size: 0; }
  #timelineMarkers button::after { width: 1px; height: 6px; margin-left: 0; }
  #timelineMarkers .timeline-marker-multikill { width: 16px; min-width: 16px; }
}

@media (max-width: 820px), (max-height: 500px) {
  #rtop { top: 8px; left: 8px; right: 8px; max-height: calc(50dvh - 72px); overflow: auto; pointer-events: auto; }
  #rtitle, #rscore, #rfeed li { overflow-wrap: anywhere; }
  #rscore { width: 100%; table-layout: fixed; }
  #rscore th, #rscore td { padding: 2px 4px; }
  #rshare button, #rshare a, #rshare label, #replayAudioSettings summary, #replayAudioSettings button, #replayAudioSettings input, #ranalytics summary, #analysisPlayer, #rkillcams button { min-height: 44px; }
  #rfeed { top: 8px; right: 8px; max-width: calc(100vw - 16px); }
  #rmap { position: static; }
  #rfeed:empty { display: none; }
  #ranalytics { left: 8px; right: 8px; bottom: calc(146px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: calc(50dvh - 72px); }
  #rbar { left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: 44px 70px minmax(0, 1fr); gap: 6px; padding: 8px; }
  #rbar > button, #rbar select, #scrubTimeline { min-width: 0; width: 100%; min-height: 44px; margin: 0; }
  #scrubTimeline { grid-column: 3; height: 62px; }
  #scrub { width: 100%; min-height: 44px; margin: 0; }
  #rtime { grid-column: 1 / 3; }
  #camGroup { grid-column: 3; display: flex; gap: 6px; min-width: 0; }
  #camGroup select { flex: 1 1 0; width: auto; }
}
#rkeys { padding: 0 12px; color: var(--game-muted); background: var(--replay-panel); border: 1px solid var(--game-line); border-radius: 12px; font-size: 12px; pointer-events: auto; }
#rkeys summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--game-cyan); font: 750 11px/1.35 var(--ds-font-display); letter-spacing: .1em; text-transform: uppercase; }
#rkeys ul { margin: 0 0 10px; padding-left: 18px; }

@media (max-width: 820px), (max-height: 500px) {
  /* Keep the minimap and feed together in the scrolling flow on short or narrow screens. */
  #rmap { position: static; }
  #rfeed { position: static; max-width: 100%; justify-items: stretch; }
  #rfeed li { min-width: 0; }
  #rtop { min-width: 0; }
}

@media (max-width: 600px) {
  /* Leave room above the two-row camera controls on phones. */
  #ranalytics { bottom: calc(max(250px, 33vh) + env(safe-area-inset-bottom, 0px)); }
  #camGroup { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); }
  #camGroup select { width: 100%; }
}
