/* Source: battle-effects-visual.css — split from consolidated CSS */

/* Bro Rogue - Battle: Visual Effects (Shake, Flash, Particles)
   Split from battle-effects.css
   Sections: Screen Shake + Hit Flash + Elemental Particles */

/* ================================
   VICTORY / DEFEAT ANIMATIONS
   ================================ */

/* Victory Banner — big golden text that scales in */
.victory-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9998;
    pointer-events: none;
    text-align: center;
    display: flex;
    background: rgb(0 0 0 / 80%);
    padding: 2rem 3rem;
    border-radius: 12px;
    border: 2px solid rgb(255 215 0 / 30%);
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: victoryBannerIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.victory-banner .victory-text {
    font-size: 5rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow:
        0 0 20px rgb(255 215 0 / 60%),
        0 0 60px rgb(255 215 0 / 30%),
        0 4px 8px rgb(0 0 0 / 80%);
    letter-spacing: 8px;
    line-height: 1;
    animation: victoryTextGlow 1.5s ease-in-out infinite alternate;
}

.victory-banner .victory-sub {
    font-size: 1.4rem;
    color: rgb(255 255 255 / 80%);
    text-shadow: 0 2px 6px rgb(0 0 0 / 80%);
    letter-spacing: 3px;
    font-weight: 300;
}

@keyframes victoryBannerIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
        filter: blur(4px);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
        filter: blur(0);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(0);
    }
}

@keyframes victoryTextGlow {
    0% {
        text-shadow:
            0 0 20px rgb(255 215 0 / 60%),
            0 0 60px rgb(255 215 0 / 30%),
            0 4px 8px rgb(0 0 0 / 80%);
    }

    100% {
        text-shadow:
            0 0 30px rgb(255 215 0 / 80%),
            0 0 80px rgb(255 215 0 / 50%),
            0 0 120px rgb(255 215 0 / 20%),
            0 4px 8px rgb(0 0 0 / 80%);
    }
}

/* Enemy defeat animation — fade out + scale down + flash */
.enemyCharacter.defeated {
    animation: enemyDefeat 0.6s ease-out forwards;
}

@keyframes enemyDefeat {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }

    20% {
        opacity: 1;
        transform: scale(1.05);
        filter: brightness(1.8) saturate(0.5);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.7);
        filter: brightness(0.3) saturate(0);
    }

    100% {
        opacity: 0;
        transform: scale(0.3) translateY(10px);
        filter: brightness(0) saturate(0);
    }
}

/* Battle level-up notification — shown on the battle screen before transition */
.battle-level-up {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9998;
    pointer-events: none;
    text-align: center;
    display: flex;
    background: rgb(0 0 0 / 85%);
    padding: 2rem 3rem;
    border-radius: 12px;
    border: 2px solid rgb(255 215 0 / 30%);
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: levelUpBannerIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.battle-level-up .level-up-text {
    font-size: 3.5rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow:
        0 0 20px rgb(255 215 0 / 60%),
        0 0 60px rgb(255 215 0 / 30%),
        0 4px 8px rgb(0 0 0 / 80%);
    letter-spacing: 4px;
    line-height: 1;
}

.battle-level-up .level-up-sub {
    font-size: 1.3rem;
    color: var(--secondary-color);
    text-shadow: 0 2px 6px rgb(0 0 0 / 80%);
    font-weight: bold;
    letter-spacing: 2px;
}

.battle-level-up .stat-points-text {
    font-size: 1.1rem;
    color: #ffeb3b;
    text-shadow: 0 2px 4px rgb(0 0 0 / 80%);
    font-weight: bold;
}

@keyframes levelUpBannerIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotateZ(-5deg);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.08) rotateZ(1deg);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotateZ(0deg);
    }
}

/* ================================
   SCREEN SHAKE ANIMATIONS
   ================================ */

@keyframes screenShakeLight {
    0%,
    100% {
        transform: translate(0);
    }

    10% {
        transform: translate(-3px, 2px);
    }

    20% {
        transform: translate(3px, -1px);
    }

    30% {
        transform: translate(-2px, 3px);
    }

    40% {
        transform: translate(2px, -2px);
    }

    50% {
        transform: translate(-1px, 1px);
    }

    60% {
        transform: translate(1px, -1px);
    }

    70% {
        transform: translate(-2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }

    90% {
        transform: translate(-1px, 1px);
    }
}

@keyframes screenShakeMedium {
    0%,
    100% {
        transform: translate(0);
    }

    5% {
        transform: translate(-6px, 4px);
    }

    10% {
        transform: translate(6px, -3px);
    }

    15% {
        transform: translate(-5px, 5px);
    }

    20% {
        transform: translate(5px, -4px);
    }

    25% {
        transform: translate(-4px, 3px);
    }

    30% {
        transform: translate(4px, -5px);
    }

    40% {
        transform: translate(-3px, 2px);
    }

    50% {
        transform: translate(3px, -2px);
    }

    65% {
        transform: translate(-2px, 1px);
    }

    80% {
        transform: translate(2px, -1px);
    }
}

@keyframes screenShakeHeavy {
    0%,
    100% {
        transform: translate(0) rotate(0deg);
    }

    4% {
        transform: translate(-10px, 6px) rotate(-1deg);
    }

    8% {
        transform: translate(10px, -5px) rotate(1deg);
    }

    12% {
        transform: translate(-8px, 8px) rotate(-1.5deg);
    }

    16% {
        transform: translate(8px, -7px) rotate(1deg);
    }

    20% {
        transform: translate(-6px, 5px) rotate(-0.5deg);
    }

    25% {
        transform: translate(6px, -6px) rotate(0.5deg);
    }

    35% {
        transform: translate(-4px, 3px);
    }

    50% {
        transform: translate(4px, -3px);
    }

    70% {
        transform: translate(-2px, 1px);
    }
}

.battleContainer.shake-light {
    animation: screenShakeLight 0.35s ease-out;
}

.battleContainer.shake-medium {
    animation: screenShakeMedium 0.5s ease-out;
}

.battleContainer.shake-heavy {
    animation: screenShakeHeavy 0.7s ease-out;
}

/* ================================
   BATTLE MESSAGE (floating center message)
   ================================ */

.battle-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgb(0 0 0 / 80%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 18px;
    z-index: 5000;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}
