* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #faf7f2; color: #1d1d1d; line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
main { max-width: 480px; margin: 0 auto; padding: 0 0 2rem; min-height: 100vh; }
[hidden] { display: none !important; }
.brand { background: var(--primary); color: var(--on-primary); padding: 1rem 1.25rem; border-bottom: 4px solid var(--accent); }
.brand h1 { margin: 0; font-size: 1.15rem; letter-spacing: .02em; }
.screen { padding: 1.25rem; }
h2 { margin: .25rem 0 .5rem; font-size: 1.6rem; }
.lead { font-size: 1.05rem; }
.small { font-size: .8rem; color: #555; }
.rules { padding-left: 1.2rem; margin: 1rem 0 1.5rem; }
.rules li { margin: .3rem 0; }
.btn {
  appearance: none; border: 0; border-radius: 12px; padding: .9rem 1.2rem; font-size: 1.05rem; font-weight: 600;
  cursor: pointer; min-height: 48px;
}
.btn.primary { background: var(--primary); color: var(--on-primary); width: 100%; }
.btn.accent { background: var(--accent); color: var(--on-accent); width: 100%; margin-top: .75rem; }
.btn.ghost { background: #e8e3da; color: #222; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.controls { display: flex; gap: .75rem; margin-top: 1rem; }
.controls .btn { flex: 1; }
.fallback { text-align: center; margin-top: 1.25rem; }
.linkish { color: var(--primary); text-decoration: underline; cursor: pointer; font-size: .95rem; }
.error { color: #a31616; background: #fdeaea; padding: .6rem .8rem; border-radius: 8px; margin-top: 1rem; }
.viewport { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 4; }
video { width: 100%; display: block; background: #000; border-radius: 14px; }
.viewport video { height: 100%; object-fit: cover; border-radius: 0; }
#preview.mirror { transform: scaleX(-1); }
.overlay-prompt { position: absolute; left: 0; right: 0; top: 0; padding: .8rem 1rem; color: #fff; font-weight: 600; background: linear-gradient(rgba(0,0,0,.65), transparent); }
.overlay-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 6rem; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); font-weight: 700; }
.overlay-timer { position: absolute; right: .8rem; bottom: .8rem; color: #fff; background: rgba(200,20,20,.85); padding: .2rem .6rem; border-radius: 999px; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar { height: 8px; background: #ddd6c8; border-radius: 99px; margin-top: .75rem; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.field { margin: 1rem 0; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.field input { width: 100%; padding: .75rem; font-size: 1rem; border: 1px solid #bbb; border-radius: 10px; }
.field small { color: #555; display: block; margin-top: .25rem; }
.check { display: flex; gap: .7rem; align-items: flex-start; margin: .9rem 0; font-size: .95rem; }
.check input { width: 1.4rem; height: 1.4rem; flex: none; margin-top: .1rem; accent-color: var(--primary); }
.perk { margin: 1.25rem 0; border: 3px dashed var(--accent); border-radius: 16px; padding: 1.25rem; text-align: center; background: #fff; }
.perk-label { font-size: 1.05rem; font-weight: 600; }
.perk-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 2.6rem; letter-spacing: .08em; font-weight: 800; color: var(--primary); margin: .5rem 0; }
.perk-meta { font-size: .85rem; color: #555; }
footer { padding: 0 1.25rem; margin-top: 1rem; text-align: center; }
.powered { opacity: .7; }
