/* ============================================================================
   MINECRAFT CUSTOM ANIMATIONS
   ============================================================================ */

/* 1. BLOCK BREAKING LOADING SPINNER */
@keyframes blockBreaking {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    25% {
        transform: scale(0.9) rotate(90deg);
        opacity: 0.8;
    }

    50% {
        transform: scale(0.8) rotate(180deg);
        opacity: 0.6;
    }

    75% {
        transform: scale(0.9) rotate(270deg);
        opacity: 0.8;
    }

    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.loading-spinner {
    width: 48px;
    height: 48px;
    background: #8B8B8B;
    box-shadow:
        inset -2px -2px 0 0 #4A4A4A,
        inset 2px 2px 0 0 #CECECE;
    animation: blockBreaking 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    image-rendering: pixelated;
}

/* 2. ENCHANTMENT GLOW PULSE */
@keyframes enchantmentGlow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(170, 0, 170, 0.3),
            0 0 20px rgba(170, 0, 170, 0.2),
            inset 0 0 10px rgba(170, 0, 170, 0.1);
    }

    50% {
        box-shadow: 0 0 20px rgba(170, 0, 170, 0.6),
            0 0 40px rgba(170, 0, 170, 0.4),
            inset 0 0 20px rgba(170, 0, 170, 0.2);
    }
}

.enchanted {
    animation: enchantmentGlow 2s ease-in-out infinite;
}

/* 3. ITEM PICKUP BOUNCE */
@keyframes itemPickup {
    0% {
        transform: translateY(0) scale(1);
    }

    30% {
        transform: translateY(-12px) scale(1.1);
    }

    50% {
        transform: translateY(-8px) scale(1.05);
    }

    70% {
        transform: translateY(-4px) scale(1.02);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

.item-bounce {
    animation: itemPickup 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 4. BLOCK WOBBLE HOVER */
@keyframes blockWobble {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-2deg);
    }

    75% {
        transform: rotate(2deg);
    }
}

.wobble-hover:hover {
    animation: blockWobble 0.3s ease-in-out 2;
}

/* 5. XP BAR FILL ANIMATION */
@keyframes xpFill {
    0% {
        width: 0%;
        background: linear-gradient(90deg, #7ED321 0%, #7ED321 100%);
    }

    50% {
        background: linear-gradient(90deg, #7ED321 0%, #B8E986 50%, #7ED321 100%);
    }

    100% {
        width: 100%;
        background: linear-gradient(90deg, #7ED321 0%, #7ED321 100%);
    }
}

.xp-bar {
    height: 8px;
    background: #2A2A2A;
    box-shadow:
        inset 1px 1px 0 0 #000000,
        inset -1px -1px 0 0 #4A4A4A;
    overflow: hidden;
    position: relative;
}

.xp-bar-fill {
    height: 100%;
    animation: xpFill 2s ease-out forwards;
    box-shadow:
        inset 0 -2px 0 0 rgba(0, 0, 0, 0.3),
        inset 0 2px 0 0 rgba(255, 255, 255, 0.3);
}

/* 6. PIXEL DISSOLVE PAGE TRANSITION */
@keyframes pixelDissolve {
    0% {
        opacity: 0;
        transform: scale(0.95);
        filter: blur(2px);
    }

    50% {
        filter: blur(1px);
    }

    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

.page-transition {
    animation: pixelDissolve 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 7. ENCHANTMENT PARTICLES */
@keyframes enchantParticle {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-60px) translateX(var(--particle-x, 0)) scale(0.3);
        opacity: 0;
    }
}

.enchant-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #AA00AA;
    box-shadow: 0 0 4px #AA00AA;
    animation: enchantParticle 1.5s ease-out forwards;
    pointer-events: none;
}

/* 8. BLOCK BREAK STAGES (for interactive effects) */
@keyframes crackAnimation {
    0% {
        background-image: none;
    }

    20% {
        opacity: 0.2;
    }

    40% {
        opacity: 0.4;
    }

    60% {
        opacity: 0.6;
    }

    80% {
        opacity: 0.8;
    }

    100% {
        opacity: 1;
    }
}

.breaking {
    animation: crackAnimation 0.5s steps(5) forwards;
}

/* 9. FLOATING ITEM ANIMATION (for ability icons) */
@keyframes floatingItem {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    25% {
        transform: translateY(-6px) rotate(-3deg);
    }

    50% {
        transform: translateY(-10px) rotate(0deg);
    }

    75% {
        transform: translateY(-6px) rotate(3deg);
    }
}

.floating-item {
    animation: floatingItem 3s ease-in-out infinite;
}

/* 10. DAMAGE SHAKE */
@keyframes damageShake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

.damage-shake {
    animation: damageShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* 11. BUTTON PRESS ANIMATION */
@keyframes buttonPress {
    0% {
        transform: translateY(0);
        box-shadow:
            inset -2px -2px 0 0 #373737,
            inset 2px 2px 0 0 #FFFFFF;
    }

    50% {
        transform: translateY(2px);
        box-shadow:
            inset 2px 2px 0 0 #373737,
            inset -2px -2px 0 0 #FFFFFF;
    }

    100% {
        transform: translateY(0);
        box-shadow:
            inset -2px -2px 0 0 #373737,
            inset 2px 2px 0 0 #FFFFFF;
    }
}

.btn-press {
    animation: buttonPress 0.2s ease-out;
}

/* 12. PIXELATED FADE IN */
@keyframes pixelFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.pixel-fade-in {
    animation: pixelFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* UTILITY CLASSES FOR ANIMATION DELAYS */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* ANIMATION SPEED MODIFIERS */
.anim-slow {
    animation-duration: 3s !important;
}

.anim-fast {
    animation-duration: 0.5s !important;
}

.anim-ultra-fast {
    animation-duration: 0.2s !important;
}