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

body {
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, 
        #ff006e 0%, 
        #9d4edd 12%, 
        #8338ec 20%, 
        #5a67d8 30%, 
        #3a86ff 40%, 
        #06ffa5 55%, 
        #c77dff 65%, 
        #e0aaff 75%, 
        #ffbe0b 85%, 
        #ff006e 100%);
    background-size: 500% 500%;
    background-attachment: fixed;
    animation: gradientShift 25s ease-in-out infinite;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    position: fixed;
    top: 0;
    left: 0;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 70%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 30%; }
    100% { background-position: 0% 50%; }
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    pointer-events: none;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    opacity: 0.8;
    animation: confettiFall linear forwards;
}

.teardrop {
    position: absolute;
    width: 6px;
    height: 10px;
    top: -10px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(45deg);
    opacity: 0.6;
    animation: teardropFall linear forwards;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes teardropFall {
    0% {
        transform: translateY(0) rotate(45deg);
        opacity: 0.6;
        filter: hue-rotate(0deg) brightness(0.8);
    }
    50% {
        opacity: 0.5;
        filter: hue-rotate(60deg) brightness(1);
    }
    100% {
        transform: translateY(100vh) rotate(45deg);
        opacity: 0;
        filter: hue-rotate(120deg) brightness(1.2);
    }
}

/* Fireworks */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    pointer-events: none;
    z-index: 999;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: explode 1.5s ease-out forwards;
}

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

/* Phrases container */
.phrases-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    pointer-events: none;
    z-index: 500;
}

.phrase {
    position: absolute;
    font-weight: bold;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    max-width: 85vw;
    max-height: 90vh;
    max-height: 90dvh;
    overflow: visible;
    word-wrap: break-word;
    white-space: normal;
    text-align: center;
    padding: 15px 20px;
    box-sizing: border-box;
    line-height: 1.4;
}

/* Animation classes */
.anim-spiral {
    animation: spiral var(--duration) var(--timing) forwards;
}

@keyframes spiral {
    0% {
        transform: translate(calc(-50% + var(--spiral-x)), calc(-50% + var(--spiral-y))) rotate(0deg) scale(0);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
        opacity: 0.9;
    }
    40% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    50% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1.08);
        animation-timing-function: ease-in-out;
    }
    60% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    80% {
        transform: translate(calc(-50% + var(--spiral-x) * -1), calc(-50% + var(--spiral-y) * -1)) rotate(720deg) scale(0);
        opacity: 0.9;
    }
    100% {
        transform: translate(calc(-50% + var(--spiral-x) * -1), calc(-50% + var(--spiral-y) * -1)) rotate(720deg) scale(0);
        opacity: 0;
    }
}

.anim-spin {
    animation: spin var(--duration) var(--timing) forwards;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(-180deg) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 0.9;
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
    40% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    50% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1.08);
        animation-timing-function: ease-in-out;
    }
    60% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    80% {
        opacity: 0.9;
        transform: translate(-50%, -50%) rotate(180deg) scale(0);
    }
    100% {
        transform: translate(-50%, -50%) rotate(180deg) scale(0);
        opacity: 0;
    }
}

.anim-backwards {
    animation: backwards var(--duration) var(--timing) forwards;
}

@keyframes backwards {
    0% {
        transform: translate(calc(-50% + 150vw), -50%) scale(0.5);
        opacity: 0;
    }
    20% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
        animation-timing-function: ease-in-out;
    }
    60% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    80% {
        opacity: 0.9;
        transform: translate(calc(-50% - 150vw), -50%) scale(0.5);
    }
    100% {
        transform: translate(calc(-50% - 150vw), -50%) scale(0);
        opacity: 0;
    }
}

.anim-scroll-up {
    animation: scrollUp var(--duration) var(--timing) forwards;
}

@keyframes scrollUp {
    0% {
        transform: translate(-50%, calc(-50% + 100vh)) scale(0.5);
        opacity: 0;
    }
    20% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
        animation-timing-function: ease-in-out;
    }
    60% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    80% {
        opacity: 0.9;
        transform: translate(-50%, calc(-50% - 100vh)) scale(0.5);
    }
    100% {
        transform: translate(-50%, calc(-50% - 100vh)) scale(0);
        opacity: 0;
    }
}

.anim-scroll-down {
    animation: scrollDown var(--duration) var(--timing) forwards;
}

@keyframes scrollDown {
    0% {
        transform: translate(-50%, calc(-50% - 100vh)) scale(0.5);
        opacity: 0;
    }
    20% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
        animation-timing-function: ease-in-out;
    }
    60% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    80% {
        opacity: 0.9;
        transform: translate(-50%, calc(-50% + 100vh)) scale(0.5);
    }
    100% {
        transform: translate(-50%, calc(-50% + 100vh)) scale(0);
        opacity: 0;
    }
}

.anim-flash {
    animation: flash var(--duration) var(--timing) forwards;
}

@keyframes flash {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    10% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
        animation-timing-function: ease-in-out;
    }
    60% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    90% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
}

.anim-bounce {
    animation: bounce var(--duration) var(--timing) forwards;
}

@keyframes bounce {
    0% {
        transform: translate(-50%, calc(-50% - 100vh)) scale(0);
        opacity: 0;
    }
    10% {
        transform: translate(-50%, calc(-50% + 20px)) scale(1);
        opacity: 0.9;
    }
    15% {
        transform: translate(-50%, calc(-50% - 10px)) scale(1);
    }
    20% {
        transform: translate(-50%, -50%) scale(1);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
        animation-timing-function: ease-in-out;
    }
    60% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    80% {
        transform: translate(-50%, calc(-50% - 10px)) scale(1);
    }
    85% {
        transform: translate(-50%, calc(-50% + 20px)) scale(1);
    }
    90% {
        transform: translate(-50%, calc(-50% + 100vh)) scale(0);
        opacity: 0.9;
    }
    100% {
        transform: translate(-50%, calc(-50% + 100vh)) scale(0);
        opacity: 0;
    }
}

.anim-wave {
    animation: wave var(--duration) var(--timing) forwards;
}

@keyframes wave {
    0% {
        transform: translate(calc(-50% - 100vw), -50%) scale(0);
        opacity: 0;
    }
    5% {
        transform: translate(calc(-50% - 50vw), calc(-50% - 20px)) scale(0.5);
        opacity: 0.5;
    }
    10% {
        transform: translate(calc(-50% - 25vw), calc(-50% + 20px)) scale(0.75);
    }
    15% {
        transform: translate(calc(-50% - 10vw), calc(-50% - 15px)) scale(0.9);
    }
    20% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
        animation-timing-function: ease-in-out;
    }
    60% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    80% {
        transform: translate(calc(-50% + 10vw), calc(-50% - 15px)) scale(0.9);
    }
    85% {
        transform: translate(calc(-50% + 25vw), calc(-50% + 20px)) scale(0.75);
    }
    90% {
        transform: translate(calc(-50% + 50vw), calc(-50% - 20px)) scale(0.5);
        opacity: 0.5;
    }
    95% {
        transform: translate(calc(-50% + 100vw), -50%) scale(0);
        opacity: 0.9;
    }
    100% {
        transform: translate(calc(-50% + 100vw), -50%) scale(0);
        opacity: 0;
    }
}

.anim-zoom {
    animation: zoom var(--duration) var(--timing) forwards;
}

@keyframes zoom {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
        animation-timing-function: ease-in-out;
    }
    60% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        animation-timing-function: ease-in-out;
    }
    80% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
}

/* Patterns for extra flair - softened with organic waves */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(0,0,0,0.02) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(255,255,255,0.015) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(0,0,0,0.015) 0%, transparent 40%);
    background-size: 100% 100%, 100% 100%, 200% 200%, 200% 200%;
    pointer-events: none;
    z-index: 1;
    animation: wavePattern 20s ease-in-out infinite;
}

@keyframes wavePattern {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
    }
}
