/* ============================================
   Игровые анимации на фоне - улучшенная версия
   ============================================ */

/* Контейнер для фоновых элементов */
body {
    position: relative;
    overflow-x: hidden;
}

/* Контейнер для анимированных элементов */
.gaming-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Пульсирующие круги с размытием (как в cshack.ru) */
.gaming-background::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.3), transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: pulseGlow 4s ease-in-out infinite;
    opacity: 0.6;
}

.gaming-background::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(123, 44, 191, 0.3), transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: pulseGlow 5s ease-in-out infinite;
    animation-delay: 1s;
    opacity: 0.5;
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Анимированные прицелы (crosshairs) */
.crosshair-bg {
    position: absolute;
    pointer-events: none;
    opacity: 0.4;
}

.crosshair-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid rgba(0, 212, 255, 0.6);
    border-radius: 50%;
    animation: ping 3s ease-in-out infinite;
}

.crosshair-bg::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(123, 44, 191, 0.5);
    border-radius: 50%;
}

.crosshair-bg .crosshair-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: rgba(0, 212, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}

.crosshair-bg.type-1 {
    width: 40px;
    height: 40px;
    top: 15%;
    left: 15%;
    animation: float 6s ease-in-out infinite;
}

.crosshair-bg.type-2 {
    width: 32px;
    height: 32px;
    top: 25%;
    right: 20%;
    animation: float 7s ease-in-out infinite reverse;
    animation-delay: 1s;
}

.crosshair-bg.type-3 {
    width: 48px;
    height: 48px;
    bottom: 25%;
    left: 20%;
    animation: float 8s ease-in-out infinite;
    animation-delay: 2s;
}

.crosshair-bg.type-4 {
    width: 36px;
    height: 36px;
    top: 50%;
    right: 15%;
    animation: float 6.5s ease-in-out infinite reverse;
    animation-delay: 0.5s;
}

.crosshair-bg.type-5 {
    width: 28px;
    height: 28px;
    bottom: 15%;
    right: 25%;
    animation: float 7.5s ease-in-out infinite;
    animation-delay: 1.5s;
}

@keyframes ping {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

/* Крестообразные прицелы */
.crosshair-x {
    position: absolute;
    pointer-events: none;
    opacity: 0.35;
}

.crosshair-x::before,
.crosshair-x::after {
    content: '';
    position: absolute;
    border: 2px solid rgba(0, 212, 255, 0.6);
    transform-origin: center;
}

.crosshair-x::before {
    inset: 0;
    transform: rotate(45deg);
}

.crosshair-x::after {
    inset: 0;
    transform: rotate(-45deg);
}

.crosshair-x .center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 3px;
    background: rgba(123, 44, 191, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(123, 44, 191, 0.6);
}

.crosshair-x.pos-1 {
    width: 32px;
    height: 32px;
    top: 20%;
    right: 25%;
    animation: float 5s ease-in-out infinite;
}

.crosshair-x.pos-2 {
    width: 40px;
    height: 40px;
    bottom: 30%;
    left: 30%;
    animation: float 6s ease-in-out infinite reverse;
    animation-delay: 1s;
}

.crosshair-x.pos-3 {
    width: 28px;
    height: 28px;
    top: 60%;
    right: 30%;
    animation: float 5.5s ease-in-out infinite;
    animation-delay: 0.5s;
}

/* Анимированные частицы/пули */
.particle-bg {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(0, 212, 255, 0.7);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.6), 0 0 16px rgba(0, 212, 255, 0.4);
    opacity: 0.6;
}

/* Генерация множества частиц через JavaScript будет добавлена */
.particle-bg:nth-child(n+7) {
    animation: particleFloat 6s ease-in-out infinite;
}

.particle-bg.particle-blue {
    background: rgba(0, 212, 255, 0.7);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.6), 0 0 16px rgba(0, 212, 255, 0.4);
}

.particle-bg.particle-purple {
    background: rgba(123, 44, 191, 0.6);
    box-shadow: 0 0 8px rgba(123, 44, 191, 0.5), 0 0 16px rgba(123, 44, 191, 0.3);
}

.particle-bg.particle-green {
    background: rgba(0, 255, 136, 0.6);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5), 0 0 16px rgba(0, 255, 136, 0.3);
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.4;
    }
    25% {
        transform: translateY(-30px) translateX(15px);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-50px) translateX(-10px);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-20px) translateX(20px);
        opacity: 0.8;
    }
}

/* Анимированные линии сетки */
.grid-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 255, 0.4) 25%, 
        rgba(123, 44, 191, 0.4) 50%, 
        rgba(0, 212, 255, 0.4) 75%, 
        transparent 100%);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    opacity: 0.3;
    animation: slideX 8s linear infinite;
}

.grid-line.line-1 {
    top: 10%;
    animation-duration: 8s;
}

.grid-line.line-2 {
    top: 25%;
    animation-duration: 10s;
    animation-delay: 2s;
}

.grid-line.line-3 {
    top: 50%;
    animation-duration: 12s;
    animation-delay: 4s;
}

.grid-line.line-4 {
    top: 75%;
    animation-duration: 9s;
    animation-delay: 1s;
}

.grid-line.line-5 {
    top: 16%;
    animation-duration: 11s;
    animation-delay: 0.5s;
}

.grid-line.line-6 {
    top: 85%;
    animation-duration: 7s;
    animation-delay: 1.5s;
}

@keyframes slideX {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Символы Mason на фоне - более заметные */
.mason-symbol-bg {
    position: absolute;
    width: 50px;
    height: 50px;
    opacity: 0.15;
    pointer-events: none;
}

.mason-symbol-bg svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: rgba(0, 212, 255, 0.4);
    stroke-width: 2;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5));
}

.mason-symbol-bg:nth-child(1) {
    top: 200px;
    left: 8%;
    animation: symbolFloat 18s ease-in-out infinite;
}

.mason-symbol-bg:nth-child(2) {
    top: 800px;
    right: 10%;
    animation: symbolFloat 22s ease-in-out infinite reverse;
}

.mason-symbol-bg:nth-child(3) {
    top: 1400px;
    left: 15%;
    animation: symbolFloat 20s ease-in-out infinite;
    animation-delay: -5s;
}

.mason-symbol-bg:nth-child(4) {
    top: 2000px;
    right: 18%;
    animation: symbolFloat 24s ease-in-out infinite reverse;
    animation-delay: -8s;
}

@keyframes symbolFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.12;
    }
    25% {
        transform: translate(25px, -35px) rotate(90deg) scale(1.1);
        opacity: 0.2;
    }
    50% {
        transform: translate(-15px, -50px) rotate(180deg) scale(0.9);
        opacity: 0.15;
    }
    75% {
        transform: translate(35px, -25px) rotate(270deg) scale(1.05);
        opacity: 0.18;
    }
}

/* Геометрические фигуры - более заметные */
.geometric-shape {
    position: absolute;
    pointer-events: none;
    opacity: 0.2;
}

.geometric-shape.square {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(0, 212, 255, 0.5);
    border-radius: 4px;
    transform: rotate(45deg);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.geometric-shape.triangle {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 50px solid rgba(123, 44, 191, 0.4);
    filter: drop-shadow(0 0 10px rgba(123, 44, 191, 0.5));
}

.geometric-shape.diamond {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(0, 255, 136, 0.5);
    transform: rotate(45deg);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}

.geometric-shape:nth-of-type(1) {
    top: 300px;
    left: 3%;
    animation: floatGeometric 18s ease-in-out infinite;
}

.geometric-shape:nth-of-type(2) {
    top: 700px;
    right: 5%;
    animation: floatGeometric 20s ease-in-out infinite reverse;
}

.geometric-shape:nth-of-type(3) {
    top: 1100px;
    left: 7%;
    animation: floatGeometric 22s ease-in-out infinite;
    animation-delay: -4s;
}

.geometric-shape:nth-of-type(4) {
    top: 1900px;
    right: 6%;
    animation: floatGeometric 19s ease-in-out infinite reverse;
    animation-delay: -7s;
}

@keyframes floatGeometric {
    0%, 100% {
        transform: translate(0, 0) rotate(45deg) scale(1);
        opacity: 0.15;
    }
    25% {
        transform: translate(30px, -40px) rotate(90deg) scale(1.1);
        opacity: 0.25;
    }
    50% {
        transform: translate(-20px, -60px) rotate(135deg) scale(0.9);
        opacity: 0.18;
    }
    75% {
        transform: translate(40px, -30px) rotate(180deg) scale(1.05);
        opacity: 0.22;
    }
}

/* Общая анимация плавания */
@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-20px) translateX(10px);
    }
}

/* Адаптивность - скрываем на мобильных */
@media (max-width: 768px) {
    .gaming-background::before,
    .gaming-background::after,
    .mason-symbol-bg,
    .hexagon-bg,
    .particle-bg,
    .crosshair-bg,
    .crosshair-x,
    .geometric-shape,
    .grid-line {
        display: none;
    }
}
