/* ==========================================================
   Новогоднее оформление (поверх site.css и dashboard.css)
   Только CSS/SVG, без внешних ресурсов.
   Анимации включаются классом .fx-on на <html> (festive.js):
   его нет при prefers-reduced-motion и при выключенных эффектах.
   ========================================================== */
:root {
  --fest-night-1: #061c47;
  --fest-night-2: #0b3170;
  --fest-night-3: #14509e;
  --fest-gold: #ffd45e;
  --fest-red: #ff6b7a;
  --fest-ice: #5fd4ff;
  --fest-page: #edf4fc;      /* цвет страницы под шапкой — совпадает с краем холмов */
  --fest-page-end: #e8f1fb;  /* и перед подвалом */
}

[hidden] { display: none !important; }

/* ---------- снегопад ---------- */
.snow-canvas { position: fixed; z-index: 40; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- фон страницы под шапкой ---------- */
body.page-public {
  background-color: var(--fest-page);
  background-image:
    url("../img/page-pattern.54f10c79082f.svg"),
    radial-gradient(ellipse 520px 420px at 10% 16%, rgba(95, 212, 255, .12), transparent 70%),
    radial-gradient(ellipse 460px 360px at 90% 30%, rgba(255, 212, 94, .09), transparent 72%),
    radial-gradient(ellipse 620px 500px at 6% 58%, rgba(79, 149, 240, .13), transparent 70%),
    radial-gradient(ellipse 560px 440px at 94% 74%, rgba(185, 139, 255, .07), transparent 72%),
    radial-gradient(ellipse 520px 380px at 48% 88%, rgba(255, 190, 120, .06), transparent 70%),
    linear-gradient(180deg,
      var(--fest-page) 0,
      var(--fest-page) 360px,
      #e4eef9 38%,
      #e7edf6 60%,
      #eef3fa 82%,
      var(--fest-page-end) 100%);
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: 400px 480px, auto, auto, auto, auto, auto, auto;
  background-attachment: scroll;
}

/* ==========================================================
   ШАПКА: ночное небо, гирлянда, холмы
   ========================================================== */
.hero { position: sticky; top: 0; z-index: 0; isolation: isolate; padding: 28px 0 46px; color: #fff; }

/* Контент подтягивается поверх неподвижной шапки */
.page-sheet {
  position: relative;
  z-index: 1;
  display: flow-root;
  background-color: inherit;
  background-image: inherit;
  background-repeat: inherit;
  background-size: inherit;
  background-attachment: inherit;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -18px 40px rgba(6, 20, 56, .22);
}
.hero-sky {
  position: absolute; z-index: -1; inset: 0; overflow: hidden;
  background:
    radial-gradient(ellipse 520px 260px at 82% 8%, rgba(95, 212, 255, .20), transparent 70%),
    radial-gradient(ellipse 620px 300px at 12% 100%, rgba(255, 190, 120, .20), transparent 70%),
    linear-gradient(180deg, var(--fest-night-1) 0%, var(--fest-night-2) 52%, var(--fest-night-3) 100%);
}
.hero-moon {
  position: absolute; top: 96px; left: 49%; width: 46px; height: 46px; border-radius: 50%;
  box-shadow: inset -13px -3px 0 0 #fff4cf, 0 0 38px 5px rgba(255, 244, 207, .22);
  transform: rotate(-12deg);
}
.hero-stars { position: absolute; inset: 0; }
.star { position: absolute; display: block; border-radius: 50%; background: #fff; opacity: .7; }
svg.star { border-radius: 0; background: none; color: #fff6d9; fill: currentColor; opacity: .85; }
.fx-on .star { animation: star-twinkle 4s ease-in-out infinite; }
@keyframes star-twinkle { 0%, 100% { opacity: .25; transform: scale(.75); } 50% { opacity: 1; transform: scale(1.1); } }

/* холмы по нижнему краю шапки */
.hero-hills { position: absolute; z-index: 1; right: 0; bottom: -1px; left: 0; display: block; width: 100%; height: 68px; pointer-events: none; }
.hero-hills .hill-back { fill: #2d63ad; opacity: .6; }
.hero-hills .hill-mid { fill: #8fb5e3; opacity: .85; }
.hero-hills .hill-front { fill: var(--fest-page); }
.hero-hills .hill-crest { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; opacity: .9; }

/* шапка на тёмном: переопределяем цвета site.css */
.hero .brand-mark { filter: brightness(0) invert(1); }
.hero .topbar { border-bottom-color: rgba(255, 255, 255, .16); }
.hero .topnav a { color: #e3eeff; }
.hero .topnav a:hover { background: rgba(255, 255, 255, .14); }
.hero .event-chip { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .12); color: #fff; backdrop-filter: blur(6px); }
.hero .live-dot { background: var(--fest-gold); box-shadow: 0 0 0 4px rgba(255, 212, 94, .25); }
.hero :where(a, button):focus-visible { outline-color: var(--fest-gold); }

.hero-kicker { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; color: var(--fest-gold); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero-kicker svg { width: 13px; height: 13px; fill: currentColor; }
.hero h1 { color: #fff; text-shadow: 0 2px 26px rgba(120, 190, 255, .5); }
.hero .intro-text { color: #d6e4fb; }
.hero .intro-meta { color: #d6e4fb; }
.hero .intro-meta strong { color: #fff; }
.hero .intro-side .intro-meta { margin-top: -2px; }
.hero .meta-icon { background: rgba(255, 255, 255, .14); color: #fff; }

/* лента недель на тёмном */
.hero .week-dots li { color: #b3c9ec; }
.hero .week-dots li::before { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .12); }
.hero .week-dots li::after { background: rgba(255, 255, 255, .3); }
.hero .week-dots li.past::before { border-color: var(--fest-ice); background: var(--fest-ice); }
.hero .week-dots li.past::after, .hero .week-dots li.active::after { background: var(--fest-ice); }
.hero .week-dots li.active { color: #fff; }
.hero .week-dots li.active::before { border-color: var(--fest-gold); background: var(--fest-gold); box-shadow: 0 0 0 4px rgba(255, 212, 94, .28); }

/* карточка модификатора: светлое стекло со звездой */
.hero .week-mod { position: relative; color: var(--brand-ink); border-color: rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .93); box-shadow: 0 14px 36px rgba(0, 12, 48, .35); }
.hero .week-mod::after { content: ''; position: absolute; top: 8px; right: 10px; width: 12px; height: 12px; background: #f0b429; -webkit-mask: url("../img/star.0fcf54b77d75.svg") center / contain no-repeat; mask: url("../img/star.0fcf54b77d75.svg") center / contain no-repeat; }
.hero .mod-body strong { color: var(--brand-ink); }
.hero .mod-body small { color: var(--brand-text); }
.hero .mod-badge { background: radial-gradient(circle at 35% 30%, #8cc0ff, var(--brand)); box-shadow: 0 0 0 4px rgba(0, 160, 223, .18), 0 0 0 7px rgba(255, 212, 94, .35); }

/* открытка сообщества: светлое стекло, снежная шапка и звезда */
.hero .community-card {
  position: relative;
  overflow: clip;
  overflow-clip-margin: 8px;
  color: var(--brand-ink);
  border-color: rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 14px 36px rgba(0, 12, 48, .35);
}
.hero .community-card::before {
  content: ''; position: absolute; z-index: 1; top: -7px; right: 0; left: 0; height: 24px;
  background: url("../img/snowcap.5bb6a91417bc.svg") repeat-x left top / 160px 24px;
  filter: drop-shadow(0 2px 2px rgba(0, 20, 60, .25));
  pointer-events: none;
}
.hero .community-card::after {
  content: ''; position: absolute; top: 12px; right: 14px; width: 12px; height: 12px;
  background: #f0b429;
  -webkit-mask: url("../img/star.0fcf54b77d75.svg") center / contain no-repeat; mask: url("../img/star.0fcf54b77d75.svg") center / contain no-repeat;
}
.hero .community-slogan { color: var(--brand-ink); }
.hero .community-join { box-shadow: 0 6px 16px rgba(0, 12, 48, .2); }
.hero .community-qr:focus-visible { outline: 2px solid var(--fest-gold); outline-offset: 3px; }

/* кнопка эффектов */
.fx-toggle { flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; transition: background .2s, color .2s; }
.fx-toggle svg { width: 20px; height: 20px; fill: none; }
.fx-toggle:hover { background: rgba(255, 255, 255, .24); }
.fx-toggle[aria-pressed="false"] { color: #aac2e8; }
.fx-toggle[aria-pressed="false"]::after { content: ''; position: absolute; width: 22px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-45deg); }
.fx-toggle { position: relative; }

/* ---------- обратный отсчёт ---------- */
.countdown { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 0 0 16px; }
.cd-title { color: var(--fest-gold); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.cd-cells { display: flex; gap: 8px; }
.cd-cell { min-width: 62px; padding: 9px 8px 8px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 14px; text-align: center; background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .07)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 8px 20px rgba(0, 10, 40, .25); backdrop-filter: blur(8px); }
.cd-cell b { display: block; color: #fff; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.cd-cell small { display: block; margin-top: 5px; color: #c4d8f6; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.countdown.is-done .cd-cells { display: none; }
.countdown.is-done .cd-title { font-size: 15px; letter-spacing: .04em; text-transform: none; }

/* ---------- гирлянда ---------- */
.fest-garland { position: absolute; z-index: 2; top: 0; right: 0; left: 0; height: 56px; pointer-events: none; }
.fest-garland svg { display: block; overflow: visible; }
.bulb-glow { opacity: .55; }
.fx-on .bulb-glow { animation: bulb-twinkle 3s ease-in-out infinite; }
.fx-on .b1 .bulb-glow { animation-duration: 2.3s; animation-delay: -.7s; }
.fx-on .b2 .bulb-glow { animation-duration: 3.7s; animation-delay: -1.9s; }
.fx-on .b3 .bulb-glow { animation-duration: 2.8s; animation-delay: -1.2s; }
@keyframes bulb-twinkle { 0%, 100% { opacity: .2; } 45% { opacity: 1; } }
.bauble { transform-origin: 0 0; }
.fx-on .bauble { animation: bauble-swing 5s ease-in-out infinite; }
@keyframes bauble-swing { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

/* ==========================================================
   ОБЩИЕ ЭЛЕМЕНТЫ СТРАНИЦЫ
   ========================================================== */
/* заголовки разделов */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ''; flex: none; width: 15px; height: 15px; background: currentColor; -webkit-mask: url("../img/flake.992faf3b53cc.svg") center / contain no-repeat; mask: url("../img/flake.992faf3b53cc.svg") center / contain no-repeat; }
.section-heading h2::after { content: ''; display: block; width: 64px; height: 4px; margin-top: 10px; border-radius: 4px; background: linear-gradient(90deg, var(--fest-red), var(--fest-gold) 35%, var(--fest-ice) 70%, #b98bff); }

/* разделитель секций — тонкая гирлянда */
.fest-divider { display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 42px auto -14px; color: #7fb4e8; }
.fest-divider::before, .fest-divider::after {
  content: ''; flex: 1; height: 8px; border-radius: 99px;
  background-image:
    radial-gradient(circle closest-side, var(--fest-gold) 58%, transparent 62%),
    radial-gradient(circle closest-side, var(--fest-ice) 58%, transparent 62%),
    linear-gradient(90deg, transparent, rgba(0, 114, 176, .2) 25%, rgba(255, 212, 94, .25) 50%, rgba(0, 114, 176, .2));
  background-size: 32px 8px, 32px 8px, auto 2px;
  background-position: 0 50%, 16px 50%, 0 50%;
  background-repeat: repeat-x, repeat-x, no-repeat;
}
.fest-divider::after { transform: scaleX(-1); }
.fest-divider .div-flake { width: 26px; height: 26px; fill: none; color: #5aa9e6; }
.fest-divider .div-star { width: 11px; height: 11px; fill: currentColor; color: #f0b429; }
.fest-divider .div-orn { width: 14px; height: 16px; }

/* стеклянные панели и снежные шапки */
.tree-panel, .control-panel, .board-card {
  position: relative;
  border-color: rgba(255, 255, 255, .95);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 18px 50px rgba(20, 60, 120, .12), inset 0 1px 0 #fff;
  backdrop-filter: blur(12px) saturate(1.15);
}
.tree-panel, .control-panel, .board-card {
  overflow: clip;
  overflow-clip-margin: 8px;
}
.tree-panel::before, .control-panel::before, .board-card::before {
  content: ''; position: absolute; z-index: 3; top: -7px; right: 0; left: 0; height: 24px;
  background: url("../img/snowcap.5bb6a91417bc.svg") repeat-x left top / 160px 24px;
  filter: drop-shadow(0 2px 2px rgba(60, 110, 170, .3));
  pointer-events: none;
}
.board thead th:first-child { border-top-left-radius: 19px; }
.board thead th:last-child { border-top-right-radius: 19px; }
.board-more { border-radius: 0 0 19px 19px; }

/* крупные бледные снежинки на фоне */
body.page-public main { position: relative; }
body.page-public main::before, body.page-public main::after {
  content: ''; position: absolute; z-index: -1; width: 280px; height: 280px; pointer-events: none;
  background: rgba(0, 114, 176, .08);
  -webkit-mask: url("../img/flake.992faf3b53cc.svg") center / contain no-repeat; mask: url("../img/flake.992faf3b53cc.svg") center / contain no-repeat;
}
body.page-public main::before { top: 700px; left: -24px; transform: rotate(12deg); }
body.page-public main::after { top: 1500px; right: -24px; width: 340px; height: 340px; transform: rotate(-8deg); }

/* редкие звёзды по краям полей, не под карточками */
.page-body { position: relative; }
.page-ornaments {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.page-ornaments .orn { position: absolute; display: block; }
.page-ornaments .orn-star { width: 13px; height: 13px; color: #e0b33a; fill: currentColor; opacity: .5; }
.page-body > .page-shell { position: relative; z-index: 1; }
.page-ornaments .orn-l2 { top: 31%; left:  max(22px, calc(50% - 628px)); }
.page-ornaments .orn-r1 { top: 15%; right: max(20px, calc(50% - 632px)); }
.fx-on .page-ornaments .orn-star { animation: star-twinkle 5.4s ease-in-out infinite; }
.fx-on .page-ornaments .orn-l2 { animation-delay: .8s; }
.fx-on .page-ornaments .orn-r1 { animation-delay: 1.6s; }

/* карточки леса: звезда на выбранной ёлке и при наведении */
.tree-card { position: relative; background: rgba(255, 255, 255, .82); }
.tree-card::after {
  content: ''; position: absolute; top: 16px; right: 16px; width: 18px; height: 18px; background: #f0b429; opacity: 0;
  transform: scale(.3) rotate(-60deg); transition: opacity .25s, transform .3s;
  -webkit-mask: url("../img/star.0fcf54b77d75.svg") center / contain no-repeat; mask: url("../img/star.0fcf54b77d75.svg") center / contain no-repeat;
}
.tree-card:hover::after, .tree-card:focus-visible::after, .tree-card[aria-current="true"]::after { opacity: 1; transform: none; }
.tree-card:hover { border-color: #f3d78a; }

/* рейтинг: топ-3 с шарами, оттенки строк */
.medal-orn { width: 17px; height: 20px; margin: -2px 0 0 9px; vertical-align: middle; transform-origin: 50% 0; }
.board tbody tr.medal-1 { background: linear-gradient(90deg, rgba(255, 214, 102, .30), rgba(255, 214, 102, 0) 65%); }
.board tbody tr.medal-2 { background: linear-gradient(90deg, rgba(190, 203, 222, .32), rgba(190, 203, 222, 0) 65%); }
.board tbody tr.medal-3 { background: linear-gradient(90deg, rgba(217, 154, 95, .24), rgba(217, 154, 95, 0) 65%); }
.board tbody tr.medal.is-selected { background: #e8f3fd; }
.medal-1 .place { box-shadow: 0 0 0 3px rgba(246, 196, 67, .38); }
.medal-2 .place { box-shadow: 0 0 0 3px rgba(173, 187, 207, .4); }
.medal-3 .place { box-shadow: 0 0 0 3px rgba(217, 154, 95, .35); }
.place { transition: transform .25s ease, background-color .2s; }
.board tbody tr:hover .place { transform: scale(1.12) rotate(-6deg); }
.board tbody tr:hover .medal-orn { animation: bauble-swing 1.1s ease-in-out 2; }
.board tbody tr:hover { background: #f2f8ff; }
.board tbody tr.medal-1:hover { background: linear-gradient(90deg, rgba(255, 214, 102, .46), rgba(255, 214, 102, .04) 70%); }
.board tbody tr.medal-2:hover { background: linear-gradient(90deg, rgba(190, 203, 222, .5), rgba(190, 203, 222, .04) 70%); }
.board tbody tr.medal-3:hover { background: linear-gradient(90deg, rgba(217, 154, 95, .4), rgba(217, 154, 95, .04) 70%); }

/* ==========================================================
   ПОДВАЛ: ночь, холмы и ёлки
   ========================================================== */
.site-footer { position: relative; display: block; overflow: visible; margin-top: 96px; padding: 0; border-top: 0; color: #cfe0f7; background: linear-gradient(180deg, #0a2d69, #061c47); }
.footer-hills { position: absolute; right: 0; bottom: calc(100% - 1px); left: 0; display: block; width: 100%; height: 64px; pointer-events: none; }
.footer-hills .hill-back { fill: #1b4d94; }
.footer-hills .hill-front { fill: #0a2d69; }
.footer-pines { position: absolute; right: 0; bottom: calc(100% + 8px); left: 0; height: 70px; background: url("../img/pines.b12b4dcd5133.svg") repeat-x center bottom / 480px 70px; opacity: .9; pointer-events: none; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 22px; padding-bottom: 28px; overflow: visible; font-size: 13px; }
.footer-wish { display: inline-flex; align-items: center; gap: 8px; color: var(--fest-gold); font-weight: 700; }
.footer-wish svg { width: 11px; height: 11px; fill: currentColor; }

/* ==========================================================
   ВХОД В ДАШБОРД: ночное небо
   ========================================================== */
.login-page { position: relative; isolation: isolate; background: linear-gradient(180deg, var(--fest-night-1), var(--fest-night-2) 58%, var(--fest-night-3)); }
.login-sky { position: fixed; z-index: -1; inset: 0; overflow: hidden; background: radial-gradient(ellipse 600px 300px at 80% 6%, rgba(95, 212, 255, .18), transparent 70%); }
.login-page .fest-garland { position: fixed; }
.login-hills { position: fixed; z-index: 0; right: 0; bottom: -1px; left: 0; display: block; width: 100%; height: 110px; pointer-events: none; }
.login-hills .hill-back { fill: #2d63ad; opacity: .6; }
.login-hills .hill-mid { fill: #8fb5e3; opacity: .85; }
.login-hills .hill-front { fill: var(--fest-page); }
.login-hills .hill-crest { fill: none; stroke: #fff; stroke-width: 3; opacity: .9; }
.login-wrap { position: relative; z-index: 1; }
.login-card { position: relative; overflow: clip; overflow-clip-margin: 8px; background: rgba(255, 255, 255, .98); }
.login-card::before { content: ''; position: absolute; z-index: 1; top: -7px; right: 0; left: 0; height: 24px; background: url("../img/snowcap.5bb6a91417bc.svg") repeat-x left top / 160px 24px; filter: drop-shadow(0 2px 2px rgba(0, 20, 60, .25)); pointer-events: none; }
.login-card h1::after { content: ''; display: block; width: 56px; height: 4px; margin-top: 10px; border-radius: 4px; background: linear-gradient(90deg, var(--fest-red), var(--fest-gold) 35%, var(--fest-ice) 70%, #b98bff); }

/* ==========================================================
   ДАШБОРД: лёгкие акценты
   ========================================================== */
.dash-top { position: sticky; }
.dash-top::before { content: ''; position: absolute; top: 0; right: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--fest-red), var(--fest-gold), var(--fest-ice), #b98bff, #7be3a5, var(--fest-red)); }
.dash-top .fest-garland { top: 100%; height: 36px; }
.dash-brand span::after { content: ''; display: inline-block; width: 11px; height: 11px; margin-left: 9px; background: #f0b429; -webkit-mask: url("../img/star.0fcf54b77d75.svg") center / contain no-repeat; mask: url("../img/star.0fcf54b77d75.svg") center / contain no-repeat; }

/* ==========================================================
   АДАПТИВ
   ========================================================== */
@media (min-width: 851px) {
  .hero { padding: 28px 0 50px; }
  .hero .intro { padding: 14px 0 10px; }
  .hero .intro-text { margin-bottom: 14px; }
  .hero h1 { margin-bottom: 8px; }
  .countdown { margin-bottom: 12px; }
  .hero .community-card { padding-top: 24px; }
  .workspace { padding-top: 20px; }
}

@media (max-width: 1399px) {
  .page-ornaments { display: none; }
}

@media (max-width: 850px) {
  .hero-moon { display: none; }
  .fest-divider { margin-top: 34px; max-width: 420px; }
  body.page-public main::before, body.page-public main::after { display: none; }
  .hero .community-card { padding-top: 24px; }
}

@media (max-width: 600px) {
  .hero { padding: 26px 0 40px; }
  .hero .topbar { gap: 10px; }
  .hero .intro { padding-top: 20px; }
  .hero-kicker { font-size: 11px; letter-spacing: .1em; }
  .hero .community-card { padding-top: 24px; }
  .hero .community-card::after { top: 14px; right: 12px; width: 12px; height: 12px; }
  .cd-cells { gap: 6px; }
  .cd-cell { min-width: 56px; padding: 8px 6px 7px; border-radius: 12px; }
  .cd-cell b { font-size: 24px; }
  .hero-hills { height: 46px; }
  .fest-divider { margin: 30px auto -8px; max-width: 280px; }
  .section-heading h2::after { width: 52px; margin-top: 8px; }
  .site-footer { margin-top: 86px; }
  .footer-hills { height: 40px; }
  .footer-pines { height: 56px; background-size: 384px 56px; bottom: calc(100% + 6px); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .medal-orn { width: 15px; height: 18px; margin-left: 6px; }
  .login-hills { height: 70px; }
}

/* на случай, если движение не нужно: ничего не крутится и не мерцает */
@media (prefers-reduced-motion: reduce) {
  .snow-canvas { display: none; }
  .star, .bulb-glow, .bauble, .medal-orn, .page-ornaments .orn { animation: none !important; }
  .tree-card::after, .place { transition: none; }
}
