/* Animations and Visual Effects */

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

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes glowPulse {
    from { box-shadow: 0 0 5px #ffd700; }
    to { box-shadow: 0 0 30px #ffd700; }
}

@keyframes walkCycle {
    /* Only using translateY and rotate to ensure standalone 'scale' mirroring property is not overridden */
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    25% { 
        transform: translateY(-8px) rotate(3deg); 
    }
    50% { 
        transform: translateY(0) rotate(0deg); 
    }
    75% { 
        transform: translateY(-8px) rotate(-3deg); 
    }
}

@keyframes portalPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 40px #7b2ff7; filter: hue-rotate(0deg); }
    50% { transform: scale(1.05); box-shadow: 0 0 70px #e0a7ff; filter: hue-rotate(20deg); }
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

@keyframes sideBounce {
    from { transform: translateX(0); }
    to { transform: translateX(20px); }
}

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

@keyframes flashAnim {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes drift {
    0% { transform: translateY(-10vh) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(110vh) translateX(20px); opacity: 0; }
}

#damage-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 0, 0.6);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
}

.flash-active {
    /* Set to 0.02s for near-instant 2ms request, though 0.02 is usually the browser floor for CSS animations */
    animation: flashAnim 0.02s linear forwards;
}

.screen-shake {
    animation: shake 0.3s cubic-bezier(.36,.07,.19,.97) both;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    top: -10px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 8px white;
    animation: drift linear infinite;
    pointer-events: none;
}

.menu-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.m-particle {
    position: absolute;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, var(--accent-color), transparent);
    filter: blur(2px);
    border-radius: 50%;
    animation: mFloat 4s infinite alternate ease-in-out;
}

@keyframes mFloat {
    0% { transform: translateY(0) scale(1); opacity: 0.3; }
    100% { transform: translateY(-30px) scale(1.5); opacity: 0.8; }
}

.wall-fragment {
    position: absolute;
    background: #7b2ff7;
    width: 15px;
    height: 15px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 60;
}

#day-night-cycle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 35;
    background: rgba(0,0,0,0);
    transition: background 5s ease;
}