/* =====================================
   ITCH SUMMER PARTICLES
   Floating Particles für Itch.io Highlights
   ===================================== */

/* Particle Container */
.itch-summer-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none !important;
    z-index: -1 !important;
    overflow: hidden;
}

/* Base Particle Styles */
.summer-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none !important;
    opacity: 0;
    animation: particleFloat linear infinite;
}

/* Bubble Styles */
.summer-bubble {
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(6, 182, 212, 0.3), transparent);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: bubbleFloat linear infinite;
    pointer-events: none !important;
}

/* Floater Styles */
.summer-floater {
    background: radial-gradient(circle, rgba(249, 115, 22, 0.6) 0%, rgba(251, 191, 36, 0.4) 50%, transparent 100%);
    animation: floaterDrift linear infinite;
    pointer-events: none !important;
}

/* Particle Sizes */
.summer-particle.tiny {
    width: 3px;
    height: 3px;
}

.summer-particle.small {
    width: 6px;
    height: 6px;
}

.summer-particle.medium {
    width: 10px;
    height: 10px;
}

.summer-particle.large {
    width: 14px;
    height: 14px;
}

/* Particle Types */
.summer-particle.coral {
    background: radial-gradient(circle, #f97316 0%, #ea580c 50%, transparent 100%);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.6);
}

.summer-particle.sand {
    background: radial-gradient(circle, #fbbf24 0%, #f59e0b 50%, transparent 100%);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.summer-particle.ocean {
    background: radial-gradient(circle, #0ea5e9 0%, #0284c7 50%, transparent 100%);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.7);
}

.summer-particle.mint {
    background: radial-gradient(circle, #10b981 0%, #059669 50%, transparent 100%);
    box-shadow: 0 0 9px rgba(16, 185, 129, 0.6);
}

.summer-particle.itch {
    background: radial-gradient(circle, #fa5c5c 0%, #dc2626 50%, transparent 100%);
    box-shadow: 0 0 15px rgba(250, 92, 92, 0.8);
}

/* Particle Animations */
@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20vh) translateX(var(--drift)) rotate(360deg);
        opacity: 0;
    }
}

/* Specific Particle Movements */
.summer-particle:nth-child(odd) {
    animation-duration: 15s;
    --drift: 30px;
}

.summer-particle:nth-child(even) {
    animation-duration: 20s;
    --drift: -25px;
}

.summer-particle:nth-child(3n) {
    animation-duration: 18s;
    --drift: 45px;
}

.summer-particle:nth-child(4n) {
    animation-duration: 22s;
    --drift: -40px;
}

.summer-particle:nth-child(5n) {
    animation-duration: 16s;
    --drift: 20px;
}

/* Floating Elements */
.summer-floater {
    position: absolute;
    pointer-events: none;
    opacity: 0.6;
    animation: floaterDrift 25s linear infinite;
}

.summer-floater.shell {
    width: 20px;
    height: 20px;
    background: 
        radial-gradient(ellipse at top, #fbbf24 0%, #f59e0b 50%, transparent 100%),
        radial-gradient(ellipse at bottom, #f97316 0%, #ea580c 50%, transparent 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform-origin: center;
}

.summer-floater.starfish {
    width: 16px;
    height: 16px;
    background: #f97316;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.6));
}

.summer-floater.bubble {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8) 0%, rgba(14, 165, 233, 0.3) 50%, transparent 100%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}

@keyframes floaterDrift {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.6;
    }
    95% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-10vh) translateX(var(--float-drift)) rotate(var(--float-rotation));
        opacity: 0;
    }
}

.summer-floater:nth-child(odd) {
    --float-drift: 50px;
    --float-rotation: 180deg;
    animation-duration: 30s;
}

.summer-floater:nth-child(even) {
    --float-drift: -40px;
    --float-rotation: -150deg;
    animation-duration: 35s;
}

.summer-floater:nth-child(3n) {
    --float-drift: 70px;
    --float-rotation: 270deg;
    animation-duration: 28s;
}

/* Beach Wave Particles */
.wave-particle {
    position: absolute;
    width: 30px;
    height: 6px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(14, 165, 233, 0.6) 20%, 
        rgba(6, 182, 212, 0.8) 50%, 
        rgba(14, 165, 233, 0.6) 80%, 
        transparent 100%);
    border-radius: 3px;
    animation: waveParticleFlow 20s linear infinite;
    opacity: 0;
}

@keyframes waveParticleFlow {
    0% {
        transform: translateX(-100px) translateY(100vh) scaleX(0.5);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
        transform: translateX(0) translateY(90vh) scaleX(1);
    }
    90% {
        opacity: 0.8;
        transform: translateX(var(--wave-drift)) translateY(-10vh) scaleX(1.2);
    }
    100% {
        transform: translateX(var(--wave-drift)) translateY(-20vh) scaleX(0.5);
        opacity: 0;
    }
}

.wave-particle:nth-child(odd) {
    --wave-drift: 80px;
    animation-delay: 0s;
}

.wave-particle:nth-child(even) {
    --wave-drift: -60px;
    animation-delay: -10s;
}

.wave-particle:nth-child(3n) {
    --wave-drift: 100px;
    animation-delay: -5s;
}

/* Interactive Particles */
.interactive-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #8b5cf6 0%, #7c3aed 50%, transparent 100%);
    border-radius: 50%;
    pointer-events: auto;
    cursor: pointer;
    animation: interactiveFloat 12s ease-in-out infinite;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.interactive-particle:hover {
    transform: scale(1.5) !important;
    opacity: 1 !important;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.8);
}

@keyframes interactiveFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-15px) scale(1.1);
        opacity: 0.9;
    }
}

/* Seasonal Particles for Itch Theme */
.itch-seasonal-particle {
    position: absolute;
    animation: seasonalDrift 25s linear infinite;
    opacity: 0;
}

.itch-seasonal-particle.game-icon {
    width: 16px;
    height: 16px;
    background: #fa5c5c;
    mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2L13.09 8.26L20 9L13.09 9.74L12 16L10.91 9.74L4 9L10.91 8.26L12 2Z"/></svg>') center/contain no-repeat;
    -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2L13.09 8.26L20 9L13.09 9.74L12 16L10.91 9.74L4 9L10.91 8.26L12 2Z"/></svg>') center/contain no-repeat;
    filter: drop-shadow(0 0 8px rgba(250, 92, 92, 0.6));
}

.itch-seasonal-particle.code-symbol {
    width: 14px;
    height: 14px;
    background: #10b981;
    mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 3L6 5L10 9L6 13L8 15L14 9L8 3Z"/></svg>') center/contain no-repeat;
    -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 3L6 5L10 9L6 13L8 15L14 9L8 3Z"/></svg>') center/contain no-repeat;
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.5));
}

@keyframes seasonalDrift {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-20vh) translateX(var(--seasonal-drift)) rotate(var(--seasonal-rotation));
        opacity: 0;
    }
}

.itch-seasonal-particle:nth-child(odd) {
    --seasonal-drift: 60px;
    --seasonal-rotation: 720deg;
    animation-duration: 30s;
}

.itch-seasonal-particle:nth-child(even) {
    --seasonal-drift: -50px;
    --seasonal-rotation: -540deg;
    animation-duration: 25s;
}

/* Performance Optimizations */
@media (max-width: 768px) {
    .summer-particle,
    .summer-floater,
    .wave-particle,
    .itch-seasonal-particle {
        animation-duration: calc(var(--base-duration, 20s) * 1.5);
    }
    
    .summer-particle.large,
    .summer-floater.shell,
    .wave-particle {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .summer-particle,
    .summer-floater,
    .wave-particle,
    .interactive-particle,
    .itch-seasonal-particle {
        animation: none;
        opacity: 0.3;
        position: static;
    }
}
