:root {
  --bg: #05080d;
  --fg: #e6edf3;
  --dim: #8b949e;
  --accent: #22c55e;
  --panel: rgba(13, 17, 23, 0.92);
  --border: rgba(255, 255, 255, 0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; background: var(--bg); color: var(--fg);
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif; overflow: hidden; }
.hidden { display: none !important; }

.stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.box { text-align: center; max-width: 420px; padding: 24px; }
.box h1 { font-size: 1.25rem; margin: 16px 0 8px; }
.box p { color: var(--dim); font-size: 0.9rem; margin-bottom: 16px; }
.box button { margin-top: 8px; padding: 10px 22px; border-radius: 10px; border: none;
  background: var(--accent); color: #04140a; font-weight: 700; cursor: pointer; }
.spinner { width: 42px; height: 42px; margin: 0 auto; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.12); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dim { color: var(--dim); }
.small { font-size: 0.78rem; }

#video { width: 100%; height: 100%; object-fit: contain; background: #000; }

.overlay { position: fixed; top: 12px; left: 12px; pointer-events: none; z-index: 5; }
.overlay-inner { background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 12px; font-size: 0.8rem; display: flex; gap: 14px; align-items: center; }

.controls { position: fixed; bottom: 16px; right: 16px; z-index: 6; display: flex; gap: 8px; }
.controls button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel); color: var(--fg); font-size: 1.1rem; cursor: pointer; }
.controls button:hover { background: rgba(34, 197, 94, 0.15); }

.panel { position: fixed; z-index: 7; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px; width: 300px; }
#panel-settings { right: 16px; bottom: 72px; }
#panel-stats { left: 16px; bottom: 72px; }
.panel h2 { font-size: 1rem; margin-bottom: 12px; }
.panel label { display: block; margin-bottom: 10px; font-size: 0.85rem; color: var(--dim); }
.panel select, .panel input[type=range] { width: 100%; margin-top: 4px; background: #11161d;
  color: var(--fg); border: 1px solid var(--border); border-radius: 8px; padding: 6px; }
.panel .row { display: flex; align-items: center; gap: 8px; }
.panel .row input { width: auto; }
.panel table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.panel td { padding: 5px 0; border-bottom: 1px solid var(--border); }
.panel td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
#btn-apply-settings { width: 100%; margin-top: 8px; padding: 9px; border-radius: 9px; border: none;
  background: var(--accent); color: #04140a; font-weight: 700; cursor: pointer; }
