/* Highlight cho tên sinh nhật trong subtitle */
.highlight-name {
    color: #d4a017;
    font-weight: bold;
}
/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Quicksand', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
    position: relative;
}

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

/* ===== BACKGROUND STARS ===== */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 40px 70px, white, transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(2px 2px at 160px 30px, white, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: sparkle 3s linear infinite;
}

.stars::after {
    background-size: 400px 200px;
    animation-delay: 1s;
    animation-duration: 4s;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ===== FLOATING BALLOONS ===== */
.balloons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.balloon {
    position: absolute;
    width: 60px;
    height: 80px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: float 6s ease-in-out infinite;
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
}

.balloon-1 {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    top: 20%;
    left: 5%;
    animation-delay: 0s;
}

.balloon-2 {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    top: 30%;
    right: 8%;
    animation-delay: 1.5s;
}

.balloon-3 {
    background: linear-gradient(45deg, #45b7d1, #96c93d);
    top: 15%;
    left: 85%;
    animation-delay: 3s;
}

.balloon-4 {
    background: linear-gradient(45deg, #f093fb, #f5576c);
    top: 40%;
    left: 10%;
    animation-delay: 2s;
}

.balloon-5 {
    background: linear-gradient(45deg, #ffecd2, #fcb69f);
    top: 25%;
    right: 15%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    25% { transform: translateY(-10px) rotate(1deg); }
    50% { transform: translateY(-20px) rotate(-1deg); }
    75% { transform: translateY(-10px) rotate(2deg); }
}

/* ===== MAIN CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out;
}

.main-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.title-line {
    color: white;
    animation: bounceIn 1s ease-out;
}

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

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

.rainbow-text {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96c93d, #feca57, #ff9ff3);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowFlow 3s ease infinite, bounceIn 1s ease-out 0.3s;
}

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

.subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    animation: fadeIn 1s ease-out 1s both;
}

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== CAKE SECTION ===== */
.cake-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 3rem 0;
    animation: slideInUp 1.2s ease-out 0.5s both;
}

.cake-container {
    position: relative;
    margin-bottom: 2rem;
    animation: cakeAppear 2s ease-out 1s both;
}

.cake {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Cake Layers */
.cake-layer {
    border-radius: 15px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.cake-top {
    width: 200px;
    height: 60px;
    background: linear-gradient(45deg, #ff9a9e, #fecfef);
    border: 3px solid #fff;
    margin-bottom: -5px;
    z-index: 3;
}

.cake-middle {
    width: 250px;
    height: 70px;
    background: linear-gradient(45deg, #a8edea, #fed6e3);
    border: 3px solid #fff;
    margin-bottom: -5px;
    z-index: 2;
}

.cake-bottom {
    width: 300px;
    height: 80px;
    background: linear-gradient(45deg, #d299c2, #fef9d7);
    border: 3px solid #fff;
    z-index: 1;
}

.cake-plate {
    width: 350px;
    height: 20px;
    background: linear-gradient(45deg, #8e9aaf, #cbc0d3);
    border-radius: 50%;
    margin-top: -10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Cake Decorations */
.cake-decoration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 30px;
}

.cherry, .strawberry {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

.strawberry {
    animation-delay: 0.5s;
}

.cake-cream {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

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

.candle {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.candle:hover {
    transform: scale(1.1);
}

.candle:active {
    transform: scale(0.95);
}

.candle-body {
    width: 8px;
    height: 30px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96c93d, #feca57);
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.flame {
    width: 12px;
    height: 15px;
    background: radial-gradient(circle, #fff700 0%, #ff8c00 50%, #ff4500 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: absolute;
    top: -15px;
    animation: flicker 1s ease-in-out infinite alternate;
    box-shadow: 0 0 10px #ff8c00, 0 0 20px #ff4500;
    transition: all 0.5s ease;
}

.flame.blown-out {
    opacity: 0;
    transform: scale(0);
}

@keyframes flicker {
    0% { transform: rotate(-2deg) scale(1); }
    100% { transform: rotate(2deg) scale(1.1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes cakeAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

/* ===== BLOW SECTION ===== */
.blow-section {
    text-align: center;
    opacity: 1;
}

.blow-button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.blow-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.blow-button:active {
    transform: translateY(0);
    animation: blowPulse 0.6s ease-out;
}

.blow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.6s ease;
}

.blow-button.active .blow-effect {
    width: 200px;
    height: 200px;
}

@keyframes blowPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.blow-instruction {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 300;
    margin-top: 1rem;
    opacity: 1;
}

/* ===== WISHES SECTION ===== */
.wishes-section {
    margin: 3rem 0;
    width: 100%;
    max-width: 600px;
    animation: fadeIn 1s ease-out 2.5s both;
}

.wish-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.wish-card h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.wishes-container {
    position: relative;
    height: 60px;
    overflow: hidden;
}

.wish {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.wish.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SURPRISE SECTION ===== */
.surprise-section {
    margin: 2rem 0;
    animation: fadeIn 1s ease-out 3s both;
}

.surprise-button {
    background: linear-gradient(45deg, #ff9a9e, #fecfef, #feca57);
    background-size: 200% 200%;
    border: none;
    border-radius: 50px;
    padding: 18px 35px;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: surpriseGlow 2s ease infinite;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.surprise-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

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

/* ===== LIGHTING OVERLAY =====*/
.lighting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse 800px 600px at 50% 50%, 
        transparent 0%, 
        transparent 30%, 
        rgba(0, 0, 0, 0.95) 70%
    );
    z-index: 500;
    pointer-events: none;
    transition: opacity 2s ease-out;
    opacity: 1;
}

.lighting-overlay.lights-on {
    opacity: 0;
}

/* Ensure cake area is always visible */
.cake-section {
    position: relative;
    z-index: 600;
}

/* Responsive lighting overlay */
@media (max-width: 768px) {
    .lighting-overlay {
        background: radial-gradient(
            ellipse 500px 400px at 50% 45%, 
            transparent 0%, 
            transparent 25%, 
            rgba(0, 0, 0, 0.92) 65%
        );
    }
}

@media (max-width: 480px) {
    .lighting-overlay {
        background: radial-gradient(
            ellipse 320px 280px at 50% 42%, 
            transparent 0%, 
            transparent 25%, 
            rgba(0, 0, 0, 0.85) 65%
        );
    }
    
    .cake-section {
        transform: translateY(-5px);
    }
}

/* ===== AUTHOR CREDIT ===== */
.author-credit {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 8px 15px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 400;
    z-index: 1000;
    transition: all 0.3s ease;
    cursor: pointer;
}

.author-credit:hover {
    background: linear-gradient(90deg, #ff9ff3, #54a0ff);
    color: #222;
    border-color: #fff;
    transform: scale(1.08) rotate(-2deg);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.author-credit:active {
    background: linear-gradient(90deg, #feca57, #ff6b6b);
    color: #fff;
    transform: scale(0.98) rotate(2deg);
}


.author-credit:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* ===== MUSIC CONTROL ===== */
.music-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.music-button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 12px 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.music-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ===== RESPONSIVE FOR MOBILE ===== */
@media (max-width: 768px) {
    .author-credit {
        font-size: 0.45rem;
        padding: 4px 8px;
        bottom: 10px;
        left: 10px;
        opacity: 0.5;
        border-radius: 15px;
    }

    .music-control {
        bottom: 10px;
        right: 10px;
    }

    .music-button {
        font-size: 0.7rem;
        padding: 6px 10px;
        opacity: 0.5;
        border-radius: 25px;
        gap: 4px;
    }
}

/* ===== PHOTO GALLERY MODAL ===== */
.photo-gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.photo-gallery-modal.active {
    display: flex;
}

/* ===== 3D EXPLOSION GALLERY ===== */
.explosion-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.98) 100%);
    display: none;
    z-index: 3000;
    perspective: 1500px;
    overflow: hidden;
}

.explosion-gallery.active {
    display: block;
    animation: explosionBackdrop 0.8s ease-out;
}

.explosion-image {
    position: absolute;
    width: 200px;
    height: 150px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    border: 3px solid rgba(255, 215, 0, 0.8);
}

.explosion-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.explosion-image:hover {
    transform: scale(1.1) rotateY(10deg);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.8);
    z-index: 10;
}

.explosion-image.animate {
    animation: explodeOut 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards,
               rotateAround 8s linear infinite 1s;
}

.explosion-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffd700;
    font-size: 3.5rem;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    z-index: 5;
    opacity: 0;
    animation: titleExplosion 1s ease-out 0.2s forwards;
    text-align: center;
}

.explosion-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.8);
    color: #ffd700;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.explosion-close:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: rotate(90deg) scale(1.1);
}

.explosion-instruction {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 25px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
        opacity: 0.9;
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
        opacity: 1;
    }
}

@keyframes explosionBackdrop {
    0% { 
        background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(0,0,0,0.95) 100%);
        transform: scale(0);
    }
    100% { 
        background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.98) 100%);
        transform: scale(1);
    }
}

@keyframes explodeOut {
    0% {
        transform: scale(0) rotateX(90deg) rotateY(180deg) rotateZ(0deg);
        opacity: 0;
    }
    30% {
        opacity: 1;
        transform: scale(0.8) rotateX(45deg) rotateY(90deg) rotateZ(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg)) rotateZ(var(--rotate-z, 0deg));
    }
}

@keyframes titleExplosion {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0) rotateY(180deg);
        text-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2) rotateY(0deg);
        text-shadow: 0 0 30px rgba(255, 215, 0, 1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotateY(0deg);
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

@keyframes rotateAround {
    0% {
        transform: 
            translateX(calc(var(--orbit-x, 0px) * cos(0deg) - var(--orbit-y, 0px) * sin(0deg)))
            translateY(calc(var(--orbit-x, 0px) * sin(0deg) + var(--orbit-y, 0px) * cos(0deg)))
            rotateX(var(--rotate-x, 0deg)) 
            rotateY(var(--rotate-y, 0deg)) 
            rotateZ(var(--rotate-z, 0deg));
    }
    100% {
        transform: 
            translateX(calc(var(--orbit-x, 0px) * cos(360deg) - var(--orbit-y, 0px) * sin(360deg)))
            translateY(calc(var(--orbit-x, 0px) * sin(360deg) + var(--orbit-y, 0px) * cos(360deg)))
            rotateX(var(--rotate-x, 0deg)) 
            rotateY(calc(var(--rotate-y, 0deg) + 360deg)) 
            rotateZ(calc(var(--rotate-z, 0deg) + 180deg));
    }
}

.gallery-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: transparent;
}

.party-hat-frame {
    position: relative;
    width: 800px;
    height: 650px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Party Hat Styling */
.party-hat {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.hat-body {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 80px solid #ff6b6b;
    position: relative;
    background: linear-gradient(45deg, #ff6b6b, #ff9ff3);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.hat-body::after {
    content: '';
    position: absolute;
    top: 80px;
    left: -35px;
    width: 70px;
    height: 15px;
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hat-tip {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #feca57;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hat-dots {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: white;
}

.hat-dots span {
    animation: bounce 2s infinite;
}

.hat-dots span:nth-child(2) { animation-delay: 0.2s; }
.hat-dots span:nth-child(3) { animation-delay: 0.4s; }
.hat-dots span:nth-child(4) { animation-delay: 0.6s; }
.hat-dots span:nth-child(5) { animation-delay: 0.8s; }

/* Photo Display */
.photo-display {
    position: relative;
    width: 800px;
    height: 600px;
    max-width: 90vw;
    max-height: 75vh;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 8px solid #fff;
}

.photo-display img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px 12px 0 0;
    background: #fff;
    object-position: center top;
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 8px 12px;
    text-align: center;
}

.photo-overlay h3 {
    margin: 0 0 3px 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
}

.photo-overlay p {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigation Buttons */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 20;
}

.gallery-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.prev-btn {
    left: -80px;
}

.next-btn {
    right: -80px;
}

/* Progress Indicator */
.gallery-progress {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 20%; /* Will be updated by JavaScript */
}

.progress-text {
    font-weight: 600;
    white-space: nowrap;
}

/* Close Button */
.gallery-close {
    position: absolute;
    top: -20px;
    right: -20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.gallery-close:hover {
    background: white;
    transform: scale(1.1);
}

/* ===== EFFECTS CONTAINERS ===== */
#confetti-container,
#fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* ===== CONFETTI STYLES ===== */
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: confetti-fall 3s linear forwards;
}

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

/* ===== FIREWORK STYLES ===== */
.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: firework-explosion 1s ease-out forwards;
}

@keyframes firework-explosion {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .cake-top { width: 150px; height: 50px; }
    .cake-middle { width: 200px; height: 60px; }
    .cake-bottom { width: 250px; height: 70px; }
    .cake-plate { width: 280px; }
    
    .candles { gap: 10px; }
    .candle-body { width: 6px; height: 25px; }
    .flame { width: 10px; height: 12px; }
    
    .wish-card {
        margin: 0 1rem;
        padding: 1.5rem;
    }
    
    .wish {
        font-size: 1rem;
    }
    
    .balloons .balloon {
        width: 40px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    .party-hat-frame {
        width: 400px;
        height: 350px;
    }
    
    .photo-display {
        width: 450px;
        height: 320px;
    }
    
    .prev-btn {
        left: -60px;
    }
    
    .next-btn {
        right: -60px;
    }
    
    .progress-bar {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .cake-top { width: 120px; height: 40px; }
    .cake-middle { width: 160px; height: 50px; }
    .cake-bottom { width: 200px; height: 60px; }
    .cake-plate { width: 220px; }
    
    .candles { gap: 8px; }
    
    .blow-button, .surprise-button {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .party-hat-frame {
        width: 380px;
        height: 350px;
    }
    
    .photo-display {
        width: 360px;
        height: 280px;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .prev-btn {
        left: -50px;
    }
    
    .next-btn {
        right: -50px;
    }
    
    .progress-bar {
        width: 120px;
    }
    
    .progress-text {
        font-size: 0.9rem;
    }

    /* Explosion gallery responsive */
    .explosion-image {
        width: 150px;
        height: 112px;
    }

    .explosion-image.animate {
        animation: explodeOut 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards,
                   rotateAroundMobile 10s linear infinite 1s;
    }

    .explosion-title {
        font-size: 2rem;
        padding: 0 10px;
    }

    .explosion-close {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        top: 20px;
        right: 20px;
    }

    .explosion-instruction {
        font-size: 0.75rem;
        padding: 6px 12px;
        bottom: 50px;
        max-width: 90%;
    }

    @keyframes rotateAroundMobile {
        0% {
            transform: 
                translateX(calc(var(--orbit-x, 0px) * 0.3))
                translateY(calc(var(--orbit-y, 0px) * 0.3))
                rotateX(var(--rotate-x, 0deg)) 
                rotateY(var(--rotate-y, 0deg)) 
                rotateZ(var(--rotate-z, 0deg));
        }
        100% {
            transform: 
                translateX(calc(var(--orbit-x, 0px) * 0.3))
                translateY(calc(var(--orbit-y, 0px) * 0.3))
                rotateX(var(--rotate-x, 0deg)) 
                rotateY(calc(var(--rotate-y, 0deg) + 360deg)) 
                rotateZ(calc(var(--rotate-z, 0deg) + 180deg));
        }
    }
}

@media (max-width: 768px) {
    /* Explosion gallery tablet responsive */
    .explosion-image {
        width: 180px;
        height: 135px;
    }

    .explosion-title {
        font-size: 2.5rem;
        padding: 0 15px;
    }

    .explosion-close {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
        top: 25px;
        right: 25px;
    }

    .explosion-instruction {
        font-size: 0.85rem;
        padding: 8px 16px;
        bottom: 60px;
    }

    @keyframes rotateAround {
        0% {
            transform: 
                translateX(calc(var(--orbit-x, 0px) * cos(0deg) * 0.8 - var(--orbit-y, 0px) * sin(0deg) * 0.8))
                translateY(calc(var(--orbit-x, 0px) * sin(0deg) * 0.8 + var(--orbit-y, 0px) * cos(0deg) * 0.8))
                rotateX(var(--rotate-x, 0deg)) 
                rotateY(var(--rotate-y, 0deg)) 
                rotateZ(var(--rotate-z, 0deg));
        }
        100% {
            transform: 
                translateX(calc(var(--orbit-x, 0px) * cos(360deg) * 0.8 - var(--orbit-y, 0px) * sin(360deg) * 0.8))
                translateY(calc(var(--orbit-x, 0px) * sin(360deg) * 0.8 + var(--orbit-y, 0px) * cos(360deg) * 0.8))
                rotateX(var(--rotate-x, 0deg)) 
                rotateY(calc(var(--rotate-y, 0deg) + 360deg)) 
                rotateZ(calc(var(--rotate-z, 0deg) + 180deg));
        }
    }
}