html.iptv-christmas-active {
    --iptv-christmas-garland-height: 78px;
    --iptv-christmas-garland-side-width: clamp(26px, 2.6vw, 38px);
    --iptv-christmas-top-clearance: min(80px, 25vh);
}

.iptv-christmas {
    --winter-side: clamp(50px, 14vw, 210px);
    --winter-ink: 7 22 38;
    height: var(--iptv-christmas-garland-height);
}

.iptv-christmas__frame,
.iptv-christmas__snow {
    position: fixed;
    inset: var(--iptv-christmas-top-clearance) 0 0;
    pointer-events: none;
}

.iptv-christmas__frame {
    z-index: 7;
    background:
        linear-gradient(90deg, rgb(var(--winter-ink) / 27%), transparent var(--winter-side), transparent calc(100% - var(--winter-side)), rgb(var(--winter-ink) / 27%)),
        linear-gradient(0deg, rgb(var(--winter-ink) / 30%), transparent 96px);
    mask-image: linear-gradient(transparent, #000 64px);
}

.iptv-christmas__snow {
    z-index: 10;
    display: block;
    width: 100%;
    height: calc(100% - var(--iptv-christmas-top-clearance));
}

.iptv-christmas__garland {
    z-index: 9;
    inset: auto 0 0;
    height: var(--iptv-christmas-garland-height);
    transform: scaleY(-1);
    filter: drop-shadow(0 3px 5px rgb(3 17 23 / 30%));
}

.iptv-christmas__garland,
.iptv-christmas::before,
.iptv-christmas::after {
    position: fixed;
    pointer-events: none;
    background: url(../img/northstar-christmas-bells.webp) center top / auto 100% repeat-x;
}

.iptv-christmas::before,
.iptv-christmas::after {
    z-index: 8;
    top: var(--iptv-christmas-top-clearance);
    width: max(0px, calc(100vh - var(--iptv-christmas-top-clearance) - var(--iptv-christmas-garland-height) + 16px));
    width: max(0px, calc(100dvh - var(--iptv-christmas-top-clearance) - var(--iptv-christmas-garland-height) + 16px));
    height: var(--iptv-christmas-garland-side-width);
    transform-origin: top left;
    mask-image: linear-gradient(90deg, transparent, #000 24px);
    content: "";
}

.iptv-christmas::before {
    left: 0;
    transform: rotate(90deg) scaleY(-1);
}

.iptv-christmas::after {
    left: 100%;
    transform: rotate(90deg);
}

.iptv-christmas-active .iptv-telegram-button {
    bottom: calc(var(--iptv-christmas-garland-height) + max(22px, env(safe-area-inset-bottom)));
}

@media (max-width: 767px) {
    html.iptv-christmas-active {
        --iptv-christmas-garland-height: 55px;
        --iptv-christmas-garland-side-width: 20px;
        --iptv-christmas-top-clearance: min(68px, 25vh);
    }
}

@media (max-width: 480px) {
    .iptv-christmas-active .iptv-telegram-button {
        bottom: calc(var(--iptv-christmas-garland-height) + max(14px, env(safe-area-inset-bottom)));
    }
}

@media (max-height: 420px) {
    html.iptv-christmas-active { --iptv-christmas-garland-height: 36px; }
}
