/* ===== ANIMATIONS ===== */

/* Menu animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Game Over Animations - Curtain Falling Effect */
@keyframes curtainFall {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
    }
}

@keyframes modalCurtainFall {
    0% {
        transform: translateY(-100vh) scale(1.1);
        opacity: 0;
    }
    25% {
        opacity: 0.3;
    }
    60% {
        transform: translateY(10px) scale(1.02);
        opacity: 0.9;
    }
    80% {
        transform: translateY(-5px) scale(1.01);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes iconBounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -15px, 0);
    }
    70% {
        transform: translate3d(0, -8px, 0);
    }
    90% {
        transform: translate3d(0, -3px, 0);
    }
}

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

@keyframes subtitleFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 0.8;
        transform: translateY(0);
    }
}

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

@keyframes scoreCountUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes starPop {
    0% {
        transform: scale(0.5);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

@keyframes clearRow {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(0); opacity: 0; }
}

@keyframes scorePopup {
    0% { transform: scale(0) translateY(0); opacity: 0; }
    50% { transform: scale(1.2) translateY(-20px); opacity: 1; }
    100% { transform: scale(1) translateY(-40px); opacity: 0; }
}

/* Animation classes */
.clearing {
    animation: clearRow 0.5s ease-in-out;
}

.score-popup {
    position: absolute;
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    animation: scorePopup 1s ease-out forwards;
    z-index: 150;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Difficulty button animations */
@keyframes difficultyPulse {
    0%, 100% {
        transform: scale(1.1);
        box-shadow: 0 0 25px rgba(255,107,107,0.4);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 35px rgba(255,107,107,0.6);
    }
}

.difficulty-btn.selected {
    animation: difficultyPulse 2.5s ease-in-out infinite;
}

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

.difficulty-btn {
    animation: difficultySlideIn 0.7s ease both;
}

.difficulty-btn:nth-child(1) { animation-delay: 0.1s; }
.difficulty-btn:nth-child(2) { animation-delay: 0.2s; }
.difficulty-btn:nth-child(3) { animation-delay: 0.3s; }

@keyframes difficultyBounce {
    0%, 20%, 53%, 80%, 100% {
        transform: scale(1.1);
    }
    40%, 43% {
        transform: scale(1.2);
    }
    70% {
        transform: scale(1.15);
    }
}

.difficulty-btn.selected:active {
    animation: difficultyBounce 0.6s ease;
}