/* CS2 DROP — fundo animado compartilhado entre o site e o Django Admin */

.ambient-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.ambient-grid {
    z-index: 0;
    opacity: 0.75;
    background-image:
        linear-gradient(rgba(255, 106, 0, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 106, 0, 0.055) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: ambientGridScroll 14s linear infinite;
}

.ambient-glow {
    z-index: 0;
    background:
        radial-gradient(ellipse 70% 55% at 55% 25%, rgba(212, 0, 138, 0.20), transparent 70%),
        radial-gradient(ellipse 55% 48% at 12% 82%, rgba(255, 106, 0, 0.15), transparent 65%),
        radial-gradient(ellipse 45% 38% at 92% 72%, rgba(247, 37, 133, 0.10), transparent 70%);
}

.ambient-particles {
    z-index: 1;
    overflow: hidden;
}

.ambient-particle {
    position: absolute;
    bottom: -12px;
    left: var(--left);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--particle-color, #ff6b35);
    opacity: 0;
    box-shadow: 0 0 9px var(--particle-color, #ff6b35);
    animation: ambientFloatUp var(--duration) linear var(--delay) infinite;
    will-change: transform, opacity;
}

.ambient-particle:nth-child(3n + 1) {
    --particle-color: #ff6b35;
}

.ambient-particle:nth-child(3n + 2) {
    --particle-color: #f72585;
}

.ambient-particle:nth-child(3n) {
    --particle-color: #ffd166;
}

/* Mantém todo o conteúdo acima dos efeitos. */
body > *:not(.ambient-layer):not(script):not(.site-header) {
    position: relative;
    z-index: 2;
}

@keyframes ambientGridScroll {
    from { background-position: 0 0; }
    to { background-position: 60px 60px; }
}

@keyframes ambientFloatUp {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(0.75);
    }
    12% { opacity: 0.85; }
    82% { opacity: 0.45; }
    100% {
        opacity: 0;
        transform: translate3d(var(--drift), -110vh, 0) scale(0.25);
    }
}

@media (max-width: 700px) {
    .ambient-grid {
        background-size: 44px 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ambient-grid {
        animation: none;
    }

    .ambient-particles {
        display: none;
    }
}

/* Oculta a grade e mantém o brilho e as partículas */
.ambient-grid {
    display: none !important;
}

/* Site público: brilho mais discreto para combinar com o fundo quase preto. */
body:not(.login):not([class*="app-"]) .ambient-glow { opacity: .55; }
