/* Orbit Replay — replay booth chrome
   tokens: mat slate bg, replay amber accent, camera hues carry identity */
:root {
  --bg: #101318;
  --panel: #1a1f27;
  --panel-2: #151a21;
  --line: #2a313c;
  --text: #e8ecf2;
  --muted: #8a94a6;
  --amber: #ffb020;
  --amber-dim: #b57708;
  --ok: #3fd47f;
  --radius: 14px;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --disp: "Chakra Petch", var(--sans);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------------- top bar ---------------- */
.bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.06em;
}
.brand span { color: var(--amber); font-weight: 500; margin-left: 2px; }
.session {
  color: var(--muted);
  font-size: 13px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.genlock {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}
.genlock i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
}
.genlock i.good { background: var(--ok); box-shadow: 0 0 6px var(--ok); }

/* ---------------- stage ---------------- */
main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 20px 22px 8px; }
.stage-wrap { display: flex; justify-content: center; }
.stage {
  position: relative;
  width: min(100%, calc(68vh * 16 / 9));
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  outline: none;
}
.stage:focus-visible { border-color: var(--amber); }
.stage.dragging { cursor: grabbing; }
.videos, .videos video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.videos video { object-fit: cover; opacity: 0; pointer-events: none; }

.hud {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  pointer-events: none;
}
.badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 12, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--disp);
  font-size: 13px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
}
.badge i { width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.badge span { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.tc {
  font-family: var(--mono);
  font-size: 15px;
  background: rgba(10, 12, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 12px;
  backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}

.hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: rgba(10, 12, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 7px 16px;
  font-family: var(--disp);
  font-size: 13px;
  letter-spacing: 0.06em;
  pointer-events: none;
  animation: hintPulse 2.4s ease-in-out infinite;
  transition: opacity 0.5s;
}
.hint.gone { opacity: 0; animation: none; }
@keyframes hintPulse {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

.loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(12, 14, 18, 0.9);
  transition: opacity 0.45s;
  z-index: 5;
}
.loader.gone { opacity: 0; pointer-events: none; }
.loader-ring {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--amber);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ---------------- control deck ---------------- */
.deck {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-top: 14px;
}

.dial-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
#dial { width: 92px; height: 92px; cursor: grab; outline: none; touch-action: none; }
#dial:focus-visible .dial-track { stroke: var(--amber); }
#dial.dragging { cursor: grabbing; }
.dial-track { fill: none; stroke: var(--line); stroke-width: 2; }
.dial-dot { cursor: pointer; stroke: rgba(0, 0, 0, 0.5); stroke-width: 1; transition: r 0.15s; }
.dial-dot.on { stroke: #fff; stroke-width: 1.5; }
.needle { stroke: var(--amber); stroke-width: 2.5; stroke-linecap: round; }
.needle-hub { fill: var(--amber); }
.dial-label {
  font-family: var(--disp);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.transport { display: flex; align-items: center; gap: 8px; }
.ctl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 38px; height: 38px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ctl:hover { border-color: var(--muted); }
.ctl:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.ctl svg { width: 17px; height: 17px; }
.ctl.big { width: 48px; height: 48px; border-radius: 12px; background: var(--amber); color: #14161a; border-color: var(--amber); }
.ctl.big:hover { background: #ffc14d; }
.ctl.big svg { width: 21px; height: 21px; }

.timeline { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 200px; }
.time { font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); }
.dim { color: var(--muted); }

input[type="range"] {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--amber);
  border: none;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--amber);
  border: none;
}
input[type="range"]:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.rate { display: flex; gap: 6px; }
.chip {
  width: auto;
  padding: 0 11px;
  font-family: var(--mono);
  font-size: 12.5px;
  height: 32px;
}
.chip.on { border-color: var(--amber); color: var(--amber); }

/* ---------------- explainer ---------------- */
.explain {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 26px;
}
.ex {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.ex h3 {
  margin: 0 0 6px;
  font-family: var(--disp);
  font-size: 14.5px;
  letter-spacing: 0.04em;
  color: var(--amber);
}
.ex p { margin: 0; color: var(--muted); font-size: 13.5px; }
.ex code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

/* ---------------- footer ---------------- */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 22px 22px;
  font-size: 12.5px;
  color: var(--muted);
}
.foot strong { color: var(--text); font-weight: 600; }

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
  .deck { flex-wrap: wrap; justify-content: center; row-gap: 14px; }
  .timeline { order: 4; flex-basis: 100%; }
  .explain { grid-template-columns: 1fr; }
  .session { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hint { animation: none; }
  .loader-ring { animation-duration: 1.8s; }
}
