:root {
  --bg: #0b0d0e;
  --panel: rgba(20, 24, 26, 0.9);
  --panel-solid: #15191b;
  --btn: rgba(255, 255, 255, 0.07);
  --btn-hover: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef2f0;
  --muted: #9aa6a2;
  --on: #2f9e5b;
  --progress: #e0453a;
  --kick: #f2c230;
  --bounce: #3aa0e8;
  --other: #d8dcda;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 13px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
button, select { font: inherit; color: inherit; }

/* the view fills the window (letterboxed to the shot camera's aspect); the controls float over it */
#stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; }
#view { display: block; }
/* no backdrop-filter: blurring the moving 3D view under the panels cost ~35 ms a frame (51 -> 17 ms, 2026-11-22) */
.panel { background: var(--panel); border-radius: 8px; }

/* top left: title */
#titleBox { position: fixed; top: 18px; left: 20px; min-width: 260px; max-width: min(500px, 45vw); padding: 9px 18px 10px; }
#title { font-size: 20px; font-weight: 650; letter-spacing: .1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#subtitle { color: var(--muted); font-size: 13px; margin-top: 1px; }
#subtitle:empty { display: none; }

/* top right: camera / quality / full */
#topRight { position: fixed; top: 22px; right: 20px; display: flex; gap: 12px; align-items: stretch; }
.drop { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 5px 34px 6px 14px; cursor: pointer; }
.drop .cap { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); pointer-events: none; }
.drop select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; outline: 0; padding: 0;
  font-size: 15.5px; font-weight: 600; cursor: pointer; min-width: 90px; }
.drop select option { background: var(--panel-solid); color: var(--text); font-weight: 400; }
.drop::after { content: ""; position: absolute; right: 13px; top: 50%; margin-top: -3px; border: 6px solid transparent;
  border-top: 7px solid var(--text); border-bottom: 0; pointer-events: none; }
#topRight .drop:first-child select { min-width: 200px; }
.drop:hover, .btn:hover { background: rgba(32, 38, 40, 0.92); }
.btn { display: flex; align-items: center; gap: 8px; border: 0; padding: 0 22px 0 14px; cursor: pointer; font-size: 15.5px; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }

/* bottom bar */
#bar { position: fixed; left: 20px; right: 20px; bottom: 16px; height: 66px; display: flex; align-items: center; gap: 8px;
  padding: 0 16px; }
.icon { width: 46px; height: 44px; border: 0; border-radius: 6px; background: var(--btn); display: grid; place-items: center;
  cursor: pointer; padding: 0; flex: none; }
.icon:hover { background: var(--btn-hover); }
.icon.play { width: 56px; background: rgba(255, 255, 255, 0.16); }
.icon svg { width: 19px; height: 19px; fill: currentColor; }
#play .i-pause { display: none; }
#play.playing .i-pause { display: block; }
#play.playing .i-play { display: none; }
.mono { font-variant-numeric: tabular-nums; }
#clock { margin: 0 14px 0 8px; font-size: 15px; white-space: nowrap; flex: none; }

#timeline { position: relative; flex: 1; min-width: 80px; height: 44px; margin: 0 18px 0 22px; cursor: pointer; touch-action: none; }
#timeline .track { position: absolute; left: 0; right: 0; top: 50%; height: 5px; margin-top: -2px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.28); overflow: hidden; }
#timeline .fill { height: 100%; width: 0; background: var(--progress); }
#timeline .knob { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); left: 0; }

.drop.small { background: var(--btn); border-radius: 6px; height: 44px; padding: 3px 30px 4px 12px; margin-right: 6px; }
.drop.small select { font-size: 14px; min-width: 44px; }
.drop.small::after { right: 11px; }
.toggle { height: 44px; min-width: 110px; border: 0; border-radius: 6px; padding: 0 16px; cursor: pointer; font-size: 16px;
  background: var(--btn); color: var(--muted); flex: none; }
.toggle:hover { background: var(--btn-hover); }
.toggle.on { background: var(--on); color: #fff; font-weight: 600; }
.toggle.on:hover { background: #36ad66; }

/* overhead map: bottom centre, above the bar */
#radar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 92px; display: block; pointer-events: none; }
#radar.hide { display: none; }

/* tooltips: name + shortcut (shortcuts only here) */
#tip { position: fixed; z-index: 10; pointer-events: none; background: rgba(10, 12, 13, 0.94); color: var(--text);
  padding: 7px 11px; border-radius: 5px; font-size: 13px; white-space: nowrap; opacity: 0; transition: opacity .12s; }
#tip.show { opacity: 1; }
#tip kbd { font: inherit; color: var(--muted); margin-left: 12px; }

#loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; background: rgba(0,0,0,.75); color: var(--muted); z-index: 5; }
#loading.hide { display: none; }
#loadBar { width: 220px; height: 4px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; }
#loadBar i { display: block; height: 100%; width: 0; background: var(--on); transition: width .2s; }
.spin { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--on); border-radius: 50%;
  animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

body.full #titleBox, body.full #topRight, body.full #bar { transition: opacity .3s; }
body.idle #titleBox, body.idle #topRight, body.idle #bar { opacity: 0; }

@media (max-width: 900px) {
  #titleBox { min-width: 0; padding: 7px 12px; }
  #title { font-size: 16px; }
  #topRight { gap: 6px; top: 18px; right: 12px; }
  #topRight .drop:first-child select { min-width: 120px; }
  .drop select { font-size: 13.5px; }
  .btn span { display: none; }
  .btn { padding: 0 12px; }
  #bar { left: 8px; right: 8px; bottom: 8px; height: 56px; gap: 4px; padding: 0 8px; }
  .icon { width: 36px; height: 38px; }
  .icon.play { width: 42px; }
  #start, #end, .drop.small { display: none; }
  #clock { font-size: 12px; margin: 0 4px; }
  #timeline { margin: 0 8px; }
  .toggle { min-width: 0; height: 38px; padding: 0 10px; font-size: 13px; }
  #radar { bottom: 74px; }
}

#cmp { position: absolute; pointer-events: none; }
#cmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
#cmp .split { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; pointer-events: auto;
  cursor: ew-resize; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
#cmp .split::before { content: ""; position: absolute; top: 0; bottom: 0; left: -10px; right: -10px; }
#cmp .split span { position: absolute; top: 8px; font: 600 11px system-ui; color: #fff; background: rgba(0,0,0,.55);
  padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
#cmp .split span:first-child { right: 8px; }
#cmp .split span:last-child { left: 8px; }

/* orbit (drag the view; mouse or one finger): no page scroll / pinch zoom on the view */
#stage { touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
#stage.dragging { cursor: grabbing; }
#resetView.hide { display: none; }
