:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --fg: #f4f6f8;
  --accent: #37c2b5;
  --accent-press: #2a9d92;
  --muted: #7c8794;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

main {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#stage {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#video, #overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#overlay { pointer-events: none; }

#status {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.3;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#status.hidden { display: none; }

#fps {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  display: none;
}

#fps.visible { display: block; }

#flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}

#flash.show {
  opacity: 0.75;
  transition-duration: 40ms;
}

#controls {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
}

#model-picker {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #1a1f26;
  border-radius: 10px;
}

#model-picker label {
  flex: 1;
  position: relative;
}

#model-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#model-picker span {
  display: block;
  padding: 8px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 120ms ease, color 120ms ease;
}

#model-picker input:checked + span {
  background: var(--accent);
  color: #06201d;
  font-weight: 600;
}

#model-picker input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#model-picker input:disabled + span {
  opacity: 0.5;
  cursor: not-allowed;
}

#buttons {
  display: flex;
  gap: 10px;
}

button {
  flex: 1;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #06201d;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 120ms ease;
}

button:active { background: var(--accent-press); }

button:disabled {
  background: #2a3139;
  color: var(--muted);
  cursor: not-allowed;
}
