/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:        #f5c518;
  --gold-dim:    #c8961e;
  --gold-glow:   rgba(245, 197, 24, 0.55);
  --green-glow:  rgba(34, 197, 94, 0.55);
  --red-glow:    rgba(239, 68, 68, 0.40);
  --bg:          #0d1117;
  --card-bg:     #111827;
  --card-border: #2a3450;
  --text:        #e2e8f0;
  --text-dim:    #94a3b8;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Film strip ───────────────────────────────────────────── */
.filmstrip {
  flex-shrink: 0;
  height: 38px;
  background: var(--gold-dim);
  position: relative;
  overflow: hidden;
}
.filmstrip::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg, transparent 0px, transparent 8px,
    var(--bg) 8px, var(--bg) 22px,
    transparent 22px, transparent 32px
  );
  background-size: 38px 100%;
  background-position: 8px 0;
  top: 50%; height: 20px;
  transform: translateY(-50%);
}

/* ── User info bar ────────────────────────────────────────── */
.user-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(245,197,24,0.12);
  gap: 12px;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.user-greeting {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta {
  font-size: 0.70rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.logout-btn:hover {
  color: var(--gold);
  border-color: rgba(245,197,24,0.35);
  background: rgba(245,197,24,0.06);
}

/* Push main content below the user bar when it's visible */
body:has(.user-bar:not(.hidden)) .main {
  padding-top: 52px;
}

/* ── Main layout ──────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  gap: 10px;
}

/* ── Branding ─────────────────────────────────────────────── */
.brand-title {
  font-size: clamp(2.1rem, 6.5vw, 4rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-shadow: 0 2px 28px rgba(245,197,24,0.4);
  line-height: 1;
}
.brand-subtitle {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  box-shadow: 0 0 0 1px rgba(245,197,24,0.06), 0 16px 60px rgba(0,0,0,0.75);
}

.badge {
  position: absolute;
  top: 14px; right: 16px;
  background: var(--gold); color: #000;
  font-size: 0.6rem; font-weight: 800;
  letter-spacing: 0.12em;
  padding: 2px 7px; border-radius: 4px;
}

/* ── States ───────────────────────────────────────────────── */
.state {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.hidden { display: none !important; }

/* ── Avatar wrap ──────────────────────────────────────────── */
.avatar-wrap {
  position: relative;
  width: 200px;
  display: flex;
  justify-content: center;

  /* Idle float */
  animation: avatarFloat 4s ease-in-out infinite;
}

@keyframes avatarFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-7px); }
}

.host-image {
  width: 100%;
  border-radius: 16px;
  border: 2px solid rgba(245,197,24,0.25);
  display: block;
  object-fit: cover;
  aspect-ratio: 3/4;
  /* Base glow – overridden per state */
  box-shadow:
    0 0 30px 4px rgba(245,197,24,0.15),
    0 12px 40px rgba(0,0,0,0.55);
  transition: box-shadow 0.5s ease, transform 0.3s ease;
}

/* Blink: briefly dim image to simulate eye-closing */
@keyframes blinkAnim {
  0%   { opacity: 1; }
  20%  { opacity: 0.78; }
  40%  { opacity: 1; }
}
.host-image.blinking {
  animation: blinkAnim 110ms linear forwards;
}

/* Canvas sits pixel-perfect over the image */
.avatar-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 16px;
  pointer-events: none;
}

/* ── State-based avatar visuals ───────────────────────────── */

/* IDLE */
.avatar-wrap.av-idle .host-image {
  box-shadow:
    0 0 30px 4px rgba(245,197,24,0.18),
    0 12px 40px rgba(0,0,0,0.55);
}

/* SPEAKING — gold pulse glow */
.avatar-wrap.av-speaking .host-image {
  box-shadow:
    0 0 0 2px rgba(245,197,24,0.5),
    0 0 50px 12px rgba(245,197,24,0.45),
    0 12px 40px rgba(0,0,0,0.55);
  animation: speakingPulse 0.55s ease-in-out infinite alternate,
             avatarFloat 4s ease-in-out infinite;
}
@keyframes speakingPulse {
  from { box-shadow: 0 0 0 2px rgba(245,197,24,0.45), 0 0 40px 8px  rgba(245,197,24,0.35), 0 12px 40px rgba(0,0,0,0.55); }
  to   { box-shadow: 0 0 0 3px rgba(245,197,24,0.70), 0 0 70px 18px rgba(245,197,24,0.55), 0 12px 40px rgba(0,0,0,0.55); }
}

/* LISTENING — softer rhythmic glow */
.avatar-wrap.av-listening .host-image {
  box-shadow:
    0 0 0 2px rgba(245,197,24,0.35),
    0 0 40px 10px rgba(245,197,24,0.30),
    0 12px 40px rgba(0,0,0,0.55);
  animation: listeningPulse 2s ease-in-out infinite,
             avatarFloat 4s ease-in-out infinite;
}
@keyframes listeningPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(245,197,24,0.30), 0 0 30px 6px  rgba(245,197,24,0.20), 0 12px 40px rgba(0,0,0,0.55); }
  50%       { box-shadow: 0 0 0 3px rgba(245,197,24,0.55), 0 0 55px 14px rgba(245,197,24,0.42), 0 12px 40px rgba(0,0,0,0.55); }
}

/* RECORDING — red glow */
.avatar-wrap.av-recording .host-image {
  box-shadow:
    0 0 0 2px rgba(239,68,68,0.45),
    0 0 40px 10px rgba(239,68,68,0.25),
    0 12px 40px rgba(0,0,0,0.55);
}

/* SUCCESS — green glow */
.avatar-wrap.av-success .host-image {
  box-shadow:
    0 0 0 2px rgba(34,197,94,0.55),
    0 0 50px 12px rgba(34,197,94,0.40),
    0 12px 40px rgba(0,0,0,0.55);
}

/* ── Outer rings (listening ripple) ───────────────────────── */
.av-rings {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
}
.av-rings span {
  display: none; /* shown only in listening state */
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 2px solid var(--gold);
  animation: ringExpand 1.8s ease-out infinite;
  opacity: 0;
}
.av-rings span:nth-child(2) { animation-delay: 0.6s; }
.av-rings span:nth-child(3) { animation-delay: 1.2s; }

.avatar-wrap.av-listening .av-rings span { display: block; }

@keyframes ringExpand {
  0%   { inset: 0;      opacity: 0.7; }
  100% { inset: -22px;  opacity: 0; }
}

/* ── Entry: code verification form ───────────────────────── */
.entry-clapper {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(245,197,24,0.4));
}

.entry-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 4px;
}

.entry-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.entry-input-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.18);
}
.entry-input-wrap.entry-error-state {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.18);
}

.entry-input-icon {
  flex-shrink: 0;
  margin-left: 13px;
  color: var(--text-dim);
  pointer-events: none;
  transition: color 0.2s;
}
.entry-input-wrap:focus-within .entry-input-icon { color: var(--gold); }

#entry-code {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 13px 14px 13px 9px;
  font-family: 'Courier New', monospace;
}
#entry-code::placeholder { color: var(--text-dim); font-weight: 400; letter-spacing: 0.05em; }

@keyframes entryShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.entry-shake { animation: entryShake 0.4s ease; }

.entry-error {
  font-size: 0.77rem;
  color: #ef4444;
  text-align: center;
  padding: 6px 10px;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.20);
  border-radius: 8px;
  line-height: 1.4;
}

.entry-submit-btn {
  width: 100%;
  padding: 13px 22px;
  background: var(--gold);
  color: #000;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 18px rgba(245,197,24,0.35);
  margin-top: 2px;
}
.entry-submit-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(245,197,24,0.50);
}
.entry-submit-btn:active:not(:disabled) { transform: translateY(0); }
.entry-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; }

@keyframes spinAnim { to { transform: rotate(360deg); } }
.spin { animation: spinAnim 0.7s linear infinite; }

/* ── Speech bubble ────────────────────────────────────────── */
.host-bubble {
  width: 100%;
  padding: 11px 16px;
  background: rgba(245,197,24,0.055);
  border: 1px solid rgba(245,197,24,0.16);
  border-radius: 12px;
  font-size: 0.86rem;
  color: var(--text);
  text-align: center;
  line-height: 1.5;
  min-height: 42px;
  transition: opacity 0.25s ease;
}
.host-bubble--sm { font-size: 0.8rem; min-height: 36px; }

/* ── Listening row ────────────────────────────────────────── */
.listening-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 700;
  animation: fadePulse 2s ease-in-out infinite;
}
@keyframes fadePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ─────────────────────────────────────────────────────────
 *  IMMERSIVE / KIOSK MODE
 *  Activated by JS adding `body.immersive` whenever the
 *  active state is anything other than the code-entry form.
 *  Goal: every post-verify stage fills 100vw × 100vh with
 *  zero page scroll on desktop, tablet, mobile (portrait
 *  & landscape). Aspect ratios are preserved for videos.
 * ───────────────────────────────────────────────────────── */
html:has(body.immersive),
body.immersive {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Hide all standard page chrome during immersive flow */
body.immersive .filmstrip,
body.immersive .brand-title,
body.immersive .brand-subtitle,
body.immersive .user-bar { display: none !important; }

/* Reset the layout shift the user-bar normally pushes on .main */
body.immersive:has(.user-bar:not(.hidden)) .main { padding-top: 0; }

/* Main + card fill the viewport, lose all framing */
body.immersive {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.immersive .main {
  flex: 1 1 auto;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  padding: 0;
  margin: 0;
  gap: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
body.immersive .card {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none !important;
  max-height: none !important;
  border: none;
  border-radius: 0;
  background: #000;
  padding: 0;
  margin: 0;
  box-shadow: none;
  gap: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* The active state is a flex column that fills the card */
body.immersive .state:not(.hidden) {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 28px 32px;
  box-sizing: border-box;
  overflow: hidden;
  min-height: 0;
}

/* ── HOST INTRO (welcome) ───────────────────────────────────
 * Video dominates; aspect ratio preserved with letterbox. */
body.immersive #state-welcome .avatar-video-wrap {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
body.immersive #state-welcome .avatar-welcome-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0;
}
body.immersive #state-welcome .host-bubble:not(.hidden),
body.immersive #state-welcome .listening-row:not(.hidden),
body.immersive #state-welcome .btn-start-audition:not(.hidden) {
  flex: 0 0 auto;
}

/* ── GET READY + RECORDING ──────────────────────────────────
 * Camera-wrap fills available height; video fills wrap (cover). */
body.immersive #state-getready .get-ready-avatar,
body.immersive #state-getready .host-bubble,
body.immersive #state-recording .timer,
body.immersive #state-recording .card-text,
body.immersive #state-review  .review-hint,
body.immersive #state-review  .submit-error,
body.immersive #state-review  .review-actions {
  flex: 0 0 auto;
}

body.immersive #state-getready .camera-wrap,
body.immersive #state-recording .camera-wrap,
body.immersive #state-review .camera-wrap {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: none;
  height: auto;
  aspect-ratio: auto;       /* let flex sizing decide; video uses object-fit */
  margin: 0;
  border-radius: 14px;
  background: #000;
}

/* Recording: punchier timer for kiosk readability */
body.immersive #state-recording .timer { font-size: 4.4rem; }

/* Review: keep the action buttons comfortably below video */
body.immersive #state-review .review-actions {
  width: auto;
  gap: 16px;
}

/* ── UPLOADING / SUCCESS / ERROR ────────────────────────── */
body.immersive #state-uploading,
body.immersive #state-success,
body.immersive #state-error {
  justify-content: center;
  text-align: center;
}

/* ── Tablet ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  body.immersive .state:not(.hidden) {
    padding: 22px 22px 24px;
    gap: 14px;
  }
}

/* ── Mobile portrait & small landscape ─────────────────── */
@media (max-width: 640px) {
  body.immersive .state:not(.hidden) {
    padding: 14px 12px 16px;
    gap: 10px;
  }
  body.immersive #state-recording .timer { font-size: 2.6rem; }
  body.immersive #state-getready .get-ready-avatar { width: 64px; }
  body.immersive #state-review .review-actions { gap: 10px; }
  body.immersive .card-text { font-size: 0.78rem; max-width: 92vw; }
  body.immersive .host-bubble { font-size: 0.82rem; }
}

/* Landscape phones — very short viewport, hide ancillary text
 * to keep video + controls fully visible without scrolling */
@media (max-height: 480px) and (orientation: landscape) {
  body.immersive #state-recording .card-text,
  body.immersive #state-review .review-hint { display: none; }
  body.immersive #state-recording .timer { font-size: 2.2rem; }
  body.immersive .state:not(.hidden) { padding: 8px 10px; gap: 6px; }
}

/* ── Fullscreen logo loop (BBC-style screensaver) ────────── */
.logo-loop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 9999;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-loop-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-loop-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  background: rgba(0, 0, 0, 0.55);
  color: #f5c518;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border: 1px solid rgba(245, 197, 24, 0.35);
  border-radius: 30px;
  backdrop-filter: blur(6px);
  white-space: nowrap;
  animation: logoHintFade 2.6s ease-in-out infinite;
}

.logo-loop-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f5c518;
  box-shadow: 0 0 0 0 rgba(245, 197, 24, 0.7);
  animation: logoDotPulse 1.4s ease-in-out infinite;
}

@keyframes logoHintFade {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 1; }
}

@keyframes logoDotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(245, 197, 24, 0.7); }
  70%  { box-shadow: 0 0 0 12px rgba(245, 197, 24, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 197, 24, 0); }
}

/* ── HeyGen avatar welcome video ─────────────────────────── */
.avatar-video-wrap {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  line-height: 0;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(245,197,24,0.15);
}

.avatar-welcome-video {
  width: 100%;
  max-height: 75vh;
  display: block;
  border-radius: 14px;
  object-fit: cover;
}

/* ── Premium / immersive sizing for video-heavy states ───── *
 * Default card is 480px (great for the code-entry form).
 * For welcome (host intro), get-ready, recording and review,
 * widen the card so the video containers feel broadcast-grade.
 * Uses :has() — supported in all modern evergreen browsers,
 * which is fine for the kiosk demo target.                    */
.card:has(#state-welcome:not(.hidden)),
.card:has(#state-getready:not(.hidden)),
.card:has(#state-recording:not(.hidden)),
.card:has(#state-review:not(.hidden)) {
  max-width: min(1100px, 94vw);
  padding: 28px 28px 30px;
  transition: max-width 0.35s ease;
}

/* Get-ready: shrink the host portrait so the camera dominates */
.card:has(#state-getready:not(.hidden)) .host-image--mini {
  width: 110px;
  align-self: center;
}
#state-getready { gap: 14px; }

/* Recording: bigger timer for kiosk readability */
.card:has(#state-recording:not(.hidden)) .timer {
  font-size: 4.2rem;
}

/* Review: keep action buttons comfortably spaced under the larger video */
.card:has(#state-review:not(.hidden)) .review-actions {
  margin-top: 6px;
}

/* Camera + review videos — make sure they stay balanced and never
 * become awkwardly tall on wide cards. 16/9 aspect-ratio on the
 * wrap already handles this, but cap the wrap width slightly so
 * the video frame doesn't bleed past readable scale on huge screens. */
#state-getready .camera-wrap,
#state-recording .camera-wrap,
#state-review .camera-wrap {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

/* Mobile: keep the card snug — wide cards waste space on narrow screens */
@media (max-width: 640px) {
  .card:has(#state-welcome:not(.hidden)),
  .card:has(#state-getready:not(.hidden)),
  .card:has(#state-recording:not(.hidden)),
  .card:has(#state-review:not(.hidden)) {
    max-width: 100%;
    padding: 22px 18px 24px;
  }
  .card:has(#state-recording:not(.hidden)) .timer {
    font-size: 3rem;
  }
  .avatar-welcome-video {
    max-height: 60vh;
  }
}

/* ── Start Audition CTA button ────────────────────────────── */
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,197,24,0.55), 0 4px 18px rgba(245,197,24,0.30); }
  50%       { box-shadow: 0 0 0 10px rgba(245,197,24,0),  0 6px 28px rgba(245,197,24,0.50); }
}

.btn-start-audition {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 36px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #000;
  background: var(--gold);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  animation: btnPulse 2s ease-in-out infinite;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  margin-top: 4px;
}

.btn-start-audition:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  animation-play-state: paused;
  box-shadow: 0 8px 32px rgba(245,197,24,0.55);
}

.btn-start-audition:active {
  transform: translateY(0);
  opacity: 1;
}

/* ── Get-ready layout ─────────────────────────────────────── */
.get-ready-avatar {
  width: 90px;
  animation: avatarFloat 4s ease-in-out infinite;
}
.host-image--mini {
  width: 100%;
  border-radius: 10px;
  aspect-ratio: 3/4;
  object-fit: cover;
  border: 1px solid rgba(245,197,24,0.2);
  box-shadow: 0 0 20px 4px rgba(34,197,94,0.3);
}

/* ── Camera wrap ──────────────────────────────────────────── */
.camera-wrap {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16/9;
}
#preview, #preview-rec {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transform: scaleX(-1);
}

/* ── REC badge ────────────────────────────────────────────── */
.rec-badge {
  position: absolute; top: 10px; left: 12px;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 3px 9px; border-radius: 20px;
  display: flex; align-items: center; gap: 5px;
}
.rec-dot {
  width: 8px; height: 8px;
  background: #ef4444; border-radius: 50%;
  animation: blink 1s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Timer ────────────────────────────────────────────────── */
.timer {
  font-size: 3rem; font-weight: 900;
  color: var(--gold); letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 22px rgba(245,197,24,0.5);
}
.timer.urgent {
  color: #ef4444;
  text-shadow: 0 0 22px rgba(239,68,68,0.5);
  animation: timerPulse 0.5s ease-in-out infinite alternate;
}
@keyframes timerPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

/* ── Card text ────────────────────────────────────────────── */
.card-heading {
  font-size: 1.15rem; font-weight: 800;
  letter-spacing: 0.04em; color: var(--gold); text-align: center;
}
.card-text {
  font-size: 0.84rem; color: var(--text-dim);
  text-align: center; line-height: 1.6; max-width: 360px;
}

/* ── Review state ─────────────────────────────────────────── */
.review-video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);   /* mirror like the live camera */
  border-radius: 0;
}

.review-hint {
  font-size: 0.80rem;
  color: var(--text-dim);
}

.submit-error {
  width: 100%;
  font-size: 0.77rem;
  color: #ef4444;
  text-align: center;
  padding: 7px 12px;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.20);
  border-radius: 8px;
  line-height: 1.4;
}

.review-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.btn-retake,
.btn-submit {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-retake {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1.5px solid var(--card-border);
}
.btn-retake:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.25);
}

.btn-submit {
  background: var(--gold);
  color: #000;
  box-shadow: 0 4px 18px rgba(245,197,24,0.35);
}
.btn-submit:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(245,197,24,0.50);
}
.btn-submit:active,
.btn-retake:active { transform: translateY(0); }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  width: 52px; height: 52px;
  border: 3px solid var(--card-border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════
 *  CINEMATIC LIVE-AUDITION STUDIO  (#state-recording)
 *  Edge-to-edge fullscreen camera + broadcast-style overlays.
 *  Scoped entirely to the recording state — does not affect any
 *  other screen, the live site, or recording/upload logic.
 * ══════════════════════════════════════════════════════════════ */

/* Make the recording state itself a true fullscreen black canvas */
body.immersive .state#state-recording:not(.hidden) {
  padding: 0 !important;
  gap: 0 !important;
  background: #000;
  position: relative;
  overflow: hidden;
}
/* Force the immersive card to drop its inner padding only when
 * the recording state is active, so the studio reaches the edges. */
body.immersive .card:has(#state-recording:not(.hidden)) {
  padding: 0 !important;
  background: #000 !important;
  border: none !important;
  box-shadow: none !important;
}

.studio-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: #000;
  overflow: hidden;
  display: block;
}

/* ── Camera feed: edge-to-edge, true fullscreen ─────────── */
.studio-feed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);
  background: #000;
  z-index: 1;
}

/* ── Cinematic gradient veils ───────────────────────────── */
.studio-veil {
  position: absolute;
  left: 0; right: 0;
  pointer-events: none;
  z-index: 2;
}
.studio-veil-top {
  top: 0;
  height: 28%;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.78) 0%,
    rgba(0,0,0,0.45) 55%,
    rgba(0,0,0,0) 100%
  );
}
.studio-veil-bottom {
  bottom: 0;
  height: 42%;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.88) 0%,
    rgba(0,0,0,0.55) 55%,
    rgba(0,0,0,0) 100%
  );
}

/* ── Top bar: REC LIVE + brand ──────────────────────────── */
.studio-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 32px;
  z-index: 5;
  pointer-events: none;
}

.studio-live {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 14px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  box-shadow:
    0 4px 18px rgba(0,0,0,0.5),
    0 0 0 1px rgba(239,68,68,0.18);
}
.studio-live-dot {
  width: 10px; height: 10px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow:
    0 0 0 3px rgba(239,68,68,0.22),
    0 0 14px rgba(239,68,68,0.85);
  animation: studioLiveDot 1.1s ease-in-out infinite;
}
@keyframes studioLiveDot {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%      { opacity: 0.55; transform: scale(0.85); }
}
.studio-live-rec   { color: #ef4444; }
.studio-live-sep   { color: rgba(255,255,255,0.35); margin: 0 2px; font-size: 0.6em; }
.studio-live-text  { color: #fff; }

.studio-brand-logo {
  display: block;
  height: clamp(56px, 9.5vh, 110px);
  width: auto;
  opacity: 0.92;
  filter: drop-shadow(0 4px 18px rgba(0,0,0,0.55))
          drop-shadow(0 0 14px rgba(245,197,24,0.18));
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ── Side panels (subtle, glassy) ───────────────────────── */
.studio-side {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 14px 18px;
  background: rgba(0,0,0,0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(245,197,24,0.18);
  border-radius: 14px;
  color: #fff;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  z-index: 4;
  max-width: 200px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
}
.studio-side-left  { left: 28px; }
.studio-side-right { right: 28px; text-align: right; }

.studio-side-title {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.studio-side-list {
  margin: 0; padding: 0;
  list-style: none;
  font-size: 0.78rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.9);
}
.studio-side-list li {
  position: relative;
  padding-left: 14px;
}
.studio-side-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.65em;
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(245,197,24,0.7);
}
.studio-side-quote {
  margin: 0;
  font-size: 0.82rem;
  font-style: italic;
  color: rgba(255,255,255,0.92);
  line-height: 1.45;
}

/* ── Bottom HUD: progress + cinematic timer + instruction ─ */
.studio-hud {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 32px 30px;
  z-index: 6;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.studio-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(720px, 86%);
  color: rgba(255,255,255,0.75);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}
.studio-progress-track {
  flex: 1 1 auto;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.studio-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(245,197,24,0.7);
  transition: width 0.95s linear;
}

.studio-timer-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.studio-timer-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.42em;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}

/* Override generic .timer for the studio HUD: cinematic, gold-glow */
.studio-timer.timer {
  font-size: clamp(3.5rem, 8.5vw, 6.5rem);
  font-weight: 900;
  line-height: 1;
  color: var(--gold);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 18px rgba(245,197,24,0.55),
    0 0 42px rgba(245,197,24,0.30),
    0 4px 30px rgba(0,0,0,0.85);
}
.studio-timer.timer.urgent {
  color: #ef4444;
  text-shadow:
    0 0 18px rgba(239,68,68,0.65),
    0 0 42px rgba(239,68,68,0.35),
    0 4px 30px rgba(0,0,0,0.85);
}

.studio-instruction {
  margin: 6px 0 0;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.85);
}
.studio-instruction-sub {
  margin: 0;
  color: rgba(255,255,255,0.62);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}

/* ── Override the older immersive recording rules ─────────
 * The previous rules sized .camera-wrap and .timer; the new
 * studio markup doesn't use .camera-wrap, but be defensive. */
body.immersive #state-recording .studio-stage { aspect-ratio: auto; }

/* ── Tablet ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .studio-topbar { padding: 18px 22px; }
  .studio-hud    { padding: 0 22px 24px; }
  .studio-side   { max-width: 170px; padding: 12px 14px; }
  .studio-side-left  { left: 18px; }
  .studio-side-right { right: 18px; }
  .studio-brand-name { font-size: 0.82rem; letter-spacing: 0.26em; }
  .studio-brand-sub  { font-size: 0.56rem; letter-spacing: 0.26em; }
}

/* ── Mobile portrait ────────────────────────────────────── */
@media (max-width: 640px) {
  .studio-topbar { padding: 14px 14px; }
  .studio-hud    { padding: 0 14px 18px; gap: 9px; }
  .studio-live   { padding: 7px 12px 7px 10px; font-size: 0.66rem; gap: 8px; }
  .studio-live-dot { width: 8px; height: 8px; }
  .studio-brand-name { font-size: 0.7rem; letter-spacing: 0.22em; }
  .studio-brand-sub  { font-size: 0.5rem;  letter-spacing: 0.22em; margin-top: 2px; }
  .studio-side       { display: none; }   /* keep mobile uncluttered */
  .studio-progress   { width: 96%; font-size: 0.62rem; gap: 10px; }
  .studio-timer-label { font-size: 0.55rem; letter-spacing: 0.34em; }
  .studio-instruction      { font-size: 0.78rem; }
  .studio-instruction-sub  { font-size: 0.6rem;  letter-spacing: 0.16em; }
}

/* ── Landscape phones (very short viewport) ─────────────── */
@media (max-height: 480px) and (orientation: landscape) {
  .studio-topbar { padding: 10px 16px; }
  .studio-hud    { padding: 0 16px 10px; gap: 6px; }
  .studio-side   { display: none; }
  .studio-instruction-sub { display: none; }
  .studio-timer.timer { font-size: clamp(2.2rem, 7vh, 3.6rem); }
  .studio-timer-label { font-size: 0.52rem; }
}

/* ══════════════════════════════════════════════════════════════
 *  CINEMATIC FINALE  (#state-success)
 *  Broadcast-style "audition locked in" finish screen.
 *  Fully scoped to the success state — leaves error / other
 *  screens, the live site, and all submit/reset logic untouched.
 * ══════════════════════════════════════════════════════════════ */

body.immersive .state#state-success:not(.hidden) {
  padding: 0 !important;
  gap: 0 !important;
  background: #000;
  position: relative;
  overflow: hidden;
}
body.immersive .card:has(#state-success:not(.hidden)) {
  padding: 0 !important;
  background: #000 !important;
  border: none !important;
  box-shadow: none !important;
}

.finale-stage {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 700px at 50% 35%,
      rgba(245,197,24,0.12) 0%,
      rgba(245,197,24,0.04) 35%,
      rgba(0,0,0,0) 70%),
    radial-gradient(900px 600px at 50% 110%,
      rgba(245,197,24,0.10) 0%,
      rgba(0,0,0,0) 60%),
    #060606;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 36px 32px 28px;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  animation: finaleStageIn 700ms ease-out both;
}
@keyframes finaleStageIn {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Spotlight beams (subtle, broadcast feel) ──────────── */
.finale-spotlight {
  position: absolute;
  top: -10%;
  width: 60vmax;
  height: 140vmax;
  pointer-events: none;
  filter: blur(6px);
  opacity: 0.35;
  z-index: 0;
}
.finale-spotlight-l {
  left: -28vmax;
  background: linear-gradient(
    115deg,
    rgba(245,197,24,0) 38%,
    rgba(245,197,24,0.18) 50%,
    rgba(245,197,24,0) 62%
  );
  transform: rotate(14deg);
  animation: finaleBeam 9s ease-in-out infinite alternate;
}
.finale-spotlight-r {
  right: -28vmax;
  background: linear-gradient(
    -115deg,
    rgba(245,197,24,0) 38%,
    rgba(245,197,24,0.16) 50%,
    rgba(245,197,24,0) 62%
  );
  transform: rotate(-14deg);
  animation: finaleBeam 11s ease-in-out infinite alternate-reverse;
}
@keyframes finaleBeam {
  from { opacity: 0.28; }
  to   { opacity: 0.45; }
}

/* ── Drifting gold particles ───────────────────────────── */
.finale-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.finale-particles span {
  position: absolute;
  bottom: -8px;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 8px rgba(245,197,24,0.8);
  animation: finaleParticle 11s linear infinite;
}
.finale-particles span:nth-child(1)  { left:  6%; width: 4px; height: 4px; animation-delay: 0.0s;  animation-duration: 12s; }
.finale-particles span:nth-child(2)  { left: 14%; width: 7px; height: 7px; animation-delay: 1.5s;  animation-duration: 14s; }
.finale-particles span:nth-child(3)  { left: 22%; width: 5px; height: 5px; animation-delay: 3.0s;  animation-duration: 10s; }
.finale-particles span:nth-child(4)  { left: 33%; width: 4px; height: 4px; animation-delay: 4.5s;  animation-duration: 13s; }
.finale-particles span:nth-child(5)  { left: 42%; width: 6px; height: 6px; animation-delay: 0.6s;  animation-duration: 15s; }
.finale-particles span:nth-child(6)  { left: 51%; width: 5px; height: 5px; animation-delay: 2.4s;  animation-duration: 11s; }
.finale-particles span:nth-child(7)  { left: 60%; width: 7px; height: 7px; animation-delay: 5.5s;  animation-duration: 12s; }
.finale-particles span:nth-child(8)  { left: 68%; width: 4px; height: 4px; animation-delay: 1.2s;  animation-duration: 14s; }
.finale-particles span:nth-child(9)  { left: 76%; width: 5px; height: 5px; animation-delay: 3.8s;  animation-duration: 10s; }
.finale-particles span:nth-child(10) { left: 84%; width: 6px; height: 6px; animation-delay: 5.0s;  animation-duration: 13s; }
.finale-particles span:nth-child(11) { left: 91%; width: 4px; height: 4px; animation-delay: 0.9s;  animation-duration: 12s; }
.finale-particles span:nth-child(12) { left: 96%; width: 5px; height: 5px; animation-delay: 4.2s;  animation-duration: 15s; }
@keyframes finaleParticle {
  0%   { transform: translateY(0)        scale(1);   opacity: 0;    }
  10%  {                                              opacity: 0.85; }
  90%  {                                              opacity: 0.85; }
  100% { transform: translateY(-110vh)   scale(0.4); opacity: 0;    }
}

/* ── Top brand strip ───────────────────────────────────── */
.finale-brand {
  position: relative;
  z-index: 4;
  text-align: center;
  color: #fff;
  line-height: 1.15;
  animation: finaleFadeDown 600ms 80ms ease-out both;
}
.finale-brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.42em;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(245,197,24,0.45);
}
.finale-brand-sub {
  margin-top: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  color: rgba(255,255,255,0.62);
  text-transform: uppercase;
}
@keyframes finaleFadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Center: check + headline + subtitle ─────────────── */
.finale-center {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.finale-check {
  position: relative;
  width: 156px;
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.finale-check-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(245,197,24,0.5);
  opacity: 0;
  animation: finaleRing 2.4s ease-out infinite;
}
.finale-check-ring-2 { animation-delay: 0.7s; }
.finale-check-ring-3 { animation-delay: 1.4s; }
@keyframes finaleRing {
  0%   { transform: scale(0.55); opacity: 0;   }
  20%  {                          opacity: 0.7; }
  100% { transform: scale(1.6);  opacity: 0;   }
}
.finale-check-core {
  position: relative;
  width: 110px; height: 110px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%,
      rgba(245,197,24,0.32) 0%,
      rgba(245,197,24,0.10) 60%,
      rgba(0,0,0,0) 100%),
    linear-gradient(160deg, #1a1304 0%, #0a0a0a 100%);
  border: 2px solid rgba(245,197,24,0.7);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 6px rgba(245,197,24,0.08),
    0 0 60px rgba(245,197,24,0.45),
    inset 0 0 30px rgba(245,197,24,0.18);
  animation: finaleCheckPop 800ms 120ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.finale-check-core svg {
  filter: drop-shadow(0 0 10px rgba(245,197,24,0.7));
  animation: finaleCheckDraw 600ms 600ms ease-out both;
}
@keyframes finaleCheckPop {
  from { transform: scale(0.55); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
@keyframes finaleCheckDraw {
  from { stroke-dasharray: 0 100;   }
  to   { stroke-dasharray: 100 0;   }
}

.finale-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5em;
  color: var(--gold);
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(245,197,24,0.45);
  animation: finaleFadeUp 600ms 340ms ease-out both;
}
.finale-headline {
  margin: 0;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.012em;
  color: #fff;
  text-shadow: 0 4px 40px rgba(0,0,0,0.6);
  animation: finaleFadeUp 700ms 440ms ease-out both;
}
.finale-headline-accent {
  display: block;
  margin-top: 6px;
  background: linear-gradient(180deg, #ffe26b 0%, var(--gold) 60%, var(--gold-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(245,197,24,0.45));
}
.finale-subtitle {
  margin: 4px 0 0;
  font-size: clamp(0.92rem, 1.4vw, 1.05rem);
  font-weight: 500;
  line-height: 1.55;
  color: rgba(255,255,255,0.78);
  max-width: 580px;
  animation: finaleFadeUp 700ms 560ms ease-out both;
}
@keyframes finaleFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Next-step panel ─────────────────────────────────── */
.finale-next {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 520px;
  padding: 14px 20px;
  background: rgba(20,16,8,0.58);
  border: 1px solid rgba(245,197,24,0.22);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.55);
  text-align: left;
  animation: finaleFadeUp 700ms 700ms ease-out both;
}
.finale-next-icon {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(245,197,24,0.10);
  border: 1px solid rgba(245,197,24,0.35);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.finale-next-text { line-height: 1.45; }
.finale-next-title {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
.finale-next-body {
  font-size: 0.84rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
}

/* ── Auto-reset countdown HUD ────────────────────────── */
.finale-reset {
  position: relative;
  z-index: 4;
  width: min(640px, 88%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  animation: finaleFadeUp 700ms 820ms ease-out both;
}
.finale-reset-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.finale-reset-num {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(245,197,24,0.55);
  min-width: 1.2em;
  text-align: right;
}
.finale-reset-bar {
  height: 3px;
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.finale-reset-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(245,197,24,0.7);
}

/* ── Tablet ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .finale-stage      { padding: 28px 22px 22px; }
  .finale-check      { width: 132px; height: 132px; }
  .finale-check-core { width: 96px;  height: 96px; }
  .finale-check-core svg { width: 56px; height: 56px; }
}

/* ── Mobile portrait ────────────────────────────────────── */
@media (max-width: 640px) {
  .finale-stage      { padding: 22px 16px 18px; }
  .finale-brand-name { font-size: 0.78rem; letter-spacing: 0.32em; }
  .finale-brand-sub  { font-size: 0.52rem; letter-spacing: 0.28em; }
  .finale-check      { width: 112px; height: 112px; margin-bottom: 2px; }
  .finale-check-core { width: 84px;  height: 84px; }
  .finale-check-core svg { width: 48px; height: 48px; }
  .finale-eyebrow    { font-size: 0.62rem; letter-spacing: 0.4em; }
  .finale-subtitle   { font-size: 0.84rem; max-width: 92vw; }
  .finale-next       { gap: 10px; padding: 12px 14px; }
  .finale-next-icon  { width: 32px; height: 32px; }
  .finale-next-body  { font-size: 0.78rem; }
  .finale-reset-label { font-size: 0.6rem; letter-spacing: 0.26em; }
  .finale-particles span { transform-origin: center; }
}

/* ── Landscape phones (very short viewport) ─────────────── */
@media (max-height: 480px) and (orientation: landscape) {
  .finale-stage     { padding: 14px 18px 12px; }
  .finale-check     { width: 84px; height: 84px; margin-bottom: 0; }
  .finale-check-core { width: 64px; height: 64px; }
  .finale-check-core svg { width: 38px; height: 38px; }
  .finale-eyebrow   { display: none; }
  .finale-subtitle  { font-size: 0.78rem; }
  .finale-next      { display: none; }
  .finale-particles { display: none; }
}

/* ── Icon circles ─────────────────────────────────────────── */
.icon-circle {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 900; border: 2.5px solid;
}
.icon-success { border-color: #22c55e; color: #22c55e; }
.icon-error   { border-color: #ef4444; color: #ef4444; }
