* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(165deg, #fff8f0 0%, #ffeedd 55%, #ffe3cb 100%) fixed;
  color: #3b2f2a; min-height: 100vh;
}
.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 18px; }
.card {
  background: #ffffff; border: 1px solid #f1dfc9; border-radius: 22px;
  box-shadow: 0 14px 34px rgba(160, 95, 40, 0.13);
  padding: 26px; width: 100%; max-width: 420px;
}
.card.wide { max-width: 640px; }
h1 { margin: 0 0 8px; font-size: 28px; color: #2f2118; letter-spacing: -0.3px; }
h2 { color: #2f2118; }
.sub { color: #8a7460; margin: 0 0 18px; line-height: 1.45; }
label { display: block; font-size: 14px; color: #7a6753; margin: 12px 0 6px; }
input[type="text"], input[type="password"], input[type="email"], textarea {
  width: 100%; background: #fffdf8; color: #3b2f2a; border: 1.5px solid #ead9c2;
  border-radius: 14px; padding: 12px 14px; font-size: 17px;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, textarea:focus {
  outline: none; border-color: #f2764b;
  box-shadow: 0 0 0 3px rgba(242, 118, 75, 0.22);
}
textarea { resize: vertical; line-height: 1.45; }
button.primary, a.primary {
  display: block; width: 100%; margin-top: 16px; padding: 14px; border: 0;
  border-radius: 999px; background: linear-gradient(180deg, #f2764b, #e85a35);
  box-shadow: 0 6px 16px rgba(232, 90, 53, 0.28);
  color: #fff; font-size: 17px;
  font-weight: 600; text-align: center; text-decoration: none; cursor: pointer;
}
button.primary:active, a.primary:active { transform: translateY(1px); }
button.primary.alt { background: #fbeadb; color: #8a4b1f; box-shadow: none; }
button.primary.big { font-size: 19px; padding: 16px; }
.msg { min-height: 20px; font-size: 15px; color: #c2431f; margin: 10px 0 0; line-height: 1.4; }
.msg.ok { color: #2f7d46; }
.fineprint { color: #a68f76; font-size: 13px; margin-top: 14px; line-height: 1.5; }
.fineprint a { color: #d95f33; }
.linkbtn { background: none; border: 0; color: #d95f33; font-size: 13px; cursor: pointer; padding: 0; text-decoration: underline; }
.meta { color: #8a7460; font-size: 14px; margin: 8px 0 0; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > label { flex: 1 1 200px; }
.row.toggles { margin-top: 6px; }
.switch { display: flex; align-items: center; gap: 8px; color: #3b2f2a; font-size: 15px; }
input[type="range"] { width: 100%; accent-color: #ee6a41; }
input[type="checkbox"] { accent-color: #ee6a41; width: 18px; height: 18px; }
video#playback { width: 100%; border-radius: 14px; background: #000; }

/* ---- stage (stays dark: it sits on top of the camera picture) ---- */
.screen.stage { padding: 0; display: block; position: relative; background: #000; overflow: hidden; }
#cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#cam.mirrored { transform: scaleX(-1); }
.band {
  position: absolute; left: 0; right: 0; top: 7%; height: 34%;
  overflow: hidden; background: rgba(0,0,0,0.45);
  border-top: 1px solid rgba(255,255,255,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.25);
  touch-action: none;
}
.scroll-text {
  padding: 45% 22px 60%; text-align: center; font-weight: 600;
  line-height: 1.35; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.9);
  white-space: pre-wrap; will-change: transform;
}
.eyeline {
  position: absolute; left: 0; right: 0; top: 7%; height: 2px;
  background: rgba(255,179,122,0.0);
}
.countdown {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 120px; font-weight: 800; color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,0.8);
}
.rec {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 14px;
  background: rgba(0,0,0,0.55); color: #ff5a4d; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; font-size: 15px;
}
.controls {
  position: absolute; left: 0; right: 0; bottom: calc(52px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; justify-content: center; padding: 0 12px;
}
.controls.slim {
  bottom: calc(10px + env(safe-area-inset-bottom));
  color: #fff; font-size: 13px; align-items: center;
}
.controls.slim label { display: flex; align-items: center; gap: 8px; margin: 0; color: #fff; }
.controls.slim input[type="range"] { width: 150px; }
.ctl {
  border: 1px solid rgba(255,255,255,0.35); background: rgba(0,0,0,0.55); color: #fff;
  border-radius: 999px; padding: 12px 18px; font-size: 16px; cursor: pointer;
}
.ctl.record { background: #c22f21; border-color: #c22f21; font-weight: 700; min-width: 110px; }
.ctl.record.stop { background: #f4f0e8; color: #c22f21; min-width: 170px; padding: 18px 26px; font-size: 19px; }
.msg.onstage {
  position: absolute; left: 0; right: 0; bottom: calc(110px + env(safe-area-inset-bottom));
  text-align: center; margin: 0; padding: 0 16px; color: #ffb37a;
}
[hidden] { display: none !important; }
