:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --accent: #4dabf7;
  --accent-2: #ffd43b;
  --text: #e9ecef;
  --muted: #9aa3ad;
  --line: #2a2f3a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  padding: 20px 24px 8px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

button {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06243d;
  font-weight: 600;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.status {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
}

.status strong { color: var(--text); }

.stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  line-height: 0;
}

.stage video {
  display: block;
  max-width: 100%;
  height: auto;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.readout {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 17, 21, 0.85);
  border: 1px solid var(--accent-2);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent-2);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.readout .deg { font-size: 20px; }

.readout .reflex {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.help {
  margin-top: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 22px 18px;
}

.help h2 { font-size: 16px; }
.help ol { padding-left: 20px; }
.help li { margin: 6px 0; }
.help .note {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
}
