/* A seasonal layer: Original loads none of this file. Semantic status colors stay intact. */
html[data-season="halloween"][data-bs-theme="dark"] {
    --ui-page: #100c18;
    --theme-surface: #191321;
    --theme-surface-alt: #211a2c;
    --theme-control: #140f1d;
    --theme-text: #f3eaf5;
    --theme-muted: #bcacc8;
    --theme-border: #493451;
    --theme-shadow: rgb(8 3 14 / .3);
    --ui-accent: #ffb366;
    --ui-accent-strong: #ffd09d;
    --site-sidebar: #150f1f;
    --site-header: #170f20;
    --site-hover: #2f2038;
    --site-active: #3c2630;
    --site-action: #ffad5c;
    --site-action-hover: #ffc387;
    --site-on-action: #291408;
    --bs-primary: #ffad5c;
    --bs-primary-rgb: 255, 173, 92;
    --bs-body-bg-rgb: 16, 12, 24;
    --bs-body-color-rgb: 243, 234, 245;
    --bs-secondary-color-rgb: 188, 172, 200;
    --bs-secondary-bg-rgb: 33, 26, 44;
    --bs-tertiary-bg-rgb: 25, 19, 33;
    --bs-emphasis-color-rgb: 243, 234, 245;
    --bs-link-color-rgb: 255, 179, 102;
    --bs-link-hover-color-rgb: 255, 208, 157;
    --auth-page: #100c18;
    --auth-panel: #191321;
    --auth-card: #191321;
    --auth-control: #140f1d;
    --auth-text: #f3eaf5;
    --auth-muted: #bcacc8;
    --auth-border: #62476f;
    --auth-mint: #ffb366;
    --auth-on-mint: #291408;
}
html[data-season="halloween"][data-bs-theme="light"] {
    --ui-page: #f7f0e9;
    --theme-surface: #fffaf5;
    --theme-surface-alt: #f7eee6;
    --theme-control: #fffdfb;
    --theme-text: #322238;
    --theme-muted: #6d5874;
    --theme-border: #dac7d6;
    --ui-accent: #9a470d;
    --ui-accent-strong: #783507;
    --site-sidebar: #fcf5ee;
    --site-header: #fffaf5;
    --site-hover: #f0e2ed;
    --site-active: #f9e4d1;
    --site-action: #9a470d;
    --site-action-hover: #783507;
    --site-on-action: #fff;
    --bs-primary: #9a470d;
    --bs-primary-rgb: 154, 71, 13;
    --bs-body-bg-rgb: 247, 240, 233;
    --bs-body-color-rgb: 50, 34, 56;
    --bs-secondary-color-rgb: 109, 88, 116;
    --bs-secondary-bg-rgb: 247, 238, 230;
    --bs-tertiary-bg-rgb: 255, 250, 245;
    --bs-emphasis-color-rgb: 50, 34, 56;
    --bs-link-color-rgb: 154, 71, 13;
    --bs-link-hover-color-rgb: 120, 53, 7;
    --auth-page: #f7f0e9;
    --auth-panel: #fffaf5;
    --auth-card: #fffaf5;
    --auth-control: #fffdfb;
    --auth-text: #322238;
    --auth-muted: #6d5874;
    --auth-border: #c4a6c6;
    --auth-mint: #9a470d;
    --auth-on-mint: #fff;
}
html[data-season="halloween"] .season-pumpkin {
    width: 25px;
    height: 25px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 7px rgb(239 135 46 / .22));
}
html[data-season="halloween"] .sidebar-brand .site-brand { gap: 6px; font-size: 20px; }
html[data-season="halloween"] .auth-brand .site-brand-mark { color: #ffb366; }
html[data-season="halloween"] .auth-brand .season-pumpkin { width: 36px; height: 36px; }
html[data-season="halloween"] .auth-art-rule { background: #ffb366; }
html.site-layout[data-season="halloween"] .app-header {
    border-bottom-color: var(--theme-border);
    box-shadow: 0 3px 20px rgb(80 35 104 / .12);
}
html.site-layout[data-season="halloween"] .app-header::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 84px;
    height: 60px;
    background: url('../../images/seasons/halloween-web.svg') right top / contain no-repeat;
    pointer-events: none;
    opacity: .65;
}
html.site-layout[data-season="halloween"] .sidebar-brand {
    background: linear-gradient(115deg, var(--site-sidebar), var(--site-hover));
}
/* Corner cobwebs sit over card headers without intercepting their controls. */
html[data-season="halloween"] :is(.card, .glass-card, .home-panel, .admin-dash-panel, .tx-library, .mm-panel, .profile-reaction-card, .shoutbox-wrap, .shoutbox-container-wrap, .lounge-members, .media-library .ml-section, .lm-ambience, .lm-trailer-modal .modal-content) {
    position: relative;
}
html[data-season="halloween"] :is(.card, .glass-card, .home-panel, .admin-dash-panel, .tx-library, .mm-panel, .profile-reaction-card, .shoutbox-wrap, .shoutbox-container-wrap, .lounge-members, .media-library .ml-section, .lm-ambience, .lm-trailer-modal .modal-content)::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 76px;
    height: 64px;
    max-width: 30%;
    border-top-right-radius: inherit;
    background: url('../../images/seasons/halloween-web.svg') right top / contain no-repeat;
    opacity: .65;
    pointer-events: none;
    user-select: none;
    z-index: 1;
}
@media (max-width: 575px) {
    html[data-season="halloween"] :is(.card, .glass-card, .home-panel, .admin-dash-panel, .tx-library, .mm-panel, .profile-reaction-card, .shoutbox-wrap, .shoutbox-container-wrap, .lounge-members, .media-library .ml-section, .lm-ambience, .lm-trailer-modal .modal-content)::after {
        width: 54px;
        height: 45px;
    }
}
html.site-layout[data-season="halloween"] .app-sidebar {
    background-image: url('../../images/seasons/halloween-bats.svg');
    background-repeat: no-repeat;
    background-position: right bottom 18px;
}
html[data-season="halloween"] .auth-backdrop {
    background-image: linear-gradient(100deg, rgb(18 6 29 / .34), rgb(20 7 21 / .7)), url('../../images/backgrounds/halloween-michael-myers.jpg');
    filter: none;
    background-position: center;
}
@media (max-width: 575px) {
    html.site-layout[data-season="halloween"] .app-header::after { width: 50px; height: 42px; opacity: .35; }
    html[data-season="halloween"] .auth-brand .season-pumpkin { width: 26px; height: 26px; }
}

/* A second cobweb anchors the chat history's lower-left corner. */
html[data-season="halloween"] .shoutbox-container-wrap::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 62px;
    height: 52px;
    max-width: 25%;
    background: url('../../images/seasons/halloween-web.svg') right top / contain no-repeat;
    transform: rotate(180deg);
    opacity: .45;
    pointer-events: none;
    user-select: none;
    z-index: 1;
}
@media (max-width: 575px) {
    html[data-season="halloween"] .shoutbox-container-wrap::before { width: 44px; height: 37px; }
}

/* The movie background fills the page; personal/profile backgrounds still win. */
html.site-layout[data-season="halloween"]::before {
    content: "";
    position: fixed;
    inset: var(--site-header-height, 68px) 0 0;
    z-index: -2;
    display: block;
    pointer-events: none;
    background-image: linear-gradient(90deg, rgb(15 6 22 / .45), rgb(22 5 15 / .08) 65%, rgb(15 6 22 / .3)), var(--profile-background-image, var(--site-background-image, url('../../images/backgrounds/halloween-michael-myers.jpg')));
    background-size: cover;
    background-position: center top;
    opacity: .8;
}
html.site-layout[data-season="halloween"][data-bs-theme="light"]::before { opacity: .22; }
html.site-layout[data-season="halloween"] .app-sidebar {
    background-image: url('../../images/seasons/halloween-bats.svg') !important;
    background-repeat: no-repeat !important;
    background-position: right bottom 18px !important;
}

/* A bounded, decorative layer that never intercepts clicks or changes layout. */
html[data-season="halloween"] .halloween-effects {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    z-index: 1040;
    contain: strict;
}
html[data-season="halloween"] .halloween-effects * { pointer-events: none; }
.halloween-bat {
    position: absolute;
    left: 0;
    top: var(--bat-altitude);
    width: var(--bat-size);
    height: calc(var(--bat-size) * .54);
    color: #201023;
    filter: drop-shadow(0 0 1px #c797ce) drop-shadow(0 3px 4px #0009);
    animation: halloween-flight var(--bat-duration) linear var(--bat-delay) infinite;
    will-change: transform;
}
.halloween-bat svg { width: 100%; height: 100%; overflow: visible; }
.halloween-bat--1 { animation-direction: reverse; }
.halloween-bat--2 { animation-name: halloween-flight-low; }
.halloween-wing {
    transform-box: view-box;
    transform-origin: 50% 42%;
    animation: halloween-wingbeat var(--wing-duration) ease-in-out infinite alternate;
}
.halloween-wing-right { animation-delay: -.07s; }
@keyframes halloween-flight {
    0% { transform: translate(-15vw, 4vh) rotate(-14deg) scale(.7); opacity: 0; }
    8% { opacity: .8; }
    25% { transform: translate(20vw, -8vh) rotate(12deg) scale(.9); }
    48% { transform: translate(49vw, 12vh) rotate(-18deg) scale(1.1); }
    72% { transform: translate(80vw, -5vh) rotate(8deg) scale(.85); }
    92% { opacity: .8; }
    100% { transform: translate(115vw, 8vh) rotate(-10deg) scale(.65); opacity: 0; }
}
@keyframes halloween-flight-low {
    0% { transform: translate(115vw, 12vh) rotate(12deg) scale(.65); opacity: 0; }
    8% { opacity: .75; }
    30% { transform: translate(78vw, -10vh) rotate(-15deg) scale(1); }
    55% { transform: translate(44vw, 8vh) rotate(18deg) scale(.85); }
    78% { transform: translate(17vw, -12vh) rotate(-8deg) scale(1.1); }
    92% { opacity: .75; }
    100% { transform: translate(-15vw, 4vh) rotate(12deg) scale(.7); opacity: 0; }
}
@keyframes halloween-wingbeat {
    from { transform: scale(1, 1); }
    to { transform: scale(.62, .25); }
}

.halloween-witch {
    position: absolute;
    left: 0;
    top: var(--witch-altitude);
    width: var(--witch-size);
    height: calc(var(--witch-size) * .62);
    color: #201023;
    filter: drop-shadow(0 0 1px #c797ce) drop-shadow(0 4px 5px #0008);
    animation: halloween-witch-flight var(--witch-duration) linear var(--witch-delay) infinite;
    will-change: transform;
}
.halloween-witch svg { width: 100%; height: 100%; overflow: visible; }
.halloween-witch--1 { animation-direction: reverse; }
.halloween-witch--1 svg { transform: scaleX(-1); }
.halloween-witch-cape {
    transform-box: fill-box;
    transform-origin: right top;
    animation: halloween-cape-flutter .8s ease-in-out infinite alternate;
}
@keyframes halloween-witch-flight {
    0% { transform: translate(-20vw, 6vh) rotate(-7deg) scale(.85); opacity: 0; }
    8% { opacity: .9; }
    24% { transform: translate(12vw, -4vh) rotate(3deg) scale(.95); }
    47% { transform: translate(46vw, 7vh) rotate(-5deg) scale(1); }
    70% { transform: translate(79vw, -6vh) rotate(2deg) scale(.9); }
    92% { opacity: .9; }
    100% { transform: translate(120vw, 2vh) rotate(-6deg) scale(.8); opacity: 0; }
}
@keyframes halloween-cape-flutter {
    from { transform: skewY(-4deg) scaleY(.9); }
    to { transform: skewY(5deg) scaleY(1.06); }
}

html[data-season="halloween"] :is(.sidebar-menu a.nav-link, .app-header a.nav-link, .app-header a.dropdown-item, a.torrent-name-link, a.home-torrent-title, a.torrent-title, .recommended-name a):is(:hover, :focus-visible) {
    text-shadow: 0 2px 9px rgb(213 22 48 / .65);
    box-shadow: inset 0 -2px 0 #b71c33;
}
.halloween-blood {
    position: absolute;
    height: 40px;
    color: #bd1630;
    filter: drop-shadow(0 1px 1px #460411) drop-shadow(0 0 3px #ec234d55);
}
.halloween-blood svg { display: block; width: 100%; height: 100%; fill: currentColor; overflow: visible; }
.halloween-blood-smear { transform-origin: left top; animation: halloween-smear .25s ease-out both; }
.halloween-drip {
    transform-origin: center 4px;
    animation: halloween-drip .95s cubic-bezier(.23, .6, .42, 1) both;
}
.halloween-drip:nth-child(3) { animation-delay: .14s; }
.halloween-drip:nth-child(4) { animation-delay: .06s; }
.halloween-drip:nth-child(5) { animation-delay: .22s; }
.halloween-drip:nth-child(6) { animation-delay: .1s; }
.halloween-blood--leaving { animation: halloween-blood-fade .75s ease-in forwards; }
@keyframes halloween-smear { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes halloween-drip { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes halloween-blood-fade { to { opacity: 0; transform: translateY(9px); } }
.halloween-effects--paused :is(.halloween-bat, .halloween-wing, .halloween-witch, .halloween-witch-cape, .halloween-drip, .halloween-blood) { animation-play-state: paused; }
html[data-season="halloween"] .halloween-scarecrow {
    position: absolute;
    left: 12px;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: clamp(56px, 5.2vw, 80px);
    max-width: calc((100% - 24px) / 2);
    z-index: 1015;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 4px 9px #08030dbb) drop-shadow(0 0 12px #ef8b2822);
}
.halloween-scarecrow::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #030106;
    -webkit-mask: url('../../images/seasons/halloween-scarecrow.svg') center / contain no-repeat;
    mask: url('../../images/seasons/halloween-scarecrow.svg') center / contain no-repeat;
    transform-origin: bottom left;
    transform: translate(18%, -2%) skewX(-16deg) scale(1.25, 1.18);
    opacity: .65;
    filter: blur(1.5px);
    animation: halloween-scarecrow-shadow 9s ease-in-out infinite;
}
.halloween-scarecrow::after {
    content: "";
    position: absolute;
    inset: -15% -50% -5% -10%;
    background: radial-gradient(ellipse at 50% 65%, #cc71351c, transparent 70%);
    z-index: -1;
}
.halloween-scarecrow img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    animation: halloween-scarecrow-flicker 9s step-end infinite;
}
@keyframes halloween-scarecrow-flicker {
    0%, 100% { filter: brightness(.85) saturate(.85); opacity: .95; }
    9%, 44% { filter: brightness(.4) saturate(.6); opacity: .72; }
    20%, 71% { filter: brightness(1.45) saturate(1.1); opacity: 1; }
    29%, 92% { filter: brightness(.65) saturate(.8); opacity: .9; }
    57% { filter: brightness(.28) saturate(.5); opacity: .55; }
    82% { filter: brightness(1.1) saturate(1); opacity: 1; }
}
@keyframes halloween-scarecrow-shadow {
    0%, 100% { transform: translate(18%, -2%) skewX(-16deg) scale(1.25, 1.18); opacity: .6; }
    20%, 71% { transform: translate(24%, -2%) skewX(-23deg) scale(1.4, 1.3); opacity: .85; }
    57% { transform: translate(20%, -2%) skewX(-20deg) scale(1.48, 1.38); opacity: .95; }
    82% { transform: translate(16%, -2%) skewX(-12deg) scale(1.2, 1.12); opacity: .45; }
}
.halloween-scarecrow--paused img,
.halloween-scarecrow--paused::before { animation-play-state: paused; }
html[data-season="halloween"] .app-sidebar:has(> .halloween-scarecrow) .sidebar-wrapper { padding-bottom: 155px; }
.halloween-scarecrow-burst { position: absolute; width: 0; height: 0; }
.halloween-burst-bat {
    position: absolute;
    width: var(--burst-size);
    height: calc(var(--burst-size) * .54);
    color: #201023;
    --wing-duration: .17s;
    filter: drop-shadow(0 0 1px #c797ce) drop-shadow(0 3px 4px #0009);
    animation: halloween-scarecrow-bat-burst var(--burst-duration) ease-out var(--burst-delay) both;
}
.halloween-burst-bat svg { display: block; width: 100%; height: 100%; overflow: visible; }
@keyframes halloween-scarecrow-bat-burst {
    0% { transform: translate(-50%, -50%) scale(.15); opacity: 0; }
    12% { opacity: 1; }
    45% { transform: translate(calc(var(--burst-x) * .5), calc(var(--burst-y) * .6)) rotate(var(--burst-bank)) scale(1); opacity: .95; }
    100% { transform: translate(var(--burst-x), var(--burst-y)) rotate(var(--burst-bank)) scale(.6); opacity: 0; }
}
.halloween-effects--paused .halloween-burst-bat { animation-play-state: paused; }
@media (max-width: 991px) {
    html[data-season="halloween"] .halloween-scarecrow { width: 56px; }
}
@media (max-width: 575px) {
    html[data-season="halloween"] .halloween-scarecrow { width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .halloween-effects { display: none; }
    .halloween-scarecrow img { animation: none; filter: brightness(.95); opacity: 1; }
    .halloween-scarecrow::before { animation: none; opacity: .55; }
}
