.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: -14px;
    left: 8px;
    width: 38px;
    height: 29px;
    background: url('hat.svg?v=1.2.0') center / contain no-repeat;
    z-index: 1;
    pointer-events: none;
}

body.ny-enabled {
    background-color: #11182b;
    background-image:
        radial-gradient(ellipse at 18% 82%, rgba(47, 73, 115, .32), transparent 44%),
        radial-gradient(ellipse at 92% 82%, rgba(47, 73, 115, .32), transparent 44%),
        linear-gradient(180deg, #11182b, #10172c 52%, #172841);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

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

.ny-scene-left {
    left: var(--ny-sidebar);
    background: url('greeting-cutout.png') center top 26px / min(250px, 82%) auto no-repeat;
}

.ny-scene-right {
    right: 0;
    background: url('corner.webp') right top / min(100%, clamp(100px, 14vw, 300px)) auto no-repeat;
}

.ny-scene::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('winter-distance.svg') center bottom / 100% 74% no-repeat;
}

.ny-scene-left::before {
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 30%, rgba(0, 0, 0, .8) 48%, rgba(0, 0, 0, .32) 75%, transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 30%, rgba(0, 0, 0, .8) 48%, rgba(0, 0, 0, .32) 75%, transparent 100%);
}

.ny-scene-right::before {
    -webkit-mask-image: linear-gradient(to left, #000 0%, #000 30%, rgba(0, 0, 0, .8) 48%, rgba(0, 0, 0, .32) 75%, transparent 100%);
    mask-image: linear-gradient(to left, #000 0%, #000 30%, rgba(0, 0, 0, .8) 48%, rgba(0, 0, 0, .32) 75%, transparent 100%);
}

.ny-snow-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

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

.ny-enabled .module-card {
    overflow: visible;
}

.ny-enabled .module-card > a:first-child,
.ny-enabled .module-card > .module-cover,
.ny-enabled .module-card > .cover,
.ny-enabled .module-card > a:first-child > .module-cover,
.ny-enabled .module-card > a:first-child > .cover {
    border-top-left-radius: calc(var(--card-radius, 8px) - 1px);
    border-top-right-radius: calc(var(--card-radius, 8px) - 1px);
}

.ny-enabled .module-card::before,
.ny-enabled .stat-card::before {
    content: '';
    position: absolute;
    left: -3px;
    right: -3px;
    top: auto;
    bottom: calc(100% - 11px);
    height: 22px;
    z-index: 1;
    background: url('snow-mock-card-1.png') center bottom / 100% 100% no-repeat;
    pointer-events: none;
}

.ny-enabled .module-card:nth-child(9n + 2 of .module-card)::before { background-image: url('snow-mock-card-2.png'); }
.ny-enabled .module-card:nth-child(9n + 3 of .module-card)::before { background-image: url('snow-mock-card-3.png'); }
.ny-enabled .module-card:nth-child(9n + 4 of .module-card)::before { background-image: url('snow-mock-card-4.png'); }
.ny-enabled .module-card:nth-child(9n + 5 of .module-card)::before { background-image: url('snow-mock-card-5.png'); }
.ny-enabled .module-card:nth-child(9n + 6 of .module-card)::before { background-image: url('snow-mock-card-6.png'); }
.ny-enabled .module-card:nth-child(9n + 7 of .module-card)::before { background-image: url('snow-mock-card-7.png'); }
.ny-enabled .module-card:nth-child(9n + 8 of .module-card)::before { background-image: url('snow-mock-card-8.png'); }
.ny-enabled .module-card:nth-child(9n + 9 of .module-card)::before { background-image: url('snow-mock-card-9.png'); }

.ny-enabled .stat-card::before {
    background-image: url('snow-mock-stat-1.png');
    height: 15px;
    bottom: calc(100% - 6px);
}
.ny-enabled .stat-card:nth-child(4n + 2 of .stat-card)::before { background-image: url('snow-mock-stat-2.png'); }
.ny-enabled .stat-card:nth-child(4n + 3 of .stat-card)::before { background-image: url('snow-mock-stat-3.png'); }
.ny-enabled .stat-card:nth-child(4n + 4 of .stat-card)::before { background-image: url('snow-mock-stat-4.png'); }

.ny-enabled .sidebar-footer::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: auto;
    bottom: calc(100% - 9px);
    height: 37px;
    z-index: 1;
    background: url('snow-cap-reference.png') center bottom / 100% 100% no-repeat;
    pointer-events: none;
}

.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); }
}

@media (max-width: 1799px) {
    .ny-scene {
        width: max(var(--ny-space), clamp(140px, 22vw, 320px));
    }

    .ny-scene::before {
        opacity: .72;
    }

    .ny-scene-left {
        background: none;
    }

    .ny-enabled .app-body > .content > .container::before {
        content: '';
        display: block;
        width: 100%;
        height: clamp(80px, 12vw, 112px);
        margin: 0 0 12px;
        background: url('greeting-cutout.png') center / contain no-repeat;
        pointer-events: none;
    }
}

@media (max-width: 860px) {
    .ny-scene {
        --ny-sidebar: 0px;
        width: clamp(120px, 44vw, 320px);
    }

    .ny-scene::before {
        opacity: .58;
    }

    .ny-garland {
        height: 58px;
        background-size: auto 54px;
    }

    .ny-enabled .app-body > .content > .container::before {
        height: 92px;
        margin-bottom: 8px;
    }
}

@media (max-width: 680px) {
    .ny-enabled .module-card::before {
        height: 21px;
        bottom: calc(100% - 6px);
    }

    .ny-enabled .stat-card::before {
        height: 14px;
    }

    .ny-enabled .sidebar-footer::before {
        height: 30px;
    }
}

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

    .ny-snow-canvas {
        display: none;
    }
}

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

.ny-garland-animation {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    pointer-events: none;
}

.ny-garland.ny-animated {
    background-image: none;
    animation: none;
}

.ny-garland.ny-animated > .ny-garland-animation {
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .ny-garland.ny-animated {
        background-image: url('garland.webp');
    }

    .ny-garland.ny-animated > .ny-garland-animation {
        display: none;
    }
}
