/* WZVOD · новогоднее оформление (08.11.2026): лента, гирлянды, снег, шапки снега, блок «Новогодние подарки от Взвода».
   Всё включается классом html.ny-on (ставит скрипт в <head> до 11.01.2027 23:59 МСК) и само исчезает после. */
html:not(.ny-on) [data-ny] { display: none !important; }
.ny-ribbon { display: block; }

:root { --ny-red: #B3262E; --ny-red2: #7E1820; --ny-green: #2FA36B; --ny-ice: #8FD3FF; --ny-snow: #F4F8FB; }

/* ---------- лента над шапкой ---------- */
.ny-ribbon {
  position: relative; z-index: 11; padding: 9px 16px; text-align: center; font-size: 14.5px; font-weight: 500; line-height: 1.35;
  color: var(--pale); background: linear-gradient(90deg, var(--ny-red2), var(--ny-red) 30%, var(--ny-red) 70%, var(--ny-red2));
  border-bottom: 1px solid var(--brass); text-wrap: balance;
}
.ny-ribbon b { color: #fff; font-weight: 600; }
.ny-ribbon u { text-decoration: none; border-bottom: 1px solid currentColor; white-space: nowrap; }
.ny-ribbon:hover u { color: #fff; }

/* ---------- гирлянды (рисует ny.js) ---------- */
.ny-garland { position: absolute; left: 0; right: 0; height: 40px; pointer-events: none; overflow: visible; z-index: 1; }
.site-head > .ny-garland { top: calc(100% - 4px); }
.ny-garland .wire { fill: none; stroke: #23292f; stroke-width: 2; }
.ny-garland .cap { fill: #6b5a2a; }
.ny-garland .bulb { animation: ny-blink 2.6s ease-in-out infinite; }
.ny-garland .bulb .glass { filter: drop-shadow(0 0 5px currentColor) drop-shadow(0 0 11px currentColor); }
.ny-garland .bulb .glint { fill: rgba(255,255,255,.75); }
@keyframes ny-blink { 0%, 100% { opacity: 1; } 45% { opacity: .28; } 55% { opacity: .28; } }

/* ---------- снег (холст рисует ny.js) ---------- */
.ny-snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9; }
.ny-snow-toggle {
  position: fixed; left: 16px; bottom: 16px; z-index: 12; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--edge); background: rgba(20,26,32,.88); color: var(--ny-snow); font-size: 20px; line-height: 1;
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
html.ny-on .ny-snow-toggle { display: inline-flex; }
.ny-snow-toggle[aria-pressed="false"] { opacity: .55; }
.ny-snow-toggle:hover { border-color: var(--brass); }

/* ---------- шапки снега ---------- */
html.ny-on .rate::after, html.ny-on .ny-card::after {
  content: ""; position: absolute; left: 1px; right: 1px; top: 1px; height: 13px; z-index: 1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 13' preserveAspectRatio='none'%3E%3Cpath d='M0 0h120v5c-6 0-7 6-13 6s-7-4-12-4-6 6-12 6-8-5-13-5-6 3-11 3-7-6-12-6-7 4-12 4-6-3-11-3-6 5-12 5S6 5 0 5z' fill='%23F4F8FB'/%3E%3C/svg%3E") repeat-x 0 0 / 120px 13px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
}
/* ---------- праздничная кнопка ---------- */
/* салатовая, рамка переливается цветами гирлянды, по кнопке пробегает блик (красный — «запрет», поэтому не он) */
.btn-ny { --button-bg: linear-gradient(180deg, #B4F06A, #7ED63A 52%, #58B423); --button-text: #0F2408; padding: 3px;
  background: repeating-linear-gradient(90deg, #FFC94A 0, #FF4B4B 40px, #3BD47E 80px, #6EC8FF 120px, #FF7AD9 160px, #FFC94A 200px) 0 0 / 200px 100%;
  animation: ny-edge 2.4s linear infinite; }
@keyframes ny-edge { to { background-position: 200px 0; } }
.btn-ny .btn-inner { position: relative; overflow: hidden; font-weight: 700; text-shadow: 0 1px 0 rgba(255,255,255,.35);
  box-shadow: inset 0 -2px 0 #3F8E17, inset 0 1px 0 rgba(255,255,255,.55); animation: ny-glowbtn 2.4s ease-in-out infinite; }
.btn-ny .btn-inner::after { content: ""; position: absolute; top: -10%; bottom: -10%; left: -45%; width: 32%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent); transform: skewX(-20deg); animation: ny-shine 3.2s ease-in-out infinite; }
@keyframes ny-shine { 0%, 50% { left: -45%; } 100% { left: 135%; } }
@keyframes ny-glowbtn { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
.btn-ny:hover { --button-bg: linear-gradient(180deg, #C6F784, #8CE046 52%, #63C02B); }
.btn-ny .glyph { color: #0F2408; }
.btn-ny:disabled { opacity: .6; cursor: default; }

/* ---------- блок «Новогодние подарки от Взвода» ---------- */
.ny-gifts { position: relative; overflow: hidden; background:
  radial-gradient(ellipse 55% 70% at 78% 55%, rgba(232,184,74,.13), transparent 70%),
  radial-gradient(ellipse 40% 60% at 10% 0%, rgba(179,38,46,.22), transparent 70%), var(--night);
  border-block: 1px solid var(--rule); padding-top: clamp(70px,5.5vw,100px); }
.ny-gifts > .ny-garland { top: -6px; }
.ny-card { position: relative; }
.ny-grid { display: grid; grid-template-columns: minmax(0,1.08fr) minmax(0,.92fr); gap: clamp(30px,5vw,80px); align-items: center; }
.ny-gifts .section-label { color: var(--pale); }
.ny-gifts .section-label::before { background: var(--ny-red); }
.ny-gifts h2 span { color: var(--pale); }
.ny-lead { margin-top: 20px; max-width: 640px; font-size: 18px; line-height: 1.5; text-wrap: pretty; }
.ny-lead b { color: var(--pale); font-weight: 600; }
.ny-count { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 26px; }
.ny-count-label { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.ny-cells { display: flex; align-items: baseline; gap: 6px; font-family: var(--title); }
.ny-cells b { min-width: 2.1ch; padding: 6px 8px; text-align: center; font-size: 30px; line-height: 1; font-weight: 700; color: var(--pale);
  background: var(--card); border: 1px solid var(--edge); clip-path: var(--cut); font-variant-numeric: tabular-nums; }
.ny-cells i { font-style: normal; font-family: var(--sans); font-size: 13px; color: var(--mute); margin-right: 6px; }
.ny-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.ny-actions .btn { min-height: 58px; font-size: 17px; }
.ny-actions .btn-inner { padding-inline: 26px; }
.ny-result { margin-top: 26px; max-width: 620px; padding: 20px 22px; background: rgba(20,26,32,.92); border: 1px solid var(--edge); border-left: 3px solid var(--gold); }
.ny-gifts [hidden] { display: none !important; }
.ny-ok { font-size: 16px; }
.ny-ok b { color: var(--pale); }
.ny-key { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
.ny-key code { font: 700 clamp(20px,2vw,26px)/1.2 ui-monospace,Consolas,monospace; letter-spacing: .06em; color: var(--pale); }
.ny-mini { min-height: 40px; padding: 8px 14px; border: 1px solid var(--brass); background: var(--card); color: var(--pale); font-size: 14px; font-weight: 600; }
.ny-mini:hover { background: var(--edge); }
.ny-steps { margin-top: 14px; padding-left: 20px; font-size: 15px; line-height: 1.6; color: var(--ink); }
.ny-steps a { color: var(--pale); border-bottom: 1px solid var(--brass); }
.ny-mail { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ny-mail input { flex: 1 1 220px; min-height: 40px; padding: 8px 12px; background: var(--ground); border: 1px solid var(--edge); color: var(--ink); font: inherit; font-size: 15px; }
.ny-mail input:focus { outline: none; border-color: var(--gold); }
.ny-msg { margin-top: 10px; font-size: 14px; color: var(--mute); min-height: 1em; }
.ny-msg.err { color: #ffb3b3; }
.ny-msg.ok { color: #9fe6b0; }
.ny-after { margin-top: 26px; max-width: 640px; padding: 14px 18px; font-size: 15.5px; line-height: 1.5; background: var(--card); border-left: 3px solid var(--ny-red); }
.ny-after a { color: var(--pale); border-bottom: 1px solid var(--brass); white-space: nowrap; }

/* подарок: две картинки одной коробки (закрытая/открытая) в одном месте; наведение — приоткрыть, нажатие — открыть */
.ny-art { position: relative; justify-self: center; width: min(100%, 520px); aspect-ratio: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ny-art.open { cursor: default; }
.ny-glow { position: absolute; left: 4%; right: 4%; top: 14%; bottom: -2%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(232,184,74,.30), rgba(232,184,74,.08) 60%, transparent); transition: opacity .6s, transform .6s; opacity: .7; }
.ny-ground { position: absolute; left: 9%; right: 9%; bottom: 3%; height: 11%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(244,248,251,.92), rgba(220,230,238,.6) 55%, transparent); }
.ny-stack { position: absolute; inset: 0; transform-origin: 50% 92%; }
.ny-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .45s ease; }
.ny-stack .g-open { opacity: 0; }
.ny-art .keyfly { position: absolute; left: 50%; top: -6%; width: 13%; margin-left: -6.5%; opacity: 0; transform: translateY(70%) scale(.7);
  transition: opacity .5s .25s, transform .9s .25s cubic-bezier(.2,1.4,.4,1); filter: drop-shadow(0 0 10px rgba(241,213,138,.85)); pointer-events: none; }
@media (hover: hover) {
  .ny-art:not(.open):hover .g-open { opacity: 1; }
  .ny-art:not(.open):hover .g-closed { opacity: 0; }
  .ny-art:not(.open):hover .ny-glow { opacity: 1; }
}
.ny-art.open .g-open { opacity: 1; }
.ny-art.open .g-closed { opacity: 0; }
.ny-art.open .ny-glow { opacity: 1; transform: scale(1.08); }
.ny-art.open .keyfly { opacity: 1; transform: translateY(0) scale(1); }
.ny-art .spark { position: absolute; width: 4.5%; aspect-ratio: 1; pointer-events: none; animation: ny-spark 2.4s ease-in-out infinite;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0l2.6 7.4L20 10l-7.4 2.6L10 20l-2.6-7.4L0 10l7.4-2.6z' fill='%23F1D58A'/%3E%3C/svg%3E"); }
@keyframes ny-spark { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
.ny-art:not(.open) .ny-stack { animation: ny-wiggle 5s ease-in-out infinite; }
@keyframes ny-wiggle { 0%, 86%, 100% { transform: rotate(0); } 89% { transform: rotate(-2.2deg); } 92% { transform: rotate(2deg); } 95% { transform: rotate(-1.2deg); } }
.ny-burst { position: absolute; left: 50%; top: 52%; width: 0; height: 0; pointer-events: none; }
.ny-burst i { position: absolute; width: 7px; height: 7px; border-radius: 50%; animation: ny-fly 1.1s ease-out forwards; }
@keyframes ny-fly { from { transform: translate(0,0) scale(1); opacity: 1; } to { transform: translate(var(--dx),var(--dy)) scale(.3); opacity: 0; } }

@media (max-width: 1050px) {
  .ny-grid { grid-template-columns: 1fr; }
  .ny-art { order: -1; width: min(100%, 400px); }
}
@media (max-width: 680px) {
  .ny-ribbon { font-size: 13px; padding: 8px 12px; }
  .ny-lead { font-size: 16px; }
  .ny-cells b { font-size: 24px; padding: 5px 6px; }
  .ny-actions .btn { width: 100%; }
  .ny-result { padding: 16px 14px; }
  .ny-art { width: min(100%, 320px); }
  .ny-snow-toggle { width: 40px; height: 40px; left: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ny-garland .bulb, .ny-art .spark, .ny-art:not(.open) .ny-stack, .btn-ny, .btn-ny .btn-inner, .btn-ny .btn-inner::after { animation: none; }
}
