/* Birthday Celebration Overlay */
.birthday-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 1.5s ease;
    /* iOS safe area coverage */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    touch-action: none;
}

.birthday-overlay.fading {
    opacity: 0;
    pointer-events: none;
}

/* Fireworks Canvas */
.birthday-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: opacity 1s ease;
}

.birthday-canvas.fade-out {
    opacity: 0;
}

/* Petals Container */
.birthday-petals {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

/* Rose Petal */
.rose-petal {
    position: absolute;
    width: 18px;
    height: 22px;
    border-radius: 50% 0 50% 50%;
    opacity: 0;
    z-index: 2;
    animation: petalFall linear forwards;
    will-change: transform, opacity;
}

.rose-petal.shade-1 {
    background: radial-gradient(ellipse at 30% 30%, #e8395b, #b71c3a);
}

.rose-petal.shade-2 {
    background: radial-gradient(ellipse at 30% 30%, #f06292, #d81b60);
}

.rose-petal.shade-3 {
    background: radial-gradient(ellipse at 30% 30%, #f8a4b8, #e57399);
}

@keyframes petalFall {
    0% {
        opacity: 0;
        transform: translateY(-30px) rotate(0deg) translateX(0px);
    }
    10% {
        opacity: 0.9;
    }
    25% {
        transform: translateY(25vh) rotate(90deg) translateX(30px);
    }
    50% {
        transform: translateY(50vh) rotate(180deg) translateX(-20px);
    }
    75% {
        transform: translateY(75vh) rotate(270deg) translateX(25px);
    }
    90% {
        opacity: 0.7;
    }
    100% {
        opacity: 0;
        transform: translateY(110vh) rotate(360deg) translateX(-10px);
    }
}

/* Hearts Container */
.birthday-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

/* Floating Heart */
.floating-heart {
    position: absolute;
    bottom: -40px;
    opacity: 0;
    z-index: 2;
    animation: heartFloat ease-out forwards;
    will-change: transform, opacity;
}

.floating-heart svg {
    fill: #e8395b;
    filter: drop-shadow(0 0 6px rgba(232, 57, 91, 0.5));
}

@keyframes heartFloat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(0.5);
    }
    15% {
        opacity: 0.8;
        transform: translateY(-15vh) translateX(10px) scale(0.8);
    }
    50% {
        opacity: 0.6;
        transform: translateY(-45vh) translateX(-15px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(8px) scale(0.6);
    }
}

/* Gold Glow Background */
.gold-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
    z-index: 2;
    opacity: 0;
    transition: opacity 1.5s ease;
    animation: glowPulse 3s ease-in-out infinite;
}

.birthday-overlay.act2 .gold-glow {
    opacity: 1;
}

@keyframes glowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
}

/* Message Card */
.birthday-message {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 40px 36px;
    background: rgba(20, 10, 5, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.15), 0 0 80px rgba(255, 215, 0, 0.05);
    max-width: 420px;
    width: 90%;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

.birthday-overlay.act2 .birthday-message {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.birthday-text {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.25rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    margin: 0 0 28px 0;
}

.birthday-highlight {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    letter-spacing: 1px;
}

/* Dismiss Button */
.birthday-dismiss-btn {
    display: inline-block;
    min-height: 44px; /* iOS minimum touch target */
    padding: 14px 40px;
    background: linear-gradient(135deg, #ffd700, #e6ac00);
    color: #1a0a00;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s ease 0.5s, transform 1s ease 0.5s, box-shadow 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
}

.birthday-overlay.act2 .birthday-dismiss-btn {
    opacity: 1;
    transform: translateY(0);
}

.birthday-dismiss-btn:hover {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.birthday-dismiss-btn:active {
    transform: scale(0.97);
}

/* Responsive */
@media (max-width: 480px) {
    .birthday-message {
        padding: 28px 22px;
    }

    .birthday-text {
        font-size: 1.1rem;
    }

    .birthday-highlight {
        font-size: 1.3rem;
    }

    .gold-glow {
        width: 350px;
        height: 350px;
    }
}
