:root {
  --bg: #0b0f14;
  --panel: #0f1620;
  --text: #e7eef7;
  --muted: #99a7b5;
  --accent: #1abc9c;
  --warn: #ffd166;
  --bad: #ff5c5c;
  --line: #2a3441;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

h1 { margin: 8px 0 0; font-size: 1.25rem; color: var(--text); }
h2 { margin: 4px 0 12px; font-size: 1rem; color: var(--muted); font-weight: 500; }

.author { color: var(--muted); margin-bottom: 12px; line-height: 1.4; }
.author a { color: var(--muted); text-decoration: underline; }
.author a:hover { color: var(--text); }

.stage {
  position: relative;
  width: min(95vw, 900px);
  min-height: 240px;         /* <-- Add this line */
  margin: 0 auto;           /* Center horizontally */
  display: flex;
  align-items: center;      /* Center vertically */
  justify-content: center;  /* Center horizontally */
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  /* aspect-ratio: removed, set by JS */
}

#video, #overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensure both fill the container */
}

/* Mirror video like cv2.flip(frame, 1) */
#video {
  transform: scaleX(-1);
  object-fit: cover;
}

#metrics {
  position: absolute;
  left: 12px;
  top: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  white-space: pre;
  line-height: 1.35;
  min-width: 240px;
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

button, select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

button:hover {
  background: #1a2330;
  cursor: pointer;
}

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

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Colored spans for angle status */
.good { color: var(--accent); }
.warn { color: var(--warn); }
.bad  { color: var(--bad); }
.na   { color: #9aa5b1; }
