/* =========================================================================
   Чарівний Адвент — «ночная сказка»: полуночное индиго, золото, свет свечей,
   бархатные банты. Шрифты локальные (OFL): Cormorant Garamond (заголовки),
   Manrope (текст), Marck Script (логотип).
   ========================================================================= */

/* ---------- шрифты ---------- */
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-cyrillic-ext-600-normal.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 700; font-display: swap; src: url(../fonts/cormorant-garamond-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 700; font-display: swap; src: url(../fonts/cormorant-garamond-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 700; font-display: swap; src: url(../fonts/cormorant-garamond-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 700; font-display: swap; src: url(../fonts/cormorant-garamond-cyrillic-ext-700-normal.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(../fonts/manrope-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(../fonts/manrope-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(../fonts/manrope-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(../fonts/manrope-cyrillic-ext-400-normal.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(../fonts/manrope-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(../fonts/manrope-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(../fonts/manrope-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(../fonts/manrope-cyrillic-ext-600-normal.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(../fonts/manrope-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(../fonts/manrope-latin-ext-800-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(../fonts/manrope-cyrillic-800-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(../fonts/manrope-cyrillic-ext-800-normal.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

@font-face { font-family: 'Marck Script'; font-weight: 400; font-display: swap; src: url(../fonts/marck-script-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Marck Script'; font-weight: 400; font-display: swap; src: url(../fonts/marck-script-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Marck Script'; font-weight: 400; font-display: swap; src: url(../fonts/marck-script-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

/* ---------- токены ---------- */
:root {
  --night0: #060920; --night: #0b1033; --night2: #141b4f; --indigo: #262068;
  --gold: #e8c675; --gold-hi: #f8e6ad; --gold-lo: #b0812f; --candle: #ffc867;
  --velvet: #a3182f; --velvet-hi: #d23a52; --pine: #1d5a40;
  --cream: #f7efdc; --text: #efe7d4; --text-2: rgba(239, 231, 212, .78); --text-3: rgba(239, 231, 212, .58);
  --line: rgba(232, 198, 117, .42); --line-soft: rgba(232, 198, 117, .2);
  --glass: rgba(15, 20, 60, .6); --glass-strong: rgba(11, 15, 46, .86);
  --gold-grad: linear-gradient(180deg, #fbeab4 0%, #e8c272 48%, #c08f3c 100%);
  --serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --sans: Manrope, 'Segoe UI', system-ui, sans-serif;
  --script: 'Marck Script', 'Segoe Script', cursive;
  --top: 82px; --nav-h: 0px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
/* фон на html (уходит на холст), чтобы слои с z-index:-1 (звёзды, #winter) были поверх него */
html {
  background-color: var(--night0);
  background:
    radial-gradient(1200px 640px at 50% -12%, rgba(64, 58, 160, .55), transparent 62%),
    radial-gradient(900px 520px at 88% 108%, rgba(255, 176, 88, .12), transparent 60%),
    radial-gradient(700px 500px at 0% 70%, rgba(120, 40, 90, .14), transparent 60%),
    linear-gradient(180deg, var(--night) 0%, var(--night0) 100%) fixed;
}
body {
  font-family: var(--sans); color: var(--text); line-height: 1.5;
  min-height: 100vh; -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
/* звёздное небо под страницами (замок рисует своё) */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .75;
  background-image:
    radial-gradient(1.2px 1.2px at 23px 41px, #fff8e1 99%, transparent),
    radial-gradient(1px 1px at 141px 97px, #fff 99%, transparent),
    radial-gradient(1.6px 1.6px at 271px 33px, #ffe7b0 99%, transparent),
    radial-gradient(1px 1px at 333px 211px, #fff 99%, transparent),
    radial-gradient(1.3px 1.3px at 97px 263px, #fff3d6 99%, transparent),
    radial-gradient(1px 1px at 211px 331px, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 381px 371px, #ffe2a0 99%, transparent),
    radial-gradient(1px 1px at 51px 379px, #fff 99%, transparent);
  background-size: 400px 400px;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { to { opacity: .4; } }
body.modal-open { overflow: hidden; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
::selection { background: rgba(232, 198, 117, .35); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.muted { color: var(--text-3); }
.small { font-size: .86rem; }
.center { text-align: center; justify-content: center; }
.center-block { display: flex; margin: 10px auto; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* иконки из спрайта: штриховые, цвет = currentColor */
.ic {
  width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.18em;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- шапка: одна строка ----------
   логотип · навигация · [настройки календаря] · звёзды, музыка, язык · кофе с рукописной подписью */
.top {
  /* без backdrop-filter и transform: иначе fixed-навигация на мобильном привяжется к шапке */
  position: fixed; inset: 0 0 auto; z-index: 30; height: var(--top);
  display: flex; flex-direction: column; justify-content: flex-start; padding: 8px clamp(14px, 1.4vw, 28px) 0;
  background: linear-gradient(180deg, rgba(5, 7, 26, .85) 0%, rgba(5, 7, 26, .5) 55%, rgba(5, 7, 26, 0) 100%);
  color: var(--text); pointer-events: none;
}
.top > * { pointer-events: auto; }
/* на страницах контент прокручивается под шапкой: даём ей плотный фон (без backdrop-filter, см. выше) */
body:not([data-view=castle]) .top {
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(6, 9, 30, .98), rgba(10, 14, 44, .96));
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.top-row { display: flex; align-items: center; gap: 10px; min-height: 60px; }
/* на широком экране навигация текстовая (как в хорошем журнале), иконки появляются, когда подписи прячутся */
@media (min-width: 1280px) { .tabs a .ic { display: none; } }
.row-break { display: none; }
/* важные элементы шапки не сжимаются; при нехватке места их место уступает навигация (подписи прячутся в медиазапросах) */
.logo, .settings, .tools, .support, .medal, .medal-coin, .icon-btn, .lang, .seg button, .ext, .coffee, .tabs a { flex-shrink: 0; }

/* настройки календаря: возраст | до 31.12 — одна пилюля с разделителем */
.settings {
  display: flex; align-items: center; gap: 4px; flex: none; height: 48px; padding: 0 4px 0 3px; border-radius: 999px;
  border: 1px solid var(--line-soft); background: rgba(10, 14, 44, .45);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.seg { display: flex; gap: 2px; }
.seg button {
  min-height: 40px; min-width: 48px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; background: none; color: var(--text-2); font-weight: 800; font-size: .84rem;
  white-space: nowrap; font-variant-numeric: lining-nums; transition: .25s;
}
.seg button:hover { color: var(--cream); }
.seg button.on { color: #2b1b05; background: var(--gold-grad); border-color: rgba(255, 240, 200, .7); box-shadow: 0 4px 14px rgba(232, 170, 70, .3); }
.settings-sep { width: 1px; height: 24px; background: linear-gradient(180deg, transparent, var(--line), transparent); }
.ext {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 11px 0 6px; border-radius: 999px; cursor: pointer;
  color: var(--text-2); font-weight: 700; font-size: .84rem; white-space: nowrap; transition: color .25s, background .25s;
}
.ext:hover { color: var(--cream); background: rgba(255, 255, 255, .05); }
.ext input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ext-box {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #2b1b05;
  border: 1.5px solid var(--gold); background: rgba(232, 198, 117, .08); transition: background .25s, box-shadow .25s;
}
.ext-box .ic { width: 16px; height: 16px; stroke-width: 2.6; opacity: 0; transform: scale(.5); transition: opacity .25s, transform .35s var(--ease); }
.ext input:checked + .ext-box { background: var(--gold-grad); border-color: #fff0c4; box-shadow: 0 0 14px rgba(255, 205, 110, .5); }
.ext input:checked + .ext-box .ic { opacity: 1; transform: none; }
.ext input:checked ~ .ext-l { color: var(--gold-hi); }
.ext input:focus-visible + .ext-box { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

/* кофе: тихая пилюля с золотой чашкой, пар на hover; под ней рукописный намёк */
.support { position: relative; flex: none; display: flex; justify-content: flex-end; }
.coffee {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 14px 0 11px; border-radius: 999px;
  text-decoration: none; color: var(--text-2); font-weight: 700; font-size: .82rem; white-space: nowrap;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft);
  transition: color .3s, border-color .3s, box-shadow .3s, background .3s;
}
.coffee:hover, .coffee:focus-visible { color: var(--cream); border-color: var(--line); background: rgba(232, 198, 117, .08); box-shadow: 0 0 22px rgba(255, 200, 110, .22); }
.cup { position: relative; display: grid; place-items: center; color: var(--gold); }
.cup .ic { width: 20px; height: 20px; }
/* три струйки пара поднимаются над чашкой при наведении */
.cup::before, .cup::after {
  content: ''; position: absolute; bottom: 72%; width: 2px; height: 9px; border-radius: 2px; opacity: 0;
  background: linear-gradient(180deg, transparent, rgba(255, 236, 190, .85));
}
.cup::before { left: 6px; }
.cup::after { left: 11px; }
.coffee:hover .cup::before { animation: steam 1.6s ease-out infinite; }
.coffee:hover .cup::after { animation: steam 1.6s ease-out .5s infinite; }
@keyframes steam { 0% { opacity: 0; transform: translateY(4px) scaleY(.6); } 35% { opacity: .9; } 100% { opacity: 0; transform: translate(2px, -9px) scaleY(1.2); } }
.support-note {
  position: absolute; top: calc(100% + 1px); right: 6px; pointer-events: none;
  font-family: var(--script); font-size: .9rem; line-height: 1; white-space: nowrap; color: var(--gold); opacity: .78;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
.support:hover .support-note { opacity: 1; }
.logo { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; min-width: 0; flex: none; }
/* фирменный знак: замок на закатном небе (assets/brand/favicon.svg), тёплое свечение */
.logo-mark {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255, 221, 150, .4), 0 6px 18px rgba(232, 110, 80, .35), 0 0 24px rgba(255, 190, 110, .3);
  transition: transform .4s var(--ease), box-shadow .4s;
}
.logo:hover .logo-mark { transform: rotate(-5deg) scale(1.06); box-shadow: 0 0 0 1px rgba(255, 230, 170, .7), 0 8px 22px rgba(232, 110, 80, .45), 0 0 34px rgba(255, 200, 120, .5); }
@keyframes starGlow { 50% { filter: drop-shadow(0 0 16px rgba(255, 214, 130, .85)); transform: rotate(8deg) scale(1.04); } }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
/* «ADVENT» мелкой золотой разрядкой над рукописным «Cartoon Castle» */
.logo small {
  font-size: .6rem; font-weight: 800; letter-spacing: .5em; text-transform: uppercase; white-space: nowrap;
  color: var(--gold); opacity: .9; margin: 0 0 -1px 2px;
}
.logo b {
  font-family: var(--script); font-weight: 400; font-size: 1.62rem; white-space: nowrap; letter-spacing: .01em;
  background: linear-gradient(180deg, #fff6d6 10%, #efcf85 55%, #c99645 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .5));
  padding: .06em .1em .1em 0;
}

.tabs {
  display: flex; gap: 2px; margin: 0 auto; padding: 4px;
  border-radius: 999px; border: 1px solid var(--line-soft);
  background: rgba(10, 14, 44, .42); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.tabs a {
  display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; min-width: 44px; padding: 0 14px; white-space: nowrap; border-radius: 999px;
  text-decoration: none; font-weight: 700; font-size: .88rem; color: var(--text-2);
  border: 1px solid transparent; transition: color .25s, background .25s, border-color .25s;
}
.tabs a .ic { width: 19px; height: 19px; }
.tabs a:hover { color: var(--cream); background: rgba(255, 255, 255, .05); }
.tabs a.on {
  color: var(--gold-hi); border-color: var(--line);
  background: linear-gradient(180deg, rgba(232, 198, 117, .2), rgba(232, 198, 117, .07));
  box-shadow: 0 0 18px rgba(232, 198, 117, .18), inset 0 1px 0 rgba(255, 240, 200, .15);
}
.tools { display: flex; align-items: center; gap: 6px; flex: none; }

/* звёздочки — золотая медаль */
.medal {
  display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px 0 4px; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--line); color: var(--gold-hi);
  background: linear-gradient(180deg, rgba(232, 198, 117, .16), rgba(232, 198, 117, .05));
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, .12);
}
.medal-coin {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #7a4f12;
  background: radial-gradient(circle at 35% 30%, #fff6d0 0%, #f0cf7f 35%, #c48d36 75%, #8c5e1c 100%);
  box-shadow: 0 0 0 2px rgba(255, 236, 180, .35), 0 0 16px rgba(255, 200, 100, .5), inset 0 -2px 4px rgba(90, 55, 10, .5);
}
.medal-coin .ic { width: 19px; height: 19px; filter: drop-shadow(0 1px 0 rgba(255, 245, 210, .7)); }
.medal b { font-family: var(--serif); font-weight: 700; font-size: 1.45rem; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.medal.coin-bump .medal-coin { animation: coin .8s var(--ease); }
@keyframes coin { 35% { transform: scale(1.25) rotateY(180deg); box-shadow: 0 0 0 2px rgba(255, 236, 180, .5), 0 0 34px rgba(255, 210, 120, .95); } }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line-soft); background: rgba(10, 14, 44, .45); color: var(--text-2);
  transition: color .25s, border-color .25s, box-shadow .25s;
}
.icon-btn .ic { width: 20px; height: 20px; }
.icon-btn:hover { color: var(--gold-hi); border-color: var(--line); }
.icon-btn.on { color: var(--gold-hi); border-color: var(--line); box-shadow: 0 0 16px rgba(232, 198, 117, .35); }
.icon-btn.small { width: 44px; height: 44px; }

.lang {
  display: flex; align-items: center; height: 46px; padding: 0 4px; border-radius: 999px;
  border: 1px solid var(--line-soft); background: rgba(10, 14, 44, .45); color: var(--text-2); cursor: pointer;
}
.lang .ic { width: 17px; height: 17px; color: var(--gold); }
#lang {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--cream);
  font-weight: 700; font-size: .85rem; letter-spacing: .06em; padding: 0 8px; height: 44px; cursor: pointer;
}
#lang option { color: #1a1a2e; background: #fff; }

/* ---------- виды ---------- */
.view { display: none; }
.view.on { display: block; }
#view-castle { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
#castle { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.castle-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 16px; color: var(--text-2); font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }
.castle-loading[hidden] { display: none; }
.castle-loading p { margin: 0; max-width: 30ch; }
.spinner svg { width: 76px; height: 76px; animation: spin 6s linear infinite, starGlow 2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* плашка «Сегодня окошко №…» */
.castle-banner {
  position: absolute; left: 0; right: 0; bottom: 30px; margin: 0 auto; width: fit-content; z-index: 5;
  display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100% - 24px));
  padding: 10px 24px 10px 10px; border-radius: 20px; pointer-events: none;
  background: linear-gradient(180deg, rgba(20, 26, 74, .72), rgba(10, 14, 44, .78));
  border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 240, 200, .1);
  animation: rise .9s var(--ease) .3s both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
.bn-orn {
  flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff4cf;
  background: radial-gradient(circle at 50% 40%, rgba(255, 210, 120, .45), rgba(232, 198, 117, .08) 70%);
  border: 1px solid var(--line-soft);
}
.bn-orn .ic { width: 22px; height: 22px; filter: drop-shadow(0 0 6px rgba(255, 214, 130, .9)); animation: starGlow 3s ease-in-out infinite; }
.bn-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.castle-banner b { font-family: var(--serif); font-weight: 700; font-size: 1.45rem; line-height: 1.1; color: var(--cream); }
.castle-banner .bn-txt > span { font-size: .8rem; color: var(--text-2); }

/* ---------- страницы ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: calc(var(--top) + 14px) clamp(12px, 3vw, 28px) 44px; }
#cal, #tree, #coloring {
  border-radius: 28px; padding: clamp(14px, 3vw, 32px);
  background: linear-gradient(180deg, rgba(22, 28, 80, .62), rgba(10, 14, 44, .66));
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* ---------- кнопки-пилюли ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; cursor: pointer; text-decoration: none;
  font-weight: 700; font-size: .95rem; letter-spacing: .01em; line-height: 1.2; color: var(--cream);
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  transition: transform .2s var(--ease), background .25s, border-color .25s, box-shadow .25s, color .25s, filter .25s;
}
.btn .ic { width: 19px; height: 19px; }
.btn:hover { transform: translateY(-1px); border-color: var(--gold); background: rgba(232, 198, 117, .1); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { cursor: default; transform: none; }
.btn.gold {
  color: #2b1b05; border-color: rgba(255, 240, 200, .75); background: var(--gold-grad);
  box-shadow: 0 10px 28px rgba(232, 170, 70, .32), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(120, 80, 20, .3);
  text-shadow: 0 1px 0 rgba(255, 245, 215, .5);
}
.btn.gold:hover { filter: brightness(1.06); box-shadow: 0 12px 34px rgba(240, 180, 80, .5), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(120, 80, 20, .3); }
.btn.outline { background: rgba(255, 255, 255, .03); }
.btn.outline.on { color: var(--gold-hi); border-color: var(--gold); background: linear-gradient(180deg, rgba(232, 198, 117, .22), rgba(232, 198, 117, .08)); }
.btn.done { color: #e3f7ea; border-color: rgba(120, 210, 160, .55); background: linear-gradient(180deg, rgba(47, 127, 92, .6), rgba(23, 83, 59, .7)); }
.btn.ghost { border-color: transparent; background: rgba(255, 255, 255, .05); color: var(--text-2); }
.btn.ghost:hover { color: var(--cream); border-color: var(--line-soft); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: .88rem; }
.plus { display: inline-flex; align-items: center; gap: 3px; margin-left: 2px; padding: 3px 9px; border-radius: 999px; font-size: .8rem; background: rgba(60, 35, 5, .14); }
.plus .ic { width: 14px; height: 14px; }

/* ---------- календарь ---------- */
.filters {
  display: flex; width: fit-content; max-width: 100%; gap: 2px; margin: 0 auto 18px; padding: 4px; border-radius: 999px;
  border: 1px solid var(--line-soft); background: rgba(10, 14, 44, .5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.filters button {
  min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  background: none; color: var(--text-2); font-weight: 700; font-size: .9rem; white-space: nowrap; transition: .25s;
}
.filters button:hover { color: var(--cream); }
.filters button.on { color: #2b1b05; background: var(--gold-grad); border-color: rgba(255, 240, 200, .7); box-shadow: 0 6px 18px rgba(232, 170, 70, .3); }

.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(6px, 1.5vw, 16px); }
.cal-head { margin-bottom: 10px; }
.cal-head span { text-align: center; font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); opacity: .8; }
.cal-grid { row-gap: clamp(14px, 2.4vw, 26px); padding-top: 10px; }

.cell {
  position: relative; aspect-ratio: 1 / 1.06; border: 0; border-radius: 14px; padding: 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--cream); font-family: var(--sans); isolation: isolate;
  transition: transform .3s var(--ease), box-shadow .3s, filter .3s, opacity .3s;
}
.cell:hover { transform: translateY(-4px); }
.cell .n { font-family: var(--serif); font-weight: 700; line-height: 1; font-variant-numeric: lining-nums; }

/* подарочная коробка: обёртка + золотые ленты + бант + блик */
.gift, .shut {
  box-shadow: 0 12px 22px rgba(0, 0, 0, .45), 0 2px 0 rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -10px 18px rgba(0, 0, 0, .28);
}
.w0 { background: linear-gradient(155deg, #d0425a 0%, #9d172f 50%, #620a1c 100%); }
.w1 { background: linear-gradient(155deg, #3a8d66 0%, #1a5a40 50%, #0b3324 100%); }
.w2 { background: linear-gradient(155deg, #4a58bd 0%, #262f84 50%, #131a4f 100%); }
.w3 { background: linear-gradient(155deg, #8a4aa0 0%, #5a2a72 50%, #341646 100%); }
.gift::before, .shut::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(50% - 8px), #a77a2c calc(50% - 8px), #f8e6ad calc(50% - 2px), #e2b65e 50%, #f3d68a calc(50% + 3px), #9c6e24 calc(50% + 8px), transparent calc(50% + 8px)),
    linear-gradient(180deg, transparent calc(46% - 8px), #a77a2c calc(46% - 8px), #f8e6ad calc(46% - 2px), #e2b65e 46%, #f3d68a calc(46% + 3px), #9c6e24 calc(46% + 8px), transparent calc(46% + 8px));
}
.gift::after, .shut::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(180deg, transparent 17%, rgba(0, 0, 0, .28) 17.5%, transparent 22%),
    radial-gradient(120% 70% at 20% 0%, rgba(255, 255, 255, .28), transparent 50%);
}
.cell .bow { position: absolute; top: -13%; left: 50%; width: 58%; height: 36%; transform: translateX(-50%); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); z-index: 2; }
.gift .n, .shut .n {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 1;
  width: clamp(28px, 4.6vw, 46px); height: clamp(28px, 4.6vw, 46px); border-radius: 50%; display: grid; place-items: center;
  font-size: clamp(1rem, 2.2vw, 1.5rem); color: var(--gold-hi);
  background: radial-gradient(circle at 40% 30%, #2a2f75, #0f1442);
  border: 1.5px solid #e8c675; box-shadow: 0 3px 8px rgba(0, 0, 0, .5), 0 0 0 3px rgba(15, 20, 66, .45);
}
.gift .tt {
  position: absolute; bottom: 8%; left: 6%; right: 6%; text-align: center; z-index: 1;
  font-size: clamp(.56rem, 1vw, .7rem); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #fff4d0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
}
.shut { filter: saturate(.7) brightness(.74); cursor: pointer; }
.shut:hover { filter: saturate(.85) brightness(.88); }
.shut .lk { position: absolute; right: 7%; bottom: 7%; width: 18%; height: 18%; min-width: 14px; min-height: 14px; color: var(--gold-hi); z-index: 1; }
.cell.today {
  animation: todayGlow 2.4s ease-in-out infinite;
  outline: 2px solid var(--gold-hi); outline-offset: 3px;
}
@keyframes todayGlow {
  0%, 100% { box-shadow: 0 12px 22px rgba(0, 0, 0, .45), 0 0 18px 2px rgba(255, 205, 110, .45), inset 0 1px 0 rgba(255, 255, 255, .3); }
  50% { box-shadow: 0 12px 22px rgba(0, 0, 0, .45), 0 0 38px 10px rgba(255, 210, 120, .75), inset 0 1px 0 rgba(255, 255, 255, .3); }
}
.cell.today .n { background: radial-gradient(circle at 40% 30%, #fff3c4, #e8c272 55%, #b0812f); color: #3a2405; border-color: #fff3c4; }

/* открытое окошко: тёплый свет за дверцей */
.opened {
  border: 1px solid var(--line);
  background:
    radial-gradient(80% 60% at 50% 42%, color-mix(in srgb, var(--c1, #ffc867) 34%, transparent), transparent 72%),
    radial-gradient(60% 50% at 50% 40%, rgba(255, 200, 103, .28), transparent 70%),
    linear-gradient(170deg, #1e2563 0%, #10153f 100%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .4), inset 0 0 0 4px rgba(10, 14, 44, .55), inset 0 0 0 5px rgba(232, 198, 117, .18), inset 0 0 24px rgba(255, 190, 90, .15);
  padding: 22% 8% 8%;
}
.opened .n { position: absolute; top: 7px; left: 10px; font-size: clamp(.95rem, 1.6vw, 1.2rem); color: var(--gold); }
.opened .em { font-size: clamp(1.5rem, 3.6vw, 2.5rem); line-height: 1; filter: drop-shadow(0 4px 10px rgba(255, 190, 90, .45)); }
.opened .tt {
  font-family: var(--serif); font-weight: 700; font-size: clamp(.68rem, 1.25vw, .95rem); line-height: 1.1; text-align: center;
  color: var(--cream); margin-top: 4px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; text-overflow: ellipsis;
}
.cell .bd { position: absolute; top: 7px; right: 8px; display: flex; gap: 3px; color: var(--gold-hi); z-index: 3; }
.cell .bd .ic { width: 13px; height: 13px; stroke-width: 2; }
.gift .bd, .shut .bd { top: auto; bottom: 6px; }
.cell.dim { opacity: .22; filter: grayscale(.5); }
.cell.pad { background: none; box-shadow: none; cursor: default; border: 0; }
.cell.pad:hover { transform: none; }
.cell.after { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: rgba(239, 231, 212, .2); align-items: flex-start; justify-content: flex-start; padding: 8px 10px; border: 1px dashed rgba(232, 198, 117, .1); border-radius: 14px; }

/* ---------- модалка дня ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: clamp(46px, 9vw, 78px) 14px 14px; }
.modal[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, rgba(10, 12, 40, .5), rgba(3, 4, 16, .82)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .4s ease both; }
@keyframes fade { from { opacity: 0; } }
.dialog { position: relative; width: min(680px, 100%); animation: dlgIn .6s var(--ease) both; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(14px) scale(.95); filter: blur(10px); } }
.garland {
  position: absolute; top: 0; left: 50%; width: 114%; height: auto; z-index: 3; pointer-events: none;
  transform: translate(-50%, -32%);
  /* без CSS filter: тень уже в SVG, а filter на img поверх прокрутки даёт артефакты композитинга */
  animation: garlandIn .9s var(--ease) .1s both;
}
@keyframes garlandIn { from { opacity: 0; transform: translate(-50%, -48%); } }
.x {
  position: absolute; top: clamp(44px, 9vw, 66px); right: 14px; z-index: 4; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--cream);
  border: 1px solid var(--line); background: rgba(10, 14, 44, .75); backdrop-filter: blur(6px);
  transition: transform .25s var(--ease), color .25s;
}
.x:hover { transform: rotate(90deg); color: var(--gold-hi); }
.x .ic { width: 20px; height: 20px; }
.card {
  position: relative; max-height: calc(100dvh - clamp(60px, 11vw, 96px)); overflow-y: auto; overscroll-behavior: contain;
  border-radius: 28px; color: var(--text);
  background:
    radial-gradient(120% 50% at 50% 0%, rgba(255, 200, 110, .1), transparent 60%),
    linear-gradient(180deg, rgba(24, 30, 84, .9) 0%, rgba(11, 15, 46, .94) 100%);
  border: 1px solid var(--line);
  box-shadow: 0 40px 110px rgba(0, 0, 0, .65), inset 0 0 0 6px rgba(11, 15, 46, .0), inset 0 0 0 7px rgba(232, 198, 117, .1), inset 0 1px 0 rgba(255, 255, 255, .08);
  scrollbar-width: thin; scrollbar-color: rgba(232, 198, 117, .4) transparent;
}
.hero {
  position: relative; text-align: center; padding: 12% 28px 6px;
  background: radial-gradient(70% 90% at 50% 0%, color-mix(in srgb, var(--c2, #3b4bb0) 30%, transparent), transparent 70%);
}
.medallion {
  width: 108px; height: 108px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(255, 214, 140, .28) 0%, rgba(255, 200, 110, .06) 60%, transparent 72%);
  border: 1px solid var(--line-soft);
  box-shadow: 0 0 50px rgba(255, 196, 100, .25), inset 0 0 0 5px rgba(232, 198, 117, .06);
}
.medallion svg { width: 84px; height: 84px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); animation: sway 5s ease-in-out infinite; transform-origin: 50% 8%; }
.medal-emoji { font-size: 56px; line-height: 1; }
@keyframes sway { 50% { transform: rotate(4deg); } }
.eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 8px;
  font-size: .74rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before, .eyebrow::after { content: ''; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.eyebrow::after { transform: scaleX(-1); }
.eyebrow i { width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg); opacity: .8; }
.hero h2 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(2.1rem, 5.6vw, 3rem); line-height: 1.02; margin: 0 0 14px;
  color: var(--cream); text-wrap: balance; text-shadow: 0 2px 24px rgba(255, 200, 110, .25);
}
.hero .sub { margin: 0; color: var(--text-2); }
.chips { list-style: none; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 0; margin: 0; }
.chips li {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; color: var(--text-2); border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .04);
}
.chips .ic { width: 15px; height: 15px; color: var(--gold); }
.card-in { padding: 18px clamp(18px, 4.4vw, 34px) 30px; }
.desc { font-size: 1.06rem; line-height: 1.68; margin: 4px auto 0; text-align: center; color: var(--text); max-width: 56ch; }
.acts { display: grid; grid-template-columns: 1fr 1.25fr; gap: 12px; margin: 22px 0 24px; }
.acts .btn { min-height: 56px; font-size: 1rem; }
.boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.box { border-radius: 20px; padding: 16px 18px 18px; margin: 0 0 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line-soft); }
.boxes .box { margin: 0; }
.boxes + .box { margin-top: 14px; }
.box h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-family: var(--serif); font-weight: 700; font-size: 1.32rem; line-height: 1.1; color: var(--gold-hi); }
.bi { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); border: 1px solid var(--line); background: radial-gradient(circle at 50% 35%, rgba(232, 198, 117, .22), rgba(232, 198, 117, .04)); }
.bi .ic { width: 17px; height: 17px; }
.box p { margin: 0; line-height: 1.62; color: var(--text-2); font-size: .96rem; }
.why { background: linear-gradient(160deg, rgba(70, 80, 190, .18), rgba(255, 255, 255, .02)); }
.fact { background: linear-gradient(160deg, rgba(255, 190, 90, .12), rgba(255, 255, 255, .02)); }
.where .row { margin-top: 12px; }
.country {
  display: inline-flex; align-items: center; gap: 4px; height: 46px; padding: 0 4px 0 14px; border-radius: 999px;
  border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .04); color: var(--gold);
}
.country select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--cream); font-weight: 700; height: 44px; min-width: 52px; padding: 0 12px 0 4px; cursor: pointer; }
.country option { color: #1a1a2e; }
.riddle { background: linear-gradient(160deg, rgba(163, 24, 47, .28), rgba(163, 24, 47, .08)); border-color: rgba(222, 90, 110, .35); }
.riddle .bi { color: #ffc2cb; border-color: rgba(255, 160, 175, .45); background: radial-gradient(circle at 50% 35%, rgba(210, 58, 82, .35), rgba(210, 58, 82, .06)); }
.rq { font-family: var(--serif); font-weight: 600; font-size: 1.32rem !important; line-height: 1.3 !important; color: var(--cream) !important; margin: 4px 0 0 !important; }
.ropts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.ropt { min-height: 48px; padding: 8px 16px; background: rgba(10, 14, 44, .35); }
.ropt.right { color: #e3f7ea; border-color: rgba(120, 210, 160, .7); background: linear-gradient(180deg, rgba(47, 127, 92, .65), rgba(23, 83, 59, .75)); animation: glowOk .8s var(--ease); }
.ropt.wrong { border-color: rgba(222, 90, 110, .5); opacity: .5; animation: shake .4s; }
@keyframes glowOk { 40% { box-shadow: 0 0 26px rgba(120, 220, 160, .7); transform: scale(1.03); } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.rmsg { font-weight: 700; min-height: 1.4em; margin: 12px 0 0 !important; color: var(--gold-hi) !important; }
.rmsg .muted { font-weight: 400; }
.next { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line-soft); }

/* трейлер: большая кнопка на YouTube-поиск */
.trailer { background: linear-gradient(160deg, rgba(255, 190, 90, .1), rgba(255, 255, 255, .02)); }
.trailer-btn {
  width: 100%; min-height: 68px; justify-content: flex-start; gap: 14px; padding: 10px 22px 10px 10px; margin: 6px 0 10px; border-radius: 22px;
  text-align: left; border-color: var(--line);
  background: linear-gradient(135deg, rgba(180, 30, 55, .55), rgba(80, 10, 30, .6));
  box-shadow: 0 10px 26px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 210, 220, .15);
}
.trailer-btn:hover { background: linear-gradient(135deg, rgba(200, 40, 65, .65), rgba(95, 12, 35, .7)); }
.tb-play {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #3a2405;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #e8c272 45%, #a9762a 100%);
  box-shadow: 0 0 0 4px rgba(232, 198, 117, .15), 0 0 20px rgba(255, 205, 110, .35);
}
.tb-play .ic { width: 22px; height: 22px; margin-left: 3px; }
.trailer-btn:hover .tb-play { box-shadow: 0 0 0 5px rgba(232, 198, 117, .22), 0 0 30px rgba(255, 205, 110, .6); }
.tb-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tb-txt b { font-size: 1.02rem; color: var(--cream); }
.tb-txt small { font-weight: 600; font-size: .8rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* «Не понравился? Вот похожие» */
.alt-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 10px; }
.alt {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 12px; border-radius: 16px;
  border: 1px solid var(--line-soft); background: rgba(10, 14, 44, .35); animation: fade .5s ease both;
}
.alt[hidden] { display: none; }
.alt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.alt-head b { font-family: var(--serif); font-weight: 700; font-size: 1.16rem; line-height: 1.1; color: var(--cream); }
.alt-head span { flex: none; font-size: .78rem; font-weight: 700; color: var(--gold); font-variant-numeric: lining-nums; }
.alt p { flex: 1; font-size: .88rem !important; line-height: 1.5 !important; }
.alt .btn { align-self: flex-start; }
.alts .more { margin-top: 12px; }

/* закрытое окошко */
.hero.locked { padding-bottom: 4px; background: radial-gradient(70% 90% at 50% 0%, rgba(80, 90, 200, .22), transparent 70%); }
.lock-art { width: 132px; height: auto; display: block; margin: -6px auto 6px; animation: floaty 4.5s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-6px); } }
.countdown { display: flex; justify-content: center; align-items: flex-start; gap: 6px; margin: 18px 0 16px; min-height: 104px; }
.cd-u {
  display: grid; justify-items: center; gap: 4px; min-width: 82px; padding: 14px 8px 10px; border-radius: 18px;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 24px rgba(0, 0, 0, .3);
}
.cd-u b {
  font-family: var(--serif); font-weight: 700; font-size: 3.1rem; line-height: .9; font-variant-numeric: lining-nums tabular-nums;
  background: linear-gradient(180deg, #fff3cc, #e8c272 60%, #b98a3a); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cd-u small { font-size: .64rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--text-2); }
.cd-sep { font-style: normal; font-family: var(--serif); font-size: 2.4rem; color: var(--gold); opacity: .5; padding-top: 14px; }
.note { color: var(--cream); font-weight: 600; }

/* ---------- приглашение к музыке ---------- */
.invite { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 70px 14px 14px; }
.invite[hidden] { display: none; }
.invite-back { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(10, 12, 40, .35), rgba(3, 4, 16, .72)); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .5s ease both; }
.invite-card {
  position: relative; width: min(440px, 100%); text-align: center; padding: 0 30px 28px; border-radius: 28px;
  background: radial-gradient(120% 60% at 50% 0%, rgba(255, 200, 110, .14), transparent 60%), linear-gradient(180deg, rgba(24, 30, 84, .92), rgba(11, 15, 46, .95));
  border: 1px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .6), inset 0 0 0 7px rgba(232, 198, 117, .08);
  animation: dlgIn .7s var(--ease) both;
}
.invite-art { width: 230px; height: auto; display: block; margin: -84px auto 0; animation: ring 3.2s ease-in-out infinite; transform-origin: 50% 20%; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-4deg); } 84% { transform: rotate(3deg); } 92% { transform: rotate(-1.5deg); } }
.invite-card h2 { font-family: var(--serif); font-weight: 700; font-size: 2.1rem; line-height: 1.05; margin: 4px 0 10px; color: var(--cream); text-wrap: balance; }
.invite-card p { margin: 0 auto 22px; color: var(--text-2); max-width: 32ch; }
.invite-card .btn { min-width: 150px; }

/* ---------- плеер ---------- */
.player {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 7px; border-radius: 999px; max-width: calc(100% - 24px);
  background: rgba(11, 15, 46, .82); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 240, 200, .08);
  animation: rise2 .6s var(--ease) both;
}
@keyframes rise2 { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
.player[hidden] { display: none; }
.player-disc {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #3a2405;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #e8c272 45%, #a9762a 100%);
  box-shadow: 0 0 0 3px rgba(232, 198, 117, .18);
}
.player-disc .ic { width: 22px; height: 22px; stroke-width: 2; }
.player.playing .player-disc { animation: pulseGold 2.4s ease-in-out infinite; }
@keyframes pulseGold { 50% { box-shadow: 0 0 0 3px rgba(232, 198, 117, .25), 0 0 22px rgba(255, 205, 110, .75); } }
.player-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.player-meta small { font-size: .6rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.player-meta b { font-family: var(--serif); font-weight: 700; font-size: 1.08rem; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.switch { flex: none; width: 60px; height: 44px; border: 0; padding: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.switch span {
  position: relative; width: 50px; height: 28px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid var(--line-soft);
  transition: background .3s, border-color .3s;
}
.switch span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #d8d2c4;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .4); transition: transform .35s var(--ease), background .3s;
}
.switch[aria-checked="true"] span { background: var(--gold-grad); border-color: rgba(255, 240, 200, .7); }
.switch[aria-checked="true"] span::after { transform: translateX(22px); background: #fffaf0; }
.vol { display: flex; align-items: center; gap: 6px; color: var(--text-2); padding-right: 6px; }
.vol .ic { width: 18px; height: 18px; }
.vol input { width: 84px; accent-color: var(--gold); }
.player .icon-btn { border-color: transparent; background: rgba(255, 255, 255, .05); }

/* ---------- тост, искры ---------- */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: 96px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100% - 28px));
  padding: 13px 22px 13px 16px; border-radius: 20px; font-weight: 600; font-size: .95rem; line-height: 1.4; color: var(--cream);
  background: rgba(11, 15, 46, .9); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
  transition: opacity .4s var(--ease), transform .4s var(--ease), filter .4s; filter: blur(4px);
}
.toast .ic { width: 22px; height: 22px; color: var(--gold); flex: none; filter: drop-shadow(0 0 6px rgba(255, 210, 120, .7)); }
.toast.on { opacity: 1; transform: translate(-50%, 0); filter: none; }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
#fx span { position: absolute; top: -32px; animation: fall var(--dur, 2.8s) cubic-bezier(.25, .55, .45, 1) both; }
#fx svg { width: 100%; height: 100%; display: block; fill: currentColor; filter: drop-shadow(0 0 5px rgba(255, 210, 120, .85)); }
#fx .fx-dot { border-radius: 50%; background: currentColor; box-shadow: 0 0 8px 2px rgba(255, 210, 120, .7); }
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0) scale(.4); opacity: 0; }
  12% { opacity: 1; transform: translate(calc(var(--dx) * .1), 8vh) rotate(calc(var(--rot) * .1)) scale(1); }
  75% { opacity: 1; }
  100% { transform: translate(var(--dx), 104vh) rotate(var(--rot)) scale(.7); opacity: 0; }
}

/* ---------- ёлка (разметку рисует tree.js) ---------- */
.tree-wrap { display: grid; grid-template-columns: 1fr 280px; gap: 22px; align-items: start; }
@media (max-width: 760px) { .tree-wrap { grid-template-columns: 1fr; } }
.tree-stage { position: relative; aspect-ratio: 5 / 6; max-height: 70vh; margin: 0 auto; width: 100%; max-width: 520px;
  background: radial-gradient(60% 40% at 50% 30%, rgba(255, 200, 110, .14), transparent 70%), linear-gradient(#0d1240, #222a78 70%, #dfe2f5 70.5%);
  border-radius: 22px; overflow: hidden; border: 1px solid var(--line-soft); box-shadow: inset 0 0 40px rgba(0, 0, 0, .35); }
.tree-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rw-lights-g, .rw-star-g, .rw-gifts-g, .rw-snow-g { display: none; }
.rw-lights .rw-lights-g, .rw-star .rw-star-g, .rw-gifts .rw-gifts-g, .rw-snow .rw-snow-g { display: inline; }
.bulb { animation: blink 1.5s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.flake { animation: flake linear infinite; }
@keyframes flake { to { transform: translateY(640px); } }
.orn { position: absolute; transform: translate(-50%, -30%); cursor: grab; touch-action: none; user-select: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.tree-stage .orn svg { width: 54px; height: 54px; }
@media (max-width: 560px) { .tree-stage .orn svg { width: 40px; height: 40px; } }
.tree-tray { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 72px; margin-top: 16px; padding: 12px; border: 1px dashed var(--line); border-radius: 20px; background: rgba(255, 255, 255, .03); }
.tree-tray .orn { position: static; transform: none; }
.orn.dragging { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -50%) scale(1.2); }
.tree-side h3 { margin-top: 0; font-family: var(--serif); font-weight: 700; font-size: 1.6rem; color: var(--gold-hi); }
.rewards { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.rewards li { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line-soft); opacity: .6; }
.rewards li.got { background: linear-gradient(160deg, rgba(232, 198, 117, .2), rgba(232, 198, 117, .05)); border-color: var(--line); opacity: 1; }
.rewards .ri { font-size: 1.5rem; }
.rewards small { display: block; color: var(--text-3); }

/* ---------- раскраски ---------- */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.thumb {
  position: relative; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--cream); font-variant-numeric: lining-nums;
  border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .05); transition: .25s;
}
.thumb:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-hi); }
.thumb.active { color: #2b1b05; background: var(--gold-grad); border-color: rgba(255, 240, 200, .8); box-shadow: 0 6px 18px rgba(232, 170, 70, .4); }
.thumb.done::after { content: ''; position: absolute; top: 1px; right: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold-hi); box-shadow: 0 0 8px rgba(255, 210, 120, .9); }
.thumb:disabled { opacity: .35; cursor: default; }
.thumb .ic { width: 15px; height: 15px; color: var(--text-3); }
.paint-box { text-align: center; }
.paint-box .eyebrow { margin-bottom: 4px; }
.paint-box h3 { font-family: var(--serif); font-weight: 700; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.1; margin: 0 0 20px; color: var(--cream); }
.paint-area { display: flex; gap: 26px; justify-content: center; align-items: center; flex-wrap: wrap; }
.paper { position: relative; padding: 14px; width: min(552px, 100%); border-radius: 6px; background: #f7f1e3;
  background-image: radial-gradient(120% 120% at 0% 0%, #fffaf0, #efe5cf); box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(232, 198, 117, .35); }
.paper::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 6px; background: #e9dfc6; transform: rotate(-2.2deg) translate(-4px, 6px); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.paint-svg { width: 100%; aspect-ratio: 1; overflow: hidden; background: #fff; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(60, 40, 10, .1); }
.paint-svg svg { width: 100%; height: 100%; display: block; }
.paint-svg .c { cursor: pointer; transition: fill .15s; }
.palette { display: grid; grid-template-columns: repeat(2, 52px); gap: 6px 10px; padding: 14px 12px; border-radius: 26px; border: 1px solid var(--line-soft); background: rgba(10, 14, 44, .45); }
.sw { position: relative; width: 52px; height: 52px; border: 0; padding: 0; background: none; cursor: pointer; transition: transform .25s var(--ease); }
.sw::before {
  content: ''; position: absolute; inset: 9px; border-radius: 50% 0 50% 50%; transform: rotate(-45deg);
  background: radial-gradient(55% 35% at 34% 62%, rgba(255, 255, 255, .42), transparent 70%), linear-gradient(225deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .22)), var(--c);
  box-shadow: inset -3px -3px 6px rgba(0, 0, 0, .25), 0 4px 8px rgba(0, 0, 0, .45);
  transition: transform .25s var(--ease), outline-color .25s; outline: 2px solid transparent; outline-offset: 4px;
}
.sw:hover::before { transform: rotate(-45deg) scale(1.08); }
.sw.on::before { transform: rotate(-45deg) scale(1.14); outline-color: var(--gold-hi); }
.sw.eraser { display: grid; place-items: center; color: var(--cream); }
.sw.eraser::before { background: rgba(255, 255, 255, .1); border-radius: 50%; transform: none; box-shadow: inset 0 0 0 1px var(--line-soft); }
.sw.eraser.on::before { transform: scale(1.1); }
.sw.eraser .ic { position: relative; width: 22px; height: 22px; }
.paint-acts { margin-top: 18px; }
.paint-box > .muted { margin: 22px 0 0; }
.paint-msg { font-weight: 700; min-height: 1.4em; color: var(--gold-hi); }
.paint-empty { text-align: center; padding: 40px 10px; }
.paint-empty .ic { width: 56px; height: 56px; color: var(--gold); stroke-width: 1.2; }
.paint-empty p { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; color: var(--cream); }

/* ---------- подвал ---------- */
.foot { text-align: center; color: var(--text-3); padding: 6px 18px 36px; max-width: 760px; margin: 0 auto; font-size: .9rem; }
.foot[hidden] { display: none; }
.foot p { margin: 6px 0; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 18px; margin: 4px 0 12px; }
.foot-links a { color: var(--gold); text-decoration: none; font-weight: 600; font-size: .86rem; padding: 6px 2px; min-height: 32px; display: inline-flex; align-items: center; transition: color .2s; }
.foot-links a:hover { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }
.foot-star { width: 18px; height: 18px; color: var(--gold); opacity: .7; }
.foot-star use { fill: currentColor; }

/* ---------- зимнее настроение страниц (js/winter.js, js/critters.js) ---------- */
/* фон под контентом: сияние сверху, тёплый свет снизу, тонкий орнамент из снежинок и звёзд */
#winter {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(1100px 420px at 50% -6%, rgba(130, 96, 230, .3), transparent 70%),
    radial-gradient(900px 380px at 12% 112%, rgba(255, 170, 90, .16), transparent 70%),
    radial-gradient(900px 380px at 88% 112%, rgba(255, 120, 170, .12), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23dfe8ff' stroke-opacity='.08' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M40 30v20M31.3 35l17.4 10M31.3 45l17.4-10M37 31.5l3 3 3-3M37 48.5l3-3 3 3'/%3E%3Cpath d='M130 112v14M124 115.5l12 7M124 122.5l12-7'/%3E%3C/g%3E%3Cg fill='%23ffe6a8' fill-opacity='.09'%3E%3Cpath d='M122 28c.6 4 2.6 6 6.6 6.6-4 .6-6 2.6-6.6 6.6-.6-4-2.6-6-6.6-6.6 4-.6 6-2.6 6.6-6.6z'/%3E%3Cpath d='M52 118c.5 3 2 4.5 5 5-3 .5-4.5 2-5 5-.5-3-2-4.5-5-5 3-.5 4.5-2 5-5z'/%3E%3Ccircle cx='160' cy='158' r='1.4'/%3E%3Ccircle cx='88' cy='74' r='1.1'/%3E%3C/g%3E%3C/svg%3E");
}
body[data-view=castle] #winter, body[data-view=castle] .top-garland, body[data-view=castle] .yard, body[data-view=castle] .edge { display: none; }
.frost {
  position: absolute; width: min(34vw, 340px); aspect-ratio: 1; background-size: cover; opacity: .6;
  -webkit-mask-image: radial-gradient(circle at 0 0, #000 28%, transparent 72%); mask-image: radial-gradient(circle at 0 0, #000 28%, transparent 72%);
}
.frost.tl { left: 0; top: var(--top); }
.frost.tr { right: 0; top: var(--top); transform: scaleX(-1); }
.frost.bl { left: 0; bottom: 0; transform: scaleY(-1); }
.frost.br { right: 0; bottom: 0; transform: scale(-1, -1); }
.bokeh { position: absolute; border-radius: 50%; animation: bokeh 40s ease-in-out infinite alternate; will-change: transform; }
@keyframes bokeh {
  from { transform: translate(-50%, -50%) scale(.9); opacity: .6; }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.15); opacity: 1; }
}
/* гирлянда, свисающая с нижнего края шапки */
.top-garland { position: absolute; left: 0; right: 0; top: calc(100% - 3px); height: 36px; pointer-events: none !important; }
.top-garland svg { display: block; overflow: visible; }
.bulb { animation: bulb 3s ease-in-out infinite; }
@keyframes bulb { 0%, 100% { opacity: 1; } 50% { opacity: .42; } }
/* снег поверх контента, но без мыши */
#snow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 20; pointer-events: none; }

/* зимний двор в потоке страницы перед подвалом: никогда не перекрывает контент */
.yard { position: relative; height: 172px; margin-top: 6px; overflow: hidden; user-select: none; -webkit-user-select: none; }
.yard-hills { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 118px; -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.yard-stage { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.yo, .crit, .nut-mound, .birdie, .edge-branch { filter: drop-shadow(0 0 1.4px rgba(255, 214, 150, .6)) drop-shadow(0 5px 8px rgba(0, 0, 0, .32)); }
.yo { position: absolute; bottom: 14px; }
.art { display: block; width: 100%; height: auto; overflow: visible; }
.toy, .crit, .nut-mound, .birdie, .yo-drift { pointer-events: auto; cursor: pointer; }
.yo-lantern { left: 3%; width: 34px; }
.yo-fence { left: 9%; width: 180px; bottom: 16px; }
.yo-fence .icicles { position: absolute; left: 0; right: 0; top: 43.5%; height: 0; }
.icicle-w { position: absolute; top: 0; display: block; width: 21px; height: var(--len); padding: 0 6px; margin-left: -6px; transform-origin: 50% 0; }
.icicle-w svg { width: 100%; height: 100%; display: block; }
.yo-drift { left: 27%; width: 130px; height: 92px; overflow: hidden; bottom: 10px; }
.yo-drift .drift { position: absolute; left: 0; bottom: 0; width: 100%; height: 50px; }
.bunny-w { position: absolute; left: 50%; bottom: 10px; width: 46px; transform: translate(-50%, 100%); transition: transform .55s var(--ease); }
.bunny-w.peek { transform: translate(-50%, 46%); }
.bunny-w.up { transform: translate(-50%, 12%); }
.bunny-w.wiggle .ear { transform-box: fill-box; transform-origin: 50% 100%; animation: earWig .22s 8 alternate ease-in-out; }
@keyframes earWig { to { transform: rotate(-12deg); } }
.yo-tree { left: 70%; width: 110px; bottom: 8px; }
.owl-w { position: absolute; left: 60%; top: 30%; width: 36px; }
.owl-lids { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); animation: owlBlink 5.5s infinite; }
@keyframes owlBlink { 0%, 90%, 96%, 100% { transform: scaleY(0); } 93% { transform: scaleY(1); } }
.owl-head { transform-box: fill-box; transform-origin: 50% 85%; }
.owl-w.turn .owl-head { animation: headTurn 1.6s ease-in-out; }
@keyframes headTurn { 25% { transform: rotate(-30deg); } 50% { transform: scaleX(-1); } 75% { transform: scaleX(-1) rotate(30deg); } }
.bubble {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font-family: var(--script); font-size: 1.05rem; line-height: 1.2; color: var(--gold-hi);
  padding: 2px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(10, 14, 44, .78);
  animation: bubble 1.9s var(--ease) both;
}
@keyframes bubble { from { opacity: 0; transform: translate(-50%, 6px) scale(.8); } 15%, 80% { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -6px); } }
.bauble-w { position: absolute; display: block; width: 18px; transform-origin: 50% 0; animation: sway 3.6s ease-in-out infinite alternate; }
.bauble-w.on-tree { left: 13%; top: 52%; }
@keyframes sway { from { rotate: -5deg; } to { rotate: 5deg; } }
.yo-hill { right: 0; width: 190px; height: 64px; bottom: 8px; }
.yo-hill .mound { position: absolute; inset: 0; width: 100%; height: 100%; }
.ball-w { position: absolute; right: 9%; top: -24px; width: 34px; display: block; }
.lantern-w { position: relative; display: block; }
.lantern-w .halo {
  position: absolute; left: 50%; top: 26%; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 205, 120, .5), rgba(255, 170, 80, .14) 45%, transparent 70%);
  animation: flicker 3.4s ease-in-out infinite;
}
.lantern-w:not(.post) .halo { top: 62%; }
@keyframes flicker { 0%, 100% { opacity: .85; transform: scale(1); } 35% { opacity: 1; transform: scale(1.07); } 60% { opacity: .72; transform: scale(.97); } }
.lantern-w.blink .halo, .lantern-w.blink .glass, .lantern-w.blink .flame { animation: lampBlink .17s steps(2, jump-none) 10; }
@keyframes lampBlink { 50% { opacity: .08; } }

/* звери */
.crit { position: absolute; left: 0; bottom: 20px; clip-path: inset(-400px -400px 0 -400px); will-change: transform; }
.crit-dir.left { transform: scaleX(-1); }
.squirrel { width: 84px; } .fox { width: 150px; } .hare { width: 90px; } .penguin { width: 112px; bottom: 16px; }
.squirrel.run svg { animation: bound .36s ease-in-out infinite; }
@keyframes bound { 50% { transform: translateY(-14px) rotate(-6deg); } }
.sq-tail { transform-box: fill-box; transform-origin: 85% 90%; animation: tailSway 1.8s ease-in-out infinite alternate; }
@keyframes tailSway { to { transform: rotate(-7deg); } }
.squirrel.dig svg { transform: rotate(16deg) translateY(4px); transform-origin: 70% 100%; }
.squirrel.dig .sq-paw { transform-box: fill-box; animation: digPaw .15s infinite alternate; }
@keyframes digPaw { to { transform: translate(3px, 5px); } }
.nut { display: none; }
.has-nut .nut { display: inline; }
.fox.run svg { animation: trot .3s ease-in-out infinite alternate; }
.fox.run .lg { transform-box: fill-box; transform-origin: 50% 0; animation: leg .3s ease-in-out infinite alternate; }
.fox.run .lg.b { animation-direction: alternate-reverse; }
@keyframes trot { to { transform: translateY(-4px); } }
@keyframes leg { from { transform: rotate(22deg); } to { transform: rotate(-22deg); } }
.fox.crouch svg { transform: scaleY(.86) translateY(7%); transform-origin: 50% 100%; transition: transform .3s; }
.fox-tail { transform-box: fill-box; transform-origin: 100% 30%; }
.fox.dive .fox-tail { animation: wag .2s ease-in-out infinite alternate; }
@keyframes wag { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
.fox.happy svg { animation: happy .6s var(--ease); }
@keyframes happy { 40% { transform: translateY(-16px); } }
.hare.hop svg { animation: hop .52s cubic-bezier(.3, 0, .6, 1) infinite; }
.hare.leap svg { animation-duration: .3s; }
@keyframes hop { 45% { transform: translateY(-22px) rotate(-8deg); } }
.penguin.slide svg { animation: wobble .5s ease-in-out infinite alternate; }
.penguin.spin svg { animation: spinPeng .8s var(--ease); }
@keyframes wobble { from { transform: rotate(-2deg); } to { transform: rotate(2deg) translateY(-1px); } }
@keyframes spinPeng { 50% { transform: translateY(-18px) rotate(-180deg); } to { transform: rotate(-360deg); } }
.nut-mound { position: absolute; bottom: 14px; width: 30px; animation: bumpHint 4s ease-in-out infinite; }
.nut-mound svg { display: block; width: 100%; }
@keyframes bumpHint { 0%, 88%, 100% { transform: none; } 92% { transform: translateY(-2px) rotate(-4deg); } 96% { transform: translateY(-1px) rotate(3deg); } }
.snowdot { position: absolute; border-radius: 50%; background: #fff; pointer-events: none; box-shadow: 0 0 4px rgba(255, 255, 255, .6); }
.birdie { position: absolute; z-index: 26; width: 46px; }
.birdie svg { display: block; width: 100%; }
.birdie.fly .wing { transform-box: fill-box; transform-origin: 75% 55%; animation: flap .13s ease-in-out infinite alternate; }
@keyframes flap { to { transform: rotate(-55deg) scaleY(1.25); } }
.birdie.perch svg { animation: peck 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes peck { 0%, 78%, 100% { transform: none; } 84% { transform: rotate(9deg); } 90% { transform: translateY(-3px); } }
.spark { position: absolute; display: block; pointer-events: none; filter: drop-shadow(0 0 4px currentColor); }
.spark svg { display: block; width: 100%; height: 100%; }

/* игрушки на полях широкого экрана */
.edge { display: none; }
@media (min-width: 1400px) {
  .edge { display: block; position: fixed; inset: 0; z-index: 25; pointer-events: none; }
}
.edge-l { position: absolute; left: 0; top: calc(var(--top) + 30px); width: 150px; }
.edge-branch { display: block; }
.edge-l .bauble-w { width: 22px; }
.edge-r { position: absolute; right: 0; top: calc(var(--top) - 2px); width: 150px; height: 320px; }
.edge-icicles { position: absolute; left: 12px; width: 76px; top: 0; }
.edge-r .lantern-w { position: absolute; right: 34px; top: 70px; width: 30px; transform-origin: 50% -70px; animation: sway 4.4s ease-in-out infinite alternate; }
.edge-r .lantern-w::before { content: ''; position: absolute; left: calc(50% - .75px); bottom: 100%; width: 1.5px; height: 70px; background: linear-gradient(#2c2233, #4a3d55); }
/* ---------- планшет и телефон ---------- */
/* до 1440: прячем подпись под логотипом, чтобы всё влезло в одну строку */
@media (max-width: 1439px) {
}
/* 1280–1365: чуть плотнее навигация и промежутки, чтобы влезали трёхзначные звёзды */
@media (max-width: 1365px) and (min-width: 1280px) {
  .top-row { gap: 8px; }
  .tabs a { padding: 0 11px; }
  .coffee { padding: 0 12px 0 10px; }
}
/* 861–1279: подписи навигации и кофе превращаются в иконки (title/aria-label остаются) */
@media (max-width: 1279px) {
  .tabs a b, .coffee-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tabs a { padding: 0; width: 44px; }
  .coffee { width: 44px; padding: 0; }
}
@media (max-width: 1000px) and (min-width: 861px) {
  .logo-text { display: none; }
}
@media (max-width: 860px) {
  /* две строки: логотип + звёзды/музыка/язык; ниже настройки календаря и кофе */
  :root { --top: 116px; --nav-h: 76px; }
  .top { padding: 4px 10px 0; }
  .top-row { flex-wrap: wrap; gap: 6px 8px; min-height: 0; }
  .row-break { display: block; flex-basis: 100%; height: 0; order: 3; }
  .logo { order: 1; }
  .tools { order: 2; }
  .settings { order: 4; margin-left: auto; height: 46px; }
  .support { order: 5; margin-right: auto; }
  .support-note { display: none; }
  .seg button { padding: 0 11px; font-size: .8rem; }
  .ext { font-size: .8rem; }
  .logo { gap: 6px; }
  .logo-mark { width: 38px; height: 38px; border-radius: 10px; }
  .logo b { font-size: 1.4rem; }
  .logo small { font-size: .54rem; letter-spacing: .42em; }
  /* нижняя навигация: fixed прямо на .tabs, у шапки нет backdrop-filter/transform */
  .tabs {
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); margin: 0; z-index: 35;
    justify-content: space-around; padding: 6px; border-radius: 24px;
    background: rgba(9, 12, 38, .82); border-color: var(--line-soft);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
  }
  .tabs a { flex: 1 1 0; width: auto; flex-direction: column; justify-content: center; gap: 3px; min-height: 54px; padding: 4px 2px; border-radius: 18px; font-size: .68rem; text-align: center; line-height: 1.1; }
  .tabs a .ic { width: 22px; height: 22px; }
  .tabs a b { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .tools { gap: 6px; margin-left: auto; }
  .medal { padding: 0 12px 0 4px; gap: 6px; }
  .medal-coin { width: 34px; height: 34px; }
  .medal b { font-size: 1.3rem; }
  #lang { padding: 0 10px; }
  .castle-banner { top: calc(var(--top) + 4px); bottom: auto; padding: 7px 16px 7px 7px; gap: 10px; border-radius: 16px; animation-name: rise; }
  .bn-orn { width: 34px; height: 34px; border-radius: 11px; }
  .bn-orn .ic { width: 18px; height: 18px; }
  .castle-banner b { font-size: 1.12rem; }
  .castle-banner .bn-txt > span { font-size: .72rem; line-height: 1.3; }
  .yard { height: 140px; }
  .yo-lantern { left: 1%; width: 26px; }
  .yo-fence { left: 9%; width: 122px; }
  .yo-drift { left: 41%; width: 92px; height: 74px; }
  .yo-drift .drift { height: 38px; }
  .bunny-w { width: 36px; }
  .yo-tree { left: 63%; width: 78px; }
  .yo-hill { width: 84px; height: 44px; }
  .ball-w { width: 26px; top: -18px; }
  .crit { bottom: 16px; }
  .squirrel { width: 62px; } .fox { width: 112px; } .hare { width: 68px; } .penguin { width: 86px; bottom: 13px; }
  .frost { width: 46vw; opacity: .38; }
  .page { padding-bottom: 24px; }  .foot { padding-bottom: calc(var(--nav-h) + 30px); }
  .player { bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); right: 10px; }
  .vol { display: none; }
  .toast { bottom: calc(var(--nav-h) + 24px); }
  .acts { grid-template-columns: 1fr; }
  .boxes { grid-template-columns: 1fr; }
  .filters button { padding: 0 14px; font-size: .84rem; }
}
@media (max-width: 640px) {
  .palette { grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; gap: 2px 4px; padding: 8px 10px; border-radius: 20px; }
  .thumbs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 10px; margin: -4px -2px 14px; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .thumb { flex: none; scroll-snap-align: start; }
  .sw { width: 100%; height: auto; aspect-ratio: 1; min-height: 44px; }
  .sw::before { inset: 15%; }
  #cal { padding: 10px 6px 14px; border-radius: 22px; }
  .cal-head, .cal-grid { gap: 5px; }
  .cal-grid { row-gap: 14px; }
  .gift .tt { display: none; }
  .opened .tt { display: none; }
  .opened { padding: 14% 4% 4%; }
  .opened .n { top: 3px; left: 5px; font-size: .72rem; }
  .opened .em { margin-top: 6px; }
  .opened .em { font-size: clamp(1.2rem, 6vw, 1.9rem); }
  .cell .bd { display: none; }
  .cell { border-radius: 10px; }
  .cell.after { font-size: .9rem; padding: 4px 6px; border-radius: 10px; }
  .cell .bow { top: -16%; width: 70%; height: 42%; }
  .cal-head span { letter-spacing: .06em; font-size: .64rem; }
  .gift .n, .shut .n { border-width: 1px; }
  .cd-u { min-width: 64px; padding: 12px 4px 8px; }
  .cd-u b { font-size: 2.3rem; }
  .cd-sep { font-size: 1.8rem; padding-top: 10px; }
  .hero { padding-top: 13%; }
  .medallion { width: 92px; height: 92px; }
  .medallion svg { width: 72px; height: 72px; }
  .invite-card { padding: 0 20px 22px; }
  .invite-art { width: 190px; margin-top: -70px; }
}
@media (max-width: 400px) {
  .logo b { font-size: 1.24rem; }
  .logo-mark { width: 34px; height: 34px; }
  .medal { padding-right: 10px; }
  .medal-coin { width: 30px; height: 30px; }
  .medal-coin .ic { width: 16px; height: 16px; }
  #lang { padding: 0 9px; font-size: .8rem; }
}

/* ---------- печать раскраски ---------- */
#print-area { display: none; }
@media print {
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing { background: #fff; }
  body.printing::before { display: none; }
  body.printing #print-area { display: block; text-align: center; }
  #print-area h1 { font-family: var(--serif); color: #000; }
  #print-area svg { width: 17cm; height: 17cm; }
}

/* ---------- меньше движения ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .dialog, .invite-card, .castle-banner, .player { filter: none !important; }
}

/* На странице замка зимний фон не нужен (у сцены своё небо), а его полупрозрачные и размытые слои
   поверх WebGL-холста съедают треть кадров: прячем целиком, вместе с их анимациями. */
body[data-view="castle"] #winter,
body[data-view="castle"] .top-garland { display: none !important; }
/* мерцание звёздного слоя body перерисовывает всю страницу поверх WebGL каждый кадр: на замке не нужно */
body[data-view="castle"]::before { animation: none; display: none; }
