/* v1.9 replay: replay viewer, kill cam and clip export (js/replay.js). */
.rp { position: fixed; inset: 0; z-index: 120; background: #050705; display: flex; flex-direction: column; color: var(--text); font-family: var(--body); user-select: none; -webkit-user-select: none; }
.rp-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; }
.rp-stage:active { cursor: grabbing; }
.rp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rp-3d { position: absolute; inset: 0; background: #050705; }
.rp-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 26px; background: linear-gradient(rgba(4,7,5,0.88), rgba(4,7,5,0)); pointer-events: none; }
.rp-top > * { pointer-events: auto; }
.rp-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.rp-title b { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: 0.06em; color: #F3F6F2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-rec { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; color: var(--muted); }
.rp-rec i, .kc-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); animation: rp-blink 1.2s steps(2) infinite; }
@keyframes rp-blink { 50% { opacity: 0.25; } }
.rp-x { width: 40px; height: 40px; flex: 0 0 auto; background: rgba(7,10,8,0.8); border: 1px solid #2B3A2F; color: #D9E0DA; font-size: 16px; }
.rp-x:hover { border-color: var(--muted); }
.rp-ctl { flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #080C09; border-top: 1px solid var(--line); }
.rp-row { display: flex; align-items: center; gap: 12px; }
.rp-play { width: 44px; height: 40px; flex: 0 0 auto; background: var(--green); border: 0; color: #0B0F0C; font-size: 15px; font-weight: 800; }
.rp-scrub { flex: 1; height: 40px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.rp-track { position: relative; width: 100%; height: 6px; background: #1A241D; border-radius: 3px; }
.rp-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green-dim); border-radius: 3px; }
.rp-head { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(124,255,154,0.18); }
.rp-marks i { position: absolute; top: -5px; width: 2px; height: 16px; margin-left: -1px; background: var(--red); opacity: 0.9; }
.rp-marks i.a { background: var(--amber); } .rp-marks i.d { background: #8EC0FF; }
.rp-time { flex: 0 0 auto; min-width: 86px; text-align: right; font-family: var(--mono); font-size: 12px; color: #B4C0B6; font-variant-numeric: tabular-nums; }
.rp-tools { flex-wrap: wrap; gap: 8px; }
.rp-speed { display: flex; }
.rp-speed button, .rp-btn, .rp-cam { height: 36px; padding: 0 12px; background: transparent; border: 1px solid #2B3A2F; color: #B4C0B6; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; }
.rp-speed button + button { border-left: 0; }
.rp-speed button.on, .rp-btn.on { color: var(--green); border-color: #2E7A47; background: rgba(124,255,154,0.08); }
.rp-cam { background: #0B110D; color: #D9E0DA; max-width: 220px; }
.rp-btn:hover, .rp-speed button:hover { color: #F3F6F2; }
.rp-btn.primary { margin-left: auto; background: var(--amber); border-color: var(--amber); color: #120D02; font-weight: 600; }
.rp-btn.primary:hover { filter: brightness(1.08); color: #120D02; }
.rp-modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3,5,4,0.72); z-index: 2; }
.rp-card { width: min(520px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 22px; background: var(--panel-solid); border: 1px solid #2B3A2F; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.rp-card h3 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: 0.08em; color: #F3F6F2; }
.rp-card p { margin: 0; color: #B4C0B6; font-size: 14px; line-height: 1.5; }
.rp-sub { font-family: var(--mono); font-size: 11px !important; letter-spacing: 0.06em; color: var(--muted) !important; }
.rp-opt { display: flex; flex-direction: column; gap: 6px; }
.rp-opt > span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--muted); }
.rp-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-seg button { flex: 1; min-height: 44px; padding: 6px 10px; background: transparent; border: 1px solid #2B3A2F; color: #D9E0DA; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: 0.08em; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.rp-seg button small { font-family: var(--mono); font-weight: 400; font-size: 9px; letter-spacing: 0.08em; color: var(--muted); }
.rp-seg button.on { border-color: var(--green); color: var(--green); background: rgba(124,255,154,0.07); }
.rp-seg button:disabled { opacity: 0.35; cursor: default; }
.rp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rp-actions .btn { flex: 1 1 auto; }
.rp-prog { height: 8px; background: #1A241D; border-radius: 4px; overflow: hidden; }
.rp-prog i { display: block; width: 0; height: 100%; background: var(--amber); transition: width 0.2s linear; }
.rp-video { width: 100%; max-height: 52vh; background: #000; border: 1px solid #2B3A2F; object-fit: contain; }
/* the borrowed 3D view (#pov) fills its host */
.rp-pov { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; border: 0 !important; box-shadow: none !important; background: #050705; display: block !important; cursor: default !important; z-index: 0 !important; }
.rp-pov canvas { position: absolute; left: 0; top: 0; width: 100% !important; height: 100% !important; }
.rp-pov #pov-label { display: none; }
.rp-3d .rp-pov #pov-overlay { top: 0; }
.rp-3d { padding-top: 0; }

/* Kill cam */
.rp-killcam { position: fixed; inset: 0; z-index: 130; background: #000; cursor: pointer; touch-action: none; animation: kc-in 0.25s ease-out; }
@keyframes kc-in { from { opacity: 0; } to { opacity: 1; } }
.kc-stage { position: absolute; inset: 0; }
.kc-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%); }
.kc-bar { position: absolute; left: 0; right: 0; height: 11vh; min-height: 52px; background: #000; display: flex; align-items: center; gap: 16px; padding: 0 20px; pointer-events: none; }
.kc-bar.top { top: 0; animation: kc-bar-top 0.35s ease-out; } .kc-bar.bottom { bottom: 0; animation: kc-bar-bot 0.35s ease-out; }
@keyframes kc-bar-top { from { transform: translateY(-100%); } } @keyframes kc-bar-bot { from { transform: translateY(100%); } }
.kc-tag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.26em; color: var(--red); }
.kc-who { font-family: var(--display); font-weight: 800; font-size: clamp(18px, 3vw, 28px); letter-spacing: 0.08em; color: #F3F6F2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-rate { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--amber); letter-spacing: 0.1em; }
.kc-cap { font-family: var(--display); font-weight: 800; font-size: clamp(18px, 3.2vw, 30px); letter-spacing: 0.12em; color: var(--amber); }
.kc-hint { margin-left: auto; font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--muted); }
.kc-off { pointer-events: auto; height: 32px; padding: 0 12px; background: transparent; border: 1px solid #2B3A2F; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; }
.kc-off:hover { color: #F3F6F2; border-color: var(--muted); }
.rp-killcam .rp-pov #pov-overlay { opacity: 0.95; }

@media (max-width: 720px) {
  .rp-top { padding: 10px 12px 22px; }
  .rp-title { flex-direction: column; gap: 2px; }
  .rp-title b { font-size: 19px; max-width: calc(100vw - 90px); }
  .rp-ctl { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  .rp-row { gap: 10px; }
  .rp-time { min-width: 72px; font-size: 11px; }
  .rp-tools { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
  .rp-cam { max-width: none; width: 100%; }
  .rp-btn.primary { margin-left: 0; grid-column: 1 / -1; }
  .rp-speed button, .rp-btn, .rp-cam { height: 40px; padding: 0 10px; }
  .rp-speed button { min-width: 48px; }
  .kc-bar { gap: 10px; padding: 0 14px; flex-wrap: wrap; align-content: center; row-gap: 4px; }
  .kc-hint { display: none; }
  .kc-who { font-size: 18px; }
  .kc-cap { font-size: 18px; }
  .kc-off { height: 30px; margin-left: auto; }
}
