/* Временная новогодняя тема: украшения. Работает только при data-theme="newyear".
   Слой лежит позади содержимого страницы, анимации — только transform и opacity (дёшево для телефона). */

.ny { display: none; }
:root[data-theme='newyear'] .ny { display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ny > div { position: absolute; }
.ny svg { display: block; width: 100%; height: 100%; }

/* Снег: три слоя хлопьев, каждый бесшовно сдвигается вниз на высоту своей плитки */
.ny-snow { left: 0; right: 0; will-change: transform; }
.ny-snow-1 { top: -240px; height: calc(100% + 240px); background-size: 240px 240px; animation: ny-fall-1 16s linear infinite;
  background-image:
    radial-gradient(4.1px 4.1px at 205px 4px, rgba(255,255,255,0.9) 50%, transparent 52%),
    radial-gradient(3.4px 3.4px at 168px 77px, rgba(255,255,255,0.9) 50%, transparent 52%),
    radial-gradient(4.0px 4.0px at 119px 151px, rgba(255,255,255,0.9) 50%, transparent 52%),
    radial-gradient(3.2px 3.2px at 63px 104px, rgba(255,255,255,0.9) 50%, transparent 52%),
    radial-gradient(3.3px 3.3px at 159px 192px, rgba(255,255,255,0.9) 50%, transparent 52%),
    radial-gradient(3.7px 3.7px at 130px 177px, rgba(255,255,255,0.9) 50%, transparent 52%),
    radial-gradient(2.6px 2.6px at 216px 181px, rgba(255,255,255,0.9) 50%, transparent 52%),
    radial-gradient(2.5px 2.5px at 224px 157px, rgba(255,255,255,0.9) 50%, transparent 52%),
    radial-gradient(4.1px 4.1px at 97px 57px, rgba(255,255,255,0.9) 50%, transparent 52%); }
.ny-snow-2 { top: -320px; height: calc(100% + 320px); background-size: 320px 320px; opacity: .8; animation: ny-fall-2 26s linear infinite;
  background-image:
    radial-gradient(3.9px 3.9px at 68px 214px, rgba(255,255,255,0.75) 50%, transparent 52%),
    radial-gradient(3.9px 3.9px at 8px 30px, rgba(255,255,255,0.75) 50%, transparent 52%),
    radial-gradient(5.8px 5.8px at 137px 260px, rgba(255,255,255,0.75) 50%, transparent 52%),
    radial-gradient(6.0px 6.0px at 211px 285px, rgba(255,255,255,0.75) 50%, transparent 52%),
    radial-gradient(4.9px 4.9px at 71px 118px, rgba(255,255,255,0.75) 50%, transparent 52%),
    radial-gradient(4.3px 4.3px at 120px 142px, rgba(255,255,255,0.75) 50%, transparent 52%),
    radial-gradient(4.4px 4.4px at 251px 179px, rgba(255,255,255,0.75) 50%, transparent 52%); }
.ny-snow-3 { top: -180px; height: calc(100% + 180px); background-size: 180px 180px; opacity: .6; animation: ny-fall-3 11s linear infinite;
  background-image:
    radial-gradient(1.7px 1.7px at 49px 84px, rgba(255,255,255,0.8) 50%, transparent 52%),
    radial-gradient(1.9px 1.9px at 98px 0px, rgba(255,255,255,0.8) 50%, transparent 52%),
    radial-gradient(1.9px 1.9px at 51px 34px, rgba(255,255,255,0.8) 50%, transparent 52%),
    radial-gradient(2.1px 2.1px at 85px 128px, rgba(255,255,255,0.8) 50%, transparent 52%),
    radial-gradient(1.9px 1.9px at 117px 112px, rgba(255,255,255,0.8) 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 3px 160px, rgba(255,255,255,0.8) 50%, transparent 52%),
    radial-gradient(2.2px 2.2px at 0px 68px, rgba(255,255,255,0.8) 50%, transparent 52%),
    radial-gradient(2.5px 2.5px at 76px 143px, rgba(255,255,255,0.8) 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 82px 75px, rgba(255,255,255,0.8) 50%, transparent 52%),
    radial-gradient(2.5px 2.5px at 70px 17px, rgba(255,255,255,0.8) 50%, transparent 52%); }
@keyframes ny-fall-1 { 0% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(14px, 120px, 0); } 100% { transform: translate3d(0, 240px, 0); } }
@keyframes ny-fall-2 { 0% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(-18px, 160px, 0); } 100% { transform: translate3d(0, 320px, 0); } }
@keyframes ny-fall-3 { 0% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(8px, 90px, 0); } 100% { transform: translate3d(0, 180px, 0); } }

/* Гирлянда под шапкой: тусклые лампочки + два «горящих» слоя, которые попеременно вспыхивают */
.ny-garland { top: 58px; left: 0; right: 0; height: 46px; }
.ny-g { position: absolute; inset: 0; background-repeat: repeat-x; background-size: 160px 46px; }
.ny-g-a { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 46'%3E%3Cpath d='M0 4Q40 30 80 4Q120 30 160 4' stroke='%232a3a63' stroke-width='2' fill='none'/%3E%3Crect x='17.5' y='12.75' width='5' height='5' rx='1' fill='%238a96b8'/%3E%3Cellipse cx='20' cy='23.75' rx='4.6' ry='6.6' fill='%23ff4d5a' fill-opacity='0.45'/%3E%3Crect x='57.5' y='12.75' width='5' height='5' rx='1' fill='%238a96b8'/%3E%3Cellipse cx='60' cy='23.75' rx='4.6' ry='6.6' fill='%23ffd75e' fill-opacity='0.45'/%3E%3Crect x='97.5' y='12.75' width='5' height='5' rx='1' fill='%238a96b8'/%3E%3Cellipse cx='100' cy='23.75' rx='4.6' ry='6.6' fill='%233fd18b' fill-opacity='0.45'/%3E%3Crect x='137.5' y='12.75' width='5' height='5' rx='1' fill='%238a96b8'/%3E%3Cellipse cx='140' cy='23.75' rx='4.6' ry='6.6' fill='%237fb4ff' fill-opacity='0.45'/%3E%3C/svg%3E"); }
.ny-g-b { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 46'%3E%3Cellipse cx='20' cy='23.75' rx='9' ry='11' fill='%23ff4d5a' fill-opacity='.28'/%3E%3Crect x='17.5' y='12.75' width='5' height='5' rx='1' fill='%238a96b8'/%3E%3Cellipse cx='20' cy='23.75' rx='4.6' ry='6.6' fill='%23ff4d5a' fill-opacity='1'/%3E%3Cellipse cx='60' cy='23.75' rx='9' ry='11' fill='%23ffd75e' fill-opacity='.28'/%3E%3Crect x='57.5' y='12.75' width='5' height='5' rx='1' fill='%238a96b8'/%3E%3Cellipse cx='60' cy='23.75' rx='4.6' ry='6.6' fill='%23ffd75e' fill-opacity='1'/%3E%3Cellipse cx='100' cy='23.75' rx='9' ry='11' fill='%233fd18b' fill-opacity='.28'/%3E%3Crect x='97.5' y='12.75' width='5' height='5' rx='1' fill='%238a96b8'/%3E%3Cellipse cx='100' cy='23.75' rx='4.6' ry='6.6' fill='%233fd18b' fill-opacity='1'/%3E%3Cellipse cx='140' cy='23.75' rx='9' ry='11' fill='%237fb4ff' fill-opacity='.28'/%3E%3Crect x='137.5' y='12.75' width='5' height='5' rx='1' fill='%238a96b8'/%3E%3Cellipse cx='140' cy='23.75' rx='4.6' ry='6.6' fill='%237fb4ff' fill-opacity='1'/%3E%3C/svg%3E"); animation: ny-blink 1.6s steps(1, end) infinite; }
.ny-g-c { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 46'%3E%3Cellipse cx='20' cy='23.75' rx='9' ry='11' fill='%23ffd75e' fill-opacity='.28'/%3E%3Crect x='17.5' y='12.75' width='5' height='5' rx='1' fill='%238a96b8'/%3E%3Cellipse cx='20' cy='23.75' rx='4.6' ry='6.6' fill='%23ffd75e' fill-opacity='1'/%3E%3Cellipse cx='60' cy='23.75' rx='9' ry='11' fill='%233fd18b' fill-opacity='.28'/%3E%3Crect x='57.5' y='12.75' width='5' height='5' rx='1' fill='%238a96b8'/%3E%3Cellipse cx='60' cy='23.75' rx='4.6' ry='6.6' fill='%233fd18b' fill-opacity='1'/%3E%3Cellipse cx='100' cy='23.75' rx='9' ry='11' fill='%237fb4ff' fill-opacity='.28'/%3E%3Crect x='97.5' y='12.75' width='5' height='5' rx='1' fill='%238a96b8'/%3E%3Cellipse cx='100' cy='23.75' rx='4.6' ry='6.6' fill='%237fb4ff' fill-opacity='1'/%3E%3Cellipse cx='140' cy='23.75' rx='9' ry='11' fill='%23ff4d5a' fill-opacity='.28'/%3E%3Crect x='137.5' y='12.75' width='5' height='5' rx='1' fill='%238a96b8'/%3E%3Cellipse cx='140' cy='23.75' rx='4.6' ry='6.6' fill='%23ff4d5a' fill-opacity='1'/%3E%3C/svg%3E"); animation: ny-blink 1.6s steps(1, end) -0.8s infinite; }
@keyframes ny-blink { 0% { opacity: 1; } 50% { opacity: 0; } }

/* Падающая звезда — раз в несколько секунд */
.ny-star { top: 120px; left: 0; width: 130px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(255, 244, 214, 0.95)); transform-origin: right center; opacity: 0; animation: ny-shoot 9s ease-out infinite 2s; }
.ny-star::after { content: ''; position: absolute; right: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #fff6dc; box-shadow: 0 0 12px 4px rgba(255, 230, 160, 0.7); }
@keyframes ny-shoot {
  0% { transform: translate3d(5vw, 40px, 0) rotate(-18deg); opacity: 0; }
  3% { opacity: 1; }
  12% { transform: translate3d(70vw, -40px, 0) rotate(-18deg); opacity: 0; }
  100% { transform: translate3d(70vw, -40px, 0) rotate(-18deg); opacity: 0; }
}

.ny-ornament { top: 96px; right: 18%; width: 40px; height: 127px; transform-origin: 50% 0; animation: ny-swing 4.5s ease-in-out infinite alternate; }
@keyframes ny-swing { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }

.ny-tree { right: 10px; bottom: -6px; width: 118px; height: 177px; filter: drop-shadow(0 0 22px rgba(242, 193, 78, 0.25)); }
.ny-gifts { right: 112px; bottom: 0; width: 112px; height: 71px; }

.ny-snowman { left: 8px; bottom: -8px; width: 136px; height: 112px; animation: ny-peek 8s ease-in-out infinite; }
@keyframes ny-peek { 0%, 100% { transform: translateY(44px); } 30%, 70% { transform: translateY(0); } }

/* Шапка Деда Мороза на аватарке и снежинка у логотипа */
:root[data-theme='newyear'] .avatar-ring::before {
  content: '';
  position: absolute;
  z-index: 2;
  left: 30%;
  top: -30%;
  width: 74%;
  height: 60%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 82'%3E%3Cpath d='M14 62Q24 22 62 12Q86 8 90 28Q78 22 70 32Q82 46 88 62Z' fill='%23d11f2f'/%3E%3Cpath d='M30 58Q38 32 60 22' stroke='%23ff6b73' stroke-width='3' fill='none' stroke-linecap='round' stroke-opacity='.6'/%3E%3Crect x='6' y='56' width='88' height='18' rx='9' fill='%23f3f6ff'/%3E%3Ccircle cx='89' cy='30' r='10' fill='%23f3f6ff'/%3E%3C/svg%3E") no-repeat center / contain;
  transform: rotate(14deg);
  pointer-events: none;
}
:root[data-theme='newyear'] .logo::before {
  content: '';
  width: 0.95em;
  height: 0.95em;
  margin-top: -0.1em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12L12.00 2.00 M12.00 5.50L9.81 2.90 M12.00 5.50L14.19 2.90 M12 12L20.66 7.00 M17.63 8.75L18.79 5.56 M17.63 8.75L20.98 9.34 M12 12L20.66 17.00 M17.63 15.25L20.98 14.66 M17.63 15.25L18.79 18.44 M12 12L12.00 22.00 M12.00 18.50L14.19 21.10 M12.00 18.50L9.81 21.10 M12 12L3.34 17.00 M6.37 15.25L5.21 18.44 M6.37 15.25L3.02 14.66 M12 12L3.34 7.00 M6.37 8.75L3.02 9.34 M6.37 8.75L5.21 5.56' stroke='%23cfe3ff' stroke-width='1.7' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") no-repeat center / contain;
  animation: ny-spin 12s linear infinite;
}
@keyframes ny-spin { to { transform: rotate(360deg); } }

/* На узких экранах — меньше и мельче, чтобы не мешало */
@media (max-width: 720px) {
  .ny-snow-3, .ny-star { display: none; }
  .ny-tree { width: 82px; height: 123px; }
  .ny-gifts { right: 82px; width: 76px; height: 48px; }
  .ny-snowman { width: 98px; height: 81px; }
  .ny-ornament { right: 14%; width: 30px; height: 95px; }
  .ny-garland { top: 62px; height: 36px; }
  .ny-g { background-size: 126px 36px; }
}
