:root {
  --bg: #0f1115;
  --panel: #171a21;
  --text: #e8eaf0;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --ok: #3ccf91;
  --bad: #ff6b6b;
  color-scheme: dark;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
main { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { margin: 0 0 8px; font-size: 1.8rem; }
header p, footer, .stats { color: var(--muted); }
header p { margin: 0 0 20px; line-height: 1.5; }
.camera { position: relative; aspect-ratio: 4 / 3; background: var(--panel); border-radius: 12px; overflow: hidden; }
/* Shown mirrored, like a mirror; frames are processed un-mirrored. */
video, #overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.prompt {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font-size: 1.4rem; font-weight: 600; text-align: center;
}
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 14px 0; flex-wrap: wrap; }
.steps li { padding: 6px 12px; border-radius: 999px; background: var(--panel); color: var(--muted); font-size: 0.9rem; }
.steps li.current { background: var(--accent); color: white; }
.steps li.done { background: color-mix(in srgb, var(--ok) 25%, var(--panel)); color: var(--ok); }
.controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
button {
  padding: 10px 22px; border: 0; border-radius: 8px; background: var(--accent); color: white;
  font-size: 1rem; font-weight: 600; cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: default; }
.badge { font-size: 0.85rem; color: var(--muted); }
.stats { font-family: ui-monospace, monospace; font-size: 0.85rem; min-height: 1.2em; }
.result { margin-top: 20px; padding: 16px 20px; border-radius: 12px; background: var(--panel); }
.result h2 { margin: 0 0 6px; }
.result.passed h2 { color: var(--ok); }
.result.failed h2 { color: var(--bad); }
pre { white-space: pre-wrap; word-break: break-all; font-size: 0.8rem; color: var(--muted); }
footer { margin-top: 32px; font-size: 0.9rem; }
footer a { color: var(--accent); }
figure { display: flex; align-items: center; gap: 14px; margin: 12px 0 0; }
figure img { width: 112px; height: 112px; border-radius: 8px; image-rendering: auto; }
figcaption { color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
