/* Фон из главной страницы RusCOD: сетка, свечение, звёзды и световые полосы. */
html.ac-background-page{--bg:#0a0a0a;background:var(--bg)}
html.ac-background-page[data-theme=light]{--bg:#e8eef5}
.ac-background-page body{background:transparent;isolation:isolate;min-height:100vh}
.ac-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background: var(--bg);
}

.ac-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(63, 169, 245, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(63, 169, 245, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: acBgGridPulse 8s ease-in-out infinite;
}

@keyframes acBgGridPulse {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 0.8; }
}

.ac-bg-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ac-bg-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(63, 169, 245, 0.4), transparent 70%);
    animation: acBgFloatParticle linear infinite;
    opacity: 0;
}

.ac-bg-particle:nth-child(1) { width: 150px; height: 150px; left: 10%; top: 20%; animation-duration: 25s; animation-delay: 0s; background: radial-gradient(circle, rgba(63, 169, 245, 0.2), transparent 70%); }
.ac-bg-particle:nth-child(2) { width: 80px;  height: 80px;  left: 70%; top: 60%; animation-duration: 20s; animation-delay: 3s; background: radial-gradient(circle, rgba(63, 169, 245, 0.3), transparent 70%); }
.ac-bg-particle:nth-child(3) { width: 200px; height: 200px; left: 50%; top: 30%; animation-duration: 30s; animation-delay: 5s; background: radial-gradient(circle, rgba(63, 169, 245, 0.15), transparent 70%); }
.ac-bg-particle:nth-child(4) { width: 60px;  height: 60px;  left: 20%; top: 70%; animation-duration: 18s; animation-delay: 2s; background: radial-gradient(circle, rgba(63, 169, 245, 0.35), transparent 70%); }
.ac-bg-particle:nth-child(5) { width: 120px; height: 120px; left: 85%; top: 15%; animation-duration: 22s; animation-delay: 7s; background: radial-gradient(circle, rgba(63, 169, 245, 0.2), transparent 70%); }
.ac-bg-particle:nth-child(6) { width: 100px; height: 100px; left: 35%; top: 85%; animation-duration: 28s; animation-delay: 4s; background: radial-gradient(circle, rgba(63, 169, 245, 0.25), transparent 70%); }
.ac-bg-particle:nth-child(7) { width: 180px; height: 180px; left: 5%;  top: 50%; animation-duration: 26s; animation-delay: 6s; background: radial-gradient(circle, rgba(63, 169, 245, 0.12), transparent 70%); }
.ac-bg-particle:nth-child(8) { width: 70px;  height: 70px;  left: 60%; top: 5%;  animation-duration: 16s; animation-delay: 1s; background: radial-gradient(circle, rgba(63, 169, 245, 0.3), transparent 70%); }

@keyframes acBgFloatParticle {
    0%   { transform: translate(0, 0) scale(1); opacity: 0; }
    10%  { opacity: 0.6; }
    90%  { opacity: 0.6; }
    100% { transform: translate(100px, -200px) scale(1.5); opacity: 0; }
}

.ac-bg-tracers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ac-bg-tracer {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(63, 169, 245, 0.5), transparent);
    animation: acBgTracerMove linear infinite;
    opacity: 0;
}

.ac-bg-tracer:nth-child(1) { width: 300px; top: 15%; left: -300px; animation-duration: 8s;  animation-delay: 0s; }
.ac-bg-tracer:nth-child(2) { width: 250px; top: 35%; left: -250px; animation-duration: 10s; animation-delay: 2s; height: 2px; background: linear-gradient(90deg, transparent, rgba(63, 169, 245, 0.3), transparent); }
.ac-bg-tracer:nth-child(3) { width: 350px; top: 55%; left: -350px; animation-duration: 7s;  animation-delay: 4s; }
.ac-bg-tracer:nth-child(4) { width: 200px; top: 75%; left: -200px; animation-duration: 12s; animation-delay: 1s; height: 2px; background: linear-gradient(90deg, transparent, rgba(63, 169, 245, 0.4), transparent); }
.ac-bg-tracer:nth-child(5) { width: 280px; top: 90%; left: -280px; animation-duration: 9s;  animation-delay: 6s; }
.ac-bg-tracer:nth-child(6) { width: 220px; top: 5%;  left: -220px; animation-duration: 11s; animation-delay: 3s; height: 2px; background: linear-gradient(90deg, transparent, rgba(63, 169, 245, 0.35), transparent); }

@keyframes acBgTracerMove {
    0%   { transform: translateX(0) scaleX(1); opacity: 0; }
    10%  { opacity: 0.8; }
    90%  { opacity: 0.8; }
    100% { transform: translateX(120vw) scaleX(1.5); opacity: 0; }
}

.ac-bg-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ac-bg-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ffffff;
    border-radius: 50%;
    animation: acBgTwinkle ease-in-out infinite;
}

.ac-bg-star:nth-child(1)  { left: 5%;  top: 10%; animation-duration: 3s;   animation-delay: 0s; }
.ac-bg-star:nth-child(2)  { left: 15%; top: 25%; animation-duration: 4s;   animation-delay: 1s; width: 3px; height: 3px; }
.ac-bg-star:nth-child(3)  { left: 25%; top: 5%;  animation-duration: 2.5s; animation-delay: 0.5s; }
.ac-bg-star:nth-child(4)  { left: 35%; top: 40%; animation-duration: 3.5s; animation-delay: 2s; }
.ac-bg-star:nth-child(5)  { left: 45%; top: 15%; animation-duration: 4.5s; animation-delay: 0.3s; width: 3px; height: 3px; }
.ac-bg-star:nth-child(6)  { left: 55%; top: 60%; animation-duration: 3s;   animation-delay: 1.5s; }
.ac-bg-star:nth-child(7)  { left: 65%; top: 8%;  animation-duration: 5s;   animation-delay: 0.7s; }
.ac-bg-star:nth-child(8)  { left: 75%; top: 45%; animation-duration: 2.8s; animation-delay: 2.5s; width: 3px; height: 3px; }
.ac-bg-star:nth-child(9)  { left: 85%; top: 20%; animation-duration: 3.2s; animation-delay: 1.2s; }
.ac-bg-star:nth-child(10) { left: 92%; top: 70%; animation-duration: 4.2s; animation-delay: 0.8s; }
.ac-bg-star:nth-child(11) { left: 8%;  top: 80%; animation-duration: 3.8s; animation-delay: 1.8s; }
.ac-bg-star:nth-child(12) { left: 48%; top: 90%; animation-duration: 2.2s; animation-delay: 0.2s; }
.ac-bg-star:nth-child(13) { left: 78%; top: 85%; animation-duration: 3.6s; animation-delay: 2.2s; width: 3px; height: 3px; }
.ac-bg-star:nth-child(14) { left: 20%; top: 55%; animation-duration: 4.8s; animation-delay: 1.6s; }
.ac-bg-star:nth-child(15) { left: 60%; top: 35%; animation-duration: 2.6s; animation-delay: 0.9s; }

@keyframes acBgTwinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.5); }
}

.ac-bg-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: url("site-background-noise.svg");
    background-repeat: repeat;
    background-size: 256px 256px;
    animation: acBgNoiseAnimation 0.5s steps(2) infinite;
    pointer-events: none;
}

@keyframes acBgNoiseAnimation {
    0%   { transform: translate(0, 0); }
    10%  { transform: translate(-5%, -5%); }
    20%  { transform: translate(5%, 5%); }
    30%  { transform: translate(-10%, 0); }
    40%  { transform: translate(10%, -5%); }
    50%  { transform: translate(-5%, 10%); }
    60%  { transform: translate(5%, -10%); }
    70%  { transform: translate(-10%, 5%); }
    80%  { transform: translate(10%, 0); }
    90%  { transform: translate(0, -5%); }
    100% { transform: translate(0, 0); }
}

.ac-bg-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(63, 169, 245, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(63, 169, 245, 0.03) 0%, transparent 60%),
        linear-gradient(180deg,
            rgba(10, 10, 10, 0.85) 0%,
            rgba(10, 10, 10, 0.6) 20%,
            rgba(10, 10, 10, 0.4) 40%,
            rgba(10, 10, 10, 0.3) 60%,
            rgba(10, 10, 10, 0.4) 80%,
            rgba(10, 10, 10, 0.85) 100%
        );
    pointer-events: none;
    z-index: 1;
}

.ac-bg-light-rays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.ac-bg-light-ray {
    position: absolute;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(63, 169, 245, 0.05) 30%,
        rgba(63, 169, 245, 0.15) 50%,
        rgba(63, 169, 245, 0.05) 70%,
        transparent 100%
    );
    animation: acBgRayPulse ease-in-out infinite;
}

.ac-bg-light-ray:nth-child(1) { left: 10%; animation-duration: 4s;   animation-delay: 0s; }
.ac-bg-light-ray:nth-child(2) { left: 25%; animation-duration: 5s;   animation-delay: 1s; }
.ac-bg-light-ray:nth-child(3) { left: 40%; animation-duration: 3.5s; animation-delay: 0.5s; }
.ac-bg-light-ray:nth-child(4) { left: 55%; animation-duration: 4.5s; animation-delay: 2s; }
.ac-bg-light-ray:nth-child(5) { left: 70%; animation-duration: 3s;   animation-delay: 0.3s; }
.ac-bg-light-ray:nth-child(6) { left: 85%; animation-duration: 5.5s; animation-delay: 1.5s; }

@keyframes acBgRayPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
    50%      { opacity: 1;   transform: scaleY(1.2); }
}


html[data-theme="light"] .ac-bg-grid {
    background-image:
        linear-gradient(rgba(45, 140, 214, 0.22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 140, 214, 0.22) 1px, transparent 1px) !important;
}

html[data-theme="light"] .ac-bg-particles,
html[data-theme="light"] .ac-bg-tracers,
html[data-theme="light"] .ac-bg-light-rays,
html[data-theme="light"] .ac-bg-stars {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

html[data-theme="light"] .ac-bg-particle {
    background: radial-gradient(circle, rgba(45, 140, 214, 0.7), transparent 70%) !important;
    animation-name: acBgFloatParticleLight !important;
}

html[data-theme="light"] .ac-bg-particle:nth-child(1) { background: radial-gradient(circle, rgba(45, 140, 214, 0.5), transparent 70%) !important; }
html[data-theme="light"] .ac-bg-particle:nth-child(2) { background: radial-gradient(circle, rgba(45, 140, 214, 0.62), transparent 70%) !important; }
html[data-theme="light"] .ac-bg-particle:nth-child(3) { background: radial-gradient(circle, rgba(63, 169, 245, 0.45), transparent 70%) !important; }
html[data-theme="light"] .ac-bg-particle:nth-child(4) { background: radial-gradient(circle, rgba(45, 140, 214, 0.68), transparent 70%) !important; }
html[data-theme="light"] .ac-bg-particle:nth-child(5) { background: radial-gradient(circle, rgba(45, 140, 214, 0.52), transparent 70%) !important; }
html[data-theme="light"] .ac-bg-particle:nth-child(6) { background: radial-gradient(circle, rgba(45, 140, 214, 0.58), transparent 70%) !important; }
html[data-theme="light"] .ac-bg-particle:nth-child(7) { background: radial-gradient(circle, rgba(63, 169, 245, 0.4), transparent 70%) !important; }
html[data-theme="light"] .ac-bg-particle:nth-child(8) { background: radial-gradient(circle, rgba(45, 140, 214, 0.64), transparent 70%) !important; }

html[data-theme="light"] .ac-bg-tracer {
    background: linear-gradient(90deg, transparent, rgba(45, 140, 214, 0.7), transparent) !important;
}

html[data-theme="light"] .ac-bg-tracer:nth-child(2) {
    background: linear-gradient(90deg, transparent, rgba(45, 140, 214, 0.5), transparent) !important;
}

html[data-theme="light"] .ac-bg-tracer:nth-child(4) {
    background: linear-gradient(90deg, transparent, rgba(45, 140, 214, 0.62), transparent) !important;
}

html[data-theme="light"] .ac-bg-tracer:nth-child(6) {
    background: linear-gradient(90deg, transparent, rgba(45, 140, 214, 0.55), transparent) !important;
}

html[data-theme="light"] .ac-bg-star {
    background: rgba(45, 140, 214, 0.75) !important;
    box-shadow: 0 0 5px rgba(45, 140, 214, 0.45) !important;
}

/* keyframes live in common.css; ensure name resolves if theme-light wins cascade */
@keyframes acBgFloatParticleLight {
    0%   { transform: translate(0, 0) scale(1); opacity: 0; }
    10%  { opacity: 0.85; }
    90%  { opacity: 0.85; }
    100% { transform: translate(100px, -200px) scale(1.5); opacity: 0; }
}

html[data-theme="light"] .ac-bg-light-ray {
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(45, 140, 214, 0.08) 30%,
        rgba(45, 140, 214, 0.22) 50%,
        rgba(45, 140, 214, 0.08) 70%,
        transparent 100%
    ) !important;
}

html[data-theme="light"] .ac-bg-noise {
    opacity: 0.04 !important;
    mix-blend-mode: multiply;
}

html[data-theme="light"] .ac-bg-gradient-overlay {
    background:
        radial-gradient(ellipse at 18% 35%, rgba(45, 140, 214, 0.14) 0%, transparent 55%),
        radial-gradient(ellipse at 82% 65%, rgba(63, 169, 245, 0.1) 0%, transparent 55%),
        linear-gradient(
            180deg,
            rgba(232, 238, 245, 0.05) 0%,
            rgba(212, 224, 236, 0.18) 45%,
            rgba(232, 238, 245, 0.28) 100%
        ) !important;
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme="light"] .ac-bg-grid,
    html[data-theme="light"] .ac-bg-particle,
    html[data-theme="light"] .ac-bg-tracer,
    html[data-theme="light"] .ac-bg-star,
    html[data-theme="light"] .ac-bg-light-ray,
    html[data-theme="light"] .ac-bg-noise {
        animation: none !important;
    }
}


/* Системная настройка уменьшения движения действует в обеих темах. */
@media(prefers-reduced-motion:reduce){
 .ac-background *{animation:none!important}
 .ac-bg-grid{opacity:.5}
 .ac-bg-particle{opacity:.35}
 .ac-bg-star{opacity:.45}
 .ac-bg-light-ray{opacity:.3}
}
