/* ==========================================================================
   HEROBRINE FORTUNE - Animations & Visual Effects
   ========================================================================== */

/* --- 1. Loading & Ambient Animations --- */
.glow-pulse {
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    0% { filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.4)); opacity: 0.8; }
    100% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.9)); opacity: 1; }
}

.anim-float {
    animation: floating 4s ease-in-out infinite;
}

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* --- 2. Mining Action Animations --- */

/* Applied to the game arena/camera during a strike */
.anim-shake {
    animation: screenShake 0.3s cubic-bezier(.36,.07,.19,.97) both;
}

.anim-shake-heavy {
    animation: screenShakeHeavy 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

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

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

/* Applied to the target block when hit */
.anim-block-hit {
    animation: blockImpact 0.2s ease-out;
}

@keyframes blockImpact {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(0.92); filter: brightness(1.5); }
    100% { transform: scale(1); filter: brightness(1); }
}

/* --- 3. UI Feedback Animations --- */

/* Applied to balance when money is added */
.anim-balance-up {
    animation: balanceBump 0.4s ease-out;
    color: #22c55e !important; /* Green pop */
}

/* Applied to balance when money is deducted */
.anim-balance-down {
    animation: balanceBump 0.3s ease-out;
    color: #ef4444 !important; /* Red pop */
}

@keyframes balanceBump {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* --- 4. Rarity Glowing Effects (For Results) --- */

.glow-common {
    box-shadow: 0 0 15px rgba(148, 163, 184, 0.5), inset 0 0 10px rgba(148, 163, 184, 0.2) !important;
    border-color: #94a3b8 !important;
}

.glow-rare {
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.6), inset 0 0 15px rgba(56, 189, 248, 0.3) !important;
    border-color: #38bdf8 !important;
}

.glow-epic {
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.7), inset 0 0 20px rgba(168, 85, 247, 0.4) !important;
    border-color: #a855f7 !important;
    animation: epicPulse 1.5s infinite alternate;
}

@keyframes epicPulse {
    0% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.5); }
    100% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.8); }
}

.glow-legendary {
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.8), inset 0 0 25px rgba(255, 215, 0, 0.5) !important;
    border-color: #ffd700 !important;
    animation: legendaryPulse 1s infinite alternate;
}

@keyframes legendaryPulse {
    0% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.6); transform: scale(1); }
    100% { box-shadow: 0 0 60px rgba(255, 215, 0, 1); transform: scale(1.02); }
}

/* --- 5. Particle Engine CSS --- */

/* Base container for absolute positioning */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
    overflow: hidden;
}

/* Base style for a single generated particle */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 1;
    will-change: transform, opacity;
}

/* Specific animations triggered by JS adding classes */
.anim-particle-burst {
    animation: particleBurst linear forwards;
}

@keyframes particleBurst {
    0% { 
        transform: translate(0, 0) scale(1) rotate(0deg); 
        opacity: 1; 
    }
    100% { 
        /* The exact X/Y translation is usually injected via inline styles by JS for randomness */
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(180deg); 
        opacity: 0; 
    }
}

.anim-particle-rise {
    animation: particleRise linear forwards;
}

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

/* CSS for coin fall effect on big wins */
.coin {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
    border-radius: 50%;
    border: 1px solid #d4af37;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 30;
    pointer-events: none;
    animation: coinDrop linear forwards;
}

@keyframes coinDrop {
    0% { transform: translateY(-50px) rotate(0deg); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(calc(100vh + 50px)) rotate(720deg); opacity: 0; }
}
