:root {
  --bg: #0b0b0c;
  --fg: #f4f1ea;
  --muted: #a39e93;
  --accent: #f2b544;
  --danger: #ff5a4f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
body { font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
[hidden] { display: none !important; }

.screen { position: fixed; inset: 0; padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); }
.center { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 12px; }
h1 { margin: 0; font-size: 28px; line-height: 1.15; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--accent); }
.muted { color: var(--muted); margin: 0; max-width: 32ch; }
.small { font-size: 13px; }
.error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: 14px; }

form { display: flex; flex-direction: column; gap: 10px; width: min(320px, 100%); margin: 16px 0; text-align: left; }
label { font-size: 14px; color: var(--muted); }
input { font-size: 18px; padding: 14px 16px; border-radius: 12px; border: 1px solid #3a3833; background: #17171a; color: var(--fg); }
button.primary { font-size: 17px; font-weight: 600; padding: 15px; border: 0; border-radius: 12px; background: var(--accent); color: #1b1404; }
button.primary:disabled { opacity: .5; }

/* Camera */
.camera { padding: 0; background: #000; }
#viewfinder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .25s ease-out; }
#flash.on { opacity: .85; transition: none; }
.topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: max(14px, env(safe-area-inset-top)) 18px 14px; background: linear-gradient(#000a, #0000); }
.event-name { font-weight: 600; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.counter { font-variant-numeric: tabular-nums; background: #0009; border: 1px solid #fff3; border-radius: 999px; padding: 6px 12px; }
.counter strong { color: var(--accent); font-size: 18px; }
.rec-timer { position: absolute; top: calc(max(14px, env(safe-area-inset-top)) + 48px); left: 50%; transform: translateX(-50%);
  background: #000a; color: var(--danger); padding: 4px 12px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 18px 18px max(22px, env(safe-area-inset-bottom)); background: linear-gradient(#0000, #000b); }
.modes { display: flex; gap: 6px; background: #0008; border-radius: 999px; padding: 4px; }
.mode { border: 0; background: transparent; color: var(--muted); font-weight: 600; padding: 7px 16px; border-radius: 999px; font-size: 14px; }
.mode.active { background: #fff2; color: var(--fg); }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: #fff3; padding: 0; }
.shutter:active { transform: scale(.94); }
.shutter:disabled { opacity: .4; }
.shutter.video { background: var(--danger); border-color: #fff; }
.shutter.recording { border-radius: 22px; background: var(--danger); }
.status { min-height: 1.2em; margin: 0; color: #ddd; text-shadow: 0 1px 2px #000; }
