/* Memelordz — shared neon border sweep for interactive controls */

@keyframes mlBorderSweep {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

:root {
    --ml-neon-edge: rgba(162, 0, 255, 0.42);
    --ml-neon-sweep-a: rgba(162, 0, 255, 0.12);
    --ml-neon-sweep-b: rgba(0, 240, 255, 0.95);
    --ml-neon-sweep-c: rgba(162, 0, 255, 1);
    --ml-neon-sweep-d: rgba(255, 0, 234, 0.85);
    --ml-neon-speed: 3.8s;
}

.btn-primary,
.btn-secondary,
.btn-outline,
.btn-discord,
.btn-ghost-sm,
.path-card-link,
.chip,
.dex-filter-btn,
.quest-filter-btn,
.quest-codex-btn,
.affinity-chip,
.gallery-filter,
.chronicle-filter,
.detail-action,
.widget-link,
.quest-card,
.dex-card,
.guide-card,
.guide-link-btn,
.guide-toc-list a,
.guide-stat-pill,
.guide-block,
.guide-chip,
.guide-affinity-pill,
.roadmap-jump a,
.lb-close,
.evo-node,
.evo-tree-card,
.btn-buy-pixels,
.pb-btn,
.pixel-go-btn {
    position: relative;
    isolation: isolate;
    overflow: visible;
    border-color: transparent !important;
}

.btn-primary::after,
.btn-secondary::after,
.btn-outline::after,
.btn-discord::after,
.btn-ghost-sm::after,
.path-card-link::after,
.chip::after,
.dex-filter-btn::after,
.quest-filter-btn::after,
.quest-codex-btn::after,
.affinity-chip::after,
.gallery-filter::after,
.chronicle-filter::after,
.detail-action::after,
.widget-link::after,
.quest-card::after,
.dex-card::after,
.guide-card::after,
.guide-link-btn::after,
.guide-toc-list a::after,
.guide-stat-pill::after,
.guide-block::after,
.guide-chip::after,
.guide-affinity-pill::after,
.roadmap-jump a::after,
.lb-close::after,
.evo-node::after,
.evo-tree-card::after,
.btn-buy-pixels::after,
.pb-btn::after,
.pixel-go-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid var(--ml-neon-edge);
    pointer-events: none;
    z-index: 2;
    transition: border-color 0.25s ease;
}

.btn-primary::before,
.btn-secondary::before,
.btn-outline::before,
.btn-discord::before,
.btn-ghost-sm::before,
.path-card-link::before,
.chip::before,
.dex-filter-btn::before,
.quest-filter-btn::before,
.quest-codex-btn::before,
.affinity-chip::before,
.gallery-filter::before,
.chronicle-filter::before,
.detail-action::before,
.widget-link::before,
.quest-card::before,
.dex-card::before,
.guide-card::before,
.guide-link-btn::before,
.guide-toc-list a::before,
.guide-stat-pill::before,
.guide-block::before,
.guide-chip::before,
.guide-affinity-pill::before,
.roadmap-jump a::before,
.lb-close::before,
.evo-node::before,
.evo-tree-card::before,
.btn-buy-pixels::before,
.pb-btn::before,
.pixel-go-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(90deg,
        var(--ml-neon-sweep-a) 0%,
        var(--ml-neon-sweep-a) 38%,
        var(--ml-neon-sweep-b) 47%,
        var(--ml-neon-sweep-c) 50%,
        var(--ml-neon-sweep-d) 53%,
        var(--ml-neon-sweep-a) 62%,
        var(--ml-neon-sweep-a) 100%
    );
    background-size: 280% 100%;
    animation: mlBorderSweep var(--ml-neon-speed) linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 3;
    transition: filter 0.25s ease;
}

.btn-primary { --ml-neon-edge: rgba(162, 0, 255, 0.55); }
.btn-secondary,
.quest-filter-btn { --ml-neon-edge: rgba(255, 170, 0, 0.5); --ml-neon-sweep-b: rgba(255, 200, 80, 0.95); --ml-neon-sweep-c: rgba(255, 170, 0, 1); --ml-neon-sweep-d: rgba(255, 120, 0, 0.85); }
.btn-outline,
.affinity-chip,
.gallery-filter,
.roadmap-jump a { --ml-neon-edge: rgba(0, 240, 255, 0.4); --ml-neon-sweep-a: rgba(0, 240, 255, 0.08); --ml-neon-sweep-c: rgba(0, 240, 255, 1); --ml-neon-sweep-d: rgba(162, 0, 255, 0.75); }
.btn-discord { --ml-neon-edge: rgba(88, 101, 242, 0.55); --ml-neon-sweep-b: rgba(129, 140, 248, 0.95); --ml-neon-sweep-c: rgba(88, 101, 242, 1); --ml-neon-sweep-d: rgba(165, 180, 252, 0.85); }
.btn-ghost-sm,
.path-card-link,
.dex-filter-btn,
.quest-codex-btn { --ml-neon-edge: rgba(162, 0, 255, 0.5); }
.chip.side.is-active,
.chip.side:hover { --ml-neon-edge: rgba(0, 255, 102, 0.45); --ml-neon-sweep-b: rgba(0, 255, 102, 0.85); --ml-neon-sweep-c: rgba(0, 255, 102, 1); }
.quest-card { --ml-neon-edge: rgba(255, 170, 0, 0.35); --ml-neon-speed: 4.4s; }
.dex-card { --ml-neon-edge: rgba(162, 0, 255, 0.32); --ml-neon-speed: 4.6s; }
.guide-card { --ml-neon-edge: rgba(162, 0, 255, 0.35); --ml-neon-speed: 4.2s; }
.guide-link-btn { --ml-neon-edge: rgba(255, 170, 0, 0.45); --ml-neon-sweep-b: rgba(255, 200, 80, 0.95); --ml-neon-sweep-c: rgba(255, 170, 0, 1); --ml-neon-speed: 4.4s; }
.guide-link-btn.is-cyan { --ml-neon-edge: rgba(0, 240, 255, 0.4); --ml-neon-sweep-c: rgba(0, 240, 255, 1); }
.guide-toc-list a { --ml-neon-edge: rgba(255, 170, 0, 0.3); --ml-neon-speed: 5s; }
.guide-toc-list a.is-active { --ml-neon-edge: rgba(255, 170, 0, 0.55); filter: brightness(1.1); }
.guide-stat-pill { --ml-neon-edge: rgba(0, 240, 255, 0.28); --ml-neon-speed: 5.2s; }
.guide-block { --ml-neon-edge: rgba(255, 170, 0, 0.22); --ml-neon-speed: 5.6s; }
.guide-chip { --ml-neon-edge: rgba(0, 240, 255, 0.25); --ml-neon-speed: 5.4s; }
.guide-affinity-pill { --ml-neon-edge: rgba(162, 0, 255, 0.28); --ml-neon-speed: 5.8s; }
.chip,
.chronicle-filter,
.detail-action,
.widget-link,
.lb-close,
.evo-node { --ml-neon-speed: 4.8s; }

.btn-row > :nth-child(6n+2)::before,
.dex-chips > :nth-child(6n+2)::before,
.quest-chips > :nth-child(6n+2)::before,
.chronicle-filters > :nth-child(6n+2)::before,
.gallery-filters > :nth-child(6n+2)::before { animation-delay: -0.6s; }
.btn-row > :nth-child(6n+3)::before,
.dex-chips > :nth-child(6n+3)::before,
.quest-chips > :nth-child(6n+3)::before,
.chronicle-filters > :nth-child(6n+3)::before,
.gallery-filters > :nth-child(6n+3)::before { animation-delay: -1.2s; }
.btn-row > :nth-child(6n+4)::before,
.dex-chips > :nth-child(6n+4)::before,
.quest-chips > :nth-child(6n+4)::before,
.chronicle-filters > :nth-child(6n+4)::before,
.gallery-filters > :nth-child(6n+4)::before { animation-delay: -1.8s; }
.btn-row > :nth-child(6n+5)::before,
.dex-chips > :nth-child(6n+5)::before,
.quest-chips > :nth-child(6n+5)::before,
.chronicle-filters > :nth-child(6n+5)::before,
.gallery-filters > :nth-child(6n+5)::before { animation-delay: -2.4s; }
.btn-row > :nth-child(6n+6)::before,
.dex-chips > :nth-child(6n+6)::before,
.quest-chips > :nth-child(6n+6)::before,
.chronicle-filters > :nth-child(6n+6)::before,
.gallery-filters > :nth-child(6n+6)::before { animation-delay: -3s; }

.btn-primary:hover::before,
.btn-secondary:hover::before,
.btn-outline:hover::before,
.btn-discord:hover::before,
.btn-ghost-sm:hover::before,
.path-card-link:hover::before,
.chip:hover::before,
.dex-filter-btn:hover::before,
.quest-filter-btn:hover::before,
.quest-codex-btn:hover::before,
.affinity-chip:hover::before,
.gallery-filter:hover::before,
.chronicle-filter:hover::before,
.detail-action:hover::before,
.widget-link:hover::before,
.quest-card:hover::before,
.dex-card:hover::before,
.guide-card:hover::before,
.guide-link-btn:hover::before,
.guide-toc-list a:hover::before,
.guide-toc-list a.is-active::before,
.guide-stat-pill:hover::before,
.guide-block:hover::before,
.guide-chip:hover::before,
.guide-affinity-pill:hover::before,
.roadmap-jump a:hover::before,
.lb-close:hover::before,
.evo-node:hover::before,
.evo-tree-card:hover::before,
.chip.is-active::before,
.affinity-chip.is-active::before,
.gallery-filter.is-active::before,
.chronicle-filter.is-active::before,
.quest-card.is-selected::before,
.dex-card.is-selected::before,
.detail-action.is-active::before {
    filter: brightness(1.22);
}

.path-card-link:hover::after { border-color: rgba(0, 240, 255, 0.55); }

@media (prefers-reduced-motion: reduce) {
    .btn-primary::before,
    .btn-secondary::before,
    .btn-outline::before,
    .btn-discord::before,
    .btn-ghost-sm::before,
    .path-card-link::before,
    .chip::before,
    .dex-filter-btn::before,
    .quest-filter-btn::before,
    .quest-codex-btn::before,
    .affinity-chip::before,
    .gallery-filter::before,
    .chronicle-filter::before,
    .detail-action::before,
    .widget-link::before,
    .quest-card::before,
    .dex-card::before,
    .guide-card::before,
    .guide-link-btn::before,
    .guide-toc-list a::before,
    .guide-stat-pill::before,
    .guide-block::before,
    .guide-chip::before,
    .guide-affinity-pill::before,
    .roadmap-jump a::before,
    .lb-close::before,
    .evo-node::before,
    .evo-tree-card::before,
    .btn-buy-pixels::before,
    .pb-btn::before,
    .pixel-go-btn::before {
        animation: none;
        opacity: 0.35;
    }
}
