/* ПОЛНОЧНЫЙ ВЫПУСК: печатный номер. Подключается ПОСЛЕ palette.css.
   Идея: это напечатанный журнал, а не светящаяся открытка. Фольга одна на весь номер: обложка и финал.
   Только оформление. Логика, рубрики, id и классы не тронуты. Цвета берутся из палитры, работает во всех трёх. */

/* 0. Шрифт с настоящей кириллицей и курсивом вместо Prata с искусственным наклоном */
html:root { --font-serif: "Alegreya", "Prata", Georgia, serif; }

/* 1. Фольга редкая: заголовки рубрик набраны сплошным цветом, без градиента и мерцания */
html .section-title,
html .section-title.foil-text {
  background: none; -webkit-text-fill-color: currentColor; animation: none;
  font-style: normal; font-weight: 500; line-height: 1.08; letter-spacing: -.005em; text-wrap: balance; text-shadow: none;
}
html .page-night .section-title { color: var(--foil-light); }
html .page-paper .section-title { color: var(--ink); }
html .section-subtitle { max-width: 34ch; line-height: 1.6; text-wrap: pretty; }
html .page-paper .section-subtitle { color: rgba(var(--ink-rgb), .72); }

/* 2. Колонтитул как в настоящем журнале: название рубрики не дублирует заголовок, остаётся только номер страницы */
html .page[data-module] .running-header span:first-child { visibility: hidden; }
html .running-header { font-family: var(--font-sans); font-style: normal; font-size: 13px; opacity: .7; }

/* 3. Кнопки: плоские и уверенные вместо глянцевых */
html .primary-cranberry-btn {
  background: var(--cranberry); border-radius: 10px;
  box-shadow: 0 12px 24px -14px rgba(var(--cran-rgb), .85);
  transition: background-color .25s, transform .25s cubic-bezier(.22, 1, .36, 1);
}
html .primary-cranberry-btn:hover { background: var(--cranberry-hi); }
html .primary-cranberry-btn:active { transform: translateY(1px); }
html .secondary-gold-btn {
  background: transparent; color: var(--foil); border: 1px solid rgba(var(--foil-rgb), .55); border-radius: 10px;
  transition: background-color .25s, border-color .25s;
}
html .secondary-gold-btn:hover { background: rgba(var(--foil-rgb), .12); border-color: var(--foil); }
html .page-paper .secondary-gold-btn { color: var(--ink); border-color: rgba(var(--ink-rgb), .4); }
html .page-paper .secondary-gold-btn:hover { background: rgba(var(--ink-rgb), .07); border-color: var(--ink); }
html .icon-btn { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(var(--mid-rgb), .92); border-color: rgba(var(--foil-rgb), .3); }
html #order-fab {
  min-height: 38px; padding: 0 14px; font-size: 15px; color: var(--foil); background: rgba(var(--mid-rgb), .92);
  border: 1px solid rgba(var(--foil-rgb), .45); border-radius: 999px; box-shadow: none;
}
html #order-fab:hover { border-color: var(--foil); background: rgba(var(--cran-rgb), .4); }

/* 4. Тише фон: блёстки, снег, украшения и проводник уходят на второй план */
html #glitter { opacity: .32; }
html #snow-canvas { opacity: .5; }
html .garland-glow span { animation-duration: 8s; }
html .decor-icon { opacity: .4; }
html #guide { scale: .72; transform-origin: 100% 100%; }

/* 5. Новогодний стол: подписи читаются на любом фоне */
html .tbl-item span {
  display: inline-block; padding: 2px 9px; font-size: 13px; line-height: 1.25; border-radius: 999px;
  background: rgba(var(--deep-rgb), .6); color: var(--foil-light); text-shadow: none;
}
html .tbl-item { transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s; }
html .tbl-item:active { transform: scale(.95); }
html .tbl-card { text-wrap: pretty; }

/* 6. Мелочи браузера оформлены под палитру: выделение, фокус, полоса прокрутки, цифры */
html { accent-color: var(--cranberry); scrollbar-color: rgba(var(--foil-rgb), .4) transparent; }
html ::selection { background: rgba(var(--cran-rgb), .4); color: inherit; }
html body { font-variant-numeric: lining-nums tabular-nums; }
html :where(button, a, [role="button"], input, textarea):focus-visible { outline: 2px solid var(--foil); outline-offset: 3px; }

/* 7. «Меньше движения»: декор не рисуется совсем */
@media (prefers-reduced-motion: reduce) {
  html #glitter, html #guide, html .garland-glow, html #snow-canvas { display: none !important; }
}

/* 8. Металл: золото и серебро с бликами вместо плоского жёлтого и серого */
html:root { --metal: linear-gradient(135deg,#7A5516 0%,#D6A53A 20%,#FFF0B0 40%,#E8B94C 58%,#A87A22 78%,#F2D27A 100%); }
html[data-palette="silver"] { --metal: linear-gradient(135deg,#566470 0%,#B4BFC8 22%,#FFFFFF 42%,#C9D3DB 60%,#76848F 80%,#E7EDF1 100%); }
html[data-palette="wine"] { --metal: linear-gradient(135deg,#6E4A14 0%,#CFA14A 22%,#FBE7B2 42%,#DDB05A 60%,#92692A 80%,#EBCB86 100%); }
html:root, html[data-palette="silver"], html[data-palette="wine"] { --foil-grad: var(--metal); }

/* 9. Печать: тиснёный металлический оттиск с зубчатым краем, цвет по палитре */
html .wax-seal {
  background: var(--metal); border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%;
  box-shadow: 0 10px 24px rgba(0,0,0,.55), inset 0 2px 3px rgba(255,255,255,.65), inset 0 -6px 10px rgba(0,0,0,.35);
}
html .wax-seal::before {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(var(--ink-rgb), .34) 0 3deg, transparent 3deg 10deg);
  -webkit-mask: radial-gradient(circle, transparent 66%, #000 68%); mask: radial-gradient(circle, transparent 66%, #000 68%);
}
html .wax-seal::after { inset: 11px; border: 2px solid rgba(var(--ink-rgb), .32); box-shadow: 0 1px 1px rgba(255,255,255,.45), inset 0 1px 2px rgba(0,0,0,.3); }
html .wax-monogram { color: rgba(var(--ink-rgb), .82); text-shadow: 0 1px 0 rgba(255,255,255,.6), 0 -1px 1px rgba(0,0,0,.35); }
html .envelope-card .wax-seal { animation: sealPulse 3.2s ease-in-out infinite; filter: drop-shadow(0 0 14px rgba(var(--foil-rgb), .35)); }

/* 10. Содержание: все звёзды помещаются в раму, собранные мерцают в цвет палитры */
html .stars-board { gap: 2px 0; padding: 10px 2px; overflow: hidden; }
html .star-slot { height: auto; min-width: 0; aspect-ratio: 1; font-size: min(20px, 5vw); }
html .star-slot svg { width: min(78%, 22px); height: auto; }
html .star-slot.earned { color: var(--foil-shadow); transform: none; animation: starTwinkle 2.8s ease-in-out infinite; }
html .star-slot.earned:nth-child(3n) { animation-delay: .6s; }
html .star-slot.earned:nth-child(3n+1) { animation-delay: 1.3s; }
@keyframes starTwinkle { 50% { filter: drop-shadow(0 0 9px rgba(var(--foil-rgb), 1)); transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { html .star-slot.earned { animation: none; } }

/* 11. Рама звёзд: размер звёзд считается от ширины рамы, поэтому они всегда помещаются */
html .stars-board { container-type: inline-size; }
html .star-slot { font-size: min(20px, 5.4cqw); }
html .star-slot svg { width: 1em; height: 1em; }
