/*
 * Новогоднее оформление главной.
 *
 * Подключается только в home_page.html. Включается скриптом new-year.js
 * по дате (1 декабря — 1 января, Europe/Minsk), поэтому файл можно
 * спокойно держать в статике круглый год.
 */

/* ---------------------------------------------------------------------------
   Гирлянда: хвоя, цветные лампочки, банты и мягкое свечение.
   Живёт в верхней кромке первого экрана, клики не ловит.
   ------------------------------------------------------------------------- */
.ny-garland {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 96px;
	z-index: 2;
	overflow: visible;
	pointer-events: none;
}

/* На странице игры гирлянда стоит в потоке: полоса под шапкой, контент ниже */
.ny-garland--flow {
	position: relative;
	top: auto;
	left: auto;
	right: auto;
}

/* На странице игры контент подтягиваем ближе к гирлянде */
.ny-garland--flow + .wrapper .container {
	padding-top: clamp(0.75rem, 1.6vw, 1.35rem);
}

.ny-garland svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
	transform-origin: 50% 0;
	animation: ny-sway 9s ease-in-out infinite alternate;
}

/* тёплое свечение вдоль всей гирлянды */
.ny-glow {
	fill: none;
	stroke: rgba(255, 210, 130, 0.1);
	stroke-width: 10;
	stroke-linecap: round;
}

/* хвоя */
.ny-needles {
	fill: none;
	stroke-linecap: round;
	stroke-width: 1.15;
}

.ny-needles--dark {
	stroke: #155c33;
	opacity: 0.92;
	stroke-width: 1.3;
}

.ny-needles--mid {
	stroke: #1e6b3d;
	opacity: 0.85;
	stroke-width: 1.2;
}

.ny-needles--light {
	stroke: #2f8a52;
	opacity: 0.7;
	stroke-width: 1.1;
}

.ny-wire {
	fill: none;
	stroke: rgba(38, 72, 26, 0.55);
	stroke-width: 1.4;
	stroke-linecap: round;
}

.ny-socket {
	fill: none;
	stroke: rgba(70, 50, 30, 0.45);
	stroke-width: 1.2;
	stroke-linecap: round;
}

.ny-bulb {
	animation-name: ny-twinkle;
	animation-timing-function: ease-in-out;
	animation-iteration-count: infinite;
}

@keyframes ny-twinkle {
	0%,
	100% {
		opacity: 0.5;
	}
	45% {
		opacity: 1;
	}
}

@keyframes ny-sway {
	from {
		transform: rotate(-0.22deg);
	}
	to {
		transform: rotate(0.22deg);
	}
}

/* ---------------------------------------------------------------------------
   Снег: canvas поверх контента, но под модалками Bootstrap (1050)
   ------------------------------------------------------------------------- */
#ny-snow {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 1000;
	pointer-events: none;
}

@media (max-width: 575.98px) {
	.ny-garland {
		height: 78px;
	}
}

/* Кому анимации мешают — оставляем статичную гирлянду без снега */
@media (prefers-reduced-motion: reduce) {
	.ny-garland svg,
	.ny-bulb {
		animation: none;
	}

	.ny-bulb {
		opacity: 1;
	}
}
