/* ==============================================
   PREMIUM VARIABLES & THEME
   ============================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Poppins:wght@300;400;600;700&family=Dancing+Script:wght@400;700&display=swap');

:root {
    /* Premium Luxury Gradient Colors */
    --gradient-cosmic: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-sunset: linear-gradient(135deg, #ff6b9d 0%, #feca57 100%);
    --gradient-ocean: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-aurora: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --gradient-fire: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-royal: linear-gradient(135deg, #667eea 0%, #f093fb 50%, #feca57 100%);
    --gradient-rose-gold: linear-gradient(135deg, #ed6ea0 0%, #ec8c69 50%, #f7bb97 100%);
    --gradient-champagne: linear-gradient(135deg, #ffecd2 0%, #fcb69f 50%, #ff9a9e 100%);
    --gradient-luxury: linear-gradient(135deg, #a8edea 0%, #d299c2 50%, #ffdee9 100%);
    --gradient-birthday: linear-gradient(135deg, #fa71cd 0%, #9b59b6 50%, #667eea 100%);

    /* Premium Colors */
    --color-primary: #667eea;
    --color-secondary: #f093fb;
    --color-accent: #feca57;
    --color-rose-gold: #ed6ea0;
    --color-champagne: #ffecd2;
    --color-dark: #1a1a2e;
    --color-light: #f8f9fa;

    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

    /* Typography */
    --font-display: 'Playfair Display', serif;
    --font-heading: 'Dancing Script', cursive;
    --font-body: 'Poppins', sans-serif;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.5);

    /* Animations */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ==============================================
   COUNTDOWN WRAPPER (Before Everything)
   ============================================== */
#countdown-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 25%, #7e22ce 50%, #3b82f6 75%, #06b6d4 100%);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow: hidden;
    padding: 1rem;
}

#countdown-wrapper.hidden-countdown {
    display: none;
}

/* Fix Chrome rendering issues */
.countdown-content * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p {
    background: none !important;
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
}

.countdown-content {
    text-align: center;
    z-index: 2;
    padding: 1rem;
    max-width: 900px;
    width: 100%;
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.countdown-sparkle-line {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    animation: sparkleRotate 3s linear infinite;
}

.countdown-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.9),
                 0 0 60px rgba(6, 182, 212, 0.7),
                 0 5px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    animation: titlePulse 2s ease-in-out infinite;
    line-height: 1.2;
    background: transparent;
    -webkit-text-fill-color: white;
    -webkit-background-clip: text;
    background-clip: text;
    padding: 0;
    border: none;
    outline: none;
}

.countdown-subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.countdown-quote {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: rgba(147, 197, 253, 1);
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.4),
                 0 0 20px rgba(59, 130, 246, 0.6);
    margin-bottom: 0.5rem;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 1px;
    animation: quoteFade 3s ease-in-out infinite;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.music-hint {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: rgba(147, 197, 253, 0.9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.8rem;
    padding: 0.4rem 0.8rem;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    display: inline-block;
    animation: musicHintPulse 2s ease-in-out infinite;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.music-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

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

.countdown-timer {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.time-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    min-width: 90px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: timeBoxFloat 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.time-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 70%);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s ease;
}

.time-box:hover::before {
    transform: rotate(45deg) translateX(100%);
}

.time-box:nth-child(1) { animation-delay: 0s; }
.time-box:nth-child(2) { animation-delay: 0.2s; }
.time-box:nth-child(3) { animation-delay: 0.4s; }
.time-box:nth-child(4) { animation-delay: 0.6s; }

.time-box:hover {
    transform: translateY(-15px) scale(1.1) rotateY(5deg);
    background: rgba(147, 197, 253, 0.35);
    border-color: rgba(147, 197, 253, 0.8);
    box-shadow: 0 15px 50px rgba(59, 130, 246, 0.5),
                0 0 60px rgba(147, 197, 253, 0.4),
                inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.time-box:hover .time-number {
    transform: scale(1.15);
    text-shadow: 0 0 30px rgba(147, 197, 253, 1),
                 0 0 60px rgba(59, 130, 246, 0.8),
                 0 4px 15px rgba(0, 0, 0, 0.4);
}

.time-box:hover .time-label {
    color: rgba(147, 197, 253, 1);
    transform: translateY(-3px);
}

.time-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                 0 4px 10px rgba(0, 0, 0, 0.3);
    line-height: 1;
    margin-bottom: 0.3rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.time-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.countdown-message {
    margin: 1rem auto 1rem;
    max-width: 700px;
}

.message-line {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4),
                 0 0 15px rgba(147, 197, 253, 0.4);
    margin: 0.5rem 0;
    font-weight: 400;
    letter-spacing: 1px;
    line-height: 1.6;
    animation: messageSlideIn 1s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.message-line:nth-child(1) {
    animation-delay: 0.5s;
}

.message-line:nth-child(2) {
    animation-delay: 1s;
}

.skip-btn {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.6rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    font-weight: 600;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.skip-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

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

.patience-message {
    margin-top: 2rem;
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    min-height: 60px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.3);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(147, 197, 253, 0.6);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
                0 0 60px rgba(59, 130, 246, 0.6),
                inset 0 0 30px rgba(147, 197, 253, 0.15);
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.5),
                 0 0 25px rgba(147, 197, 253, 0.5);
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%) scale(0.8) translateY(20px);
    text-align: center;
    line-height: 1.4;
    pointer-events: none;
    letter-spacing: 0.5px;
    z-index: 10;
}

/* Speech bubble tail - REMOVED */
.patience-message::before {
    display: none;
}

.patience-message.show {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0);
    animation: gentleFloat 3s ease-in-out infinite 0.6s;
}

.countdown-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.float-emoji {
    position: absolute;
    font-size: 3rem;
    animation: floatAround 6s ease-in-out infinite;
    opacity: 0.7;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.hidden-countdown {
    display: none !important;
}

/* Sparkle Effect on Button Click */
.click-sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(147, 197, 253, 0.8),
                0 0 20px rgba(59, 130, 246, 0.6);
    animation: sparkleExplode 1s ease-out forwards;
}

@keyframes sparkleExplode {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: scale(0) translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

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

@keyframes floatAround {
    0%, 100% { 
        transform: translate(0, 0) rotate(0deg); 
        opacity: 0.7;
    }
    25% { 
        transform: translate(20px, -20px) rotate(90deg); 
        opacity: 0.9;
    }
    50% { 
        transform: translate(0, -40px) rotate(180deg); 
        opacity: 0.7;
    }
    75% { 
        transform: translate(-20px, -20px) rotate(270deg); 
        opacity: 0.9;
    }
}

@keyframes sparkleRotate {
    0%, 100% { 
        transform: rotate(0deg) scale(1); 
        opacity: 1;
    }
    50% { 
        transform: rotate(180deg) scale(1.2); 
        opacity: 0.8;
    }
}

@keyframes quoteFade {
    0%, 100% { 
        opacity: 0.9;
        transform: translateY(0px);
    }
    50% { 
        opacity: 1;
        transform: translateY(-3px);
    }
}

@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes conversationPop {
    0% { 
        transform: scale(0.3) rotate(-10deg); 
        opacity: 0;
    }
    50% { 
        transform: scale(1.1) rotate(5deg); 
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 1;
    }
}

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

@keyframes shakePulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-3deg); }
    50% { transform: scale(1.15) rotate(3deg); }
    75% { transform: scale(1.1) rotate(-3deg); }
}

/* Responsive Countdown */
@media (max-width: 768px) {
    .countdown-sparkle-line {
        font-size: 1.5rem;
    }
    
    .countdown-title {
        font-size: 1.8rem;
    }
    
    .countdown-subtitle {
        font-size: 0.9rem;
    }
    
    .countdown-quote {
        font-size: 0.85rem;
        max-width: 90%;
    }
    
    .countdown-timer {
        gap: 0.6rem;
    }
    
    .time-box {
        padding: 0.8rem 1rem;
        min-width: 70px;
    }
    
    .time-number {
        font-size: 1.8rem;
    }
    
    .time-label {
        font-size: 0.65rem;
    }
    
    .message-line {
        font-size: 0.75rem;
    }
    
    .skip-btn {
        font-size: 0.75rem;
        padding: 0.5rem 1.2rem;
    }
    
    .patience-message {
        font-size: 1rem;
        padding: 0.8rem 1.2rem;
        max-width: 85%;
        min-height: 55px;
        letter-spacing: 0.3px;
        bottom: 5%;
    }
    
    .float-emoji {
        font-size: 2rem;
    }
}

/* Responsive for larger screens (1920x1080 and similar) */
@media (min-width: 1400px) {
    .countdown-title {
        font-size: 3.2rem;
    }
    
    .countdown-subtitle {
        font-size: 1.4rem;
    }
    
    .countdown-quote {
        font-size: 1.25rem;
    }
    
    .music-hint {
        font-size: 0.95rem;
        padding: 0.6rem 1.2rem;
    }
    
    .countdown-timer {
        gap: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .time-box {
        padding: 1.8rem 2.2rem;
        min-width: 130px;
    }
    
    .time-number {
        font-size: 3.5rem;
    }
    
    .time-label {
        font-size: 0.95rem;
    }
    
    .countdown-message {
        margin: 1.5rem auto 1.5rem;
    }
    
    .message-line {
        font-size: 1.15rem;
        margin: 1rem 0;
    }
    
    .skip-btn {
        font-size: 1.05rem;
        padding: 0.85rem 2.2rem;
    }
    
    .patience-message {
        font-size: 1.4rem;
        padding: 1.3rem 2rem;
        max-width: 650px;
        min-height: 80px;
    }
}

/* Responsive for smaller laptops (1024px and below) */
@media (max-width: 1024px) {
    .countdown-title {
        font-size: 2.2rem;
    }
    
    .countdown-subtitle {
        font-size: 1rem;
    }
    
    .countdown-quote {
        font-size: 0.95rem;
    }
    
    .countdown-timer {
        gap: 0.8rem;
    }
    
    .time-box {
        padding: 0.9rem 1.3rem;
        min-width: 85px;
    }
    
    .time-number {
        font-size: 2.2rem;
    }
    
    .time-label {
        font-size: 0.7rem;
    }
    
    .message-line {
        font-size: 0.85rem;
    }
    
    .skip-btn {
        font-size: 0.8rem;
        padding: 0.55rem 1.3rem;
    }
}

/* Responsive for tablets (900px and below) */
@media (max-width: 900px) {
    .countdown-title {
        font-size: 2rem;
    }
    
    .countdown-timer {
        gap: 0.7rem;
    }
    
    .time-box {
        padding: 0.8rem 1.2rem;
        min-width: 80px;
    }
    
    .time-number {
        font-size: 2rem;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(180deg, #1a0a2e 0%, #2d1b4e 25%, #4a2c5e 50%, #2d1b4e 75%, #1a0a2e 100%);
    color: white;
    overflow: hidden;
    position: relative;
    height: 100vh;
}

/* Hide scrollbar for countdown wrapper */
.countdown-content::-webkit-scrollbar {
    display: none;
}

.countdown-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-royal);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-sunset);
}

/* ==============================================
   CANVAS BACKGROUND
   ============================================== */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* ==============================================
   CONFETTI & GLITTER EFFECTS
   ============================================== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(45deg, #ff6b9d, #feca57, #4facfe, #9b59b6);
    opacity: 0.8;
    animation: fallConfetti 8s linear infinite;
}

.confetti:nth-child(1) { left: 10%; animation-delay: 0s; background: #ff6b9d; }
.confetti:nth-child(2) { left: 20%; animation-delay: 1s; background: #feca57; }
.confetti:nth-child(3) { left: 30%; animation-delay: 2s; background: #4facfe; }
.confetti:nth-child(4) { left: 40%; animation-delay: 0.5s; background: #9b59b6; }
.confetti:nth-child(5) { left: 50%; animation-delay: 1.5s; background: #00d2d3; }
.confetti:nth-child(6) { left: 60%; animation-delay: 2.5s; background: #ff6b9d; }
.confetti:nth-child(7) { left: 70%; animation-delay: 0.8s; background: #feca57; }
.confetti:nth-child(8) { left: 80%; animation-delay: 1.8s; background: #4facfe; }
.confetti:nth-child(9) { left: 90%; animation-delay: 2.2s; background: #9b59b6; }
.confetti:nth-child(10) { left: 15%; animation-delay: 3s; background: #00d2d3; }
.confetti:nth-child(11) { left: 25%; animation-delay: 3.5s; background: #ff6b9d; }
.confetti:nth-child(12) { left: 35%; animation-delay: 4s; background: #feca57; }
.confetti:nth-child(13) { left: 55%; animation-delay: 0.3s; background: #4facfe; }
.confetti:nth-child(14) { left: 75%; animation-delay: 1.3s; background: #9b59b6; }
.confetti:nth-child(15) { left: 85%; animation-delay: 2.8s; background: #00d2d3; }

@keyframes fallConfetti {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0.3;
    }
}

.glitter-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 998;
}

.glitter {
    position: absolute;
    font-size: 1.5rem;
    animation: fallGlitter 10s ease-in infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.glitter:nth-child(1) { left: 5%; animation-delay: 0s; }
.glitter:nth-child(2) { left: 15%; animation-delay: 2s; }
.glitter:nth-child(3) { left: 30%; animation-delay: 4s; }
.glitter:nth-child(4) { left: 45%; animation-delay: 1s; }
.glitter:nth-child(5) { left: 60%; animation-delay: 3s; }
.glitter:nth-child(6) { left: 75%; animation-delay: 5s; }
.glitter:nth-child(7) { left: 85%; animation-delay: 1.5s; }
.glitter:nth-child(8) { left: 95%; animation-delay: 3.5s; }
.glitter:nth-child(9) { left: 10%; animation-delay: 6s; }
.glitter:nth-child(10) { left: 40%; animation-delay: 7s; }
.glitter:nth-child(11) { left: 70%; animation-delay: 2.5s; }
.glitter:nth-child(12) { left: 90%; animation-delay: 4.5s; }

@keyframes fallGlitter {
    0% {
        transform: translateY(-50px) scale(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) scale(1.5) rotate(360deg);
        opacity: 0;
    }
}

/* ==============================================
   FLOWER PETALS ANIMATION
   ============================================== */
.petals-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 997;
}

.petal {
    position: absolute;
    font-size: 2rem;
    animation: fallPetal 15s ease-in-out infinite;
    filter: drop-shadow(0 2px 5px rgba(255, 182, 193, 0.5));
}

.petal:nth-child(1) { left: 8%; animation-delay: 0s; animation-duration: 14s; }
.petal:nth-child(2) { left: 18%; animation-delay: 3s; animation-duration: 16s; }
.petal:nth-child(3) { left: 28%; animation-delay: 1.5s; animation-duration: 15s; }
.petal:nth-child(4) { left: 38%; animation-delay: 4s; animation-duration: 17s; }
.petal:nth-child(5) { left: 48%; animation-delay: 2s; animation-duration: 14.5s; }
.petal:nth-child(6) { left: 58%; animation-delay: 5s; animation-duration: 16.5s; }
.petal:nth-child(7) { left: 68%; animation-delay: 1s; animation-duration: 15.5s; }
.petal:nth-child(8) { left: 78%; animation-delay: 3.5s; animation-duration: 14s; }
.petal:nth-child(9) { left: 88%; animation-delay: 2.5s; animation-duration: 16s; }
.petal:nth-child(10) { left: 12%; animation-delay: 4.5s; animation-duration: 15s; }

@keyframes fallPetal {
    0% {
        transform: translateY(-100px) rotate(0deg) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg) translateX(100px);
        opacity: 0.3;
    }
}

/* ==============================================
   SCROLL SECTIONS WITH ANIMATED BACKGROUNDS
   ============================================== */
#journey-container {
    width: 100%;
    position: relative;
}

.journey-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    padding: 4rem 2rem;
    overflow: hidden;
}

/* Animated Background Orbs */
.journey-section::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    top: -250px;
    left: -250px;
    animation: orbFloat1 20s infinite ease-in-out;
    z-index: 0;
}

.journey-section::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(240, 147, 251, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -200px;
    right: -200px;
    animation: orbFloat2 25s infinite ease-in-out;
    z-index: 0;
}

@keyframes orbFloat1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(100px, 100px) scale(1.2);
    }
}

@keyframes orbFloat2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-80px, -80px) scale(1.1);
    }
}

/* Section-Specific Backgrounds with Proper Contrast */
#chapter-sky {
    background: linear-gradient(180deg, #1a0a2e 0%, #2d1b4e 25%, #4a2c5e 50%, #2d1b4e 75%, #1a0a2e 100%);
    position: relative;
    color: #ffffff;
}

#chapter-constellation {
    background: linear-gradient(135deg, #1a1a3e 0%, #2c3e50 50%, #34495e 100%);
    color: #ffffff;
}

#chapter-garden {
    background: linear-gradient(135deg, #fff9f0 0%, #ffe8d6 50%, #ffd9c4 100%);
    color: #2d3436;
}

#chapter-garden .section-title,
#chapter-garden h2,
#chapter-garden h3 {
    color: #c44d00 !important;
    font-weight: 800 !important;
}

#chapter-dreamscape {
    background: linear-gradient(135deg, #eef7fb 0%, #d6ebf5 50%, #c8e3f0 100%);
    color: #2d3436;
}

#chapter-dreamscape .section-title,
#chapter-dreamscape h2,
#chapter-dreamscape h3 {
    color: #1e5f8c !important;
    font-weight: 800 !important;
}

#chapter-timeline {
    background: linear-gradient(135deg, #7c5ce7 0%, #b59bfe 50%, #fd89b8 100%);
    color: #ffffff;
}

#chapter-book {
    background: linear-gradient(135deg, #ffa9f3 0%, #fed467 50%, #ff7b7b 100%);
    color: #ffffff;
}

#chapter-melody {
    background: linear-gradient(135deg, #10c9a4 0%, #20ded9 50%, #1994f3 100%);
    color: #ffffff;
}

#chapter-gallery {
    background: linear-gradient(135deg, #65ffd4 0%, #91f3f3 50%, #84c9ff 100%);
    color: #2d3436;
}

#chapter-gallery .section-title,
#chapter-gallery h2,
#chapter-gallery h3 {
    color: #008a6d !important;
    font-weight: 800 !important;
}

#chapter-ocean {
    background: linear-gradient(135deg, #0984e3 0%, #6c5ce7 50%, #a29bfe 100%);
    color: #ffffff;
}

.content-wrapper {
    z-index: 2;
    max-width: 800px;
}

/* ==============================================
   ENHANCED TYPOGRAPHY WITH EFFECTS
   ============================================== */
h1 {
    font-size: 4.5rem;
    font-family: var(--font-display);
    font-weight: 900;
    margin-bottom: 1rem;
    color: #ffffff;
    animation: shimmer 3s linear infinite, fadeInDown 1.5s ease-out;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.6);
    position: relative;
}

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

h2 {
    font-size: 3rem;
    font-family: var(--font-display);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    color: #ffffff;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Light background h2 */
#chapter-garden h2,
#chapter-dreamscape h2,
#chapter-gallery h2 {
    color: #1a1a2e !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.15);
    font-weight: 800;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gradient-royal);
    transition: width 0.6s ease;
}

h2:hover::after {
    width: 100%;
}

.subtitle {
    font-size: 1.5rem;
    opacity: 0.95;
    animation: fadeIn 2s ease-out;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.section-desc {
    font-size: 1.3rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    font-style: italic;
    font-weight: 400;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Light backgrounds need darker, bolder text */
#chapter-garden .subtitle,
#chapter-dreamscape .subtitle,
#chapter-gallery .subtitle,
#chapter-garden .section-desc,
#chapter-dreamscape .section-desc,
#chapter-gallery .section-desc {
    color: #1a1a2e;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Story Book section needs very dark text for bright background */
#chapter-book .section-desc {
    color: #4a1942 !important;
    font-weight: 600 !important;
    text-shadow: 0 2px 6px rgba(255, 255, 255, 0.8), 0 1px 3px rgba(255, 255, 255, 0.5) !important;
}

#chapter-book .subtitle {
    color: #4a1942 !important;
    font-weight: 600 !important;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.8) !important;
}

/* Light background sections need darker desc */
#chapter-garden .section-desc,
#chapter-dreamscape .section-desc,
#chapter-gallery .section-desc {
    color: #2d3436;
    opacity: 0.8;
}


.glow-text {
    color: #ffffff;
    text-shadow: 
        0 0 40px rgba(255, 255, 255, 1),
        0 0 60px rgba(255, 182, 193, 0.9),
        0 0 80px rgba(255, 105, 180, 0.8),
        0 4px 20px rgba(0, 0, 0, 0.8);
    animation: glowPulse 3s ease-in-out infinite;
    font-weight: 900;
}

@keyframes glowPulse {
    0%, 100% {
        text-shadow: 
            0 0 40px rgba(255, 255, 255, 1),
            0 0 60px rgba(255, 182, 193, 0.9),
            0 0 80px rgba(255, 105, 180, 0.8),
            0 4px 20px rgba(0, 0, 0, 0.8);
    }
    50% {
        text-shadow: 
            0 0 60px rgba(255, 255, 255, 1),
            0 0 80px rgba(255, 182, 193, 1),
            0 0 100px rgba(255, 105, 180, 1),
            0 4px 25px rgba(0, 0, 0, 0.9);
    }
}

@keyframes shimmerText {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes glow {

    0%,
    100% {
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 20px rgba(240, 147, 251, 0.8));
    }

    50% {
        filter: drop-shadow(0 0 50px rgba(255, 255, 255, 1)) drop-shadow(0 0 40px rgba(240, 147, 251, 1)) drop-shadow(0 0 60px rgba(102, 126, 234, 0.8));
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    margin-top: 3rem;
    animation: bounce 2s infinite;
    opacity: 0.8;
}

.arrow {
    font-size: 2rem;
    margin-top: 0.5rem;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* ==============================================
   CLOUD GALLERIES
   ============================================== */
.floating-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.cloud-card {
    background: rgba(255, 255, 255, 0.7);
    padding: 1rem;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    width: 200px;
    height: 250px;
    animation: floatDrift 8s ease-in-out infinite alternate;
    animation-delay: var(--delay);
    transition: transform 0.3s;
}

.cloud-card:hover {
    transform: scale(1.1) rotate(2deg);
    background: white;
    z-index: 10;
}

.img-placeholder {
    height: 150px;
    background: #ddeeff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* ==============================================
   ENTRY LAYER (ENVELOPE)
   ============================================== */
#entry-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 25%, #4a2c5e 50%, #2d1b4e 75%, #1a0a2e 100%);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s, transform 1s;
    overflow: hidden;
}

/* Animated gradient background */
#entry-layer::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        rgba(237, 110, 160, 0.3) 0%,
        rgba(236, 140, 105, 0.3) 20%,
        rgba(155, 89, 182, 0.3) 40%,
        rgba(102, 126, 234, 0.3) 60%,
        rgba(240, 147, 251, 0.3) 80%,
        rgba(237, 110, 160, 0.3) 100%
    );
    animation: gradientRotate 20s linear infinite;
    z-index: 0;
}

#entry-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(240, 147, 251, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(254, 202, 87, 0.15) 0%, transparent 50%);
    animation: pulseGlow 8s ease-in-out infinite;
    z-index: 0;
}

@keyframes gradientRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

#entry-layer.zoomed-in {
    transform: scale(3);
    opacity: 0;
    pointer-events: none;
    filter: blur(10px);
    animation: zoomBlur 1s ease-out forwards;
}

@keyframes zoomBlur {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: blur(0px);
    }
    50% {
        transform: scale(1.5) rotate(5deg);
        opacity: 0.8;
        filter: blur(5px);
    }
    100% {
        transform: scale(3) rotate(10deg);
        opacity: 0;
        filter: blur(10px);
    }
}


.envelope-container {
    perspective: 1000px;
    position: relative;
    z-index: 2;
}

/* Sparkle effects around envelope */
.envelope-container::before {
    content: '✨';
    position: absolute;
    font-size: 2.5rem;
    top: -50px;
    left: -50px;
    animation: sparkle 3s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.envelope-container::after {
    content: '✨';
    position: absolute;
    font-size: 2.5rem;
    bottom: -50px;
    right: -50px;
    animation: sparkle 3s ease-in-out infinite 1.5s;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(180deg);
    }
}

/* Envelope decorations */
.envelope-decoration {
    position: absolute;
    font-size: 2.5rem;
    animation: bounceDecor 2s ease-in-out infinite;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

.envelope-decoration.top-left {
    top: -60px;
    left: -60px;
    animation-delay: 0s;
}

.envelope-decoration.top-right {
    top: -60px;
    right: -60px;
    animation-delay: 0.5s;
}

.envelope-decoration.bottom-left {
    bottom: -60px;
    left: -60px;
    animation-delay: 1s;
}

.envelope-decoration.bottom-right {
    bottom: -60px;
    right: -60px;
    animation-delay: 1.5s;
}

@keyframes bounceDecor {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(10deg);
    }
}

.envelope {
    width: 350px;
    height: 220px;
    background: linear-gradient(135deg, #fff8e7 0%, #f4e4c1 25%, #e8d4a0 50%, #d4af37 75%, #b8942a 100%);
    position: relative;
    transform-style: preserve-3d;
    cursor: pointer;
    box-shadow:
        0 20px 60px rgba(212, 175, 55, 0.5),
        0 0 40px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(139, 90, 0, 0.3);
    display: flex;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition-smooth);
    animation: envelopeGlow 3s ease-in-out infinite, envelopeFloat 4s ease-in-out infinite;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.envelope:hover {
    transform: scale(1.08) rotateY(5deg) translateY(-10px);
    box-shadow:
        0 30px 90px rgba(212, 175, 55, 0.7),
        0 0 80px rgba(255, 215, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

@keyframes envelopeGlow {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.1);
    }
}

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

/* Floating Background Particles */
.letter-bg-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.floating-particle {
    position: absolute;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(102, 126, 234, 0.1) 50%, transparent 70%);
    border-radius: 50%;
    animation: floatParticle 15s infinite ease-in-out;
    filter: blur(1px);
}

.floating-particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    width: 100px;
    height: 100px;
}

.floating-particle:nth-child(2) {
    left: 30%;
    animation-delay: 2s;
    width: 60px;
    height: 60px;
}

.floating-particle:nth-child(3) {
    left: 50%;
    animation-delay: 4s;
    width: 90px;
    height: 90px;
}

.floating-particle:nth-child(4) {
    left: 70%;
    animation-delay: 1s;
    width: 70px;
    height: 70px;
}

.floating-particle:nth-child(5) {
    left: 90%;
    animation-delay: 3s;
    width: 85px;
    height: 85px;
}

.floating-particle:nth-child(6) {
    left: 15%;
    animation-delay: 5s;
    width: 75px;
    height: 75px;
}

.floating-particle:nth-child(7) {
    left: 65%;
    animation-delay: 6s;
    width: 95px;
    height: 95px;
}

.floating-particle:nth-child(8) {
    left: 45%;
    animation-delay: 7s;
    width: 65px;
    height: 65px;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) scale(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) scale(1.5) rotate(360deg);
        opacity: 0;
    }
}

/* Balloons Animation */
.balloons-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.balloon {
    position: absolute;
    font-size: 3rem;
    animation: floatBalloon 12s ease-in-out infinite;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

.balloon-pink {
    left: 10%;
    animation-delay: 0s;
    color: #ff6b9d;
}

.balloon-purple {
    left: 25%;
    animation-delay: 2s;
    color: #9b59b6;
}

.balloon-blue {
    left: 45%;
    animation-delay: 1s;
    color: #4facfe;
}

.balloon-yellow {
    left: 65%;
    animation-delay: 3s;
    color: #feca57;
}

.balloon-red {
    left: 80%;
    animation-delay: 4s;
    color: #ee5a6f;
}

.balloon-green {
    left: 35%;
    animation-delay: 2.5s;
    color: #00d2d3;
}

@keyframes floatBalloon {
    0% {
        transform: translateY(120vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-120vh) translateX(30px) rotate(20deg);
        opacity: 0;
    }
}

/* Enhanced Letter Hover */
.letter {
    position: absolute;
    top: 10px;
    width: 270px;
    height: 200px;
    background: linear-gradient(135deg, #ffffff 0%, #fef9f3 100%);
    padding: 20px;
    transition: var(--transition-smooth);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.letter:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.4);
}

.envelope.open .letter {
    transform: translateY(-120px) scale(1.1);
    z-index: 6;
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.5);
    animation: letterPulse 0.6s ease-out;
}

@keyframes letterPulse {
    0% {
        transform: translateY(10px) scale(0.9);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-130px) scale(1.15);
    }
    100% {
        transform: translateY(-120px) scale(1.1);
        opacity: 1;
    }
}

.handwriting {
    font-family: var(--font-heading);
    color: #1a1a2e;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

#enter-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    padding: 14px 32px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: btnGlow 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

#enter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

#enter-btn:hover::before {
    left: 100%;
}

@keyframes btnGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.8);
    }
}

#enter-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.8);
    animation: none;
}

/* ==============================================
   ENHANCED 3D CAKE SCENE
   ============================================== */
.cake-scene {
    width: 100%;
    max-width: 500px;
    margin: 3rem auto;
    text-align: center;
    perspective: 1000px;
}

.cake-wrapper {
    position: relative;
    display: inline-block;
    animation: floatCake 4s ease-in-out infinite;
}

@keyframes floatCake {
    0%, 100% {
        transform: translateY(0px) rotateY(0deg);
    }
    50% {
        transform: translateY(-15px) rotateY(5deg);
    }
}

/* Magical Sparkles */
.cake-sparkle {
    position: absolute;
    font-size: 2rem;
    animation: sparkleFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

.sparkle-1 { top: -20px; left: -30px; animation-delay: 0s; }
.sparkle-2 { top: -10px; right: -40px; animation-delay: 0.5s; }
.sparkle-3 { top: 50%; left: -50px; animation-delay: 1s; }
.sparkle-4 { top: 50%; right: -50px; animation-delay: 1.5s; }
.sparkle-5 { bottom: 20px; left: -20px; animation-delay: 2s; }
.sparkle-6 { bottom: 10px; right: -30px; animation-delay: 2.5s; }

@keyframes sparkleFloat {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-10px) scale(1.2) rotate(180deg);
        opacity: 1;
    }
}

/* 3D Cake Layers */
.cake-3d {
    position: relative;
    width: 300px;
    height: 280px;
    margin: 0 auto;
    transform-style: preserve-3d;
}

.cake-layer {
    position: absolute;
    left: 50%;
    transform-style: preserve-3d;
    animation: layerReveal 1s ease-out backwards;
}

.cake-layer-1 {
    bottom: 50px;
    transform: translateX(-50%);
    animation-delay: 0.2s;
}

.cake-layer-2 {
    bottom: 120px;
    transform: translateX(-50%);
    animation-delay: 0.4s;
}

.cake-layer-3 {
    bottom: 180px;
    transform: translateX(-50%);
    animation-delay: 0.6s;
}

@keyframes layerReveal {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(50px) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.layer-top {
    width: 200px;
    height: 60px;
    background: linear-gradient(135deg, #ff9ec9 0%, #ff6b9d 50%, #ff9ec9 100%);
    border-radius: 100px 100px 0 0;
    position: relative;
    box-shadow: 
        inset 0 -5px 15px rgba(255, 255, 255, 0.3),
        0 5px 20px rgba(255, 105, 157, 0.5);
    border: 3px solid #fff;
}

.cake-layer-2 .layer-top {
    width: 160px;
    height: 50px;
}

.cake-layer-3 .layer-top {
    width: 120px;
    height: 45px;
}

.layer-side {
    width: 200px;
    height: 70px;
    background: linear-gradient(180deg, #ffd6e8 0%, #ff9ec9 100%);
    position: absolute;
    top: 55px;
    box-shadow: 
        0 10px 30px rgba(255, 105, 157, 0.4),
        inset 0 5px 10px rgba(255, 255, 255, 0.2);
    border-left: 3px solid #fff;
    border-right: 3px solid #fff;
}

.cake-layer-2 .layer-side {
    width: 160px;
    height: 60px;
}

.cake-layer-3 .layer-side {
    width: 120px;
    height: 50px;
}

.layer-decoration {
    position: absolute;
    top: 30px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 10px;
}

.deco-item {
    font-size: 1.5rem;
    animation: decoSpin 4s ease-in-out infinite;
    display: inline-block;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.deco-item:nth-child(odd) {
    animation-delay: 0.5s;
}

@keyframes decoSpin {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(20deg) scale(1.1);
    }
}

/* Candles */
.candles-container {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.candle {
    width: 12px;
    height: 40px;
    background: linear-gradient(180deg, #ff6b9d 0%, #ff9ec9 100%);
    border-radius: 3px;
    position: relative;
    box-shadow: 0 5px 15px rgba(255, 105, 157, 0.5);
    animation: candleWiggle 2s ease-in-out infinite;
}

.candle:nth-child(2) {
    animation-delay: 0.3s;
}

.candle:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes candleWiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(2deg);
    }
    75% {
        transform: rotate(-2deg);
    }
}

.flame {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    animation: flameFlicker 1s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 165, 0, 0.8));
}

@keyframes flameFlicker {
    0%, 100% {
        transform: translateX(-50%) scale(1) translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) scale(1.1) translateY(-3px);
        opacity: 0.8;
    }
}

/* Floating Hearts */
.floating-hearts {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.heart {
    position: absolute;
    font-size: 1.5rem;
    animation: heartFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 3px 8px rgba(255, 105, 157, 0.6));
}

.heart:nth-child(1) {
    left: -40px;
    top: 30%;
    animation-delay: 0s;
}

.heart:nth-child(2) {
    right: -40px;
    top: 40%;
    animation-delay: 1s;
}

.heart:nth-child(3) {
    left: -30px;
    top: 60%;
    animation-delay: 2s;
}

.heart:nth-child(4) {
    right: -30px;
    top: 70%;
    animation-delay: 3s;
}

@keyframes heartFloat {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) scale(1.2) rotate(10deg);
        opacity: 1;
    }
}

/* Wish Section */
.wish-section {
    margin-top: 3rem;
}

.wish-prompt {
    text-align: center;
    margin-bottom: 1.5rem;
}

.wish-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 182, 193, 0.8);
    animation: wishGlow 2s ease-in-out infinite;
}

@keyframes wishGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255, 182, 193, 0.8);
    }
    50% {
        text-shadow: 0 0 30px rgba(255, 182, 193, 1), 0 0 40px rgba(255, 105, 180, 0.8);
    }
}

.wish-input {
    width: 280px;
    padding: 15px 25px;
    font-size: 1.1rem;
    text-align: center;
    border: 3px solid #ff6b9d;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    font-family: var(--font-body);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 105, 157, 0.4);
}

.wish-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.wish-input:focus {
    outline: none;
    border-color: #feca57;
    box-shadow: 0 0 30px rgba(254, 202, 87, 0.8);
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

.wish-reveal {
    margin-top: 2rem;
    animation: wishAppear 1s ease-out;
}

.wish-reveal.hidden {
    display: none;
}

@keyframes wishAppear {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wish-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 182, 193, 0.2));
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(255, 105, 180, 0.5);
    animation: cardPulse 2s ease-in-out infinite;
}

@keyframes cardPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 40px rgba(255, 105, 180, 0.5);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 15px 50px rgba(255, 105, 180, 0.7);
    }
}

.wish-card h3 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.wish-card p {
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.premium-cake,
.blow-candles-container,
.blow-input {
    display: none; /* Hide old elements */
}

/* ==============================================
   ENHANCED TIMELINE
   ============================================== */
.year-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
}

.timeline-emoji {
    font-size: 2rem;
    margin-top: 0.5rem;
    animation: emojiPop 0.6s ease-out backwards;
}

.timeline-item:nth-child(1) .timeline-emoji {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(2) .timeline-emoji {
    animation-delay: 0.5s;
}

.timeline-item:nth-child(3) .timeline-emoji {
    animation-delay: 0.7s;
}

.timeline-item:nth-child(4) .timeline-emoji {
    animation-delay: 0.9s;
}

@keyframes emojiPop {
    from {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* ==============================================
   BEAUTIFUL STORYBOOK
   ============================================== */
.storybook-container {
    max-width: 700px;
    margin: 3rem auto;
}

.book-wrapper {
    position: relative;
    width: 100%;
    min-height: 500px;
    perspective: 1500px;
}

.story-page {
    position: absolute;
    width: 100%;
    height: 100%;
    min-height: 500px;
    background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 50%, #ffd9b3 100%);
    border-radius: 15px;
    padding: 3rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    opacity: 0;
    transform: rotateY(-90deg);
    transform-origin: left;
    transition: all 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
    pointer-events: none;
}

.story-page.active {
    opacity: 1;
    transform: rotateY(0deg);
    pointer-events: auto;
    z-index: 10;
}

.story-page.turning-out {
    animation: pageFlipOut 0.8s ease-out forwards;
}

.story-page.turning-in {
    animation: pageFlipIn 0.8s ease-out forwards;
}

@keyframes pageFlipOut {
    0% {
        transform: rotateY(0deg);
        opacity: 1;
    }

    100% {
        transform: rotateY(90deg);
        opacity: 0;
    }
}

@keyframes pageFlipIn {
    0% {
        transform: rotateY(-90deg);
        opacity: 0;
    }

    100% {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

.page-content {
    text-align: center;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-decoration {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: decorationSpin 3s ease-in-out infinite;
}

@keyframes decorationSpin {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(10deg) scale(1.1);
    }
}

.page-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: #c0392b;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
    font-weight: 700;
}


.page-text {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    line-height: 2.2;
    color: #34495e;
    max-width: 500px;
    margin: 0 auto;
    font-weight: 500;
    padding: 0 30px;
    overflow: hidden;
}

.page-signature {
    display: block;
    margin-top: 20px;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #c0392b;
    font-style: italic;
}

.page-number {
    position: absolute;
    bottom: 20px;
    right: 30px;
    font-size: 1.5rem;
    color: rgba(139, 71, 137, 0.5);
    font-family: var(--font-display);
}

.book-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.book-btn {
    background: var(--gradient-cosmic);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.book-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.book-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-indicator {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: white;
    font-weight: 600;
}

.flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e6c86e, #d4af37);
    clip-path: polygon(0 0, 50% 50%, 100% 0);
    transform-origin: top;
    transition: transform 0.6s;
    z-index: 5;
}

.envelope.open .flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #b08d26, #a07d1a);
    clip-path: polygon(0 0, 50% 40%, 100% 0, 100% 100%, 0 100%);
    z-index: 4;
    pointer-events: none;
}

.letter {
    position: absolute;
    top: 10px;
    width: 250px;
    height: 180px;
    background: white;
    padding: 20px;
    transition: transform 0.8s 0.6s;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.envelope.open .letter {
    transform: translateY(-120px);
    z-index: 6;
}

.handwriting {
    font-family: var(--font-heading);
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

#enter-btn {
    background: #002244;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* ==============================================
   HIDDEN JOURNEY & SVG ELEMENTS
   ============================================== */
.hidden-journey {
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s 1s;
    /* Wait for zoom */
}

.visible-journey {
    opacity: 1;
    pointer-events: auto;
    animation: journeyReveal 1.5s ease-out;
}

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

/* PREMIUM SVG CAKE */
.svg-cake-container {
    width: 200px;
    margin: 2rem auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.premium-cake {
    overflow: visible;
}

.candle-flame {
    transform-origin: center bottom;
    animation: svgFlicker 0.2s infinite alternate;
}

@keyframes svgFlicker {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* GARDEN FLOWERS */
.svg-flower-bed {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 2rem 0;
    perspective: 1000px;
}

.flower-svg {
    width: 80px;
    height: 80px;
    animation: growBloom 1s ease-out backwards, flowerSway 3s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    transition: var(--transition-smooth);
}

.flower-svg:hover {
    transform: scale(1.3) rotate(10deg);
    filter: drop-shadow(0 10px 25px rgba(255, 105, 180, 0.5));
}

.flower-svg:nth-child(1) {
    animation-delay: 0.2s;
}

.flower-svg:nth-child(2) {
    animation-delay: 0.5s;
}

.flower-svg:nth-child(3) {
    animation-delay: 0.8s;
}

@keyframes growBloom {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    60% {
        transform: scale(1.2) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes flowerSway {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(5deg);
    }

    75% {
        transform: rotate(-5deg);
    }
}

/* POLAROID GALLERY */
.polaroid-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.polaroid {
    background: white;
    padding: 15px 15px 40px 15px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    width: 180px;
    transform: rotate(-5deg);
    transition: var(--transition-bounce);
    position: relative;
    cursor: pointer;
}

.polaroid::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

.polaroid:hover {
    transform: scale(1.3) rotate(0deg) translateY(-20px);
    z-index: 100;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(255, 105, 180, 0.3);
}

.polaroid.tilt-right {
    transform: rotate(5deg);
}

.polaroid.tilt-right:hover {
    transform: scale(1.3) rotate(0deg) translateY(-20px);
}

.polaroid .photo {
    height: 150px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.polaroid .photo::after {
    content: '📸';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.3;
}

.polaroid p {
    color: #333;
    font-family: var(--font-heading);
    margin: 0;
    font-size: 1.1rem;
    text-align: center;
}

/* ==============================================
   ENHANCED TYPOGRAPHY
   ============================================== */
.section-title {
    font-size: 3.5rem;
    font-family: var(--font-display);
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    animation: titleFloat 3s ease-in-out infinite;
}

/* Dark background sections - white/light text */
#chapter-sky .section-title,
#chapter-constellation .section-title,
#chapter-timeline .section-title,
#chapter-book .section-title,
#chapter-melody .section-title,
#chapter-ocean .section-title {
    color: #ffffff !important;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Light background sections - dark/vibrant text */
#chapter-garden .section-title {
    color: #d35400 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#chapter-dreamscape .section-title {
    color: #2980b9 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#chapter-gallery .section-title {
    color: #00b894 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gradient-text {
    color: #ffffff;
    text-shadow: 
        0 0 30px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(255, 182, 193, 0.6),
        0 4px 15px rgba(0, 0, 0, 0.7);
    font-weight: 900;
}

/* Time Capsule (purple/pink background) - Keep white */
#chapter-timeline .gradient-text {
    color: #ffffff !important;
    text-shadow: 
        0 0 30px rgba(255, 255, 255, 0.9),
        0 0 40px rgba(255, 182, 193, 0.7),
        0 4px 15px rgba(0, 0, 0, 0.8) !important;
}

/* Story Book (pink/yellow/red background) - Use dark text */
#chapter-book .gradient-text {
    color: #4a1942 !important;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.9),
        0 0 30px rgba(255, 255, 255, 0.7),
        0 4px 15px rgba(255, 255, 255, 0.5) !important;
    font-weight: 900 !important;
}

/* Override gradient text for light backgrounds */
#chapter-garden .gradient-text,
#chapter-dreamscape .gradient-text,
#chapter-gallery .gradient-text {
    color: #1a1a2e !important;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 30px rgba(255, 255, 255, 0.6),
        0 4px 12px rgba(0, 0, 0, 0.3) !important;
    font-weight: 900 !important;
}

@keyframes titleFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ==============================================
   GLASS CARD SYSTEM
   ============================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow:
        var(--glass-shadow),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.glass-card:hover::before {
    left: 100%;
}

.glass-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow:
        0 20px 60px 0 rgba(31, 38, 135, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    border-color: rgba(255, 255, 255, 0.4);
}

/* ==============================================
   CONSTELLATION OF WISHES
   ============================================== */
.constellation-canvas {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 2rem 0;
}

.wish-star {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-bounce);
    animation: starTwinkle 2s ease-in-out infinite;
}

.wish-star::before {
    content: '✨';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    opacity: 0;
    transition: var(--transition-smooth);
}

.wish-star:hover::before {
    opacity: 1;
}

.wish-star:hover {
    transform: scale(1.5);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
}

.wish-popup {
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    padding: 1rem 1.5rem;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 0.9rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-smooth);
    z-index: 100;
}

.wish-popup.show {
    opacity: 1;
    transform: translateY(-10px);
}

@keyframes starTwinkle {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ==============================================
   DREAMSCAPE GALLERY
   ============================================== */
.dreamscape-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.dream-card {
    position: relative;
    height: 350px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-smooth);
    animation: dreamFloat calc(3s + var(--index) * 0.5s) ease-in-out infinite;
}

.dream-card:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4);
}

.dream-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(102, 126, 234, 0.8) 0%,
            rgba(118, 75, 162, 0.8) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
    transition: var(--transition-smooth);
}

.dream-card:hover .dream-image {
    transform: scale(1.1);
}

.dream-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    transform: translateY(100%);
    transition: var(--transition-smooth);
}

.dream-card:hover .dream-overlay {
    transform: translateY(0);
}

.dream-overlay h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.dream-overlay p {
    color: #f0f0f0;
    font-size: 1.1rem;
}


@keyframes dreamFloat {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(1deg);
    }
}

/* ==============================================
   TIME CAPSULE TIMELINE
   ============================================== */
.timeline {
    position: relative;
    max-width: 600px;
    margin: 3rem auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #667eea 0%, #f093fb 50%, #feca57 100%);
    transform: translateX(-50%);
    border-radius: 2px;
    animation: progressLine 3s ease-out forwards;
}

@keyframes progressLine {
    from {
        height: 0;
    }
    to {
        height: 100%;
    }
}

.timeline-item {
    position: relative;
    margin: 3rem 0;
    display: flex;
    align-items: center;
    opacity: 0;
    animation: fadeInTimeline 0.8s ease-out forwards;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.8s;
}

.timeline-item:nth-child(3) {
    animation-delay: 1.3s;
}

.timeline-item:nth-child(4) {
    animation-delay: 1.8s;
}

@keyframes fadeInTimeline {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: var(--gradient-sunset);
    border-radius: 50%;
    border: 4px solid #1a1a2e;
    box-shadow: 0 0 20px rgba(240, 147, 251, 0.6);
    z-index: 2;
    animation: pulseMarker 2s ease-in-out infinite;
}

/* Progressive color change for markers */
.timeline-item:nth-child(1) .timeline-marker {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 0 25px rgba(102, 126, 234, 0.8);
}

.timeline-item:nth-child(2) .timeline-marker {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 0 25px rgba(240, 147, 251, 0.8);
}

.timeline-item:nth-child(3) .timeline-marker {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 0 25px rgba(250, 112, 154, 0.8);
}

.timeline-item:nth-child(4) .timeline-marker {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
    box-shadow: 0 0 25px rgba(254, 202, 87, 0.8);
    animation: pulseMarker 2s ease-in-out infinite, rotateFuture 4s linear infinite;
}

@keyframes rotateFuture {
    from {
        transform: translateX(-50%) rotate(0deg);
    }
    to {
        transform: translateX(-50%) rotate(360deg);
    }
}

@keyframes pulseMarker {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
    }

    50% {
        transform: translateX(-50%) scale(1.2);
    }
}

.timeline-content {
    width: 45%;
    animation: slideInContent 0.8s ease-out backwards;
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 40px rgba(240, 147, 251, 0.5);
}

.timeline-item:nth-child(1) .timeline-content {
    animation-delay: 0.5s;
}

.timeline-item:nth-child(2) .timeline-content {
    animation-delay: 1s;
}

.timeline-item:nth-child(3) .timeline-content {
    animation-delay: 1.5s;
}

.timeline-item:nth-child(4) .timeline-content {
    animation-delay: 2s;
}

@keyframes slideInContent {
    from {
        opacity: 0;
        transform: translateX(-80px) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.timeline-content h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #ffeaa7;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.timeline-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ffffff;
}


/* ==============================================
   ENHANCED POEM CARD
   ============================================== */
.poem-card {
    margin-top: 2rem;
    text-align: center;
}

.poem-text {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    line-height: 1.8;
    font-style: italic;
    color: #2d3436;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


/* ==============================================
   MUSIC VISUALIZER
   ============================================== */

/* ==============================================
   BOY CHARACTER
   ============================================== */
.character-boy {
    position: absolute;
    top: -80px;
    z-index: 5;
    animation: popUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.head {
    width: 80px;
    height: 80px;
    background: #ffdbac;
    /* Skin tone */
    border-radius: 50%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.hair-top {
    position: absolute;
    top: -10px;
    left: 5px;
    width: 70px;
    height: 30px;
    background: #333;
    border-radius: 50px 50px 0 0;
}

.glasses {
    position: absolute;
    top: 30px;
    left: 10px;
    width: 60px;
    height: 20px;
    display: flex;
    justify-content: space-between;
}

.glass-left,
.glass-right {
    width: 25px;
    height: 25px;
    border: 3px solid #333;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.bridge {
    position: absolute;
    top: 10px;
    left: 25px;
    width: 10px;
    height: 3px;
    background: #333;
}

.smile {
    position: absolute;
    bottom: 15px;
    left: 25px;
    width: 30px;
    height: 15px;
    border-bottom: 3px solid #333;
    border-radius: 0 0 15px 15px;
}

.speech-bubble {
    position: absolute;
    top: -50px;
    right: -80px;
    background: white;
    color: #333;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 10px;
    border-width: 5px;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

@keyframes popUp {
    from {
        transform: translateY(50px) scale(0);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

#wish-message {
    font-size: 2rem;
    font-family: var(--font-heading);
    margin-top: 1rem;
    color: #ff9aa2;
    animation: glow 1s infinite alternate;
}

.hidden {
    display: none;
}

/* ==============================================
   3D BOOK ANIMATIONS
   ============================================== */
.book-scene {
    width: 300px;
    height: 400px;
    margin: 3rem auto;
    perspective: 1500px;
}

.book {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateX(10deg);
    transition: transform 1s;
}

.book:hover {
    transform: rotateX(20deg) translateX(50px);
}

.page {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform-origin: left;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.15, 1.7, 0.84, 0.58);
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-radius: 0 10px 10px 0;
    cursor: pointer;
}

.front,
.back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
}

.back {
    transform: rotateY(180deg);
    background: #f0f8ff;
    color: #002244;
}

/* Book Cover Effect */
.cover {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #002244;
    color: white;
    z-index: 0;
    border-radius: 0 10px 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-family: var(--font-heading);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
}

/* Page Turns */
.book:hover .page {
    transform: rotateY(-180deg);
}

/* Staggered page turn on hover */
.book:hover .page:nth-child(2) {
    transition-delay: 0s;
}

.book:hover .page:nth-child(3) {
    transition-delay: 0.2s;
}

.book:hover .page:nth-child(4) {
    transition-delay: 0.4s;
}

/* Keep pages stacked slightly */
.page:nth-child(2) {
    z-index: 3;
}

.page:nth-child(3) {
    z-index: 2;
}

.page:nth-child(4) {
    z-index: 1;
}

.page img {
    max-width: 90%;
    max-height: 70%;
    border-radius: 5px;
    border: 2px solid #a2d2ff;
}


/* ==============================================
   OCEAN BUBBLES (ENHANCED)
   ============================================== */
.bubble-container {
    position: relative;
    height: 400px;
    margin-top: 2rem;
}

.bubble {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.9),
            rgba(173, 216, 230, 0.6),
            rgba(102, 126, 234, 0.4));
    border-radius: 50%;
    box-shadow:
        0 0 20px rgba(255, 255, 255, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-bounce);
    animation: bubbleFloat 8s ease-in-out infinite;
    font-size: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.bubble::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 30%;
    height: 30%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
    border-radius: 50%;
}

.bubble:hover {
    transform: scale(1.3);
    box-shadow:
        0 0 40px rgba(255, 255, 255, 0.8),
        0 0 60px rgba(102, 126, 234, 0.5);
    animation-play-state: paused;
}

.bubble-text {
    display: none;
    font-size: 0.8rem;
    text-align: center;
    padding: 5px;
    color: #004e92;
    font-weight: bold;
}

.bubble.popped {
    background: white;
    width: 150px;
    height: auto;
    min-height: 80px;
    border-radius: 10px;
    z-index: 10;
}

.bubble.popped .bubble-text {
    display: block;
}

.bubble.pop {
    animation: bubblePop 0.6s ease-out forwards;
}

@keyframes bubblePop {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes bubbleFloat {
    0% {
        transform: translateY(0) translateX(0) scale(1);
    }

    25% {
        transform: translateY(-30px) translateX(10px) scale(1.05);
    }

    50% {
        transform: translateY(-20px) translateX(-10px) scale(0.95);
    }

    75% {
        transform: translateY(20px) translateX(5px) scale(1.02);
    }

    100% {
        transform: translateY(0) translateX(0) scale(1);
    }
}

.bubble-msg {
    position: fixed;
    background: var(--gradient-cosmic);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: msgFloat 2s ease-out;
    z-index: 1000;
}

@keyframes msgFloat {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }

    10% {
        transform: translateY(-20px) scale(1);
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-60px) scale(0.8);
        opacity: 0;
    }
}

/* ==============================================
   FOOTER
   ============================================== */
.journey-footer {
    background: #002244;
    padding: 2rem;
    text-align: center;
    color: #a2d2ff;
}

.glass-btn {
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    backdrop-filter: blur(4px);
    transition: all 0.3s;
}

.glass-btn:hover {
    background: white;
    color: #002244;
}