:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0b0d; color: #f4f4f5;
  font: 14px/1.4 -apple-system, system-ui, sans-serif; }
body { display: flex; flex-direction: column; }

#stage { position: relative; flex: 1; overflow: hidden; background: #000; }
#video { width: 100%; height: 100%; object-fit: cover; display: block; }
#overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

#hud { position: absolute; top: 10px; left: 10px; padding: 10px 12px;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; backdrop-filter: blur(6px); min-width: 172px;
  font-variant-numeric: tabular-nums; }
.hud-row { display: flex; justify-content: space-between; gap: 14px; }
.hud-row span { color: #a1a1aa; }
.hud-row b { font-weight: 600; }
.hud-note { margin-top: 6px; color: #71717a; font-size: 11px; max-width: 180px; }

#result { position: absolute; inset: auto 10px 10px 10px; padding: 14px;
  background: rgba(16,16,20,.94); border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px; max-height: 60%; overflow: auto; }
#result-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
#result-body { margin: 0 0 12px; white-space: pre-wrap; word-break: break-word;
  color: #d4d4d8; font: 12px/1.5 ui-monospace, monospace; }

#controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.1); }
.ctl { display: flex; align-items: center; gap: 6px; color: #d4d4d8; }
.ctl.roi { gap: 8px; }
#c-roi { width: 120px; }

button { font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 9px;
  border: 0; background: #6d5efc; color: #fff; cursor: pointer; }
button:hover { background: #5b4bf0; }
#again { background: #27272a; }

.status { width: 100%; margin: 0; color: #a1a1aa; }
.status.err { color: #fb7185; }
.is-hidden { display: none !important; }
