/* L2MAD holiday layer. Правила сайта меняют п.9 (overflow у .home), п.7–8 (position у кнопок) и п.10 (отступы .home под Санту). */

.christmas-rail{--cont-width:100%;--cont-px:clamp(1rem,1.875vw,1.875rem);position:relative;width:100%;max-width:calc(var(--cont-width) + var(--cont-px)*2);margin:0 auto 0;padding:calc(var(--christmas-header-h,79px) + 6px) var(--cont-px) 0;box-sizing:border-box;z-index:4;pointer-events:none}

/* ---- Снегопад (canvas) ---- */
.christmas-snow{position:fixed;inset:0;z-index:2;display:block;width:100%;height:100%;pointer-events:none!important;user-select:none;opacity:.9}

/* ---- Снежная шапка на блоках (PNG с прозрачным фоном, только декор) ---- */
.christmas-cap{position:relative}
.christmas-cap::before{content:"";position:absolute;z-index:2;top:0;left:0;right:0;aspect-ratio:1186/91;transform:translateY(-44%);pointer-events:none;background:url('/img/christmas/snow-cap.png') center/100% 100% no-repeat}
/* Варианты шапки: a — snow_1 (правый верхний блок и чётные/нечётные видео), b — snow_2 (левый верхний блок). */
.christmas-cap--a::before{background-image:url('/img/christmas/snow-cap-1.png');aspect-ratio:1200/93;transform:translateY(-22%)}
.christmas-cap--b::before{background-image:url('/img/christmas/snow-cap-2.png');aspect-ratio:1200/81;transform:translateY(-29%)}
/* Нижние секции чуть скромнее верхних двух виджетов. */
.christmas-cap--subtle::before{opacity:.8;left:0;right:0}
/* Discord: высота шапки не больше 40px (без max-height — баг Safari с aspect-ratio; 7.67cqw = 91/1186 ширины блока). */
.widget__body.christmas-cap--subtle{container-type:inline-size}
.widget__body.christmas-cap--subtle::before{aspect-ratio:auto;height:min(40px,7.67cqw)}
body > main > div.top-wrapper > div.top > section.info > div > div > div > div:nth-child(1) > div:nth-child(2) > div.widget__body.christmas-cap.christmas-cap--subtle::before{
    opacity: 1;
}


@media(max-width:639px){.christmas-snow{opacity:.75}}
@media(prefers-reduced-motion:reduce){.christmas-snow{display:none!important}}

/* L2MAD — правки новогодней темы. Дописать В КОНЕЦ /css/christmas.css и поднять ?ver= у christmas.css и christmas.js. */

/* Шапки ниже меню шапки (z-index:3) и модальных окон (z-index:5): раньше z-index:5 перекрывал мобильное меню и окно «Как начать играть». */
/* 1. Меню шапки открывается над плашкой (шапка z-index:3, плашка была 4).
      Снег опущен на 1, чтобы не летел поверх плашки; в первом экране снежинки теперь проходят ЗА текстом и кнопкой. */
.christmas-rail{z-index:2}
.christmas-snow{z-index:1}


/* 3. Статус серверов: отступ, чтобы сосульки не касались первой строки (было 14.8px). */
.christmas-cap > .widget-table > .widget-table__inner{padding-top:30px}

/* 4. Telegram и Discord (iframe): сосульки растворяются, снег остаётся, текст не перекрыт. */
.widget__body.christmas-cap--a::before{
  -webkit-mask-image:linear-gradient(#000 40%,transparent 64%);
          mask-image:linear-gradient(#000 40%,transparent 64%)}
.widget__body.christmas-cap--subtle::before{
  -webkit-mask-image:linear-gradient(#000 52%,transparent 74%);
          mask-image:linear-gradient(#000 52%,transparent 74%)}

/* 5. Широкие блоки (одна колонка на экранах уже 1200px). */
/* 5a. Шапка росла вместе с шириной блока (до 50–78px) и закрывала текст → фиксированная высота на ширинах, где шапка выше лимита (42px статус, 30px статистика).
       Без max-height: в Safari связка max-height + aspect-ratio сужает шапку. */
@media (min-width:655px) and (max-width:1199px){
  .widget__body.christmas-cap--b::before{aspect-ratio:auto;height:42px}
}
@media (min-width:412px) and (max-width:655px),(min-width:831px) and (max-width:979px),(min-width:1241px){
  .statistics__row-item.christmas-cap--a::before{aspect-ratio:auto;height:30px}
}
@media (min-width:469px) and (max-width:655px),(min-width:945px) and (max-width:979px){
  .statistics__row-item.christmas-cap--b::before{aspect-ratio:auto;height:30px}
}
/* Новости (Telegram): iframe 500px по центру шире не бывает, а обёртка тянется на всю колонку → на десктопе тоже ужимаем шапку до ширины виджета. */
.widget__body.christmas-cap--a{max-width:500px;margin-left:auto!important;margin-right:auto!important}
/* 5b. Telegram/Discord: обёртка была шире самого виджета, шапка торчала по бокам → обёртка по ширине виджета, по центру. */
@media (max-width:1199px){
  .widget__body.christmas-cap--a,
  .widget__body.christmas-cap--subtle{margin-left:auto!important;margin-right:auto!important}
  .widget__body.christmas-cap--a{max-width:500px}
  .widget__body.christmas-cap--subtle{max-width:568px}
}


/* 7–8. Гирлянды на кнопках «Играть бесплатно» и «Начать играть»: мерцание тремя группами (каждая третья лампочка — своя группа).
   Лампочка плавно гаснет и разгорается; группы сдвинуты на треть цикла, поэтому часть лампочек горит всегда.
   Слои: провод с погашенными лампочками (*-base.png) + три группы горящих (три ряда в одном файле *-groups.png).
   Группы 2 и 3 висят на вложенном элементе кнопки: .home__play-inner и .promo__play > span. */
.home__play,.promo__play{position:relative}
.home__play::before,.home__play::after,.home__play-inner::before,.home__play-inner::after,
.promo__play::before,.promo__play::after,.promo__play > span::before,.promo__play > span::after{
  content:"";position:absolute;z-index:2;pointer-events:none;top:-3px;transform:translateY(-13.333%);
  background-repeat:no-repeat;background-size:100% 300%}

.home__play::before,.home__play::after,.home__play-inner::before,.home__play-inner::after{
  left:calc((100% + 6px) * -0.0327 - 3px);width:calc((100% + 6px) * 1.1444);aspect-ratio:420/150;
  background-image:url('/img/christmas/play-garland-groups.png')}
.home__play::before{background-image:url('/img/christmas/play-garland-base.png');background-size:100% 100%}

.promo__play::before,.promo__play::after,.promo__play > span::before,.promo__play > span::after{
  left:calc((100% + 6px) * -0.1233 - 3px);width:calc((100% + 6px) * 1.2329);aspect-ratio:360/150;
  background-image:url('/img/christmas/promo-garland-groups.png')}
.promo__play::before{background-image:url('/img/christmas/promo-garland-base.png');background-size:100% 100%}

.home__play::after,.promo__play::after{background-position:0 0;animation:garland-twinkle 1.8s ease-in-out infinite}
.home__play-inner::before,.promo__play > span::before{background-position:0 50%;animation:garland-twinkle 1.8s ease-in-out -0.6s infinite}
.home__play-inner::after,.promo__play > span::after{background-position:0 100%;animation:garland-twinkle 1.8s ease-in-out -1.2s infinite}

@keyframes garland-twinkle{0%,100%{opacity:1}50%{opacity:.12}}

@media (prefers-reduced-motion:reduce){
  .home__play::after,.home__play-inner::before,.home__play-inner::after,
  .promo__play::after,.promo__play > span::before,.promo__play > span::after{animation:none;opacity:1}
}

/* 9. Телефоны 360px: страница была шире экрана (гирлянда + пост Telegram). */
.home{overflow-x:clip}
.telegram-post-widget iframe{min-width:0!important}

/* 10. Санта (картинка santa-event.webp 1400x557 + текст поверх таблички).
   Левый край — по левому краю заголовка героя: та же сетка, что у .home__container (max-width 1700px, по центру, поля --cont-px).
   Санта не в потоке: герой стоит как на основном сайте и опускается только настолько, чтобы не наехать на Санту.
   Видимый зазор логотип → Санта = Санта → буквы заголовка = --santa-gap (считается по нарисованным краям, а не по рамкам):
   низ логотипа = низ шапки − её поле --header-py; в картинке сверху 3/557 и снизу 5/557 прозрачно;
   над заглавными буквами в строке заголовка пусто ≈ 0.26 размера шрифта (--quote-fz, шрифт Reaver). */
:root{
  --santa-w:min(340px,calc(100vw - 24px));                 /* телефоны */
  --santa-gap:18px;
  --santa-top:calc(var(--christmas-header-h,79px) - var(--header-py,.4rem) + var(--santa-gap) - var(--santa-w) * 3 / 1400);
  --santa-bottom:calc(var(--santa-top) + var(--santa-w) * 557 / 1400);
  --santa-text-top:calc(var(--santa-bottom) - var(--santa-w) * 5 / 1400 + var(--santa-gap) - var(--quote-fz) * .26)}
/* Брейкпоинты в em — как в style.min.css (40em = 640px, 85.375em = 1366px при шрифте 16px). */
@media (min-width:40em){:root{--santa-w:380px;--santa-gap:24px}}
@media (min-width:85.375em){:root{--santa-w:460px;--santa-gap:30px}}

.christmas-rail--santa{
  --cont-px:inherit;                                        /* поля как у контейнера героя, а не у шапки */
  position:absolute;top:0;left:0;right:0;z-index:2;display:block;
  max-width:1700px;margin:0 auto;padding:var(--santa-top) var(--cont-px) 0;pointer-events:none}
.christmas-santa{position:relative;display:block;width:var(--santa-w);max-width:100%;aspect-ratio:1400/557;box-sizing:border-box;container-type:inline-size;pointer-events:auto}
.christmas-santa__content{position:relative;display:block;width:100%;height:100%;text-decoration:none;color:inherit;-webkit-tap-highlight-color:transparent}
.christmas-santa__image{display:block;width:100%;height:auto;aspect-ratio:1400/557;object-fit:contain}
.christmas-santa__copy{position:absolute;left:25%;top:55%;width:51%;height:21%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;box-sizing:border-box;white-space:nowrap;text-align:center;pointer-events:none;text-shadow:0 1px 2px #1b0200,0 2px 3px #250000;font-family:Georgia,'Times New Roman',serif}
.christmas-santa__title{display:block;font-size:calc(var(--santa-w) * .046);font-size:4.6cqw;line-height:1.12;font-weight:700;color:#ffe0a0}
.christmas-santa__subtitle{display:block;font-size:calc(var(--santa-w) * .0275);font-size:2.75cqw;line-height:1.15;font-weight:600;color:#fff5dd}
.christmas-santa__content[href]:hover .christmas-santa__image,.christmas-santa__content[href]:focus-visible .christmas-santa__image{filter:brightness(1.07)}
.christmas-santa__content:focus-visible{outline:2px solid #f6d9a3;outline-offset:2px;border-radius:8px}

/* Герой: отступ сверху — чтобы буквы заголовка начинались через --santa-gap под Сантой, но не меньше штатного 11.375rem (182px, style.min.css от 40em). */
.home{padding-top:max(11.375rem,var(--santa-text-top))}
/* Телефоны (уже 40em): штатно у .home min-height 456px и центровка содержимого.
   Высота по содержимому, текст сразу под Сантой, снизу 116px — примерно как на основном сайте.
   «not all and (min-width:40em)» — точное дополнение к 40em, без дыры на дробных ширинах 639.x px. */
@media not all and (min-width:40em){
  .home{height:auto;min-height:0;align-items:start;padding-top:var(--santa-text-top);padding-bottom:116px}
}
