/* Новогодний режим BotPay: снегопад, гирлянда, праздничные акценты. Подключается только когда режим включён (lib/newyear.php). */

/* Снег поверх страницы, клики проходят насквозь */
.ny-snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* Гирлянда по верхнему краю */
.ny-garland { position: absolute; left: 0; right: 0; top: 0; height: 30px; z-index: 61; pointer-events: none; overflow: hidden; }
.ny-garland::before { content: ""; position: absolute; left: -2%; right: -2%; top: -14px; height: 26px; border-bottom: 2px solid rgba(160, 175, 195, .45); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.ny-garland ul { position: absolute; inset: 0; display: flex; justify-content: space-around; margin: 0; padding: 0 8px; list-style: none; }
.ny-garland li { position: relative; width: 9px; height: 15px; margin-top: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 2px 14px 2px var(--c); animation: ny-blink 1.6s ease-in-out infinite; animation-delay: var(--d); }
.ny-garland li::before { content: ""; position: absolute; top: -4px; left: 2px; width: 5px; height: 5px; border-radius: 2px; background: #5b6676; }
.ny-garland li:nth-child(2n) { margin-top: 11px; }
.ny-garland li:nth-child(3n) { margin-top: 9px; }
@keyframes ny-blink { 0%, 100% { opacity: 1; filter: brightness(1.15); } 50% { opacity: .35; box-shadow: none; filter: none; } }

/* Кнопка «снег вкл/выкл» */
.ny-toggle { position: fixed; left: 14px; bottom: 14px; z-index: 62; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2, rgba(255,255,255,.14)); background: color-mix(in srgb, var(--surface, #141a24) 85%, transparent); backdrop-filter: blur(8px); color: var(--text, #fff); font-size: 18px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: transform .2s; }
.ny-toggle:hover { transform: rotate(30deg) scale(1.06); }
.ny-toggle[aria-pressed="false"] { opacity: .55; }
body.shell .ny-toggle { bottom: 84px; left: auto; right: 12px; width: 36px; height: 36px; font-size: 16px; opacity: .8; } /* над нижним меню кабинета, справа — не закрывает поля */
@media (min-width: 901px) { body.shell .ny-toggle { bottom: 14px; left: auto; right: 14px; } }

/* Шапка и логотип: снежная шапочка на монетке */
.ny .coin { overflow: visible; }
.ny .coin::before { content: ""; position: absolute; z-index: 2; left: -9px; top: -15px; width: 36px; height: 26px; transform: rotate(-14deg); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Cpath d='M4 19C7 9 13 3 21 3c4 0 6 3 7 8l-3 1c-1-3-2-4-4-4-4 0-8 5-10 11z' fill='%23d3122f'/%3E%3Ccircle cx='26.5' cy='12.5' r='3.2' fill='%23fff'/%3E%3Crect x='2' y='17' width='22' height='6' rx='3' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); pointer-events: none; }

/* Главная: праздничная плашка и снежные края у карточек */
.ny-badge { font: inherit; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 7px 14px 7px 10px; border-radius: 999px; font-weight: 600; font-size: .92rem;
  color: #fff; background: linear-gradient(100deg, #c8102e, #e23a4f 45%, #1f8f5f); box-shadow: 0 10px 30px -12px rgba(226, 58, 79, .8); animation: ny-pop .7s cubic-bezier(.2,.9,.3,1.3) both; }
.ny-badge b { font-weight: 800; }
@keyframes ny-pop { from { opacity: 0; transform: translateY(-8px) scale(.9); } to { opacity: 1; transform: none; } }
.ny.lp .btn-glow { background-image: linear-gradient(100deg, var(--accent, #3cc8ff), #7fe3ff); }
.ny .panel, .ny .w3, .ny .chart-card { position: relative; }
.ny.lp .w3::before { content: ""; position: absolute; left: 10px; right: 10px; top: -3px; 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 14' preserveAspectRatio='none'%3E%3Cpath d='M0 0H120V5.0L120 5.0 118 4.3 116 3.7 114 3.2 112 2.9 110 2.8 108 3.3 106 4.8 104 6.2 102 5.9 100 5.4 98 5.7 96 6.3 94 6.8 92 7.1 90 7.2 88 7.1 86 6.8 84 6.3 82 5.7 80 5.0 78 4.4 76 4.3 74 5.4 72 7.1 70 6.9 68 5.1 66 3.8 64 3.8 62 4.3 60 5.0 58 5.7 56 6.3 54 6.8 52 7.1 50 7.2 48 7.1 46 6.8 44 6.3 42 5.7 40 5.0 38 4.3 36 3.7 34 3.2 32 2.9 30 2.9 28 3.3 26 4.5 24 6.4 22 7.8 20 7.7 18 7.0 16 6.7 14 6.8 12 7.1 10 7.2 8 7.1 6 6.8 4 6.3 2 5.7 0 5.0Z' fill='%23f4f8ff'/%3E%3C/svg%3E") 0 0 / 120px 13px repeat-x; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); border-radius: 8px 8px 0 0; opacity: .92; }
:root[data-theme="light"] .ny.lp .w3::before { filter: drop-shadow(0 1px 2px rgba(80,110,150,.35)); }

/* Северное сияние на главной чуть «зимнее» */
.ny .aurora i:nth-child(2) { background: rgba(120, 240, 200, .32); }
.ny .aurora i:nth-child(3) { background: rgba(140, 120, 255, .34); }

/* Кабинет: приветствие в верхней панели */
.ny-hello { font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--text); background: linear-gradient(100deg, rgba(200,16,46,.18), rgba(31,143,95,.18)); border: 1px solid rgba(226,58,79,.3); white-space: nowrap; }

/* Блок «Новогоднее оформление» в настройках бота */
.ny-panel { background: linear-gradient(135deg, rgba(200,16,46,.10), rgba(31,143,95,.08)); border-color: rgba(226,58,79,.25); }

/* ---------- Плашка-кнопка: нажми — салют, метель и карточка ---------- */
.ny-fun { position: relative; transition: transform .2s cubic-bezier(.2,.9,.3,1.4), box-shadow .2s, filter .2s; -webkit-tap-highlight-color: transparent; }
.ny-fun:hover { transform: translateY(-1px) scale(1.04); filter: brightness(1.12); box-shadow: 0 8px 26px -8px rgba(226, 58, 79, .75); }
.ny-fun:active { transform: scale(.94); }
.ny-fun:focus-visible { outline: 2px solid #ffd24d; outline-offset: 3px; }
.ny-fun::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%) 150% 0 / 250% 100% no-repeat; animation: ny-sheen 4.5s ease-in-out infinite; }
@keyframes ny-sheen { 0%, 70% { background-position: 150% 0; } 100% { background-position: -60% 0; } }
.ny-tree { display: inline-block; transform-origin: 50% 90%; }
.ny-fun:hover .ny-tree { animation: ny-swing .9s ease-in-out infinite; }
@keyframes ny-swing { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
.ny-fun.pop { animation: ny-boom .55s cubic-bezier(.2,.9,.3,1.5); }
.ny-fun.pop .ny-tree { animation: ny-spin .7s cubic-bezier(.2,.9,.3,1.3); }
@keyframes ny-boom { 0% { transform: scale(1); } 30% { transform: scale(.86); } 65% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes ny-spin { from { transform: rotate(-360deg) scale(.4); } to { transform: none; } }
.ny-fun.hint { animation: ny-ring 5s ease-in-out 2s infinite; }
@keyframes ny-ring { 0%, 86%, 100% { transform: none; } 88% { transform: rotate(-5deg) scale(1.05); } 90% { transform: rotate(5deg) scale(1.05); } 92% { transform: rotate(-4deg); } 94% { transform: rotate(3deg); } 96% { transform: none; } }
.ny-tap { position: absolute; right: -6px; top: -9px; padding: 2px 7px; border-radius: 999px; background: #ffd24d; color: #4a2a00; font: 800 .62rem/1.4 var(--body, sans-serif); font-style: normal; text-transform: uppercase; letter-spacing: .04em; box-shadow: 0 4px 10px -2px rgba(0,0,0,.35); animation: ny-bob 1.4s ease-in-out infinite; }
.ny-fun:not(.hint) .ny-tap { display: none; }
@keyframes ny-bob { 50% { transform: translateY(-3px); } }

.ny-fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

.ny-card { position: fixed; z-index: 71; padding: 18px 18px 16px; border-radius: 20px; text-align: center; color: #fff;
  background: radial-gradient(120% 90% at 50% -10%, rgba(255, 210, 77, .22), transparent 60%), linear-gradient(160deg, #3a0d17, #12233a 55%, #0b2a20);
  border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255,255,255,.12);
  opacity: 0; transform: translateY(-14px) scale(.92); transform-origin: var(--ax, 50%) 0; pointer-events: none; transition: opacity .25s, transform .45s cubic-bezier(.2,.9,.3,1.3); }
.ny-card.show { opacity: 1; transform: none; pointer-events: auto; }
.ny-card::before { content: ""; position: absolute; top: -7px; left: var(--ax, 50%); width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg); background: #3a1420; border-left: 1px solid rgba(255,255,255,.14); border-top: 1px solid rgba(255,255,255,.14); }
.ny-card-x { position: absolute; right: 8px; top: 6px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: rgba(255,255,255,.6); font-size: 20px; cursor: pointer; }
.ny-card-x:hover { background: rgba(255,255,255,.1); color: #fff; }
.ny-card-gift { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.ny-card.show .ny-card-gift { animation: ny-gift .9s cubic-bezier(.2,.9,.3,1.4); }
@keyframes ny-gift { 0% { transform: scale(.3) rotate(-30deg); } 40% { transform: scale(1.3) rotate(12deg); } 60% { transform: scale(.95) rotate(-6deg); } 100% { transform: none; } }
.ny-card-t { font: 700 .82rem var(--body, sans-serif); text-transform: uppercase; letter-spacing: .12em; color: #ffd24d; margin-bottom: 10px; }
.ny-cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.ny-cd span { display: grid; padding: 8px 2px 6px; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); }
.ny-cd b { font: 800 1.45rem/1.1 var(--display, sans-serif); font-variant-numeric: tabular-nums; }
.ny-cd small { font-size: .66rem; color: rgba(255,255,255,.6); }
.ny-wish { min-height: 2.6em; font-weight: 600; line-height: 1.35; margin-bottom: 12px; }
.ny-wish.in { animation: ny-wish .5s ease both; }
@keyframes ny-wish { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.ny-more { border: 0; border-radius: 999px; padding: 8px 16px; font: 700 .85rem var(--body, sans-serif); color: #3a1a00; background: linear-gradient(180deg, #ffe07a, #ffbf2e); cursor: pointer; box-shadow: 0 6px 16px -6px rgba(255, 191, 46, .8); transition: transform .15s; }
.ny-more:hover { transform: translateY(-1px); }
.ny-more:active { transform: scale(.95); }
@media (max-width: 700px) { .ny-hello { display: inline-flex; padding: 6px 9px; } .ny-hello span:not(.ny-tree) { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .ny-fun, .ny-fun::after, .ny-fun.pop, .ny-fun.hint, .ny-tap, .ny-card.show .ny-card-gift { animation: none !important; }
  .ny-garland li { animation: none; }
  .ny-badge { animation: none; }
}
@media print { .ny-snow, .ny-garland, .ny-toggle { display: none !important; } }
