/* RSCRevived Halloween / Autumn seasonal skin
   Loaded only while rsc_site_seasonal_theme() is active (Oct 1 – Nov 2 Eastern).
   Soft palette shift + light FX; keeps existing layout and brand chrome.
   Base .site-event-banner styles live in site.css year-round. */

body.rsc-theme-halloween {
    --bg: #0a0708;
    --bg-2: #16100c;
    --panel: rgba(22, 14, 10, 0.94);
    --panel-soft: rgba(28, 18, 12, 0.82);
    --edge: rgba(214, 132, 62, 0.42);
    --edge-strong: rgba(255, 168, 74, 0.55);
    --gold: #e8a54a;
    --gold-2: #ffd9a0;
    --text: #fff4e8;
    --muted: #d2b89a;
    --blue: #ffb26b;
    --shadow: 0 24px 80px rgba(0, 0, 0, .5);
    background:
        radial-gradient(circle at 10% -4%, rgba(255, 120, 40, 0.2), transparent 28rem),
        radial-gradient(circle at 88% 8%, rgba(120, 48, 180, 0.18), transparent 26rem),
        radial-gradient(circle at 50% 100%, rgba(180, 70, 20, 0.12), transparent 34rem),
        linear-gradient(180deg, #070405, #120c08 48%, #080504);
}

body.rsc-theme-halloween .topbar {
    background: rgba(12, 7, 6, 0.9);
    border-bottom-color: rgba(255, 150, 70, 0.22);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

body.rsc-theme-halloween .topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 146, 48, 0.75), rgba(168, 72, 255, 0.45), rgba(255, 176, 72, 0.7), transparent);
}

.site-event-banner-halloween {
    border-color: rgba(255, 148, 64, 0.42);
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 132, 42, 0.22), transparent 15rem),
        radial-gradient(circle at 90% 100%, rgba(132, 54, 190, 0.2), transparent 14rem),
        linear-gradient(135deg, rgba(28, 12, 8, 0.96), rgba(14, 8, 16, 0.94));
    box-shadow: 0 18px 40px rgba(40, 10, 0, 0.35);
}

.site-event-banner-halloween .site-event-banner-kicker {
    color: #ffb56a;
}

.site-event-banner-halloween strong {
    text-shadow: 0 0 18px rgba(255, 140, 50, 0.28);
}

body.rsc-theme-halloween .site-events-strip.is-halloween,
body.rsc-theme-halloween .site-events-strip {
    border-color: rgba(255, 150, 70, 0.28);
    background:
        radial-gradient(circle at 0% 0%, rgba(255, 120, 40, 0.12), transparent 14rem),
        rgba(18, 10, 8, 0.72);
}

body.rsc-theme-halloween .site-events-strip-grid article {
    border-color: rgba(255, 160, 80, 0.2);
    background: rgba(12, 7, 6, 0.78);
}

body.rsc-theme-halloween .site-events-strip-grid span {
    color: #ffb45c;
}

body.rsc-theme-halloween .btn,
body.rsc-theme-halloween button.btn {
    border-color: rgba(255, 168, 74, 0.55);
    background: linear-gradient(180deg, #ffc06a, #c56a22);
    color: #1a0d05;
    box-shadow: 0 12px 24px rgba(120, 50, 10, 0.28);
}

body.rsc-theme-halloween .btn.secondary {
    background: rgba(255, 170, 90, 0.06);
    border-color: rgba(255, 168, 90, 0.32);
    color: #ffe0b5;
    box-shadow: none;
}

body.rsc-theme-halloween a:hover {
    color: #ffe7c2;
}

body.rsc-theme-halloween .home-preview-page .home-seo-intro {
    border-color: rgba(255, 150, 70, 0.28);
    background: linear-gradient(180deg, rgba(36, 16, 8, 0.92), rgba(12, 8, 10, 0.9));
}

body.rsc-theme-halloween .home-preview-page .home-seo-intro.is-halloween .home-seo-kicker {
    display: inline-block;
    margin-bottom: 6px;
    color: #ffb56a;
    font-size: 0.72rem;
    font-weight: 1000;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

body.rsc-theme-halloween .footer {
    border-top-color: rgba(255, 150, 70, 0.18);
}

/* Compact top-left Halloween music chip — collapsed by default */
.rsc-halloween-music {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 2400;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: min(280px, calc(100vw - 20px));
    pointer-events: none;
}

.rsc-halloween-music > * {
    pointer-events: auto;
}

.rsc-halloween-music-chip {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 168, 90, 0.4);
    background: rgba(16, 10, 8, 0.78);
    color: #ffd7a0;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
    opacity: 0.72;
    transition: opacity 0.15s ease, filter 0.15s ease;
}

.rsc-halloween-music-chip:hover,
.rsc-halloween-music.is-open .rsc-halloween-music-chip,
.rsc-halloween-music.is-playing .rsc-halloween-music-chip {
    opacity: 0.95;
}

.rsc-halloween-music.is-muted .rsc-halloween-music-chip {
    opacity: 0.55;
    color: #c9a88a;
}

.rsc-halloween-music-chip:focus-visible {
    outline: 2px solid #ffb56a;
    outline-offset: 2px;
}

.rsc-halloween-music-panel {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    padding: 3px 4px;
    border: 1px solid rgba(255, 168, 90, 0.38);
    border-radius: 999px;
    background: rgba(14, 9, 8, 0.92);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

.rsc-halloween-music-panel[hidden] {
    display: none !important;
}

.rsc-halloween-music-btn {
    min-width: 0;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 168, 90, 0.4);
    background: linear-gradient(180deg, #ffc06a, #c56a22);
    color: #1a0d05;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    line-height: 1;
}

.rsc-halloween-music-btn.is-skip {
    background: rgba(255, 170, 90, 0.08);
    color: #ffe0b5;
}

.rsc-halloween-music-btn:hover,
.rsc-halloween-music-mute-opt:hover {
    filter: brightness(1.06);
}

.rsc-halloween-music-btn:focus-visible,
.rsc-halloween-music-mute-opt:focus-visible {
    outline: 2px solid #ffb56a;
    outline-offset: 1px;
}

.rsc-halloween-music-btn.is-active {
    box-shadow: 0 0 0 1px rgba(255, 176, 90, 0.55);
}

.rsc-halloween-music-btn:disabled {
    opacity: 0.4;
    cursor: default;
    filter: none;
}

.rsc-halloween-music-mute {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 1px;
    padding-left: 4px;
    border-left: 1px solid rgba(255, 168, 90, 0.22);
}

.rsc-halloween-music-mute-label {
    padding: 0 2px;
    color: #c9a88a;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rsc-halloween-music-mute-opt {
    min-height: 22px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 168, 90, 0.28);
    background: rgba(255, 170, 90, 0.06);
    color: #ffe0b5;
    font-size: 0.6rem;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}

@media (max-width: 720px) {
    .rsc-halloween-music {
        top: 8px;
        left: 8px;
    }

    .rsc-halloween-music-chip {
        width: 28px;
        height: 28px;
        font-size: 0.84rem;
        opacity: 0.65;
    }

    .rsc-halloween-music-panel {
        max-width: calc(100vw - 48px);
    }
}

/* Lightweight FX layer — decorative only; reapers opt into pointer-events */
.rsc-seasonal-fx {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
    overflow: hidden;
}

.rsc-seasonal-leaf,
.rsc-seasonal-bat {
    position: absolute;
    display: block;
    opacity: 0.55;
    will-change: transform;
}

.rsc-seasonal-leaf {
    width: 12px;
    height: 12px;
    border-radius: 2px 10px 2px 10px;
    background: linear-gradient(135deg, #d96a2b, #8a3a12);
    box-shadow: 0 0 10px rgba(255, 140, 50, 0.18);
    animation: rsc-leaf-fall 16s linear infinite;
}

.rsc-seasonal-leaf.l1 { left: 8%; top: -8%; animation-duration: 18s; animation-delay: -2s; background: linear-gradient(135deg, #e08a32, #9a4a18); }
.rsc-seasonal-leaf.l2 { left: 28%; top: -12%; width: 10px; height: 10px; animation-duration: 22s; animation-delay: -7s; background: linear-gradient(135deg, #c45a24, #6f2e10); }
.rsc-seasonal-leaf.l3 { left: 52%; top: -6%; animation-duration: 19s; animation-delay: -11s; background: linear-gradient(135deg, #f0a040, #a85a20); }
.rsc-seasonal-leaf.l4 { left: 74%; top: -10%; width: 9px; height: 9px; animation-duration: 21s; animation-delay: -4s; background: linear-gradient(135deg, #b84e1c, #5c240c); }
.rsc-seasonal-leaf.l5 { left: 90%; top: -14%; animation-duration: 24s; animation-delay: -15s; background: linear-gradient(135deg, #d97828, #7a3a14); }

.rsc-seasonal-bat {
    width: 18px;
    height: 8px;
    opacity: 0.28;
    background:
        radial-gradient(circle at 30% 50%, #1a1014 0 42%, transparent 43%),
        radial-gradient(circle at 70% 50%, #1a1014 0 42%, transparent 43%),
        linear-gradient(180deg, transparent 35%, #1a1014 36% 64%, transparent 65%);
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.4));
    animation: rsc-bat-drift 28s ease-in-out infinite;
}

.rsc-seasonal-bat.b1 { left: -4%; top: 18%; animation-delay: -3s; }
.rsc-seasonal-bat.b2 { left: -6%; top: 42%; animation-duration: 34s; animation-delay: -16s; opacity: 0.2; }

@keyframes rsc-leaf-fall {
    0% { transform: translate3d(0, -5vh, 0) rotate(0deg); opacity: 0; }
    8% { opacity: 0.55; }
    100% { transform: translate3d(40px, 110vh, 0) rotate(360deg); opacity: 0.15; }
}

@keyframes rsc-bat-drift {
    0% { transform: translate3d(0, 0, 0) scaleX(1); }
    45% { transform: translate3d(55vw, -18px, 0) scaleX(1); }
    50% { transform: translate3d(58vw, -12px, 0) scaleX(-1); }
    95% { transform: translate3d(110vw, 10px, 0) scaleX(-1); }
    100% { transform: translate3d(112vw, 12px, 0) scaleX(-1); }
}

/* Death Reaper site accents — opt-in only (default hidden). In-game Reapers unchanged. */
.rsc-seasonal-reaper {
    display: none;
    position: absolute;
    left: 50%;
    bottom: 6%;
    width: 72px;
    height: 156px;
    margin: 0;
    transform-origin: 50% 100%;
    pointer-events: auto;
    cursor: pointer;
    will-change: transform, opacity;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
    outline: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

html[data-seasonal-reapers='on'] .rsc-seasonal-reaper {
    display: block;
}

.rsc-seasonal-reaper:focus-visible {
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 10px rgba(255, 180, 80, 0.65));
}

.rsc-seasonal-reaper.is-dead {
    pointer-events: none;
    cursor: default;
    transition: opacity 0.55s ease, filter 0.55s ease;
    opacity: 0 !important;
    filter: grayscale(1) brightness(0.35) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
}

.rsc-seasonal-reaper.is-dead .rsc-seasonal-reaper-frame {
    animation-play-state: paused;
}

.rsc-seasonal-hitsplat {
    position: absolute;
    left: 50%;
    top: 32%;
    z-index: 6;
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font: 1000 15px/1 "Courier New", Courier, monospace;
    letter-spacing: -0.04em;
    text-shadow: 0 1px 0 #1a0000, 0 0 2px #000;
    background:
        radial-gradient(circle at 32% 28%, #ff8a72 0 18%, transparent 19%),
        radial-gradient(circle at 50% 50%, #e52424 0 58%, #9a0c0c 78%, #4a0404 100%);
    border: 2px solid #2a0505;
    box-shadow:
        inset 0 -3px 0 rgba(0, 0, 0, 0.28),
        0 2px 0 #1a0000,
        0 0 14px rgba(255, 40, 20, 0.5);
    pointer-events: none;
    animation: rsc-hitsplat-pop 0.9s ease-out forwards;
}

@keyframes rsc-hitsplat-pop {
    0% {
        transform: scale(0.35) translateY(10px);
        opacity: 0;
    }
    12% {
        transform: scale(1.18) translateY(0);
        opacity: 1;
    }
    55% {
        transform: scale(1) translateY(-12px);
        opacity: 1;
    }
    100% {
        transform: scale(0.92) translateY(-28px);
        opacity: 0;
    }
}

.rsc-seasonal-reaper-frame {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 100%;
    height: auto;
    transform: translateX(-50%);
    image-rendering: pixelated;
    opacity: 0;
}

.rsc-seasonal-reaper-frame.f0 {
    animation: rsc-reaper-step-f0 0.48s steps(1, end) infinite;
}

.rsc-seasonal-reaper-frame.f1 {
    animation: rsc-reaper-step-f1 0.48s steps(1, end) infinite;
}

.rsc-seasonal-reaper-frame.f2 {
    animation: rsc-reaper-step-f2 0.48s steps(1, end) infinite;
}

.rsc-seasonal-reaper-charge {
    z-index: 2;
    animation: rsc-reaper-charge 22s cubic-bezier(0.22, 0.8, 0.28, 1) infinite;
}

.rsc-seasonal-reaper-roam {
    z-index: 1;
    width: 54px;
    height: 118px;
    bottom: 3%;
    opacity: 0.72;
    animation: rsc-reaper-roam 42s linear infinite;
    animation-delay: -8s;
}

.rsc-seasonal-reaper-roam .rsc-seasonal-reaper-frame.f0,
.rsc-seasonal-reaper-roam .rsc-seasonal-reaper-frame.f1,
.rsc-seasonal-reaper-roam .rsc-seasonal-reaper-frame.f2 {
    animation-duration: 0.4s;
}

@keyframes rsc-reaper-step-f0 {
    0%, 32.9% { opacity: 1; }
    33%, 100% { opacity: 0; }
}

@keyframes rsc-reaper-step-f1 {
    0%, 32.9% { opacity: 0; }
    33%, 65.9% { opacity: 1; }
    66%, 100% { opacity: 0; }
}

@keyframes rsc-reaper-step-f2 {
    0%, 65.9% { opacity: 0; }
    66%, 100% { opacity: 1; }
}

@keyframes rsc-reaper-charge {
    0%, 4% {
        opacity: 0;
        transform: translate3d(-50%, 10vh, 0) scale(0.55);
    }
    12% {
        opacity: 0.75;
        transform: translate3d(-48%, 6vh, 0) scale(0.85);
    }
    22% {
        opacity: 0.85;
        transform: translate3d(-50%, 4vh, 0) scale(1.05);
    }
    30% {
        opacity: 0.55;
        transform: translate3d(-52%, 3vh, 0) scale(1.15);
    }
    36% {
        opacity: 0;
        transform: translate3d(-50%, 5vh, 0) scale(1.2);
    }
    37%, 100% {
        opacity: 0;
        transform: translate3d(-50%, 10vh, 0) scale(0.55);
    }
}

@keyframes rsc-reaper-roam {
    0% {
        opacity: 0;
        transform: translate3d(-120vw, 0, 0) scaleX(1);
    }
    6% { opacity: 0.9; }
    44% {
        opacity: 0.9;
        transform: translate3d(70vw, -6px, 0) scaleX(1);
    }
    48% {
        opacity: 0;
        transform: translate3d(90vw, 0, 0) scaleX(1);
    }
    52% {
        opacity: 0;
        transform: translate3d(90vw, 0, 0) scaleX(-1);
    }
    58% { opacity: 0.9; }
    94% {
        opacity: 0.9;
        transform: translate3d(-110vw, -4px, 0) scaleX(-1);
    }
    100% {
        opacity: 0;
        transform: translate3d(-130vw, 0, 0) scaleX(-1);
    }
}

@media (max-width: 720px) {
    .rsc-seasonal-leaf.l4,
    .rsc-seasonal-leaf.l5,
    .rsc-seasonal-bat.b2 {
        display: none;
    }

    .rsc-seasonal-reaper-charge {
        width: 58px;
        height: 126px;
    }

    .rsc-seasonal-reaper-roam {
        width: 44px;
        height: 96px;
    }
}

/* Compact first-visit ask — dismisses after a choice; not a permanent control */
.rsc-reaper-pref-ask {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 80;
    max-width: min(320px, calc(100vw - 32px));
    padding: 12px 14px;
    border: 1px solid rgba(255, 168, 90, 0.38);
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(28, 14, 10, 0.96), rgba(12, 8, 10, 0.96));
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
    color: #ffe8c8;
}

.rsc-reaper-pref-ask p {
    margin: 0 0 10px;
    font-size: 0.84rem;
    line-height: 1.4;
    color: #f0d2b0;
}

.rsc-reaper-pref-ask-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rsc-reaper-pref-ask-actions button {
    min-height: 32px;
    padding: 5px 11px;
    border-radius: 9px;
    border: 1px solid rgba(255, 168, 90, 0.4);
    background: linear-gradient(180deg, #ffc06a, #c56a22);
    color: #1a0d05;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.rsc-reaper-pref-ask-actions button.is-ghost {
    background: rgba(255, 170, 90, 0.08);
    color: #ffe0b5;
}

.forum-reaper-pref {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 14px;
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 168, 90, 0.18);
}

.forum-reaper-pref-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffe8c8;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.forum-reaper-pref-toggle input {
    width: 16px;
    height: 16px;
    accent-color: #e8a54a;
}

.forum-reaper-pref-hint {
    color: #c9a88a;
    font-size: 0.74rem;
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .rsc-seasonal-leaf,
    .rsc-seasonal-bat,
    .rsc-seasonal-reaper,
    .rsc-seasonal-reaper-frame {
        animation: none !important;
        opacity: 0.2;
    }

    .rsc-seasonal-leaf.l1 { top: 12%; left: 6%; }
    .rsc-seasonal-leaf.l2 { top: 28%; left: 22%; }
    .rsc-seasonal-leaf.l3 { top: 18%; left: 78%; }
    .rsc-seasonal-bat,
    .rsc-seasonal-reaper-roam {
        display: none;
    }

    .rsc-seasonal-reaper-charge {
        left: auto;
        right: 4%;
        bottom: 8%;
        opacity: 0.45;
        transform: none;
        pointer-events: auto;
        cursor: pointer;
    }

    .rsc-seasonal-reaper-charge .rsc-seasonal-reaper-frame.f0 {
        opacity: 1;
    }

    .rsc-seasonal-reaper.is-dead {
        opacity: 0 !important;
    }
}

/* Reaper Slayer website easter egg modal */
.rsc-reaper-slayer-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(4, 2, 3, 0.72);
}

.rsc-reaper-slayer-panel {
    width: min(28rem, 100%);
    border: 1px solid rgba(255, 168, 74, 0.5);
    border-radius: 0.85rem;
    padding: 1.35rem 1.4rem 1.2rem;
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 132, 42, 0.22), transparent 12rem),
        radial-gradient(circle at 90% 100%, rgba(120, 48, 180, 0.18), transparent 12rem),
        linear-gradient(160deg, rgba(28, 14, 10, 0.98), rgba(12, 8, 14, 0.96));
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    color: #fff4e8;
}

.rsc-reaper-slayer-panel h2 {
    margin: 0 0 0.55rem;
    font-size: 1.45rem;
    letter-spacing: 0.04em;
    color: #ffc06a;
    text-shadow: 0 0 18px rgba(255, 140, 50, 0.28);
}

.rsc-reaper-slayer-panel p {
    margin: 0 0 0.7rem;
    line-height: 1.45;
    color: #ffe7c8;
}

.rsc-reaper-slayer-meta {
    color: #d2b89a !important;
    font-size: 0.92rem;
}

.rsc-reaper-slayer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.rsc-reaper-slayer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(255, 168, 74, 0.55);
    border-radius: 0.45rem;
    background: linear-gradient(180deg, #ffc06a, #c56a22);
    color: #1a0d06;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.rsc-reaper-slayer-btn.is-ghost {
    background: transparent;
    color: #ffd9a0;
}

.rsc-reaper-slayer-btn:focus-visible {
    outline: 2px solid #ffd9a0;
    outline-offset: 2px;
}
