/* Stage 2 / task 19. Two quiet light fields drift behind the existing TOP content.
   The tokens can be reassigned by a future FoxLand palette without changing the effect. */
.fox-top-grid > .fox-ranking-card {
    --fox-top19-light-rgb: var(--rank-accent-rgb, 170, 96, 244);
    --fox-top19-secondary-rgb: 132, 79, 218;
    --fox-top19-warm-rgb: 204, 137, 247;
    --fox-top19-drift-time: 13s;
    --fox-top19-drift-phase: 0s;
    --fox-top19-pointer-x: 50%;
    --fox-top19-pointer-y: 42%;
    position: relative;
    isolation: isolate;
    background: linear-gradient(165deg, rgba(var(--fox-top19-light-rgb), .12), transparent 54%),
        linear-gradient(180deg, var(--fox-tone-ts1l2, #141021) 0%, var(--fox-tone-ts2l1, #0b0914) 100%);
    transition: box-shadow .45s ease, border-color .45s ease;
}

.fox-top-grid > .fox-ranking-card--skill {
    --fox-top19-drift-time: 13s;
    --fox-top19-drift-phase: -3s;
}

.fox-top-grid > .fox-ranking-card--donate {
    --fox-top19-drift-time: 16s;
    --fox-top19-drift-phase: -7s;
}

.fox-top-grid > .fox-ranking-card--online {
    --fox-top19-drift-time: 14s;
    --fox-top19-drift-phase: -11s;
}

.fox-top-grid > .fox-ranking-card::before,
.fox-top-grid > .fox-ranking-card::after {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    content: "";
}

.fox-top-grid > .fox-ranking-card::before {
    inset: -26%;
    background: radial-gradient(ellipse 42% 39% at 19% 32%, rgba(var(--fox-top19-light-rgb), .48), transparent 78%),
        radial-gradient(ellipse 43% 42% at 84% 67%, rgba(var(--fox-top19-secondary-rgb), .43), transparent 79%),
        radial-gradient(ellipse 28% 26% at 55% 12%, rgba(var(--fox-top19-warm-rgb), .24), transparent 83%),
        linear-gradient(116deg, transparent 37%, rgba(var(--fox-top19-light-rgb), .21) 48%, transparent 61%);
    opacity: .96;
    transform: translate3d(-16%, -6%, 0) rotate(-4deg) scale(1);
    animation: fox-top19-drift var(--fox-top19-drift-time) ease-in-out var(--fox-top19-drift-phase) infinite alternate;
}

.fox-top-grid > .fox-ranking-card::after {
    inset: 0;
    background: radial-gradient(circle 190px at var(--fox-top19-pointer-x) var(--fox-top19-pointer-y),
        rgba(var(--fox-top19-light-rgb), .32), transparent 82%);
    opacity: 0;
    transition: opacity .48s ease;
}

/* Both layers stay behind the header, lists, medals, and animated icons. */
.fox-top-grid > .fox-ranking-card > .fox-ranking-head,
.fox-top-grid > .fox-ranking-card > .fox-ranking-list {
    position: relative;
    z-index: 1;
}

.fox-top-grid > .fox-ranking-card > .fox-ranking-head {
    background: rgba(var(--fox-rgb-as2l1, 9, 7, 18), .2);
}

.fox-top-grid > .fox-ranking-card > .fox-ranking-list {
    background: linear-gradient(180deg, rgba(var(--fox-rgb-ts2l1, 9, 7, 18), .18), rgba(var(--fox-rgb-ts2l1, 9, 7, 18), .35));
}

@keyframes fox-top19-drift {
    0% { transform: translate3d(-16%, -6%, 0) rotate(-4deg) scale(1); }
    50% { transform: translate3d(4%, 6%, 0) rotate(3deg) scale(1.08); }
    100% { transform: translate3d(16%, -3%, 0) rotate(-3deg) scale(1.03); }
}

@media (hover: hover) and (pointer: fine) {
    .fox-top-grid > .fox-ranking-card.fox-top19-pointer::after {
        opacity: .82;
    }

    .fox-top-grid > .fox-ranking-card.fox-top19-pointer {
        border-right-color: rgba(var(--fox-top19-light-rgb), .46);
        border-bottom-color: rgba(var(--fox-top19-light-rgb), .46);
        border-left-color: rgba(var(--fox-top19-light-rgb), .46);
        box-shadow: var(--fox-home-frame-shadow, 0 14px 34px rgba(0, 0, 0, .3)),
            0 0 22px rgba(var(--fox-top19-light-rgb), .14);
    }
}

@media (hover: none), (pointer: coarse) {
    .fox-top-grid > .fox-ranking-card::after { display: none; }
    .fox-top-grid > .fox-ranking-card::before { opacity: .82; }
}

@media (prefers-reduced-motion: reduce) {
    .fox-top-grid > .fox-ranking-card,
    .fox-top-grid > .fox-ranking-card::after { transition: none; }

    .fox-top-grid > .fox-ranking-card::before {
        animation: none;
        transform: none;
        opacity: .86;
    }

    .fox-top-grid > .fox-ranking-card::after { display: none; }
}
