/* Design Tokens & Variables */
:root {
    --bg-color: #070b13;
    --text-color: #f8fafc;
    --pink: #ec4899;
    --purple: #a855f7;
    --gold: #fbbf24;
    --coral: #ff6b6b;
    --primary-grad: linear-gradient(135deg, var(--pink), var(--purple));
    --glass-bg: rgba(15, 23, 42, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-cursive: 'Great Vibes', cursive;
}

/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Persistent Aurora Animated Background */
.aurora-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    background: radial-gradient(circle at 20% 30%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.8) 0%, rgba(7, 11, 19, 1) 100%);
    animation: auroraFlow 25s ease infinite alternate;
}

@keyframes auroraFlow {
    0% {
        filter: hue-rotate(0deg) saturate(1);
    }
    100% {
        filter: hue-rotate(45deg) saturate(1.2);
    }
}

/* Particle Canvas Layer */
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* App Container */
#app-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Screen Transitions Style */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95) translateY(20px);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateY(0);
    z-index: 20;
}

/* Glassmorphism Common Style */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

/* Buttons Styling */
.btn {
    position: relative;
    padding: 16px 36px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary-grad);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.6);
}

.btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
}

.btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
    cursor: not-allowed;
}

.glow-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.5s ease-out;
    pointer-events: none;
}

.glow-btn:hover::before {
    transform: scale(1);
}

/* Equalizer & Audio Controls */
.music-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    cursor: pointer;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    outline: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.music-btn:hover {
    background: rgba(15, 23, 42, 0.85);
    transform: scale(1.05);
    border-color: var(--pink);
}

.music-icon {
    font-size: 1.3rem;
    transition: transform 0.3s;
}

/* Equalizer mini animation */
.equalizer {
    display: none;
    align-items: flex-end;
    gap: 3px;
    width: 20px;
    height: 18px;
}

.music-btn.playing .music-icon {
    display: none;
}

.music-btn.playing .equalizer {
    display: flex;
}

.bar {
    width: 3px;
    height: 100%;
    background: var(--pink);
    border-radius: 3px;
    animation: bounce 0.8s ease-in-out infinite alternate;
    transform-origin: bottom;
}

.bar:nth-child(2) { height: 70%; animation-delay: 0.15s; background: #c084fc; }
.bar:nth-child(3) { height: 40%; animation-delay: 0.3s; background: #e879f9; }
.bar:nth-child(4) { height: 85%; animation-delay: 0.45s; background: #f472b6; }

@keyframes bounce {
    0% { transform: scaleY(0.2); }
    100% { transform: scaleY(1); }
}

/* SECTION 1: Countdown Screen */
#screen-countdown {
    perspective: 1000px;
}

.countdown-card {
    padding: 48px;
    max-width: 550px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    border-radius: 32px;
}

.heart-pulse-container {
    font-size: 4.5rem;
    animation: heartBeat 1.4s infinite cubic-bezier(0.25, 0.8, 0.25, 1);
    filter: drop-shadow(0 0 20px rgba(236, 72, 153, 0.7));
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.18); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    70% { transform: scale(1); }
    100% { transform: scale(1); }
}

.coming-soon-title {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    background: linear-gradient(120deg, #fff, rgba(255,255,255,0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.timer-container {
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: center;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(4px);
}

.time-num {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: var(--font-sans);
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.lock-icon {
    font-size: 1rem;
    transition: transform 0.3s;
}

.btn:hover .lock-icon {
    transform: rotate(-15deg);
}

.dev-bypass-btn {
    position: absolute;
    bottom: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.dev-bypass-btn:hover {
    background: rgba(236, 72, 153, 0.2);
    color: var(--pink);
    border-color: rgba(236, 72, 153, 0.4);
}

/* SECTION 2: Happy Birthday Intro */
.intro-content {
    text-align: center;
}

.hbd-shine-text {
    font-size: 3.5rem;
    font-family: var(--font-sans);
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(to right, #fff 20%, var(--pink) 40%, var(--purple) 60%, #fff 80%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 4s linear infinite;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.3));
}

@keyframes shine {
    to { background-position: 200% center; }
}

.name-container {
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glow-name {
    font-family: var(--font-cursive);
    font-size: 5rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(236, 72, 153, 0.8),
                 0 0 20px rgba(236, 72, 153, 0.5),
                 0 0 35px rgba(168, 85, 247, 0.5);
    animation: glowpulse 2s infinite alternate;
}

@keyframes glowpulse {
    from {
        text-shadow: 0 0 10px rgba(236, 72, 153, 0.8), 0 0 20px rgba(236, 72, 153, 0.4), 0 0 30px rgba(168, 85, 247, 0.4);
        transform: scale(1);
    }
    to {
        text-shadow: 0 0 15px rgba(236, 72, 153, 1), 0 0 30px rgba(236, 72, 153, 0.6), 0 0 45px rgba(168, 85, 247, 0.6);
        transform: scale(1.04);
    }
}

/* SECTION 3: Nicknames Screen */
.nickname-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nickname-card {
    padding: 60px 80px;
    text-align: center;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 380px;
    transform: translateY(0);
    transition: transform 0.5s ease;
}

.nickname-icon {
    font-size: 5rem;
    transition: all 0.5s ease;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
}

.nickname-text {
    font-size: 2.5rem;
    font-weight: 600;
    transition: all 0.5s ease;
}

/* Dynamic Nickname Animations triggered by Class */
.animate-crown {
    animation: dropCrown 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes dropCrown {
    0% { transform: translateY(-100px) rotate(-45deg); opacity: 0; }
    60% { transform: translateY(10px) rotate(10deg); }
    100% { transform: translateY(0) rotate(0); opacity: 1; }
}

.animate-heart {
    animation: floatHeart 1s infinite alternate ease-in-out;
}
@keyframes floatHeart {
    0% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 5px rgba(236,72,153,0.5)); }
    100% { transform: translateY(-15px) scale(1.1); filter: drop-shadow(0 0 15px rgba(236,72,153,0.8)); }
}

.animate-shake {
    animation: wiggleText 0.4s infinite;
}
@keyframes wiggleText {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(0px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.animate-flower {
    animation: spinFlower 4s linear infinite;
}
@keyframes spinFlower {
    100% { transform: rotate(360deg); }
}

.animate-fireworks {
    animation: fireworkText 1.5s infinite alternate;
}
@keyframes fireworkText {
    0% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(168,85,247,0.5)); }
    100% { transform: scale(1.15); filter: drop-shadow(0 0 25px rgba(168,85,247,1)) saturate(1.5); }
}

/* SECTION 4: Poster Screen */
.poster-container {
    padding: 30px;
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.poster-frame {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #000;
    aspect-ratio: 4 / 5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bday-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: posterEntrance 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes posterEntrance {
    0% { transform: scale(1.15) rotate(2deg); opacity: 0; filter: blur(5px); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; filter: blur(0); }
}

/* SECTION 5: Letter & Envelope Screen */
.letter-envelope-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
}

.envelope-wrapper {
    position: relative;
    width: 320px;
    height: 220px;
    background: transparent;
    cursor: pointer;
    z-index: 10;
}

.envelope {
    position: relative;
    width: 100%;
    height: 100%;
    background: #5d4037; /* Brown envelope base */
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
    transform-style: preserve-3d;
}

/* Envelope Flap */
.envelope .flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-top: 115px solid #6d4c41; /* Lighter brown for flap */
    transform-origin: top;
    transition: transform 0.6s ease-in-out, border-top-color 0.6s;
    z-index: 30;
}

/* Inside pocket */
.envelope .pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border-left: 160px solid #4e342e;
    border-right: 160px solid #4e342e;
    border-bottom: 110px solid #3e2723;
    border-radius: 0 0 12px 12px;
    z-index: 25;
    pointer-events: none;
}

/* Letter Paper */
.envelope .letter {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 290px;
    height: 190px;
    background: #fff9e6; /* Soft warm paper color */
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 20;
    transition: transform 0.8s ease-in-out, height 0.8s ease-in-out, top 0.8s ease-in-out;
    transform: translateY(0);
    overflow: hidden;
}

/* Letter Content Typing */
.letter-text-box {
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.letter-text {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    line-height: 1.5;
    color: #2c1d11;
    font-weight: 500;
    white-space: pre-wrap;
    text-align: left;
}

/* Envelope Open Animation */
.envelope-wrapper.open .envelope .flap {
    transform: rotateX(180deg);
    border-top-color: #4e342e;
    z-index: 10;
}

.envelope-wrapper.open .envelope .letter {
    top: -240px;
    height: 380px;
    transform: translateY(0);
    z-index: 27;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    display: none !important;
}

/* SECTION 6: Instagram Chat Stories */
.memories-container {
    padding: 24px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.memory-badge {
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid rgba(236, 72, 153, 0.4);
    color: var(--pink);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: pulseBadge 1.5s infinite alternate;
}

@keyframes pulseBadge {
    from { transform: scale(1); opacity: 0.9; }
    to { transform: scale(1.05); opacity: 1; }
}

.phone-frame {
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 36px;
    border: 8px solid #222;
    overflow: hidden;
    position: relative;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
}

/* Top Progress Bars */
.story-progress-container {
    position: absolute;
    top: 12px;
    left: 0;
    width: 100%;
    display: flex;
    gap: 4px;
    padding: 0 12px;
    z-index: 30;
}

.story-progress-bar {
    height: 3px;
    flex: 1;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    overflow: hidden;
}

.story-progress-fill {
    height: 100%;
    width: 0;
    background: #fff;
    transition: width 0.1s linear;
}

.story-progress-fill.completed {
    width: 100%;
}

/* Header */
.instagram-header {
    position: absolute;
    top: 24px;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    color: #fff;
    z-index: 30;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}

.ig-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-grad);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 0.9rem;
    border: 1.5px solid #fff;
}

.ig-user-info {
    display: flex;
    flex-direction: column;
}

.ig-username {
    font-size: 0.85rem;
    font-weight: 600;
}

.ig-time {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
}

.ig-options {
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Screenshot Content */
.story-body {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #121212;
}

.story-screenshot {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s;
}

.tap-area-left, .tap-area-right {
    position: absolute;
    top: 0;
    height: 100%;
    width: 35%;
    z-index: 28;
    cursor: pointer;
}

.tap-area-left { left: 0; }
.tap-area-right { right: 0; }

/* Bottom mockup */
.instagram-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    z-index: 30;
}

.ig-send-msg {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
}

.ig-heart-react {
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.2s;
    filter: drop-shadow(0 0 5px rgba(255, 64, 129, 0.5));
}

.ig-heart-react:active {
    transform: scale(1.3);
}

/* SECTION 7: Gift Box Stage */
.gifts-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

.gift-box-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.gift-box {
    position: relative;
    width: 150px;
    height: 150px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.3s;
}

/* 3D Flat Gift Box design */
.gift-box-lid {
    position: absolute;
    top: 0;
    left: -5px;
    width: 160px;
    height: 40px;
    background: var(--pink);
    border-radius: 8px 8px 4px 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 2;
    transition: transform 0.5s ease-in-out, top 0.5s ease-in-out;
}

/* Ribbon cross on lid */
.gift-box-lid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 70px;
    width: 20px;
    height: 100%;
    background: var(--gold);
}

/* Ribbon Bow top */
.gift-box-lid::after {
    content: '💝';
    position: absolute;
    top: -28px;
    left: 65px;
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    animation: floatBow 2s infinite alternate ease-in-out;
}

@keyframes floatBow {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

.gift-box-body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 150px;
    height: 110px;
    background: var(--purple);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
    z-index: 1;
}

.gift-box-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 65px;
    width: 20px;
    height: 100%;
    background: var(--gold);
}

.gift-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(168,85,247,0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0.8);
    pointer-events: none;
    z-index: 0;
    animation: giftGlowPulse 2s infinite alternate ease-in-out;
}

@keyframes giftGlowPulse {
    0% { transform: translate(-50%, -50%) scale(0.7); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.9; }
}

/* Gift Shake keyframe */
.shake-box {
    animation: shakeGift 0.6s ease;
}

@keyframes shakeGift {
    0% { transform: rotate(0); }
    15% { transform: rotate(-8deg) scale(1.05); }
    30% { transform: rotate(8deg) scale(1.05); }
    45% { transform: rotate(-6deg); }
    60% { transform: rotate(6deg); }
    75% { transform: rotate(-3deg); }
    90% { transform: rotate(3deg); }
    100% { transform: rotate(0); }
}

/* Opened Box Style */
.gift-box.opened .gift-box-lid {
    transform: translateY(-80px) rotate(-15deg);
    opacity: 0;
}

.gift-instruction {
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
    text-align: center;
    animation: pulseInstruction 1.5s infinite alternate;
}

@keyframes pulseInstruction {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Gift Reveal Card style */
.gift-reveal-card {
    padding: 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    animation: revealZoom 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes revealZoom {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.revealed-item-icon {
    font-size: 6rem;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.6));
    animation: rotateIcon 4s ease infinite;
}

@keyframes rotateIcon {
    0%, 100% { transform: rotate(0) scale(1); }
    50% { transform: rotate(10deg) scale(1.08); }
}

.revealed-item-name {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.revealed-item-desc {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

/* SECTION 8: Final Surprise */
.final-surprise-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.surprise-text-stage {
    text-align: center;
}

.ambient-surprise-text {
    font-size: 3rem;
    font-weight: 600;
    color: #fff;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.magical-box-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: boxDrop 1.8s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes boxDrop {
    0% { transform: translateY(-300px) scale(0.6); opacity: 0; }
    70% { transform: translateY(15px) scale(1.05); opacity: 1; }
    100% { transform: translateY(0) scale(1); }
}

.magical-box {
    position: relative;
    width: 160px;
    height: 160px;
    cursor: pointer;
}

.magical-box-lid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 45px;
    background: linear-gradient(135deg, #ffd54f, #ffb300); /* Golden magical lid */
    border-radius: 12px 12px 4px 4px;
    box-shadow: 0 0 15px rgba(255, 179, 0, 0.6);
    z-index: 2;
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.magical-box-body {
    position: absolute;
    bottom: 0;
    left: 5px;
    width: 150px;
    height: 120px;
    background: linear-gradient(135deg, #ffb300, #ff8f00);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 0 25px rgba(255, 143, 0, 0.4);
    z-index: 1;
}

/* Sparkle stars on magical box */
.magical-sparkles {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    animation: magicalPulse 2.5s infinite alternate;
}

@keyframes magicalPulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.4; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.9; }
}

.magical-hint {
    color: var(--gold);
    font-size: 1rem;
    letter-spacing: 1px;
    animation: goldPulse 1.5s infinite alternate;
}

@keyframes goldPulse {
    0% { opacity: 0.6; text-shadow: 0 0 5px rgba(255,215,0,0.3); }
    100% { opacity: 1; text-shadow: 0 0 15px rgba(255,215,0,0.8); }
}

/* Shake magical box */
.shake-magical {
    animation: shakeMagicalBox 0.7s infinite;
}

@keyframes shakeMagicalBox {
    0%, 100% { transform: rotate(0) scale(1); }
    20% { transform: rotate(-5deg) scale(1.05); }
    40% { transform: rotate(5deg) scale(1.05); }
    60% { transform: rotate(-3deg); }
    80% { transform: rotate(3deg); }
}

.magical-reveal {
    position: relative;
    padding: 50px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    z-index: 10;
    animation: zoomReveal 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomReveal {
    0% { transform: scale(0.3); opacity: 0; filter: blur(10px); }
    100% { transform: scale(1); opacity: 1; filter: blur(0); }
}

.burst-light {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(236,72,153,0.3) 40%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    animation: burstGlow 4s infinite linear;
}

@keyframes burstGlow {
    0% { transform: translate(-50%, -50%) rotate(0deg) scale(0.8); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) rotate(360deg) scale(0.8); opacity: 0.8; }
}

.magical-you {
    font-size: 4rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 24px;
    text-shadow: 0 0 10px rgba(255, 64, 129, 0.8),
                 0 0 20px rgba(255, 64, 129, 0.6),
                 0 0 40px rgba(236, 72, 153, 0.6);
    animation: pulseYou 2s infinite alternate;
}

@keyframes pulseYou {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.magical-desc-1 {
    font-size: 1.3rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.magical-desc-2 {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #fff, var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* SECTION 9: Ending Screen */
.ending-container {
    padding: 30px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.night-sky-vector {
    position: relative;
    width: 100%;
    height: 240px;
    background: linear-gradient(to bottom, #050b18, #0e172a);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.crescent-moon {
    position: absolute;
    top: 24px;
    right: 48px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: -10px 10px 0 0 #fffde7;
    filter: drop-shadow(0 0 8px rgba(255, 253, 231, 0.8));
    transform: rotate(-15deg);
}

.hill-svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ending-text {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ending-title {
    font-family: var(--font-cursive);
    font-size: 3.2rem;
    color: var(--pink);
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(236,72,153,0.3);
}

.ending-line {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    font-weight: 400;
}

.highlight-icecream {
    font-size: 1.2rem;
    color: #fff;
    font-weight: 600;
    margin-top: 6px;
    text-shadow: 0 0 5px rgba(255,255,255,0.2);
}

/* SECTION 10: Grand Finale Screen */
#screen-grand-finale {
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.95) 0%, rgba(5, 7, 12, 1) 100%);
}

.finale-card {
    padding: 40px;
    max-width: 550px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    border-radius: 32px;
    border: 1px solid rgba(236, 72, 153, 0.2);
    box-shadow: 0 0 50px rgba(236, 72, 153, 0.15);
    animation: cardPulse 3s infinite alternate;
}

@keyframes cardPulse {
    0% { border-color: rgba(236, 72, 153, 0.2); box-shadow: 0 0 30px rgba(236, 72, 153, 0.1); }
    100% { border-color: rgba(168, 85, 247, 0.4); box-shadow: 0 0 50px rgba(168, 85, 247, 0.25); }
}

.beating-heart-large {
    font-size: 6.5rem;
    animation: heartBeatLarge 1.2s infinite cubic-bezier(0.25, 0.8, 0.25, 1);
    filter: drop-shadow(0 0 25px rgba(236, 72, 153, 0.8));
}

@keyframes heartBeatLarge {
    0% { transform: scale(1); }
    15% { transform: scale(1.2); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    70% { transform: scale(1); }
    100% { transform: scale(1); }
}

.finale-text-box {
    min-height: 120px;
}

.finale-para {
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.6;
    color: #fff;
    text-align: center;
    white-space: pre-wrap;
    text-shadow: 0 0 8px rgba(255,255,255,0.1);
}

.sparkles-container {
    font-size: 1.5rem;
    letter-spacing: 8px;
    color: var(--gold);
    animation: floatSparkles 2s infinite alternate ease-in-out;
}

@keyframes floatSparkles {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

/* Mobile Responsiveness Rules */
@media (max-width: 600px) {
    .btn {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    .countdown-card {
        padding: 30px 20px;
    }
    
    .time-block {
        min-width: 65px;
        padding: 8px;
    }
    
    .time-num {
        font-size: 1.6rem;
    }
    
    .coming-soon-title {
        font-size: 1.4rem;
    }
    
    .hbd-shine-text {
        font-size: 2.3rem;
    }
    
    .glow-name {
        font-size: 3.5rem;
    }
    
    .nickname-card {
        padding: 40px 30px;
        min-width: 290px;
    }
    
    .nickname-text {
        font-size: 1.8rem;
    }
    
    .envelope-wrapper {
        width: 280px;
        height: 190px;
    }
    
    .envelope .flap {
        border-left: 140px solid transparent;
        border-right: 140px solid transparent;
        border-top: 100px solid #6d4c41;
    }
    
    .envelope .pocket {
        border-left: 140px solid #4e342e;
        border-right: 140px solid #4e342e;
        border-bottom: 95px solid #3e2723;
    }
    
    .envelope .letter {
        width: 250px;
        height: 165px;
    }
    
    .envelope-wrapper.open .envelope .letter {
        top: -210px;
        height: 330px;
    }
    
    .memories-container {
        padding: 16px;
        max-width: 320px;
    }
    
    .revealed-item-icon {
        font-size: 4.5rem;
    }
    
    .revealed-item-name {
        font-size: 1.8rem;
    }
    
    .magical-you {
        font-size: 3rem;
    }
    
    .magical-desc-2 {
        font-size: 1.3rem;
    }
    
    .ending-title {
        font-size: 2.5rem;
    }
    
    .ending-container {
        padding: 20px 16px;
    }
    
    .night-sky-vector {
        height: 180px;
    }
    
    .finale-card {
        padding: 24px 16px;
    }
    
    .finale-para {
        font-size: 1.1rem;
        line-height: 1.5;
    }
    
    .beating-heart-large {
        font-size: 4.5rem;
    }
}
