/* Independent seasonal layer. Existing layout, colours, and components stay intact. */
.ny-garland {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 79px;
    pointer-events: none;
    background: url('garland.webp') left top / auto 74px repeat-x;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    animation: ny-lights 5s ease-in-out infinite alternate;
}

.ny-enabled .brand-badge {
    position: relative;
}

.ny-enabled .brand-badge::after {
    content: '';
    position: absolute;
    top: -9px;
    right: -12px;
    width: 33px;
    height: 29px;
    background: url('hat.svg') center / contain no-repeat;
    transform: rotate(-8deg);
    pointer-events: none;
}

/* Paint the background directly on the page, not as a covering element.
   Header, sidebar, content and modal positioning remain in the base CSS. */
body.ny-enabled {
    background-color: #11182b;
    background-image:
        radial-gradient(ellipse at 15% 78%, rgba(42, 84, 153, .23), transparent 45%),
        radial-gradient(ellipse at 95% 78%, rgba(42, 84, 153, .23), transparent 45%),
        linear-gradient(180deg, #11182b, #10172c 52%, #101829);
    background-attachment: fixed;
}

.ny-scene {
    --ny-space: max(0px, calc((100vw - var(--sidebar-w) - 1180px) / 2));
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    width: min(360px, var(--ny-space));
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ny-scene::before,
.ny-scene::after {
    content: '';
    position: absolute;
    inset: 0;
}

.ny-scene-left {
    left: var(--sidebar-w);
}

.ny-scene-left::before {
    background-image: url('greeting.webp'), url('winter-village.webp');
    background-repeat: no-repeat, no-repeat;
    background-size: 90% auto, 100% auto;
    background-position: center 24px, center bottom;
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 70%, rgba(0,0,0,.82) 82%, transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 70%, rgba(0,0,0,.82) 82%, transparent 100%);
}

.ny-scene-right {
    right: 0;
}

.ny-scene-right::before {
    background-image: url('corner.webp'), url('christmas-tree.webp');
    background-repeat: no-repeat, no-repeat;
    background-size: 96% auto, 92% auto;
    background-position: center top, center bottom;
    -webkit-mask-image: linear-gradient(to left, #000 0%, #000 70%, rgba(0,0,0,.82) 82%, transparent 100%);
    mask-image: linear-gradient(to left, #000 0%, #000 70%, rgba(0,0,0,.82) 82%, transparent 100%);
}

.ny-scene::after {
    inset: -252px 0 0;
    background-image: radial-gradient(circle, #fff 0 1px, transparent 1.6px), radial-gradient(circle, #b7d3ff 0 1.5px, transparent 2px);
    background-size: 63px 84px, 105px 126px;
    background-position: 11px 14px, 43px 38px;
    opacity: .40;
    animation: ny-snow 28s linear infinite;
}

.ny-enabled .module-card,
.ny-enabled .stat-card,
.ny-enabled .sidebar-footer {
    position: relative;
}

.ny-enabled .module-card::before,
.ny-enabled .stat-card::before,
.ny-enabled .sidebar-footer::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 18px;
    z-index: 3;
    background: url('snow-1.webp') center top / 100% 100% no-repeat;
    pointer-events: none;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .24));
}

.ny-enabled .module-card:nth-child(3n + 2)::before,
.ny-enabled .stat-card:nth-child(3n + 2)::before {
    background-image: url('snow-2.webp');
}

.ny-enabled .module-card:nth-child(3n)::before,
.ny-enabled .stat-card:nth-child(3n)::before {
    background-image: url('snow-3.webp');
}

.ny-enabled .module-card:nth-child(4n)::before {
    background-size: 100.6% 100%;
    background-position: center top;
}

.ny-enabled .stat-card::before {
    left: -1px;
    right: -1px;
    top: -1px;
    height: 18px;
}

.ny-enabled .sidebar-footer::before {
    left: 0;
    right: 0;
    top: 0;
    height: 15px;
}

.ny-enabled .module-cover::after {
    background: url('flakes.svg') center / 100% 100% no-repeat, linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .22));
}

@keyframes ny-lights {
    from { filter: brightness(.95); }
    to { filter: brightness(1.17) saturate(1.07); }
}

@keyframes ny-snow {
    from { transform: translateY(0); }
    to { transform: translateY(252px); }
}

@media (max-width: 1840px) {
    .ny-scene {
        width: min(320px, var(--ny-space));
    }

    .ny-scene-left::before {
        background-size: 92% auto, 100% auto;
    }

    .ny-scene-right::before {
        background-size: 97% auto, 95% auto;
    }
}

@media (max-width: 1660px) {
    .ny-scene {
        width: min(260px, var(--ny-space));
    }

    .ny-scene-left::before {
        background-size: 94% auto, 100% auto;
    }

    .ny-scene-right::before {
        background-size: 100% auto, 100% auto;
    }
}

@media (max-width: 1600px) {
    .ny-scene {
        display: none;
    }

}

@media (max-width: 860px) {
    .ny-garland {
        height: 58px;
        background-size: auto 54px;
    }

    body.ny-enabled {
        background-attachment: scroll;
    }

}

@media (max-width: 680px) {
    .ny-enabled .module-card::before,
    .ny-enabled .stat-card::before,
    .ny-enabled .sidebar-footer::before {
        height: 14px;
    }
}

/* Dedicated panoramic artwork for ultrawide desktop viewports. */
@media (min-width: 2400px) and (min-aspect-ratio: 2/1) {
    body.ny-enabled {
        background-image: url('ultrawide-compact.webp'), url('ultrawide-2560.webp');
        background-size: calc(100% - var(--sidebar-w)) calc(100% - var(--header-h));
        background-position: right bottom;
        background-repeat: no-repeat;
    }

    .ny-scene {
        width: var(--ny-space);
    }

    .ny-scene::before {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ny-garland,
    .ny-scene::after {
        animation: none;
    }
}

@media print {
    body.ny-enabled { background: none !important; }
    .ny-garland,
    .ny-scene,
    .ny-enabled .brand-badge::after,
    .ny-enabled .module-card::before,
    .ny-enabled .stat-card::before,
    .ny-enabled .sidebar-footer::before {
        display: none !important;
    }
}
