/* css/effects.css - Particle Effects and Animations */

/* Cursor Avatar Styles */
.cursor-avatar {
    position: fixed;
    width: 30px;
    height: 30px;
    pointer-events: none;
    z-index: 10000;
    transition: transform 0.1s ease-out;
}

.avatar-body {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, #00ffff, #0088ff);
    border-radius: 50% 50% 40% 40%;
    border: 2px solid #00ff00;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.8),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: avatar-hover 2s ease-in-out infinite;
}

.avatar-visor {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 30%;
    background: linear-gradient(135deg, #ff0080, #ffff00);
    border-radius: 50%;
    box-shadow:
        0 0 15px currentColor,
        inset 0 0 5px rgba(255, 255, 255, 0.8);
    animation: visor-glow 1.5s ease-in-out infinite;
}

.avatar-arms {
    position: absolute;
    top: 40%;
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.avatar-arm {
    width: 8px;
    height: 12px;
    background: #0088ff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 136, 255, 0.8);
}

.avatar-jet {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 15px;
    background: radial-gradient(ellipse at center, #ff8800, transparent);
    border-radius: 50%;
    opacity: 0.8;
    animation: jet-pulse 0.5s ease-in-out infinite;
}

/* Cursor Trail */
.cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #ffffff, transparent);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.6;
    animation: trail-fade 0.8s ease-out forwards;
    z-index: 9999;
}

/* Cursor Particles */
.cursor-particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: #00ffff;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 6px currentColor;
    animation: particle-burst 1s ease-out forwards;
    z-index: 9999;
}

.cursor-particle.grab {
    background: #00ff00;
}

.cursor-particle.shoot {
    background: #ff0080;
}

.cursor-particle.hit {
    background: #ffff00;
}

/* Avatar Animations */
@keyframes avatar-hover {

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

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

    75% {
        transform: translateY(-2px) rotate(5deg);
    }
}

@keyframes visor-glow {

    0%,
    100% {
        opacity: 0.9;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
}

@keyframes jet-pulse {

    0%,
    100% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.2);
    }
}

@keyframes trail-fade {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

@keyframes particle-burst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.5);
    }
}

/* Explosion Effects */
.explosion {
    position: absolute;
    width: 100px;
    height: 100px;
    pointer-events: none;
    animation: explosion-expand 0.5s ease-out forwards;
    z-index: 500;
}

.explosion-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid #ff8800;
    border-radius: 50%;
    box-shadow:
        0 0 20px #ff8800,
        inset 0 0 20px #ff8800;
    animation: ring-expand 0.5s ease-out forwards;
}

.explosion-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffff00;
    border-radius: 50%;
    box-shadow: 0 0 10px #ff8800;
    animation: explosion-particle 0.8s ease-out forwards;
}

@keyframes explosion-expand {
    0% {
        transform: scale(0.2);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes ring-expand {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes explosion-particle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.2);
        opacity: 0;
    }
}

/* Flame Effects */
.flame {
    position: absolute;
    width: 20px;
    height: 30px;
    pointer-events: none;
    filter: blur(1px);
    animation: flame-flicker 0.3s ease-in-out infinite;
}

.flame-inner {
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at bottom, #fff 0%, #ff8800 30%, #ff0000 70%, transparent 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flame-wave 0.5s ease-in-out infinite;
}

@keyframes flame-flicker {

    0%,
    100% {
        opacity: 0.9;
        transform: scaleY(1);
    }

    50% {
        opacity: 1;
        transform: scaleY(1.1);
    }
}

@keyframes flame-wave {

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

    25% {
        transform: rotate(0deg);
    }

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

/* Safe Zone Effect */
.safe-zone {
    position: absolute;
    border: 3px solid #00ff00;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 0, 0.1), transparent);
    pointer-events: none;
    animation: safe-zone-pulse 2s ease-in-out infinite;
    z-index: 50;
}

.safe-zone-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #00ff00;
    border-radius: 50%;
    opacity: 0.5;
    animation: safe-zone-expand 2s ease-out infinite;
}

@keyframes safe-zone-pulse {

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

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes safe-zone-expand {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Power Shot Effect */
.power-shot-trail {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff0080, transparent);
    box-shadow: 0 0 10px #ff0080;
    pointer-events: none;
    animation: trail-fade-horizontal 0.5s ease-out forwards;
}

@keyframes trail-fade-horizontal {
    0% {
        opacity: 1;
        transform: scaleX(1);
    }

    100% {
        opacity: 0;
        transform: scaleX(0.5);
    }
}

/* Hit Marker */
.hit-marker {
    position: absolute;
    width: 40px;
    height: 40px;
    pointer-events: none;
    animation: hit-marker-pop 0.3s ease-out forwards;
    z-index: 600;
}

.hit-marker::before,
.hit-marker::after {
    content: '';
    position: absolute;
    background: #ffff00;
    box-shadow: 0 0 10px #ffff00;
}

.hit-marker::before {
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
}

.hit-marker::after {
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-50%);
}

@keyframes hit-marker-pop {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: scale(1.2) rotate(45deg);
        opacity: 1;
    }

    100% {
        transform: scale(1.5) rotate(45deg);
        opacity: 0;
    }
}

/* Score Popup */
.score-popup {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    animation: score-rise 1.5s ease-out forwards;
    z-index: 700;
}

.score-popup.bonus {
    color: #00ff00;
    font-size: 32px;
}

.score-popup.penalty {
    color: #ff0000;
}

@keyframes score-rise {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }

    20% {
        transform: translateY(-10px) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translateY(-60px) scale(1);
        opacity: 0;
    }
}

/* Damage Flash */
.damage-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(255, 0, 0, 0.4) 100%);
    pointer-events: none;
    opacity: 0;
    animation: damage-flash-anim 0.3s ease-out;
    z-index: 8000;
}

@keyframes damage-flash-anim {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Bonus Collected Effect */
.bonus-collected {
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none;
    animation: bonus-collect 0.8s ease-out forwards;
    z-index: 800;
}

.bonus-icon {
    width: 100%;
    height: 100%;
    font-size: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 0 20px currentColor);
}

@keyframes bonus-collect {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 1;
    }

    100% {
        transform: scale(2) rotate(360deg) translateY(-50px);
        opacity: 0;
    }
}

/* Performance Settings */
.low-quality .explosion-particle,
.low-quality .cursor-particle,
.low-quality .flame {
    display: none;
}

.low-quality * {
    animation-duration: 0s !important;
    box-shadow: none !important;
    filter: none !important;
}

/* Mobile Optimizations */
@media (max-width: 768px) {

    .cursor-avatar,
    .cursor-trail {
        display: none;
    }

    .explosion {
        width: 60px;
        height: 60px;
    }

    .score-popup {
        font-size: 18px;
    }

    /* Reduce particle counts on mobile */
    .explosion-particle:nth-child(n+5),
    .cursor-particle:nth-child(n+3) {
        display: none;
    }
}