/* =============================================================================
   MERCURY52 — НОВОГОДНЯЯ ГИРЛЯНДА (подключается из include/new_year.php)
   Полоса в цвет topbar над ним: провод «волнами», под каждой волной лампочка.
   ========================================================================== */

.ny-garland {
  --ny-step: 48px;                 /* шаг лампочек = период волны провода */
  position: relative;
  display: flex;
  height: 26px;
  overflow: hidden;
  background-color: var(--color-primary, #141312);
  /* провод: повторяющаяся провисающая дуга */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='14' viewBox='0 0 48 14'%3E%3Cpath d='M0 2 Q24 16 48 2' fill='none' stroke='%23565048' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: var(--ny-step) 14px;
  background-position: 0 0;
  pointer-events: none;
  user-select: none;
}

.ny-garland__bulb {
  position: relative;
  flex: 0 0 var(--ny-step);
  height: 100%;
}

/* цоколь */
.ny-garland__bulb::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 6px;
  height: 4px;
  margin-left: -3px;
  border-radius: 1px;
  background: #6b645b;
}

/* колба */
.ny-garland__bulb::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 9px;
  height: 13px;
  margin-left: -4.5px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: var(--ny-c);
  box-shadow: 0 0 6px 1px var(--ny-c), 0 0 14px 3px var(--ny-glow);
  animation: ny-twinkle 2.4s ease-in-out infinite;
}

/* цвета по кругу: жёлтый фирменный, красный, зелёный, синий, оранжевый */
.ny-garland__bulb:nth-child(5n+1) { --ny-c: #fff200; --ny-glow: rgba(255, 242, 0, .45); }
.ny-garland__bulb:nth-child(5n+2) { --ny-c: #ff3b3b; --ny-glow: rgba(255, 59, 59, .45); }
.ny-garland__bulb:nth-child(5n+3) { --ny-c: #34e07a; --ny-glow: rgba(52, 224, 122, .45); }
.ny-garland__bulb:nth-child(5n+4) { --ny-c: #3fa9ff; --ny-glow: rgba(63, 169, 255, .45); }
.ny-garland__bulb:nth-child(5n+5) { --ny-c: #ff9a1f; --ny-glow: rgba(255, 154, 31, .45); }

/* разнобой мигания: соседние лампочки гаснут в разное время */
.ny-garland__bulb:nth-child(3n+2)::after { animation-delay: -.8s; }
.ny-garland__bulb:nth-child(3n+3)::after { animation-delay: -1.6s; }
.ny-garland__bulb:nth-child(4n)::after   { animation-duration: 3.1s; }

@keyframes ny-twinkle {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; box-shadow: 0 0 2px 0 var(--ny-c); }
}

/* снег: canvas создаёт js/new-year.js */
.ny-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9990;
  pointer-events: none;
}

/* мобильные: лампочки мельче и чаще */
@media (max-width: 767px) {
  .ny-garland {
    --ny-step: 34px;
    height: 22px;
    background-size: var(--ny-step) 11px;
  }
  .ny-garland__bulb::before { top: 5px; }
  .ny-garland__bulb::after {
    top: 8px;
    width: 7px;
    height: 11px;
    margin-left: -3.5px;
  }
}

/* «Уменьшить движение» в системе: лампочки горят ровно, снега нет */
@media (prefers-reduced-motion: reduce) {
  .ny-garland__bulb::after { animation: none; }
  .ny-snow { display: none; }
}

@media print {
  .ny-garland,
  .ny-snow { display: none; }
}
