/* Новогоднее оформление сайта. Включается js/newyear.js (15.12–10.01); стили — только под html.is-newyear,
   вне сезона ничего не действует. Палитра — как у сайта: тёплый янтарь #da9256 на тёмном. */

html.is-newyear body {
	background: #121214 url(../img/newyear/bg.webp) no-repeat fixed center top / cover;
}

/* телефон: картинка поменьше, чтобы не тянуть лишнего */
@media (max-width: 767px) {
	html.is-newyear body {
		background-image: url(../img/newyear/bg-small.webp);
		background-position: 62% top;
	}
}

/* ---------- гирлянда под шапкой ---------- */

html.is-newyear .ny-garland {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 2;
	height: 52px;
	overflow: hidden;
	pointer-events: none;
}

.ny-garland svg { display: block; width: 100%; height: 100%; }

.ny-wire {
	fill: none;
	stroke: #463d34;
	stroke-width: 2;
	stroke-linecap: round;
}

.ny-bulb {
	animation: ny-twinkle 2.4s ease-in-out infinite;
	transform-origin: center;
	transform-box: fill-box;
}

.ny-bulb--b { animation-duration: 3.1s; animation-delay: -.8s; }
.ny-bulb--c { animation-duration: 2.7s; animation-delay: -1.5s; }
.ny-bulb--d { animation-duration: 3.6s; animation-delay: -2.2s; }

@keyframes ny-twinkle {
	0%, 100% { opacity: 1; }
	50% { opacity: .55; }
}

/* ---------- блок «розыгрыш» на главной: новогодняя монета ---------- */

html.is-newyear .mh-lottery {
	background: #0f1a14 url(../img/newyear/lottery.webp) 78% center / cover no-repeat;
}

/* тонкая тёплая рамка у главного блока и блока розыгрыша — как у остальных карточек, чтобы картинка не «растекалась» по фону */
html.is-newyear .mh-hero,
html.is-newyear .mh-lottery {
	border: 1px solid rgba(218, 146, 86, .32);
	box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
}

/* ---------- плитки магазина: картинки видны лучше, без цветной полоски снизу ---------- */

/* в новогодних картинках низ уже уходит в чёрный — лишнее затемнение сверху не нужно */
html.is-newyear .shp-card::before {
	background: linear-gradient(0deg, rgba(10, 10, 12, .9) 0%, rgba(10, 10, 12, .45) 28%, rgba(10, 10, 12, 0) 55%);
}

html.is-newyear .shp-card::after { display: none; }

html.is-newyear .shp-card__img {
	filter: none;
	object-position: center top;
}

html.is-newyear .shp-card__title,
html.is-newyear .shp-card__text { text-shadow: 0 1px 8px rgba(0, 0, 0, .75); }

/* ---------- снег ---------- */

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

/* над снежинкой — рука (на неё можно нажать) */
html.ny-hover,
html.ny-hover * { cursor: pointer !important; }

/* ---------- кнопка «выключить / включить» ---------- */

.ny-toggle {
	position: fixed;
	left: 14px;
	bottom: 14px;
	z-index: 1037;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .1);
	border-radius: 12px;
	background: rgba(35, 35, 39, .92);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
	color: #da9256;
	cursor: pointer;
	backdrop-filter: blur(6px);
	transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.ny-toggle:hover,
.ny-toggle:focus-visible {
	border-color: rgba(218, 146, 86, .55);
	background: rgba(46, 40, 35, .95);
	color: #eda162;
	outline: 0;
}

/* выключено — приглушённая иконка, перечёркнута; нажать — включить */
.ny-toggle.is-off { color: #8e8e98; }

.ny-toggle.is-off::after {
	content: "";
	position: absolute;
	width: 24px;
	height: 2px;
	border-radius: 2px;
	background: #8e8e98;
	box-shadow: 0 0 0 2px rgba(35, 35, 39, .92);
	transform: rotate(-45deg);
}

@media (max-width: 991px) {
	html.is-newyear .ny-garland { height: 36px; }

	/* над нижней панелью вкладок сайта */
	body:has(.hdr-tabs) .ny-toggle {
		bottom: calc(78px + env(safe-area-inset-bottom));
	}
}

@media (prefers-reduced-motion: reduce) {
	.ny-bulb { animation: none; }
}
