/* ==========================================================================
   SHREYA - THE 20TH CHAPTER | CINEMATIC SURPRISE STYLESHEET
   Mobile-First · 60fps GPU Accelerated · Distinct Theatrical Aesthetics
   ========================================================================== */

:root {
    --bg-noir: #07070a;
    --bg-gradient: radial-gradient(circle at 50% 30%, #170910 0%, #07070a 100%);
    --crimson: #e62040;
    --crimson-glow: rgba(230, 32, 64, 0.55);
    --velvet-dark: #40050e;
    --gold: #d4af37;
    --gold-light: #fbe38b;
    --gold-glow: rgba(212, 175, 55, 0.5);
    --film-amber: #f8c15c;
    --glass-surface: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.12);
    --bulb-warm: #ffd770;
    --bulb-glow: rgba(255, 215, 112, 0.85);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-script: 'Dancing Script', cursive;
    --font-chalk: 'Caveat', cursive;
    --font-mono: 'Special Elite', 'Courier New', monospace;
    --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base Reset & Mobile Fit */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: var(--bg-noir);
    color: #f5f5f7;
    font-family: var(--font-sans);
    line-height: 1.6;
    touch-action: manipulation;
}

body {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
    background: var(--bg-gradient);
    background-attachment: fixed;
}

/* ==========================================================================
   CINEMATIC LETTERBOX (2.39:1) BARS
   ========================================================================== */

.letterbox-bar {
    position: fixed;
    left: 0;
    width: 100%;
    height: 0;
    background: #000;
    z-index: 997;
    transition: height 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

.letterbox-top { top: 0; }
.letterbox-bottom { bottom: 0; }

body.letterbox-active .letterbox-bar {
    height: clamp(22px, 4.5vh, 46px);
}

/* Cinematic Grain & Vignette Overlays */
.cinematic-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.cinematic-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 998;
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.75) 100%);
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Top Navigation Controls Bar */
.top-controls-bar {
    position: fixed;
    top: calc(16px + var(--safe-top));
    right: calc(16px + var(--safe-right));
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.music-retry-chip {
    background: rgba(230, 32, 64, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 6px 14px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(230, 32, 64, 0.5);
    animation: retryPulse 1.8s infinite ease-in-out;
}

@keyframes retryPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Floating Audio Visualizer Toggle (GPU scaleY Transform) */
.audio-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(15, 12, 18, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    color: var(--gold-light);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, border-color 0.3s ease;
}

.audio-toggle-btn:hover {
    border-color: var(--gold);
    transform: scale(1.04);
}

.eq-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
    width: 16px;
}

.eq-bar {
    width: 3px;
    height: 16px;
    background: var(--gold);
    border-radius: 2px;
    transform-origin: bottom;
    transform: scaleY(0.25);
    transition: transform 0.2s ease;
}

.audio-toggle-btn.playing .eq-bar:nth-child(1) {
    animation: eqPulse 0.6s infinite alternate ease-in-out;
}
.audio-toggle-btn.playing .eq-bar:nth-child(2) {
    animation: eqPulse 0.9s infinite alternate ease-in-out 0.2s;
}
.audio-toggle-btn.playing .eq-bar:nth-child(3) {
    animation: eqPulse 0.7s infinite alternate ease-in-out 0.4s;
}

@keyframes eqPulse {
    0% { transform: scaleY(0.25); }
    100% { transform: scaleY(1); }
}

/* ==========================================================================
   SCENE CONTAINER & TRANSITIONS
   ========================================================================== */

.scene {
    width: 100%;
    min-height: 100vh;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 80px;
    text-align: center;
    opacity: 0;
    transform: scale(0.97) translateY(12px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 10;
    position: relative;
}

.scene.active {
    display: flex;
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Generic UI Components */
.badge-drama {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(230, 32, 64, 0.15);
    border: 1px solid rgba(230, 32, 64, 0.4);
    border-radius: 20px;
    color: var(--crimson);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.btn-cinema {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 36px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #a71128, var(--crimson));
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--crimson-glow);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
}

.btn-cinema::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: rotate(30deg) translateY(-100%);
    transition: transform 0.6s ease;
}

.btn-cinema:hover::after {
    transform: rotate(30deg) translateY(100%);
}

.btn-cinema:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 14px 40px rgba(230, 32, 64, 0.75);
    border-color: var(--gold-light);
}

.btn-cinema:active {
    transform: translateY(1px) scale(0.98);
}

.btn-gold {
    background: linear-gradient(135deg, #99781d, var(--gold));
    box-shadow: 0 10px 30px var(--gold-glow);
    color: #0d0a04;
    font-weight: 700;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-gold:hover {
    box-shadow: 0 14px 40px rgba(212, 175, 55, 0.8);
}

.glass-box {
    background: rgba(25, 18, 26, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 28px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(212, 175, 55, 0.1);
    padding: 36px 24px;
    width: 100%;
    max-width: 540px;
    position: relative;
    margin: 0 auto;
}

/* ==========================================================================
   SCENE 0: COUNTDOWN GATEKEEPER
   ========================================================================== */

#scene-countdown .premiere-tag {
    color: var(--gold);
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}

.countdown-title {
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, var(--gold-light) 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.countdown-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

.countdown-timer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.time-card {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-number {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1.1;
}

.time-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

/* ==========================================================================
   THEME: BLOSSOM ENTRY (PASTEL FLORAL PURITY - MATCHING USER SCREENSHOTS)
   ========================================================================== */

body.theme-blossom {
    background: linear-gradient(135deg, #fff0f3 0%, #fde2e8 45%, #fcd5ce 100%) !important;
}

body.theme-blossom .cinematic-vignette,
body.theme-blossom .cinematic-grain,
body.theme-blossom .letterbox-bar,
body.theme-blossom .top-controls-bar,
body.theme-blossom .cinematic-ost-dock,
body.theme-blossom .global-footer,
body.theme-blossom #particle-canvas,
body.theme-blossom #confetti-canvas {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ==========================================================================
   SCENE 0.5: BLOSSOM TOUCH & PIN LOCK SCREEN
   ========================================================================== */

#scene-blossom {
    background: transparent;
    position: relative;
    overflow: hidden;
    padding: 20px;
    color: #4a202c;
    min-height: 100vh;
}

.blossom-center-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Great Vibes', var(--font-script), cursive;
    font-size: clamp(2.8rem, 8vw, 4.6rem);
    font-weight: 400;
    font-style: italic;
    color: #722f42;
    text-shadow: 0 2px 18px rgba(255, 255, 255, 0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
    letter-spacing: 1px;
}

.blossom-center-prompt.hidden {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.9);
}

.blossom-corner-trigger {
    position: absolute;
    top: calc(28px + var(--safe-top));
    right: calc(32px + var(--safe-right));
    width: 105px;
    height: 105px;
    cursor: pointer;
    z-index: 100;
    background: none;
    border: none;
    outline: none;
    animation: blossomFloat 3.2s ease-in-out infinite;
    filter: drop-shadow(0 8px 22px rgba(230, 32, 64, 0.32));
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding: 0;
}

.blossom-corner-trigger:hover {
    transform: scale(1.18) rotate(10deg);
    filter: drop-shadow(0 12px 28px rgba(230, 32, 64, 0.48));
}

.blossom-corner-trigger:active {
    transform: scale(0.92);
}

.blossom-img-flower {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    display: block;
}

@keyframes blossomFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(8deg); }
}

/* Floral Bloom Screen Fill */
.floral-bloom-canvas-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.floral-bloom-img {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left bottom;
    opacity: 0;
    transform: scale(0.85) translate(-20px, 20px);
    transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.floral-bloom-img.bloomed {
    opacity: 1;
    transform: scale(1) translate(0, 0);
}

/* PIN Lock Card */
.pin-lock-card {
    position: relative;
    z-index: 20;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    border-radius: 32px;
    padding: 28px 24px;
    max-width: 350px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 70px rgba(114, 47, 66, 0.22), 0 0 30px rgba(255, 255, 255, 0.6);
    opacity: 0;
    transform: translateY(30px) scale(0.92);
    pointer-events: none;
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    color: #4a1e2b;
    margin: 0 auto;
}

@media (min-width: 820px) {
    .pin-lock-card {
        margin: 0 0 0 auto !important;
        margin-right: clamp(40px, 12vw, 200px) !important;
    }
}

.pin-lock-card.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.pin-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: rgba(230, 32, 64, 0.1);
    border: 1px solid rgba(230, 32, 64, 0.3);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #e62040;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.pin-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 800;
    color: #4a1e2b;
    margin-bottom: 6px;
}

.pin-hint {
    font-size: 0.82rem;
    color: #834457;
    margin-bottom: 18px;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.pin-hint.error {
    color: #d61a38;
    font-weight: 700;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 22px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #bd6b82;
    background: transparent;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pin-dot.filled {
    background: #e62040;
    border-color: #e62040;
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(230, 32, 64, 0.5);
}

.pin-dot.success {
    background: #2ed573;
    border-color: #2ed573;
    box-shadow: 0 0 14px rgba(46, 213, 115, 0.6);
}

/* Shake Animation on Wrong PIN */
@keyframes pinCardShake {
    0%, 100% { transform: translateX(0); }
    15%, 55%, 85% { transform: translateX(-12px); }
    35%, 75% { transform: translateX(12px); }
}

.pin-lock-card.shake {
    animation: pinCardShake 0.5s ease-in-out;
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 250px;
    margin: 0 auto;
}

.pin-key {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(189, 107, 130, 0.35);
    color: #4a1e2b;
    font-family: var(--font-sans);
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(114, 47, 66, 0.08);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    user-select: none;
}

.pin-key:active {
    background: #ffd6df;
    transform: scale(0.92);
    border-color: #e62040;
}

.pin-key.key-action {
    font-size: 1.1rem;
    color: #834457;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}
.pin-key.key-action:active {
    background: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   VINTAGE 3-2-1 FILM LEADER COUNTDOWN OVERLAY
   ========================================================================== */

.film-leader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #050406;
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.film-leader-overlay.active {
    display: flex;
    opacity: 1;
}

.film-leader-lens {
    position: relative;
    width: 220px;
    height: 220px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 55, 0.15);
}

.film-leader-crosshair-h {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.film-leader-crosshair-v {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
}

.film-leader-sweep {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(255, 255, 255, 0.4) 0deg, transparent 90deg);
    animation: filmSweep 1s linear infinite;
}

@keyframes filmSweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.film-leader-num {
    position: relative;
    z-index: 10;
    font-family: var(--font-serif);
    font-size: 5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   SCENE 1: CLAPPERBOARD INTRO & MOVIE POSTER
   ========================================================================== */

.clapperboard-wrapper {
    width: 100%;
    max-width: 340px;
    margin: 0 auto 30px;
    perspective: 800px;
    cursor: pointer;
}

.clapperboard {
    background: #111;
    border: 2px solid #333;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(230, 32, 64, 0.2);
    transition: transform 0.3s ease;
}

.clapper-top {
    height: 48px;
    background: repeating-linear-gradient(
        -45deg,
        #fff,
        #fff 20px,
        #111 20px,
        #111 40px
    );
    border-bottom: 3px solid #000;
    transform-origin: bottom left;
    transition: transform 0.4s cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

.clapperboard.snapped .clapper-top {
    animation: clapperSnap 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes clapperSnap {
    0% { transform: rotate(-28deg); }
    40% { transform: rotate(0deg); }
    60% { transform: rotate(-8deg); }
    100% { transform: rotate(0deg); }
}

.clapper-body {
    padding: 16px;
    background: #141217;
    text-align: left;
    font-size: 0.75rem;
    color: #eee;
}

.clapper-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #2a2530;
    padding: 6px 0;
}

.clapper-label {
    color: var(--gold);
    font-weight: 600;
    letter-spacing: 1px;
}

.clapper-chalk-text {
    font-family: var(--font-chalk);
    font-size: 1.25rem;
    color: #f5f5f5;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
    letter-spacing: 0.5px;
}

.poster-preview {
    margin-top: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.4s, transform 1s ease 0.4s;
}

.poster-preview.show {
    opacity: 1;
    transform: translateY(0);
}

.poster-heroine-title {
    font-family: var(--font-serif);
    font-size: clamp(2.6rem, 8vw, 5.2rem);
    font-weight: 900;
    font-style: italic;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff 0%, var(--crimson) 50%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 40px var(--crimson-glow);
    margin-bottom: 6px;
}

.poster-tagline {
    font-size: clamp(0.9rem, 3vw, 1.25rem);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 24px;
}

.poster-ost-pill {
    margin: 0 auto 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid var(--gold);
    border-radius: 30px;
    font-size: 0.75rem;
    color: var(--gold-light);
}

/* ==========================================================================
   SCENE 2: PROLOGUE (FULL-BLEED CINEMA SUBTITLES)
   ========================================================================== */

.scene-prologue {
    background: #000;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.prologue-cinematic-stage {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: clamp(60px, 12vh, 120px);
}

.prologue-badge-wrap {
    position: absolute;
    top: calc(40px + var(--safe-top));
}

.prologue-subtitle-wrap {
    max-width: 680px;
    width: 90%;
    margin: 0 auto;
    text-align: center;
}

.prologue-subtitle-text {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 5vw, 2.6rem);
    font-weight: 600;
    color: #fff;
    line-height: 1.45;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.95), 0 0 30px rgba(212, 175, 55, 0.25);
}

.prologue-progress-line {
    position: absolute;
    bottom: calc(24px + var(--safe-bottom));
    left: 10%;
    width: 80%;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.prologue-progress-fill {
    width: 33.33%;
    height: 100%;
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold-glow);
    transition: width 0.4s ease;
}

.prologue-tap-prompt {
    position: absolute;
    bottom: calc(36px + var(--safe-bottom));
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    animation: pulsePrompt 2s infinite ease-in-out;
}

@keyframes pulsePrompt {
    0%, 100% { opacity: 0.35; transform: translateY(0); }
    50% { opacity: 0.85; transform: translateY(-3px); }
}

/* ==========================================================================
   SCENE 3: STAGE & SPOTLIGHTS & BALLOONS
   ========================================================================== */

.stage-spotlight {
    position: absolute;
    top: -100px;
    width: 300px;
    height: 500px;
    pointer-events: none;
    z-index: 2;
    opacity: 0.22;
    transition: opacity 1.2s ease, filter 1.2s ease;
}

.stage-spotlight-left {
    left: -50px;
    background: radial-gradient(ellipse at 20% 0%, rgba(255, 220, 150, 0.6) 0%, transparent 70%);
    transform: rotate(20deg);
}

.stage-spotlight-right {
    right: -50px;
    background: radial-gradient(ellipse at 80% 0%, rgba(255, 220, 150, 0.6) 0%, transparent 70%);
    transform: rotate(-20deg);
}

.lights-on .stage-spotlight {
    opacity: 0.65;
    filter: blur(10px);
}

.stage-floor {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 140px;
    background: linear-gradient(to top, rgba(20, 14, 24, 0.95), transparent);
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    pointer-events: none;
    z-index: 1;
}

.stage-control-box {
    margin-top: 100px;
    position: relative;
    z-index: 10;
}

.fairy-lights-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 140px;
    pointer-events: none;
    z-index: 6;
}

.wire-path {
    fill: none;
    stroke: #252528;
    stroke-width: 2.5;
}

.bulb-teardrop {
    position: absolute;
    width: 15px;
    height: 22px;
    border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
    background: #333;
    transform-origin: top center;
    transform: translate(-50%, 0);
    transition: background 0.8s ease, box-shadow 0.8s ease;
}

.lights-on .bulb-teardrop {
    background: radial-gradient(circle at 35% 35%, #fff, var(--bulb-warm) 65%, #c89518);
    box-shadow: 0 0 16px var(--bulb-glow), 0 0 32px var(--bulb-glow);
    animation: flicker var(--d, 1.5s) infinite alternate ease-in-out;
}

@keyframes flicker {
    0%, 100% {
        opacity: 0.95;
        box-shadow: 0 0 14px var(--bulb-glow), 0 0 28px var(--bulb-glow);
    }
    30% { opacity: 0.65; box-shadow: 0 0 6px var(--bulb-glow); }
    65% { opacity: 1; box-shadow: 0 0 22px var(--bulb-glow), 0 0 44px var(--bulb-glow); }
    85% { opacity: 0.8; box-shadow: 0 0 10px var(--bulb-glow); }
}

/* 3D Realistic Balloons */
.balloon {
    position: fixed;
    bottom: -160px;
    width: 64px;
    height: 82px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    z-index: 95;
    pointer-events: none;
    animation: balloonFloat 9s ease-in forwards;
    display: flex;
    justify-content: center;
}

.balloon::before {
    content: '';
    position: absolute;
    bottom: -5px;
    width: 10px;
    height: 7px;
    background: inherit;
    border-radius: 50%;
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -90px;
    width: 1px;
    height: 90px;
    background: rgba(255, 255, 255, 0.45);
    transform-origin: top;
    animation: stringWobble 2.5s infinite ease-in-out;
}

.balloon-shine {
    position: absolute;
    top: 16%;
    left: 18%;
    width: 14px;
    height: 24px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    filter: blur(2px);
    transform: rotate(28deg);
}

@keyframes balloonFloat {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.95; }
    85% { opacity: 0.95; }
    100% { transform: translateY(-135vh) rotate(15deg); opacity: 0; }
}

@keyframes stringWobble {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

/* ==========================================================================
   SCENE 4: RED VELVET CURTAIN REVEAL
   ========================================================================== */

#scene-curtain {
    padding: 0;
    overflow: hidden;
    perspective: 1200px;
}

.curtain-stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.curtain-panel {
    position: absolute;
    top: 0;
    width: 52%;
    height: 100%;
    background: repeating-linear-gradient(
        to right,
        #4e040f,
        #78081a 12%,
        #35020a 24%
    );
    z-index: 30;
    transition: transform 2.6s cubic-bezier(0.65, 0, 0.35, 1);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.85);
}

.curtain-left {
    left: 0;
    border-right: 4px solid var(--gold);
}

.curtain-right {
    right: 0;
    border-left: 4px solid var(--gold);
}

.curtain-open .curtain-left {
    transform: translateX(-105%) skewY(-4deg);
}

.curtain-open .curtain-right {
    transform: translateX(105%) skewY(4deg);
}

/* Sparkle Particle Styling */
.sparkle-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, #fff, var(--gold-light));
    box-shadow: 0 0 8px #fff, 0 0 16px var(--gold);
    animation: sparkleAnim 1.2s ease-in-out infinite;
}

@keyframes sparkleAnim {
    0%, 100% { opacity: 0; transform: scale(0.2); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ==========================================================================
   SCENE 5: THE LETTER (SCREENPLAY SCRIPT FORMAT)
   ========================================================================== */

.screenplay-wrapper {
    background: #141117;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 20px;
    padding: clamp(24px, 5vw, 42px);
    max-width: 650px;
    width: 92%;
    position: relative;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 30px rgba(212, 175, 55, 0.1);
    margin: 0 auto;
    text-align: left;
    cursor: pointer;
}

.screenplay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed rgba(212, 175, 55, 0.25);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.screenplay-slug {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--gold-light);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.screenplay-scene-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--crimson);
    letter-spacing: 1.5px;
}

.screenplay-character-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.screenplay-character {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #fff;
}

.screenplay-polaroid-thumb {
    position: relative;
    width: 58px;
    height: 68px;
    background: #fff;
    padding: 3px 3px 12px 3px;
    border-radius: 3px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    transform: rotate(4deg);
}

.screenplay-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

.tape-strip {
    position: absolute;
    top: -6px;
    left: 12px;
    width: 28px;
    height: 10px;
    background: rgba(255, 255, 255, 0.45);
    transform: rotate(-6deg);
    border-radius: 1px;
}

.screenplay-dialogue {
    font-family: var(--font-script);
    font-size: clamp(1.2rem, 3.2vw, 1.55rem);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.92);
    min-height: 180px;
    margin-bottom: 28px;
    white-space: pre-line;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.screenplay-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.letter-dots {
    display: flex;
    gap: 8px;
}

.letter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
}

.letter-dot.active {
    background: var(--gold);
    transform: scale(1.3);
    box-shadow: 0 0 10px var(--gold-glow);
}

/* ==========================================================================
   SCENE 5.5: "OUR STORY" DRAMA TIMELINE
   ========================================================================== */

.timeline-header {
    text-align: center;
    margin-bottom: 30px;
}

.timeline-episodes-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 640px;
    width: 90%;
    margin: 0 auto 36px;
}

.timeline-card {
    background: rgba(20, 16, 24, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 18px 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-card:hover, .timeline-card.revealed {
    border-color: var(--gold);
    background: rgba(28, 22, 34, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.15);
}

.timeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.timeline-ep-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--crimson);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.timeline-date-tag {
    font-size: 0.75rem;
    color: var(--gold-light);
}

.timeline-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 4px;
}

.timeline-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.timeline-card.revealed .timeline-body {
    max-height: 160px;
    opacity: 1;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.timeline-tap-hint {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 6px;
    text-align: right;
}

.timeline-card.revealed .timeline-tap-hint {
    display: none;
}

.timeline-footer-cta {
    text-align: center;
}

/* ==========================================================================
   SCENE 6: 11 SCENES GALLERY (35MM SPROCKET FILM REEL)
   ========================================================================== */

#scene-gallery {
    display: none;
    padding: 80px 0 120px;
    min-height: 100vh;
}

#scene-gallery.active {
    display: block;
}

.gallery-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.gallery-main-title {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    font-weight: 900;
    background: linear-gradient(135deg, #fff, var(--gold-light), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.gallery-sub {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95rem;
    letter-spacing: 2px;
}

/* 35mm Sprocket Borders Film Strip */
.sprocket-film-strip-wrap {
    position: relative;
    width: 100%;
    background: #0d0a10;
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    padding: 18px 0;
}

.sprocket-border {
    height: 16px;
    width: 100%;
    background-image: repeating-linear-gradient(
        to right,
        #000 0px,
        #000 12px,
        transparent 12px,
        transparent 26px
    );
    opacity: 0.6;
}

.film-reel-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 24px 20px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.film-reel-track::-webkit-scrollbar {
    height: 6px;
}

.film-reel-track::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.scene-polaroid {
    flex: 0 0 280px;
    scroll-snap-align: center;
    background: #15131a;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    display: flex;
    flex-direction: column;
}

.scene-polaroid:nth-child(even) {
    transform: rotate(-1.5deg);
}

.scene-polaroid:nth-child(odd) {
    transform: rotate(1.2deg);
}

@media (min-width: 768px) {
    .scene-polaroid {
        flex: 0 0 320px;
    }
    .scene-polaroid:hover {
        transform: rotate(0deg) translateY(-12px) scale(1.03) !important;
        box-shadow: 0 24px 60px var(--crimson-glow);
        border-color: var(--crimson);
    }
}

.polaroid-media-wrap {
    position: relative;
    width: 100%;
    height: 360px;
    overflow: hidden;
    background: #000;
}

.polaroid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.65) brightness(0.9);
    transition: filter 0.5s ease, transform 0.8s ease;
}

.scene-polaroid:hover .polaroid-img {
    filter: saturate(1.1) brightness(1);
    transform: scale(1.06);
}

.polaroid-ep-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--gold);
    color: var(--gold-light);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
}

.polaroid-content {
    padding: 18px 16px;
    background: #141218;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.polaroid-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.polaroid-caption {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
}

.gallery-footer-cta {
    text-align: center;
    margin-top: 40px;
    padding: 0 20px;
}

/* Lightbox Modal with Ken Burns Pan/Zoom */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 4, 8, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-close {
    position: absolute;
    top: calc(20px + var(--safe-top));
    right: calc(20px + var(--safe-right));
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: #fff;
    font-size: 1.8rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2005;
}

.lightbox-content {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.lightbox-img-frame {
    max-width: 100%;
    max-height: 65vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    margin-bottom: 16px;
}

.lightbox-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@keyframes kenBurnsZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

.lightbox-modal.active .lightbox-img {
    animation: kenBurnsZoom 14s alternate infinite ease-in-out;
}

.lightbox-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    color: var(--gold-light);
    margin-bottom: 6px;
}

.lightbox-caption {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 16px;
}

.lightbox-nav-btns {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ==========================================================================
   SCENE 6.5: "OPEN WHEN..." ENVELOPE CARDS
   ========================================================================== */

.openwhen-header {
    text-align: center;
    margin-bottom: 30px;
}

.openwhen-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    max-width: 800px;
    width: 90%;
    margin: 0 auto 36px;
}

.openwhen-card {
    background: #19141f;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    padding: 24px 20px;
    width: 240px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

.openwhen-card:hover {
    transform: translateY(-8px);
    border-color: var(--crimson);
    box-shadow: 0 15px 40px var(--crimson-glow);
}

.openwhen-seal {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.openwhen-card-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 8px;
}

.openwhen-card-prompt {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    margin-bottom: 14px;
    min-height: 38px;
}

.openwhen-open-btn {
    font-size: 0.75rem;
    color: var(--gold-light);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.openwhen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 4, 8, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.openwhen-modal.active {
    display: flex;
}

.openwhen-modal-card {
    background: #17131b;
    border: 1px solid var(--gold);
    border-radius: 24px;
    padding: 32px 24px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px var(--gold-glow);
}

.openwhen-stamp-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold);
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--gold-light);
    letter-spacing: 1.5px;
    margin-bottom: 14px;
}

.openwhen-modal-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 14px;
}

.openwhen-letter-paper {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin: 18px 0 24px;
    text-align: left;
}

.openwhen-modal-body {
    font-family: var(--font-script);
    font-size: 1.25rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.92);
    white-space: pre-line;
}

.openwhen-footer-cta {
    text-align: center;
}

/* ==========================================================================
   SCENE 7: BIRTHDAY CAKE, 3D TABLE & CONFETTI MOMENT
   ========================================================================== */

.cake-scene-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    padding-bottom: 20px;
}

.cake-table-surface {
    position: absolute;
    bottom: 5px;
    left: -10%;
    width: 120%;
    height: 40px;
    background: linear-gradient(to bottom, #2b1f1d, #140c0b);
    border-radius: 50%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95);
    z-index: 1;
}

.cake-plate {
    position: absolute;
    bottom: 12px;
    left: 5px;
    width: 230px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 30%, #fff, #ddd 60%, #999 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8);
    z-index: 2;
}

.cake-wrapper {
    position: relative;
    width: 240px;
    height: 230px;
    margin: 30px auto 10px;
    z-index: 5;
}

.cake-topper-20 {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--gold-light);
    background: linear-gradient(135deg, #fff 0%, var(--gold) 50%, #8c6d1f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.7));
    z-index: 15;
    animation: topperShimmer 2s infinite alternate ease-in-out;
}

@keyframes topperShimmer {
    0% { filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.6)); }
    100% { filter: drop-shadow(0 4px 16px rgba(255, 255, 255, 0.9)); }
}

.cake-layer {
    position: absolute;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 4;
}

.cake-bottom {
    bottom: 20px;
    left: 20px;
    width: 200px;
    height: 80px;
    background: linear-gradient(to right, #40050e, #8a0c20, #40050e);
    border-top: 6px solid #fbe38b;
}

.cake-middle {
    bottom: 95px;
    left: 45px;
    width: 150px;
    height: 60px;
    background: linear-gradient(to right, #6b0919, #b51532, #6b0919);
    border-top: 5px solid #fff;
}

.cake-top {
    bottom: 150px;
    left: 70px;
    width: 100px;
    height: 45px;
    background: linear-gradient(to right, #8a0c20, #e62040, #8a0c20);
    border-top: 4px solid #fbe38b;
}

.candles-row {
    position: absolute;
    top: 25px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 14px;
    z-index: 10;
}

.candle-unit {
    position: relative;
    width: 10px;
    height: 34px;
    background: repeating-linear-gradient(
        45deg,
        #fff,
        #fff 4px,
        var(--gold) 4px,
        var(--gold) 8px
    );
    border-radius: 3px;
    cursor: pointer;
}

.flame {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 18px;
    background: radial-gradient(circle at 40% 60%, #fff, #ffae19 60%, #ff4500 100%);
    border-radius: 50% 50% 20% 20%;
    box-shadow: 0 0 12px #ffae19, 0 0 24px #ff4500;
    animation: flameFlicker 0.6s infinite alternate ease-in-out;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.candle-unit.blown .flame {
    opacity: 0;
    transform: translateX(-50%) scale(0.2);
    pointer-events: none;
}

@keyframes flameFlicker {
    0% { transform: translateX(-50%) rotate(-3deg) scale(0.95); }
    100% { transform: translateX(-50%) rotate(3deg) scale(1.05); }
}

.cake-status-text {
    font-family: var(--font-serif);
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: var(--gold-light);
    margin-bottom: 20px;
}

/* Canvas Confetti */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1500;
}

/* ==========================================================================
   SCENE 9: VOICE NOTE PLAYER
   ========================================================================== */

.voice-note-card {
    background: rgba(22, 16, 26, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px 24px;
    max-width: 460px;
    width: 100%;
    margin: 0 auto 24px;
    text-align: center;
}

.voice-player-ctrls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.voice-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gold);
    color: #111;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--gold-glow);
}

.voice-progress-wrap {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.voice-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--crimson);
    transition: width 0.1s linear;
}

/* ==========================================================================
   SCENE 10: CREDITS (PLAYS ONCE) & STATIC FINAL CARD
   ========================================================================== */

#scene-credits {
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding-bottom: 120px; /* Safe clearance above music dock on 375px */
}

.credits-viewport-wrap {
    height: 52vh;
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
}

.credits-roll-box.crawl-active {
    animation: creditsCrawl 28s linear forwards;
}

.credits-roll-box:hover {
    animation-play-state: paused;
}

@keyframes creditsCrawl {
    0% { transform: translateY(45vh); }
    100% { transform: translateY(-105%); }
}

.credit-role {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 4px;
}

.credit-name {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 24px;
}

.credits-secret-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    letter-spacing: 1px;
    margin-top: 10px;
}

/* Static Final Climax Card */
.credits-final-card {
    position: relative;
    z-index: 25;
    background: rgba(22, 16, 26, 0.95);
    border: 1.5px solid var(--gold);
    border-radius: 28px;
    padding: 32px 24px;
    max-width: 480px;
    width: 90%;
    margin: 20px auto 0;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 30px var(--gold-glow);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 1.2s ease, transform 1.2s ease;
    text-align: center;
}

.credits-final-card.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.final-photo-frame {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    box-shadow: 0 0 20px var(--gold-glow);
    margin: 0 auto 18px;
    overflow: hidden;
}

.credits-final-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

.final-card-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 8px;
}

.final-card-line {
    font-size: 0.95rem;
    color: var(--gold-light);
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 24px;
}

.final-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.final-cta-buttons .btn-cinema {
    width: 100%;
    max-width: 280px;
    text-decoration: none;
}

/* ==========================================================================
   EASTER EGG MODAL & GLOBAL FOOTER
   ========================================================================== */

.global-footer {
    position: fixed;
    bottom: 10px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 100;
    pointer-events: auto;
}

.easter-egg-heart {
    display: inline-block;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--crimson);
    transition: transform 0.2s ease;
    user-select: none;
}

.easter-egg-heart:active {
    transform: scale(1.4);
}

.easter-egg-heart.pulse {
    animation: heartSoftPulse 1.8s infinite ease-in-out;
}

@keyframes heartSoftPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
    50% { transform: scale(1.3); filter: drop-shadow(0 0 12px rgba(230, 32, 64, 0.85)); }
}

.easter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.easter-modal.active {
    display: flex;
}

.easter-card {
    background: #19141d;
    border: 1px solid var(--gold);
    border-radius: 24px;
    padding: 32px 24px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px var(--gold-glow);
}

/* ==========================================================================
   CINEMATIC OST STREAMING DOCK (YOUTUBE API INTEGRATION)
   ========================================================================== */

.cinematic-ost-dock {
    position: fixed;
    bottom: calc(16px + var(--safe-bottom));
    right: calc(16px + var(--safe-right));
    z-index: 1050;
    max-width: 280px;
    width: calc(100% - 32px);
    background: rgba(16, 12, 20, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.2);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ost-dock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(90deg, rgba(230, 32, 64, 0.15), rgba(212, 175, 55, 0.15));
}

.ost-dock-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.ost-dock-icon {
    font-size: 1.15rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.cinematic-ost-dock.playing .ost-dock-icon {
    animation: vinylSpin 4s linear infinite;
}

@keyframes vinylSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ost-dock-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    overflow: hidden;
}

.ost-dock-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ost-dock-artist {
    font-size: 0.68rem;
    color: var(--gold-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ost-dock-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ost-dock-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    transform: scale(1.08);
}

.ost-dock-video-wrap {
    width: 100%;
    height: 160px;
    background: #000;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    overflow: hidden;
}

.ost-dock-video-wrap.collapsed {
    max-height: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.ost-dock-video-wrap:not(.collapsed) {
    max-height: 180px;
    opacity: 1;
}

#yt-player-iframe {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS & PREFERS-REDUCED-MOTION
   ========================================================================== */

@media (max-width: 480px) {
    .cinematic-ost-dock {
        max-width: 250px;
    }
    .final-cta-buttons .btn-cinema {
        padding: 14px 20px;
        font-size: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
