/* TRANSIÇÕES SUAVES */

/* Transições de Telas */
.menu-screen {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.menu-screen.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.menu-screen.fade-in {
    animation: screenFadeIn 0.5s ease forwards;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Transição do Game Over */
#gameOver {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#gameOver.active {
    animation: gameOverAppear 0.6s ease forwards;
}

@keyframes gameOverAppear {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    60% {
        transform: translateY(10px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animação de Rank Up */
.rank-up-notification {
    animation: rankUpSlide 1s ease forwards;
}

@keyframes rankUpSlide {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    20% {
        opacity: 1;
        transform: translateX(-10px);
    }
    30% {
        transform: translateX(5px);
    }
    100% {
        transform: translateX(0);
    }
}

/* Animação de Targets Aparecendo */
.target-spawn {
    animation: targetSpawn 0.3s ease-out forwards;
}

@keyframes targetSpawn {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    60% {
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animação de Botões */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    animation: buttonHover 0.3s ease forwards;
}

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

/* Animação de HUD */
.hud-item {
    transition: all 0.3s ease;
}

.hud-value {
    transition: all 0.2s ease;
}

.hud-value.pulse {
    animation: valuePulse 0.3s ease;
}

@keyframes valuePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: #FFD700;
    }
}

/* Animação de Combo */
#combo {
    transition: all 0.2s ease;
}

#combo.combo-increase {
    animation: comboIncrease 0.4s ease;
}

@keyframes comboIncrease {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* Animação de Score Popup */
.score-popup {
    animation: scorePopup 1s ease-out forwards;
}

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

/* Animação de Critical Hit */
.critical-hit {
    animation: criticalHit 0.5s ease-out;
}

@keyframes criticalHit {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.5);
        filter: brightness(2) saturate(2);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Animação de HP Loss */
.hp-damage {
    animation: hpDamage 0.3s ease;
}

@keyframes hpDamage {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Screen Shake */
.screen-shake {
    animation: screenShake 0.5s ease;
}

@keyframes screenShake {
    0%, 100% {
        transform: translate(0, 0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translate(-5px, 0);
    }
    20%, 40%, 60%, 80% {
        transform: translate(5px, 0);
    }
}

/* Animação de Settings Tabs */
.settings-tab {
    animation: tabFadeIn 0.3s ease;
}

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

/* Animação de Leaderboard Entries */
.leaderboard-entry {
    animation: entrySlideIn 0.4s ease forwards;
    opacity: 0;
}

.leaderboard-entry:nth-child(1) { animation-delay: 0.05s; }
.leaderboard-entry:nth-child(2) { animation-delay: 0.1s; }
.leaderboard-entry:nth-child(3) { animation-delay: 0.15s; }
.leaderboard-entry:nth-child(4) { animation-delay: 0.2s; }
.leaderboard-entry:nth-child(5) { animation-delay: 0.25s; }
.leaderboard-entry:nth-child(n+6) { animation-delay: 0.3s; }

@keyframes entrySlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animação de Countdown */
.countdown-number {
    animation: countdownPulse 1s ease;
}

@keyframes countdownPulse {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* Animação de Victory */
#victoryScreen.active {
    animation: victoryAppear 0.8s ease forwards;
}

@keyframes victoryAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg);
    }
    60% {
        transform: scale(1.1) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Smooth Transitions para todos os elementos interativos */
a, button, input, select, textarea {
    transition: all 0.2s ease;
}

/* Hover Effects Suaves */
.map-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading Animation */
.loading {
    animation: loading 1.5s ease-in-out infinite;
}

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

/* Glow Effect */
.glow {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 70, 85, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 70, 85, 0.8);
    }
}

/* Reduce Motion para acessibilidade */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
