/* ===== ПРОДВИНУТЫЕ ЭФФЕКТЫ И АНИМАЦИИ ===== */

/* Плавающие частицы в фоне */
@keyframes float-particles {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-blue);
    border-radius: 50%;
    animation: float-particles 6s infinite ease-in-out;
    box-shadow: 0 0 10px var(--neon-blue);
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 6s;
}

.particle:nth-child(2) {
    left: 20%;
    animation-delay: 1s;
    animation-duration: 8s;
}

.particle:nth-child(3) {
    left: 30%;
    animation-delay: 2s;
    animation-duration: 7s;
}

.particle:nth-child(4) {
    left: 40%;
    animation-delay: 3s;
    animation-duration: 9s;
}

.particle:nth-child(5) {
    left: 50%;
    animation-delay: 4s;
    animation-duration: 6s;
}

.particle:nth-child(6) {
    left: 60%;
    animation-delay: 5s;
    animation-duration: 8s;
}

.particle:nth-child(7) {
    left: 70%;
    animation-delay: 1.5s;
    animation-duration: 7s;
}

.particle:nth-child(8) {
    left: 80%;
    animation-delay: 2.5s;
    animation-duration: 9s;
}

.particle:nth-child(9) {
    left: 90%;
    animation-delay: 3.5s;
    animation-duration: 6s;
}

/* Неоновые рамки для карточек */
@keyframes neon-border {
    0%,
    100% {
        box-shadow: 0 0 5px var(--neon-blue), 0 0 10px var(--neon-blue),
            0 0 15px var(--neon-blue), inset 0 0 5px var(--neon-blue);
    }
    50% {
        box-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue),
            0 0 30px var(--neon-blue), inset 0 0 10px var(--neon-blue);
    }
}

.game__wrapper.neon-border {
    animation: neon-border 2s ease-in-out infinite;
}

/* Пульсирующие кнопки */
@keyframes pulse-button {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    }
}

.button.pulse {
    animation: pulse-button 2s ease-in-out infinite;
}

/* Волновой эффект для hover */
@keyframes wave {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.wave-effect {
    position: relative;
    overflow: hidden;
}

.wave-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.wave-effect:hover::after {
    width: 300px;
    height: 300px;
    animation: wave 0.6s ease-out;
}

/* Глитч эффект для заголовков */
@keyframes glitch {
    0%,
    100% {
        text-shadow: 0.05em 0 0 #ff3366, -0.05em -0.025em 0 #00d4ff,
            0.025em 0.05em 0 #b347ff;
    }
    15% {
        text-shadow: 0.05em 0 0 #ff3366, -0.05em -0.025em 0 #00d4ff,
            0.025em 0.05em 0 #b347ff;
    }
    16% {
        text-shadow: -0.05em -0.025em 0 #ff3366, 0.025em 0.025em 0 #00d4ff,
            -0.05em -0.05em 0 #b347ff;
    }
    49% {
        text-shadow: -0.05em -0.025em 0 #ff3366, 0.025em 0.025em 0 #00d4ff,
            -0.05em -0.05em 0 #b347ff;
    }
    50% {
        text-shadow: 0.025em 0.05em 0 #ff3366, 0.05em 0 0 #00d4ff,
            0 -0.05em 0 #b347ff;
    }
    99% {
        text-shadow: 0.025em 0.05em 0 #ff3366, 0.05em 0 0 #00d4ff,
            0 -0.05em 0 #b347ff;
    }
}

.glitch-text {
    animation: glitch 2s infinite;
}

/* Морфинг градиентов */
@keyframes morph-gradient {
    0%,
    100% {
        background: linear-gradient(
            135deg,
            #ff6b6b 0%,
            #feca57 50%,
            #48dbfb 100%
        );
    }
    25% {
        background: linear-gradient(
            135deg,
            #feca57 0%,
            #48dbfb 50%,
            #ff6b6b 100%
        );
    }
    50% {
        background: linear-gradient(
            135deg,
            #48dbfb 0%,
            #ff6b6b 50%,
            #feca57 100%
        );
    }
    75% {
        background: linear-gradient(
            135deg,
            #ff6b6b 0%,
            #48dbfb 50%,
            #feca57 100%
        );
    }
}

.morph-gradient {
    animation: morph-gradient 4s ease-in-out infinite;
}

/* 3D эффект для карточек */
@keyframes card-3d {
    0%,
    100% {
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
    }
    50% {
        transform: perspective(1000px) rotateX(0deg) rotateY(10deg);
    }
    75% {
        transform: perspective(1000px) rotateX(-5deg) rotateY(5deg);
    }
}

.game__wrapper.3d-effect {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.game__wrapper.3d-effect:hover {
    animation: card-3d 2s ease-in-out infinite;
}

/* Светящиеся иконки */
@keyframes icon-glow {
    0%,
    100% {
        filter: drop-shadow(0 0 5px var(--neon-blue));
    }
    50% {
        filter: drop-shadow(0 0 20px var(--neon-blue))
            drop-shadow(0 0 30px var(--neon-blue));
    }
}

.icon-glow {
    animation: icon-glow 2s ease-in-out infinite;
}

/* Плавающий текст */
@keyframes float-text {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-text {
    animation: float-text 3s ease-in-out infinite;
}

/* Матричный эффект для фона */
@keyframes matrix-rain {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    overflow: hidden;
}

.matrix-char {
    position: absolute;
    color: var(--neon-green);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    animation: matrix-rain 10s linear infinite;
    text-shadow: 0 0 5px var(--neon-green);
}

/* Голографический эффект */
@keyframes hologram {
    0%,
    100% {
        opacity: 1;
        filter: hue-rotate(0deg) saturate(1);
    }
    25% {
        opacity: 0.8;
        filter: hue-rotate(90deg) saturate(1.2);
    }
    50% {
        opacity: 0.6;
        filter: hue-rotate(180deg) saturate(1.5);
    }
    75% {
        opacity: 0.8;
        filter: hue-rotate(270deg) saturate(1.2);
    }
}

.hologram-effect {
    animation: hologram 3s ease-in-out infinite;
}

/* Эффект размытия при скролле */
.blur-on-scroll {
    /* transition: filter 0.3s ease; */
}

.blur-on-scroll.blurred {
    /* filter: blur(2px); */
}

/* Неоновые линии */
@keyframes neon-line {
    0%,
    100% {
        opacity: 0.3;
        transform: scaleX(0);
    }
    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}

.neon-line {
    position: relative;
    overflow: hidden;
}

.neon-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
    animation: neon-line 2s ease-in-out infinite;
}

/* Эффект частиц при клике */
@keyframes click-particles {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.click-particles {
    position: relative;
    overflow: hidden;
}

.click-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-blue);
    border-radius: 50%;
    pointer-events: none;
    animation: click-particles 0.6s ease-out forwards;
}

/* Адаптивные эффекты */
@media (max-width: 768px) {
    .floating-particles {
        display: none;
    }

    .matrix-bg {
        display: none;
    }

    .game__wrapper.3d-effect:hover {
        animation: none;
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    }
}

/* Отключение анимаций для пользователей с предпочтением reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
