:root { color-scheme: dark; background: #000; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #000; }
#cast-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
#status {
  position: fixed;
  left: 50%;
  bottom: 5vh;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: rgba(255, 255, 255, .72);
  font: 500 20px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  pointer-events: none;
}
#status[hidden] { display: none; }
.stream-loading {
  position: fixed;
  z-index: 7;
  right: 32px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(8, 10, 15, .68);
  color: rgba(255, 255, 255, .78);
  font: 500 17px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  pointer-events: none;
}
.stream-loading[hidden] { display: none; }
.stream-loading .catchup-ring-track { stroke: rgba(255, 255, 255, .22); }
.stream-loading .catchup-ring-progress { stroke: #fff; }
#remote-render-canvas {
  position: fixed;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  image-rendering: auto;
}
#remote-render-canvas[hidden] { display: none; }
#probe-diagnostics {
  position: fixed;
  top: 2.5vh;
  left: 2.5vw;
  z-index: 4;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .52);
  color: rgba(255, 255, 255, .82);
  font: 500 15px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  pointer-events: none;
}
#probe-diagnostics[hidden] { display: none; }


/* Instant Beam-style catch-up overlay. Deliberately independent of the delayed HLS path. */
.catchup {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: 30px;
  width: min(440px, 40vw);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 15px;
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: 15px;
  background: rgba(8, 10, 15, .72);
  box-shadow: 0 12px 38px rgba(0, 0, 0, .28);
  backdrop-filter: blur(12px);
  color: #fff;
  pointer-events: none;
}
.catchup[hidden] { display: none; }
.catchup-copy { flex: 1; min-width: 0; }
.catchup-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: clamp(15px, 1vw, 20px); font-weight: 650; }
.catchup-time { color: rgba(255, 255, 255, .72); font-variant-numeric: tabular-nums; white-space: nowrap; }
.catchup-detail { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, .76); font-size: clamp(13px, .88vw, 17px); }
.catchup-ring { width: 18px; height: 18px; flex: 0 0 18px; overflow: visible; transform: rotate(-90deg); }
.catchup-ring-track, .catchup-ring-progress { fill: none; stroke-width: 2.2; }
.catchup-ring-track { stroke: rgba(255, 255, 255, .24); }
.catchup-ring-progress { stroke: #fff; stroke-linecap: round; stroke-dasharray: 47.124; stroke-dashoffset: 47.124; transition: stroke-dashoffset 220ms linear; }
.catchup-ring.is-indeterminate { animation: catchup-ring-spin 900ms linear infinite; }
.catchup-ring.is-indeterminate .catchup-ring-progress { stroke-dasharray: 13 34.124; stroke-dashoffset: 0 !important; transition: none; }
@keyframes catchup-ring-spin { to { transform: rotate(270deg); } }
@media (max-aspect-ratio: 4/3) {
  .catchup { bottom: 20px; width: min(440px, 58vw); }
}
