/* styles.css — phone-first: big tap targets, vertical layout, dark theme */

* { box-sizing: border-box; }

body {
  font-family: -apple-system, system-ui, sans-serif;
  margin: 0;
  background: #11131a;
  color: #fff;
  padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom) 20px;
  min-height: 100vh;
}

/* Each "screen" fills the phone; only the active one shows. */
.screen { display: none; min-height: 100vh; flex-direction: column; justify-content: center; }
.screen.active { display: flex; }

h1 { font-size: 30px; text-align: center; margin: 0 0 8px; }
.subtitle { font-size: 18px; color: #b8c0d0; text-align: center; margin: 0 0 28px; }

label { font-size: 16px; color: #b8c0d0; margin: 18px 0 6px; }

input, select {
  font-size: 20px;
  padding: 16px;
  border-radius: 14px;
  border: 2px solid #2a2f3d;
  background: #1b1f2a;
  color: #fff;
  width: 100%;
}

/* Big, thumb-friendly buttons */
.big-btn {
  font-size: 22px;
  font-weight: 700;
  padding: 20px;
  margin-top: 28px;
  border: none;
  border-radius: 16px;
  background: #4f7cff;
  color: #fff;
  width: 100%;
}
.big-btn.green { background: #2ec27e; }
.big-btn.record {
  background: #e23b4e;
  font-size: 24px;
  animation: recordPulse 1.6s ease-in-out infinite;
}
@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 59, 78, 0.55); }
  50%      { box-shadow: 0 0 0 16px rgba(226, 59, 78, 0); }
}
.big-btn:active { transform: scale(0.98); }

.ghost-btn {
  margin-top: 16px;
  background: transparent;
  border: 2px dashed #2a2f3d;
  color: #b8c0d0;
  font-size: 18px;
  padding: 16px;
  border-radius: 14px;
  width: 100%;
}

/* The shot card on the shoot screen */
.card {
  background: #1b1f2a;
  border-radius: 18px;
  padding: 22px;
  margin: 10px 0;
}
/* Kids can't read — text stays tiny (it's spoken aloud); the storyboard and
   the record button get the screen. */
.label-tag { font-size: 10px; color: #7f8aa3; text-transform: uppercase; letter-spacing: 1px; margin-top: 8px; }
.label-tag:first-child { margin-top: 0; }
.instruction { font-size: 13px; line-height: 1.35; margin: 3px 0 2px; color: #b8c0d0; }
.narration { font-size: 12px; line-height: 1.35; font-style: italic; color: #8893a7; margin: 3px 0 0; }

.progress { text-align: center; font-size: 16px; color: #7f8aa3; margin-bottom: 14px; }

.nav-row { display: flex; gap: 12px; margin-top: 16px; }
.nav-btn {
  flex: 1;
  font-size: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 2px solid #2a2f3d;
  background: #1b1f2a;
  color: #fff;
}
.nav-btn.primary { background: #4f7cff; border-color: #4f7cff; }
.nav-btn:disabled { opacity: 0.35; }

.back-link {
  background: transparent; border: none; color: #7f8aa3;
  font-size: 16px; padding: 8px 0; margin-bottom: 4px;
}
.top-row { display: flex; justify-content: space-between; align-items: center; }
#storyBody .card { margin: 10px 0; }
#storyBody .label-tag { color: #4f7cff; font-weight: 700; }

/* Character-name rows on the Characters screen */
.char-row { display: flex; gap: 10px; margin-bottom: 10px; }
.char-row input { flex: 1; }
.char-row button {
  background: #2a2f3d; border: none; color: #fff;
  border-radius: 12px; padding: 0 18px; font-size: 22px;
}

/* Shot list rows */
.shot-row {
  display: flex; align-items: center; gap: 14px;
  background: #1b1f2a; border-radius: 16px; padding: 14px;
  margin-bottom: 10px;
  border: 2px solid transparent;
}
.shot-row.done { border-color: #2ec27e; }
/* Automated VFX shots — the computer makes these, no filming. */
.shot-row.auto { border-color: #6c5ce7; background: #1d1b2e; }
/* Locked VFX siblings — generated together with their project's first shot. */
.shot-row.locked { opacity: 0.45; border-style: dashed; }
.shot-row.auto .shot-thumb {
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; background-image: none; background: #2a2540;
}
.shot-thumb {
  width: 64px; height: 64px; border-radius: 12px; flex-shrink: 0;
  background: #2a2f3d url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%237f8aa3' stroke-width='2'><rect x='3' y='5' width='15' height='14' rx='2'/><polygon points='18,9 22,7 22,17 18,15'/></svg>") center / 32px no-repeat;
  object-fit: cover;
}
.shot-body { flex: 1; min-width: 0; }
.shot-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.vfx-tag {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  color: #d6ccff; background: #4a3f7a; border-radius: 999px;
  padding: 2px 8px;
}

/* Storyboard reference frame on the shoot screen — the star of the card */
.storyboard-ref { margin: 8px 0 4px; }
.storyboard-ref.hidden { display: none; }
.storyboard-img {
  width: 100%; max-height: 42vh; object-fit: contain;
  border-radius: 12px; background: #fff; border: 1px solid #2a2f3d;
}

/* Voice-quota banner */
.tts-banner {
  position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 60;
  background: #2a1d22; border: 2px solid #5a2a33; color: #ffb3b3;
  font-size: 14px; font-weight: 600; border-radius: 12px; padding: 12px 14px;
  text-align: center;
}
.shot-snippet { font-size: 14px; color: #b8c0d0; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shot-check { font-size: 24px; color: #2ec27e; width: 28px; text-align: center; }
.shot-check.pending { color: #3a4054; }

/* Filmed badge on the shoot screen */
.filmed-badge {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 10px;
  background: #14352a; border-radius: 12px;
  color: #7ee2b0; font-weight: 700;
}
.filmed-badge img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.hidden { display: none !important; }

.ok { font-size: 64px; text-align: center; }

/* ===== Camera screen (full-screen, dark, overlays) ===== */
.camera-screen {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: #000; padding: 0; z-index: 100;
}
.camera-screen.active { display: block; }
#cameraVideo {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; background: #000;
}
.cam-overlay {
  position: absolute; left: 0; right: 0; z-index: 2;
  padding: 16px 20px;
}
.cam-overlay.top {
  top: 0;
  padding-top: calc(env(safe-area-inset-top, 12px) + 12px);
  background: linear-gradient(to bottom, rgba(0,0,0,0.75), transparent);
}
.cam-overlay.bottom {
  /* Default: lifted clear of Safari's bottom URL bar. Orientation-specific
     overrides below tune this for portrait vs landscape.
     Uses a 3-column grid so the Record button sits at TRUE page center
     (under the zoom row), not just centered in the leftover flex space. */
  bottom: 18vh;
  padding: 14px 20px;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.cam-overlay.bottom > #camCancel { justify-self: start; }
.cam-overlay.bottom > #camRecord { justify-self: center; }
.cam-overlay.bottom > #camTimer  { justify-self: end; }
/* In portrait, push the controls a bit further down toward the bottom. */
@media (orientation: portrait) {
  .cam-overlay.bottom { bottom: 8vh; }
}
/* In landscape, mirror the native iOS camera: the shutter sits on the RIGHT
   edge, vertically centered, with cancel + timer stacked around it. */
@media (orientation: landscape) {
  .cam-overlay.bottom {
    left: auto; right: max(4vw, env(safe-area-inset-right, 16px));
    bottom: auto; top: 50%;
    transform: translateY(-50%);
    width: auto;
    grid-template-columns: auto;          /* single vertical stack */
    grid-auto-flow: row;
    gap: 20px;
    justify-items: center;
  }
  .cam-overlay.bottom > #camRecord { justify-self: center; order: 2; }
  .cam-overlay.bottom > #camTimer  { justify-self: center; order: 1; }
  .cam-overlay.bottom > #camCancel { justify-self: center; order: 3; }
}
.cam-label {
  font-size: 12px; color: #cdd6ea;
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.cam-instruction {
  font-size: 19px; color: #fff; line-height: 1.3; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.cam-tip-label { margin-top: 12px; color: #ffe082; }
.cam-tip {
  font-size: 15px; color: #ffe082; line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.cam-icon-btn {
  width: 48px; height: 48px; border-radius: 24px; flex-shrink: 0;
  background: rgba(255,255,255,0.18); border: none; color: #fff;
  font-size: 20px; font-weight: 700;
}
/* Outer button stays 76x76 always so the tap target is reliable.
   Only the inner red dot/square changes to indicate recording state. */
.cam-record-btn {
  width: 76px; height: 76px; border-radius: 38px;
  background: transparent; border: 5px solid #fff;
  flex-shrink: 0; padding: 0;
  position: relative;
}
.cam-record-btn::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 28px;
  background: #e23b4e;
  transition: width 0.18s, height 0.18s, border-radius 0.18s;
}
.cam-record-btn.recording::before {
  width: 30px; height: 30px; border-radius: 6px;
}
/* Spinning ring while recording — makes it obvious to a child it's filming. */
.cam-record-btn.recording::after {
  content: '';
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 5px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  animation: recSpin 0.9s linear infinite;
}
@keyframes recSpin { to { transform: rotate(360deg); } }
/* Pulse while "Ready, set, action!" plays, just before recording starts. */
.cam-record-btn.arming { animation: recArm 0.45s ease-in-out infinite alternate; }
@keyframes recArm { from { transform: scale(1); } to { transform: scale(1.12); } }
.cam-timer {
  color: #fff; font-size: 16px; font-variant-numeric: tabular-nums;
  font-weight: 700;
  background: rgba(0,0,0,0.45); padding: 8px 12px; border-radius: 12px;
  min-width: 90px; text-align: center;
}
.cam-timer.warn { background: rgba(226,59,78,0.7); }

/* ===== Review + Trim screen ===== */
/* Tighter spacing so the Save button is reachable without scrolling. */
#screen-review h1 { margin: 6px 0 2px; font-size: 22px; }
#screen-review > .subtitle { margin: 0 0 4px; }
#reviewVideo {
  width: 100%;
  max-height: 30vh;
  background: #000;
  border-radius: 14px;
  margin: 4px 0;
  object-fit: contain;
}
.trim-controls label {
  display: flex; justify-content: space-between;
  font-size: 14px; color: #b8c0d0;
  margin: 8px 0 2px;
  font-variant-numeric: tabular-nums;
}
/* Big custom slider with a large blue (or red when cued) thumb. */
.trim-controls input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 40px; background: transparent; margin: 0;
}
.trim-controls input[type=range]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px; background: #2a3550;
}
.trim-controls input[type=range]::-moz-range-track {
  height: 8px; border-radius: 4px; background: #2a3550;
}
.trim-controls input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 38px; height: 38px; border-radius: 50%;
  background: #2f6bff; border: 3px solid #fff;
  margin-top: -15px;                /* center the 38px thumb on the 8px track */
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.trim-controls input[type=range]::-moz-range-thumb {
  width: 38px; height: 38px; border-radius: 50%;
  background: #2f6bff; border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
#trimStart.cue::-webkit-slider-thumb, #trimEnd.cue::-webkit-slider-thumb { background: #e74c3c; }
#trimStart.cue::-moz-range-thumb,    #trimEnd.cue::-moz-range-thumb    { background: #e74c3c; }

/* Play/Pause icon button on the review screen */
.play-pause-row {
  display: flex; justify-content: center;
  margin: 4px 0 0;
}
.play-pause-btn {
  width: 52px; height: 52px;
  border-radius: 26px;
  border: 2px solid #2a2f3d;
  background: #1b1f2a;
  color: #fff;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.play-pause-btn.playing {
  background: #4f7cff;
  border-color: #4f7cff;
}
.play-pause-btn:active { transform: scale(0.94); }

/* "✅ Yes!" confirm button — green and gently pulsing. */
#trimSave {
  background: #2ec27e; border-color: #2ec27e; color: #06281a;
  animation: trimSavePulse 1.6s ease-in-out infinite;
}
@keyframes trimSavePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 194, 126, 0.6); }
  50%      { box-shadow: 0 0 0 14px rgba(46, 194, 126, 0); }
}
/* Trash (delete + re-record) button on the review screen */
.trash-btn {
  flex: 0 0 auto; width: 60px;
  font-size: 24px; line-height: 1;
  background: #2a1d22; border: 2px solid #5a2a33; color: #ff6b6b;
  border-radius: 14px; padding: 14px 0;
}
.trash-btn:active { transform: scale(0.94); }

/* ===== Start-Flag thumbnail strip ===== */
.thumb-strip {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 8px 2px 12px; -webkit-overflow-scrolling: touch;
  min-height: 124px;
}
.thumb-loading { color: #b8c0d0; padding: 40px 8px; font-size: 16px; width: 100%; text-align: center; }
.thumb-cell {
  position: relative; flex: 0 0 auto;
  height: 110px; padding: 0;
  border-radius: 12px; overflow: hidden;
  border: 3px solid #2a2f3d; background: #0d1018;
}
.thumb-cell img { height: 110px; width: auto; display: block; }
.thumb-blank {
  height: 110px; width: 62px; display: flex; align-items: center; justify-content: center;
  color: #3a4054; font-size: 28px; font-weight: 800;
}
.thumb-cell.flagged { border-color: #2ec27e; box-shadow: 0 0 0 3px rgba(46,194,126,0.45); }
.thumb-flag {
  position: absolute; top: 4px; left: 4px; z-index: 2; font-size: 28px;
  opacity: 0; transform: translateY(-8px); transition: opacity .15s, transform .15s;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.7));
}
.thumb-cell.flagged .thumb-flag { opacity: 1; transform: translateY(0); }
.confirm-q {
  text-align: center; font-size: 18px; font-weight: 800; color: #fff; margin: 6px 0 2px;
}
.confirm-q.hidden { display: none; }
.review-actions { gap: 10px; }

/* Kid ↔ grown-up mode toggle (top-right of the review screen) */
#screen-review { position: relative; }
.mode-toggle {
  position: absolute; top: 10px; right: 14px; z-index: 5;
  width: 44px; height: 44px; border-radius: 22px;
  background: #1b1f2a; border: 2px solid #2a2f3d;
  font-size: 22px; line-height: 1; padding: 0;
}
.mode-toggle:active { transform: scale(0.92); }

/* Grown-up precise in-point scrubber */
.adult-trim { margin: 8px 0 4px; }
.adult-trim.hidden { display: none; }
.adult-trim > label {
  display: flex; justify-content: space-between;
  font-size: 14px; color: #b8c0d0; margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}
.adult-trim > label > span { color: #6c8cff; font-weight: 800; }
.adult-trim input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 36px; background: transparent; margin: 0;
}
.adult-trim input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px; background: #2a3550;
}
.adult-trim input[type=range]::-moz-range-track {
  height: 6px; border-radius: 3px; background: #2a3550;
}
.adult-trim input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: #2f6bff; border: 2px solid #fff;
  margin-top: -9px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.adult-trim input[type=range]::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: #2f6bff; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.adult-hint { font-size: 12px; color: #7f8aa3; margin-top: 2px; }

/* Playhead line that moves across the Start slider during playback */
.track-wrap { position: relative; }
.playhead {
  position: absolute; pointer-events: none;
  top: 6px; bottom: 6px;
  width: 2px; background: #ffeb3b;
  left: 0; opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 0 6px rgba(255, 235, 59, 0.85);
}
.playhead.active { opacity: 1; }

/* Narrator "Hear" button — smaller, sits inside the shot card */
.hear-btn {
  margin-top: 12px;
  font-size: 16px;
  padding: 12px;
  border-style: solid;
  border-color: #4f7cff;
  color: #cdd6ea;
}
.hear-btn:disabled { opacity: 0.5; }
.hear-btn.playing { background: #1d2740; color: #fff; }

/* ===== Play screen (sequential movie viewer) ===== */
.play-screen { background: #000; padding: 0; position: relative; }
.play-screen.active { display: flex; flex-direction: column; }

#playVideo {
  width: 100%; height: 100vh;
  object-fit: contain; background: #000;
}

.play-back {
  position: absolute; top: env(safe-area-inset-top, 12px); left: 14px;
  color: #fff; z-index: 5;
  background: rgba(0,0,0,0.4); border-radius: 10px; padding: 8px 12px;
}
.play-progress {
  position: absolute;
  top: calc(env(safe-area-inset-top, 12px) + 4px);
  left: 50%; transform: translateX(-50%);
  color: #fff; background: rgba(0,0,0,0.5);
  padding: 6px 12px; border-radius: 12px;
  font-size: 14px; z-index: 5;
}
.play-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.9); color: #fff;
  z-index: 4; padding: 24px;
}
.play-overlay h1 { margin-bottom: 18px; }
.play-overlay .big-btn { width: 70%; max-width: 320px; }
.play-overlay .nav-btn { width: 70%; max-width: 320px; margin-top: 12px; }
.play-overlay.hidden { display: none; }

/* The End overlay fades in after a 1s freeze on the last frame */
#playEndOverlay {
  opacity: 0;
  transition: opacity 1s ease;
}
#playEndOverlay.shown { opacity: 1; }

/* ===== VFX Asset Capture screen ===== */
.vfx-capture-screen .back-link { display: inline-block; margin-bottom: 8px; }
.vfx-asset-card {
  background: #1b1f2a; border: 2px solid #2a2f3d;
  border-radius: 18px;
  padding: 18px;
  margin: 12px 0 22px;
}
.vfx-instructions {
  font-size: 18px;
  line-height: 1.4;
  color: #fff;
  margin: 6px 0 14px;
}
.vfx-reference {
  width: 100%;
  border-radius: 12px;
  background: #2a2f3d;
  margin-top: 4px;
  display: block;
}

/* Still-image element on the play screen — used for VFX shots whose
   "recording" is a captured photo, not a video. Same shape as playVideo. */
.play-still {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100vh;
  object-fit: contain; background: #000;
  z-index: 1;
}
.play-still.hidden { display: none; }

/* Closing card image (Runway storybook ending) — replaces the freeze frame.
   Fills the play screen so it feels like the film's final shot. */
.closing-card {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100vh;
  object-fit: contain; background: #000;
  z-index: 2;
  opacity: 0; transition: opacity 0.6s ease;
}
.closing-card.shown { opacity: 1; }
.closing-card.hidden { display: none; }

/* End overlay sits on top of the closing card. Bottom-aligned with a
   gradient so the image stays readable behind the text + buttons. */
#playEndOverlay {
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.55) 45%, rgba(0,0,0,0) 70%);
  justify-content: flex-end;
  padding-bottom: 60px;
}

/* Loading spinner on the Preparing state of the Start overlay */
.storybook-spinner {
  width: 40px; height: 40px;
  margin: 24px auto 0;
  border: 4px solid rgba(255, 224, 130, 0.25);
  border-top-color: #ffe082;
  border-radius: 50%;
  animation: storybookSpin 0.9s linear infinite;
}
@keyframes storybookSpin { to { transform: rotate(360deg); } }

/* "How close is my movie?" loading bar on the preparing overlay */
.prep-progress {
  width: min(78vw, 360px); height: 18px;
  margin: 22px auto 8px;
  background: #1b1f2a; border: 2px solid #2a2f3d; border-radius: 999px;
  overflow: hidden;
}
.prep-fill {
  height: 100%; width: 5%;
  background: linear-gradient(90deg, #6c5ce7, #4f7cff, #2ec27e);
  border-radius: 999px;
  transition: width 0.8s ease;
}
.prep-pct { color: #cdd6ea; font-weight: 800; font-size: 15px; }

/* Share / Save button on The End overlay */
.share-btn {
  background: #2ec27e; color: #06281a;
  animation: trimSavePulse 1.6s ease-in-out infinite;
}
.share-btn:disabled { animation: none; opacity: 0.75; }

/* ===== Saved projects ("Continue a movie") on the intro screen ===== */
.saved-projects { margin-top: 28px; text-align: left; }
.saved-title {
  font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: #7f8aa3; margin-bottom: 10px; text-align: center;
}
.saved-row {
  display: flex; align-items: center; gap: 10px;
  background: #1b1f2a; border: 2px solid #2a2f3d; border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px;
}
.saved-info { flex: 1; min-width: 0; }
.saved-name {
  font-size: 15px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.saved-meta { font-size: 12px; color: #8893a7; margin-top: 2px; }
.saved-continue {
  flex-shrink: 0; background: #2ec27e; border: none; color: #06281a;
  font-size: 14px; font-weight: 800; border-radius: 10px; padding: 10px 12px;
}
.saved-delete {
  flex-shrink: 0; background: transparent; border: none;
  color: #ff6b6b; font-size: 18px; padding: 6px;
}

/* ===== Location picker ===== */
.location-card {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  background: #1b1f2a; border: 2px solid #2a2f3d;
  border-radius: 16px; padding: 18px 16px;
  margin-bottom: 10px;
  color: #fff; text-align: left;
  font: inherit; font-size: 18px; font-weight: 600;
}
.location-card:active { transform: scale(0.99); }
.location-card .count {
  font-size: 13px; color: #b8c0d0; font-weight: 400;
  background: #2a2f3d; padding: 4px 10px; border-radius: 10px;
}
.location-card.disabled { opacity: 0.45; }

/* ===== MadVars form ===== */
#madvarsList { margin: 10px 0 18px; }
.madvar-row { margin-bottom: 14px; }
.madvar-row label {
  display: block; font-size: 14px; color: #b8c0d0;
  margin: 0 0 6px;
  text-transform: capitalize;
}
.madvar-row input {
  width: 100%;
}
/* Single-select option chips for variables with {Options} */
.option-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.option-chip {
  background: #1b1f2a; border: 2px solid #2a2f3d; color: #cdd6ea;
  font-size: 15px; font-weight: 600;
  border-radius: 999px; padding: 10px 16px;
}
.option-chip:active { transform: scale(0.95); }
.option-chip.selected {
  background: #2f6bff; border-color: #2f6bff; color: #fff;
}

/* Sections on the combined "Tell us about your story" page */
.madvar-section { margin-bottom: 22px; }
.madvar-section-title {
  font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: #7f8aa3; margin-bottom: 10px;
}
.madvar-section .ghost-btn { margin-top: 2px; }

/* ===== Script Review ===== */
#poemTextarea {
  width: 100%;
  min-height: 240px;
  font-size: 17px;
  line-height: 1.6;
  padding: 16px;
  border-radius: 14px;
  border: 2px solid #2a2f3d;
  background: #1b1f2a;
  color: #fff;
  font-family: inherit;
  resize: vertical;
}
#poemTextarea:focus { border-color: #4f7cff; outline: none; }

.duration-estimate {
  text-align: center;
  margin: 14px 0 12px;
  padding: 12px;
  background: #14352a;
  color: #7ee2b0;
  border-radius: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.duration-slider-wrap { margin-bottom: 12px; }
.duration-slider-wrap > label {
  display: block; font-size: 15px; font-weight: 600; color: #cdd6ea; margin-bottom: 8px;
}
.duration-slider-wrap > label > span { color: #6c8cff; font-weight: 800; }
#durationSlider { width: 100%; accent-color: #6c8cff; height: 28px; }
#durationSlider:disabled { opacity: 0.45; }
.duration-slider-ends {
  display: flex; justify-content: space-between;
  font-size: 12px; color: #7f8aa3; margin-top: 2px;
}

/* (Trim handle colors + save state are styled in the Review/Trim section,
   using custom slider thumbs and #trimSave:disabled / :not(:disabled).) */

/* ===== Story picker ===== */
.story-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  background: #1b1f2a; border: 2px solid #2a2f3d;
  border-radius: 18px; padding: 14px;
  margin-bottom: 12px;
  color: #fff; text-align: left;
  font: inherit;
}
.story-card:active { transform: scale(0.99); }
.story-poster {
  width: 80px; height: 80px; border-radius: 12px;
  object-fit: cover; flex-shrink: 0;
  background: #2a2f3d;
}
.story-poster.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
}
.story-info { flex: 1; min-width: 0; }
.story-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.story-desc {
  font-size: 14px; color: #b8c0d0; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.story-chevron { font-size: 22px; color: #4f7cff; padding-left: 4px; }
.story-loading, .story-error {
  text-align: center; padding: 24px; color: #b8c0d0;
}
.story-error { color: #ff8497; }

/* ===== Orientation choice screen ===== */
.orient-grid {
  display: flex; gap: 14px; margin: 20px 0;
}
.orient-card {
  flex: 1; padding: 22px 14px;
  background: #1b1f2a; border: 2px solid #2a2f3d; color: #fff;
  border-radius: 18px;
  display: flex; flex-direction: column; align-items: center;
  font: inherit;
}
.orient-card.selected {
  border-color: #4f7cff;
  background: #1d2740;
}
.orient-shape {
  border: 3px solid #fff; border-radius: 8px;
  margin-bottom: 14px;
}
.landscape-shape { width: 90px; height: 52px; }
.portrait-shape  { width: 52px; height: 90px; }
.orient-label { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.orient-card small { color: #b8c0d0; font-size: 13px; }

/* Orient-hint: animated rotating phone icon. Centered over the live preview. */
.cam-orient-hint {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
  padding: 24px; border-radius: 20px;
}
.cam-orient-hint.hidden { display: none; }
.rotate-phone-anim {
  width: 56px; height: 90px;
  border: 5px solid #fff; border-radius: 10px;
  position: relative;
  animation: rotatePhone 2s ease-in-out infinite;
  transform-origin: center;
}
.rotate-phone-anim::before {
  content: '';
  position: absolute;
  top: 6px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 3px;
  background: #fff; border-radius: 2px;
}
@keyframes rotatePhone {
  0%, 30%  { transform: rotate(0deg); }
  60%, 100%{ transform: rotate(-90deg); }
}

/* ===== Mute button (shared) ===== */
.mute-btn {
  background: rgba(40, 46, 60, 0.85); color: #fff;
  border: none; border-radius: 22px;
  width: 44px; height: 44px;
  font-size: 20px; flex-shrink: 0;
}
.mute-btn.muted { background: rgba(226, 59, 78, 0.7); }
.mute-btn:active { transform: scale(0.94); }

/* Flip-camera button on the camera screen (front ↔ back). Lives well below
   the "What to film" + tip overlay so it doesn't overlap either. */
.cam-flip-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top, 12px) + 190px);
  right: 14px;
  z-index: 6;
  width: 44px; height: 44px;
  border-radius: 22px;
  background: rgba(40, 46, 60, 0.85);
  border: none; color: #fff;
  font-size: 20px;
}
@media (orientation: landscape) {
  /* Less vertical space in landscape — keep flip button closer to the top */
  .cam-flip-btn { top: calc(env(safe-area-inset-top, 12px) + 110px); }
}
.cam-flip-btn:disabled { opacity: 0.35; }
.cam-flip-btn:active { transform: scale(0.94); }

/* Zoom (focal length) buttons — sit comfortably above the record-button row. */
.cam-zoom-row {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 5;
  bottom: calc(18vh + 160px);   /* default; overridden per orientation below */
}
@media (orientation: portrait) {
  .cam-zoom-row { bottom: calc(8vh + 160px); }
}
@media (orientation: landscape) {
  .cam-zoom-row { bottom: calc(38vh + 160px); }
}
.cam-zoom-btn {
  background: rgba(40, 46, 60, 0.85);
  border: none; color: #fff;
  border-radius: 22px;
  width: 44px; height: 44px;
  font-size: 14px; font-weight: 700;
}
.cam-zoom-btn.active {
  background: rgba(255, 224, 130, 0.95);
  color: #1a1d26;
  transform: scale(1.12);
}
.cam-zoom-btn:active { transform: scale(0.94); }
.cam-zoom-row.hidden { display: none; }

/* List screen gets a small header row holding only the mute button */
.list-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

/* VFX processing takeover — the whole shot panel becomes a spinner. */
.shot-processing {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 56px 0; color: #9fb0d0; font-size: 20px;
}
.shot-processing.hidden { display: none; }
.spinner {
  width: 56px; height: 56px; border-radius: 50%;
  border: 5px solid #2a2f3d; border-top-color: #5b8cff;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
