/* ============================================================
   AGROCUBE — «Комната продукции» (страница smart.html)
   Стены/пол/потолок, фитосветильник с лучами, стеллажи с
   мини-3D-кубами, карточка продукта (описание / 3D / видео).
   Только CSS, без изображений и библиотек.
   ============================================================ */

/* ---------- Комната ---------- */
/* страница комнаты: только комната, без шапки и подвала */
.page-room {
	display: flex;
	flex-direction: column;
	padding: 16px;
}

.page-room .room {
	margin: auto;
}

.room {
	position: relative;
	width: 100%;
	max-width: 1040px;
	height: 640px;
	background: #080c11;
	border: 1px solid #1c2530;
	border-radius: 14px;
	overflow: hidden;
}

/* вывеска внутри комнаты: логотип + ссылка на главную */
.room-sign {
	position: absolute;
	top: 8%;
	left: 15%;
	z-index: 7;
	display: flex;
	flex-direction: column;
	gap: 7px;
	text-decoration: none;
}

.room-sign__brand {
	display: flex;
	align-items: center;
	gap: 10px;
}

.room-sign__brand .logo-cube {
	width: 30px;
	height: 30px;
}

.room-sign__brand span {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.16em;
	color: #dfeae2;
	transition: color 0.25s, text-shadow 0.25s;
}

.room-sign__hint {
	font-size: 11px;
	letter-spacing: 0.08em;
	color: #5b6b7a;
	transition: color 0.25s;
}

.room-sign:hover .room-sign__brand span {
	color: #35d07f;
	text-shadow: 0 0 12px rgba(53, 208, 127, 0.55);
}

.room-sign:hover .room-sign__hint {
	color: #35d07f;
}

.room__scene {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
}

/* дальняя стена */
.room__back {
	position: absolute;
	left: 14%;
	right: 14%;
	top: 7%;
	bottom: 20%;
	z-index: 1;
	background:
		repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 36px),
		linear-gradient(180deg, #0e151d, #0b1118);
	border: 1px solid #18222d;
	border-radius: 4px 4px 0 0;
}

/* зелёное свечение на дальней стене от лампы */
.room__back::after {
	content: "";
	position: absolute;
	top: -40px;
	left: 50%;
	width: 420px;
	height: 240px;
	margin-left: -210px;
	background: radial-gradient(50% 60% at 50% 30%, rgba(53, 208, 127, 0.12), transparent 70%);
}

/* пол: перспективная плита с сеткой */
.room__floor {
	position: absolute;
	left: -12%;
	right: -12%;
	bottom: -1px;
	height: 54%;
	z-index: 1;
	transform-origin: 50% 100%;
	transform: perspective(650px) rotateX(58deg);
	background:
		repeating-linear-gradient(0deg, rgba(53, 208, 127, 0.06) 0 1px, transparent 1px 46px),
		repeating-linear-gradient(90deg, rgba(53, 208, 127, 0.05) 0 1px, transparent 1px 46px),
		linear-gradient(180deg, #0a1016, #0e1820);
}

/* потолок */
.room__ceiling {
	position: absolute;
	left: -12%;
	right: -12%;
	top: -1px;
	height: 44%;
	z-index: 1;
	transform-origin: 50% 0%;
	transform: perspective(650px) rotateX(-62deg);
	background:
		repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 60px),
		linear-gradient(0deg, #0a0f15, #0d141b);
}

/* боковые стены */
.room__wall {
	position: absolute;
	top: -2%;
	bottom: -2%;
	width: 30%;
	z-index: 1;
	background:
		repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 44px),
		linear-gradient(90deg, #0d1319, #0a0e13);
}

.room__wall--left {
	left: -1px;
	transform-origin: 0% 50%;
	transform: perspective(650px) rotateY(64deg);
}

.room__wall--right {
	right: -1px;
	transform-origin: 100% 50%;
	transform: perspective(650px) rotateY(-64deg);
}

/* виньетка — затемнение углов комнаты */
.room__glow {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 6;
	pointer-events: none;
	background: radial-gradient(120% 90% at 50% 42%, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}

/* ---------- Фитосветильник ---------- */
.lamp {
	position: absolute;
	left: 50%;
	top: 0;
	width: 180px;
	transform: translateX(-50%);
	z-index: 5;
	pointer-events: none;
}

.lamp__cable {
	width: 2px;
	height: 70px;
	margin: 0 auto;
	background: #3a4756;
}

.lamp__head {
	position: relative;
	width: 150px;
	height: 24px;
	margin: 0 auto;
	border-radius: 5px 5px 10px 10px;
	background: linear-gradient(180deg, #2c3843, #1a232c);
	border: 1px solid #46545f;
}

/* светящаяся LED-полоса — под головой лампы */
.lamp__strip {
	position: absolute;
	top: 90px;
	left: 50%;
	width: 120px;
	height: 7px;
	margin-left: -60px;
	border-radius: 4px;
	background: #eafff2;
	box-shadow:
		0 0 18px 4px rgba(120, 235, 170, 0.75),
		0 0 46px 14px rgba(53, 208, 127, 0.35);
}

/* лучи света */
.lamp__beam {
	position: absolute;
	top: 96px;
	left: 50%;
	width: 130px;
	height: 240px;
	margin-left: -65px;
	clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
	background: linear-gradient(180deg, rgba(150, 240, 185, 0.26), rgba(150, 240, 185, 0.02));
	filter: blur(6px);
	transform-origin: 50% 0;
	mix-blend-mode: screen;
}

.lamp__beam--2 {
	height: 300px;
}

.lamp__beam--1 {
	margin-left: -215px;
	transform: rotate(20deg);
}

.lamp__beam--3 {
	margin-left: 85px;
	transform: rotate(-20deg);
}

/* ---------- Стеллаж ---------- */
.rack {
	position: absolute;
	left: 50%;
	bottom: 4%;
	width: 620px;
	height: 400px;
	transform: translateX(-50%);
	z-index: 3;
}

.rack__post {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 12px;
	border-radius: 6px;
	background: linear-gradient(90deg, #2a3540, #1b242e 60%, #232e39);
	box-shadow: inset 0 0 0 1px #101820;
}

.rack__post--left  { left: 0; }
.rack__post--right { right: 0; }

/* полка */
.rack__shelf {
	position: absolute;
	left: 0;
	right: 0;
	height: 16px;
	background: linear-gradient(180deg, #33404c, #1e2731 70%, #171f28);
	border-radius: 3px;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

/* верхняя (трёхмерная) грань полки */
.rack__shelf::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -5px;
	height: 5px;
	background: #56656f;
	border-radius: 3px 3px 0 0;
}

.rack__shelf--1 { top: 16%; }
.rack__shelf--2 { top: 46%; }
.rack__shelf--3 { top: 76%; }

/* нижнее основание стеллажа */
.rack__base {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 18px;
	background: linear-gradient(180deg, #2e3a46, #1a222b);
	border-radius: 3px;
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
}

/* предметы на полке */
.rack__items {
	position: absolute;
	left: 34px;
	right: 34px;
	bottom: 16px;
	display: flex;
	justify-content: space-around;
	align-items: flex-end;
	gap: 12px;
}

/* ---------- Мини-3D-куб ---------- */
.shelf-item {
	position: relative;
	display: block;
	width: 150px;
	cursor: pointer;
}

.shelf-item--soon {
	cursor: default;
	opacity: 0.55;
}

.cube-wrap {
	position: relative;
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 auto;
}

/* тень под кубом */
.cube-wrap::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -5px;
	width: 74%;
	height: 9px;
	transform: translateX(-50%);
	background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.55), transparent 70%);
	border-radius: 50%;
}

.mini-cube {
	--mc: 46px;
	display: block;
	position: relative;
	width: var(--mc);
	height: var(--mc);
	transform-style: preserve-3d;
	transform: rotateX(-24deg) rotateY(-34deg);
	transition: transform 0.3s ease, filter 0.3s ease;
}

.mc-face {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	border-radius: 2px;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.mc-front {
	transform: translateZ(calc(var(--mc) / 2));
	background: var(--mc-front-bg);
}

.mc-right {
	transform: rotateY(90deg) translateZ(calc(var(--mc) / 2));
	background: var(--mc-side-bg);
}

.mc-top {
	transform: rotateX(90deg) translateZ(calc(var(--mc) / 2));
	background: var(--mc-top-bg);
}

/* цветовые темы кубов (заранее вычисленные градиенты, без color-mix) */
.mini-cube--green {
	--mc-top-bg: linear-gradient(135deg, #66dd9e, #38c07e);
	--mc-front-bg: linear-gradient(180deg, #1e8054, #145938);
	--mc-side-bg: linear-gradient(180deg, #12402d, #0b2e20);
	--glow: rgba(53, 208, 127, 0.4);
}

.mini-cube--lime {
	--mc-top-bg: linear-gradient(135deg, #b7ef6a, #8fd14a);
	--mc-front-bg: linear-gradient(180deg, #6d9330, #527323);
	--mc-side-bg: linear-gradient(180deg, #3c5219, #2e4211);
	--glow: rgba(163, 230, 53, 0.4);
}

.mini-cube--teal {
	--mc-top-bg: linear-gradient(135deg, #4fe0cd, #25c3ad);
	--mc-front-bg: linear-gradient(180deg, #168273, #0e5f54);
	--mc-side-bg: linear-gradient(180deg, #0e4d44, #093a33);
	--glow: rgba(45, 212, 191, 0.4);
}

.mini-cube--blue {
	--mc-top-bg: linear-gradient(135deg, #74b3ff, #4a95ff);
	--mc-front-bg: linear-gradient(180deg, #2069c4, #164e95);
	--mc-side-bg: linear-gradient(180deg, #14406f, #0d3256);
	--glow: rgba(77, 163, 255, 0.4);
}

.mini-cube--ghost {
	--mc-top-bg: rgba(88, 106, 122, 0.4);
	--mc-front-bg: rgba(62, 78, 92, 0.45);
	--mc-side-bg: rgba(44, 57, 69, 0.5);
	--glow: rgba(120, 140, 160, 0.25);
}

/* название раздела — табличка на кромке полки, под кубом */
.shelf-item__name {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 3px;
	font-size: 12.5px;
	line-height: 1.3;
	color: #c6d5e0;
	text-align: center;
	transition: color 0.25s;
}

.item-green  { --accent-c: #35d07f; --glow: rgba(53, 208, 127, 0.4); }
.item-lime   { --accent-c: #a3e635; --glow: rgba(163, 230, 53, 0.4); }
.item-teal   { --accent-c: #2dd4bf; --glow: rgba(45, 212, 191, 0.4); }
.item-blue   { --accent-c: #4da3ff; --glow: rgba(77, 163, 255, 0.4); }

.shelf-item:hover .shelf-item__name {
	color: var(--accent-c, #35d07f);
}

/* свечение при наведении вешаем на обёртку: filter на самом кубе
   с preserve-3d сплющивает трёхмерные грани */
.shelf-item:hover .cube-wrap {
	filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 18px var(--glow));
}

.shelf-item:hover .mini-cube {
	transform: rotateX(-24deg) rotateY(-14deg) translateY(-6px);
}

/* аккуратная рамка фокуса с клавиатуры (после закрытия карточки
   фокус возвращается на куб) */
.shelf-item:focus {
	outline: none;
}

.shelf-item:focus-visible {
	outline: 1px dashed var(--accent-c, #35d07f);
	outline-offset: 5px;
	border-radius: 6px;
}

/* ---------- Карточка продукта (модальное окно) ---------- */
.pmodal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 50;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.pmodal.is-open {
	display: flex;
}

.pmodal__backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(5, 9, 14, 0.84);
}

.pmodal__panel {
	position: relative;
	width: 1060px;
	max-width: 96vw;
	max-height: 92vh;
	overflow: auto;
	background: #0d1319;
	border: 1px solid #223041;
	border-radius: 16px;
	padding: 26px 28px;
	display: flex;
	gap: 26px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.pmodal__col--left  { flex: 1 1 260px; }
.pmodal__col--right { flex: 1 1 260px; }

.pmodal__col--center {
	flex: 0 0 340px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.pmodal__label {
	font-size: 11px;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: #6b7a87;
	margin-bottom: 12px;
}

.pmodal__title {
	font-size: 20px;
	color: #ffffff;
	margin-top: 6px;
	text-align: center;
}

/* сцена с большой 3D-моделью */
.pmodal__cube {
	position: relative;
	width: 100%;
	height: 250px;
	perspective: 800px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* мягкое свечение за моделью (цвет приходит из JS: --stage-glow) */
.pmodal__cube::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 300px;
	height: 300px;
	margin: -150px 0 0 -150px;
	border-radius: 50%;
	background: radial-gradient(closest-side, var(--stage-glow, rgba(53, 208, 127, 0.25)), transparent 72%);
}

.pmodal__cube .mini-cube {
	--mc: 150px;
	transition: none;
	animation: mcSpin 18s linear infinite;
}

@keyframes mcSpin {
	from { transform: rotateX(-24deg) rotateY(0deg); }
	to   { transform: rotateX(-24deg) rotateY(360deg); }
}

.pmodal__close {
	position: absolute;
	top: 14px;
	right: 16px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #1a232d;
	border: 1px solid #2c3a48;
	color: #cfe0ea;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.pmodal__close:hover {
	border-color: #35d07f;
	color: #35d07f;
}

/* описание продукта */
.pdesc {
	font-size: 14px;
	line-height: 1.65;
	color: #aebfcb;
}

.pdesc ul {
	margin: 10px 0 0 18px;
}

.pdesc li {
	margin-bottom: 6px;
}

/* видео-колонка */
.pvideos {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.video-ph {
	position: relative;
	height: 118px;
	border: 1px dashed #33414f;
	border-radius: 10px;
	background: #10161d;
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: center;
	justify-content: center;
	color: #7d8fa0;
	font-size: 12.5px;
}

.video-ph::before {
	content: "▶";
	font-size: 20px;
	color: #35d07f;
}

.video-ph .video-ph__hint {
	font-size: 11px;
	color: #5b6b7a;
}

/* ---------- Анимации и адаптив ---------- */
@media (prefers-reduced-motion: reduce) {
	.pmodal__cube .mini-cube {
		animation: none;
	}
}

@media (max-width: 920px) {
	.room {
		height: 470px;
	}

	.room__scene {
		transform: scale(0.78);
		transform-origin: 50% 62%;
	}
}

@media (max-width: 640px) {
	.room {
		height: 340px;
	}

	.room__scene {
		transform: scale(0.55);
	}

	.pmodal__panel {
		flex-direction: column;
	}

	.pmodal__col--center {
		flex: 0 0 auto;
		order: -1;
	}
}

/* ============================================================
   Дополнительные цвета мини-кубов (космос и фабрика)
   ============================================================ */
.mini-cube--amber {
	--mc-top-bg: linear-gradient(135deg, #ffd08a, #ffab3d);
	--mc-front-bg: linear-gradient(180deg, #b36f1e, #8f5615);
	--mc-side-bg: linear-gradient(180deg, #7a4a12, #5d3709);
	--glow: rgba(255, 180, 84, 0.4);
}

.mini-cube--orange {
	--mc-top-bg: linear-gradient(135deg, #ffb27a, #ff8a42);
	--mc-front-bg: linear-gradient(180deg, #a8501c, #7d3a12);
	--mc-side-bg: linear-gradient(180deg, #5f2c0d, #4a2109);
	--glow: rgba(255, 138, 61, 0.4);
}

.mini-cube--gold {
	--mc-top-bg: linear-gradient(135deg, #ffe29a, #ffce5c);
	--mc-front-bg: linear-gradient(180deg, #b3871f, #8a6614);
	--mc-side-bg: linear-gradient(180deg, #6b4e0e, #523b09);
	--glow: rgba(255, 209, 102, 0.4);
}

.mini-cube--ember {
	--mc-top-bg: linear-gradient(135deg, #ff9d85, #ff6b4a);
	--mc-front-bg: linear-gradient(180deg, #a03323, #7d2618);
	--mc-side-bg: linear-gradient(180deg, #6d2114, #551a0f);
	--glow: rgba(255, 107, 74, 0.4);
}

.mini-cube--violet {
	--mc-top-bg: linear-gradient(135deg, #b3a6ff, #8b7bff);
	--mc-front-bg: linear-gradient(180deg, #4c3ea8, #382e85);
	--mc-side-bg: linear-gradient(180deg, #2e2668, #221c4f);
	--glow: rgba(139, 123, 255, 0.4);
}

.mini-cube--steel {
	--mc-top-bg: linear-gradient(135deg, #b9c6d2, #8fa3b3);
	--mc-front-bg: linear-gradient(180deg, #5d707f, #48586a);
	--mc-side-bg: linear-gradient(180deg, #3a4854, #2d3944);
	--glow: rgba(147, 164, 181, 0.35);
}

.item-amber  { --accent-c: #ffb454; --glow: rgba(255, 180, 84, 0.4); }
.item-orange { --accent-c: #ff8a3d; --glow: rgba(255, 138, 61, 0.4); }
.item-gold   { --accent-c: #ffd166; --glow: rgba(255, 209, 102, 0.4); }
.item-ember  { --accent-c: #ff6b4a; --glow: rgba(255, 107, 74, 0.4); }
.item-violet { --accent-c: #8b7bff; --glow: rgba(139, 123, 255, 0.4); }
.item-steel  { --accent-c: #93a4b5; --glow: rgba(147, 164, 181, 0.35); }

/* ============================================================
   КОСМОС (custom.html): звёзды, солнечная система, планеты,
   ссылки-кубы парят в невесомости
   ============================================================ */
.room--space {
	background: radial-gradient(120% 100% at 50% 0%, #0b1020 0%, #06080f 55%, #04060b 100%);
	border-color: #1a2338;
}

.room--space .room__glow {
	background: radial-gradient(120% 90% at 50% 45%, transparent 60%, rgba(2, 4, 10, 0.65) 100%);
}

/* звёздные слои */
.space__stars {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	background-image:
		radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.6px),
		radial-gradient(circle at 28% 6%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.6px),
		radial-gradient(circle at 44% 22%, rgba(255, 255, 255, 0.8) 0 1.4px, transparent 2px),
		radial-gradient(circle at 61% 9%, rgba(255, 255, 255, 0.75) 0 1px, transparent 1.6px),
		radial-gradient(circle at 78% 16%, rgba(255, 255, 255, 0.85) 0 1.4px, transparent 2px),
		radial-gradient(circle at 90% 28%, rgba(255, 255, 255, 0.6) 0 1px, transparent 1.6px),
		radial-gradient(circle at 7% 38%, rgba(255, 255, 255, 0.8) 0 1.4px, transparent 2px),
		radial-gradient(circle at 22% 44%, rgba(173, 216, 230, 0.9) 0 1.4px, transparent 2px),
		radial-gradient(circle at 38% 34%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1.6px),
		radial-gradient(circle at 55% 40%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.6px),
		radial-gradient(circle at 70% 30%, rgba(255, 200, 150, 0.8) 0 1.4px, transparent 2px),
		radial-gradient(circle at 84% 44%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.6px),
		radial-gradient(circle at 94% 56%, rgba(255, 255, 255, 0.75) 0 1.4px, transparent 2px),
		radial-gradient(circle at 15% 60%, rgba(255, 255, 255, 0.6) 0 1px, transparent 1.6px),
		radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.8) 0 1.4px, transparent 2px),
		radial-gradient(circle at 47% 62%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.6px),
		radial-gradient(circle at 63% 66%, rgba(173, 216, 230, 0.75) 0 1.4px, transparent 2px),
		radial-gradient(circle at 76% 58%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1.6px),
		radial-gradient(circle at 88% 70%, rgba(255, 255, 255, 0.8) 0 1.4px, transparent 2px),
		radial-gradient(circle at 9% 80%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.6px),
		radial-gradient(circle at 25% 88%, rgba(255, 255, 255, 0.75) 0 1.4px, transparent 2px),
		radial-gradient(circle at 41% 82%, rgba(255, 255, 255, 0.6) 0 1px, transparent 1.6px),
		radial-gradient(circle at 58% 90%, rgba(255, 255, 255, 0.8) 0 1.4px, transparent 2px),
		radial-gradient(circle at 72% 84%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.6px),
		radial-gradient(circle at 86% 90%, rgba(255, 255, 255, 0.8) 0 1.4px, transparent 2px),
		radial-gradient(circle at 96% 76%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.6px),
		radial-gradient(circle at 5% 55%, rgba(255, 255, 255, 0.75) 0 1.4px, transparent 2px),
		radial-gradient(circle at 68% 14%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1.6px);
}

.space__stars--2 {
	z-index: 1;
	opacity: 0.7;
	animation: twinkle 4.5s ease-in-out infinite alternate;
	background-image:
		radial-gradient(circle at 18% 28%, rgba(255, 255, 255, 0.8) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 33% 14%, rgba(255, 255, 255, 0.6) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 52% 30%, rgba(255, 255, 255, 0.7) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 67% 22%, rgba(255, 255, 255, 0.55) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 82% 36%, rgba(255, 255, 255, 0.7) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 11% 52%, rgba(255, 255, 255, 0.6) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 26% 56%, rgba(255, 255, 255, 0.7) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 42% 48%, rgba(255, 255, 255, 0.55) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 59% 52%, rgba(255, 255, 255, 0.65) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 74% 46%, rgba(255, 255, 255, 0.6) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 91% 50%, rgba(255, 255, 255, 0.7) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 20% 76%, rgba(255, 255, 255, 0.6) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 36% 92%, rgba(255, 255, 255, 0.7) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 51% 78%, rgba(255, 255, 255, 0.55) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 66% 94%, rgba(255, 255, 255, 0.6) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 81% 76%, rgba(255, 255, 255, 0.65) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 95% 86%, rgba(255, 255, 255, 0.6) 0 0.8px, transparent 1.4px),
		radial-gradient(circle at 45% 6%, rgba(255, 255, 255, 0.6) 0 0.8px, transparent 1.4px);
}

@keyframes twinkle {
	from { opacity: 0.45; }
	to   { opacity: 0.95; }
}

/* туманности */
.space__nebula {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	background:
		radial-gradient(420px 300px at 14% 22%, rgba(120, 80, 255, 0.10), transparent 70%),
		radial-gradient(460px 320px at 86% 74%, rgba(60, 180, 255, 0.09), transparent 70%),
		radial-gradient(380px 260px at 76% 16%, rgba(255, 120, 60, 0.06), transparent 70%);
}

/* солнечная система: наклонная плоскость орбит */
.space__system {
	position: absolute;
	left: 50%;
	top: 46%;
	width: 0;
	height: 0;
	z-index: 2;
	transform: perspective(1100px) rotateX(68deg);
	transform-style: preserve-3d;
}

.space__sunwrap {
	position: absolute;
	left: -70px;
	top: -70px;
	width: 140px;
	height: 140px;
	transform-style: preserve-3d;
}

.space__sun {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	transform: rotateX(-68deg);
	background: radial-gradient(circle at 40% 40%, #fff6d8, #ffce54 45%, #ff8f3c 75%, #f07f2e);
	box-shadow:
		0 0 50px 22px rgba(255, 170, 60, 0.4),
		0 0 120px 60px rgba(255, 140, 40, 0.18);
}

.space__orbit {
	position: absolute;
	left: 50%;
	top: 50%;
	width: var(--d);
	height: var(--d);
	margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
	transform-style: preserve-3d;
}

.space__orbit-spin {
	position: relative;
	width: 100%;
	height: 100%;
	border: 1px dashed rgba(160, 190, 255, 0.13);
	border-radius: 50%;
	transform-style: preserve-3d;
	animation: orbitSpin var(--t, 60s) linear infinite;
	animation-delay: var(--ad, 0s);
}

@keyframes orbitSpin {
	to { transform: rotate(360deg); }
}

/* планета: внешняя точка на кольце + шар, развёрнутый к зрителю */
.space__planet {
	position: absolute;
	top: 0;
	left: 50%;
	width: var(--ps);
	height: var(--ps);
	margin: calc(var(--ps) / -2) 0 0 calc(var(--ps) / -2);
	transform-style: preserve-3d;
}

.space__planet i {
	display: block;
	position: relative;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	transform: rotateX(-68deg);
	box-shadow: inset -3px -4px 9px rgba(0, 0, 0, 0.5);
}

.space__planet--mercury { --ps: 14px; }
.space__planet--mercury i { background: radial-gradient(circle at 35% 35%, #c9b8a6, #8a7a6a); }

.space__planet--venus { --ps: 18px; }
.space__planet--venus i { background: radial-gradient(circle at 35% 35%, #f6dd9a, #d49a3f); }

.space__planet--earth { --ps: 20px; }
.space__planet--earth i {
	background: radial-gradient(circle at 35% 35%, #7cd0ff, #1f66c8);
	box-shadow: inset -3px -4px 9px rgba(0, 0, 40, 0.55), 0 0 10px rgba(120, 200, 255, 0.45);
}

.space__planet--mars { --ps: 16px; }
.space__planet--mars i { background: radial-gradient(circle at 35% 35%, #ff9d76, #b64a2c); }

.space__planet--jupiter { --ps: 30px; }
.space__planet--jupiter i {
	background:
		repeating-linear-gradient(0deg, #e8d2ae 0 4px, #c9a26e 4px 7px, #b3865a 7px 11px);
	box-shadow: inset -4px -5px 10px rgba(60, 30, 10, 0.5);
}

.space__planet--saturn { --ps: 22px; }
.space__planet--saturn i { background: radial-gradient(circle at 35% 35%, #f0dfae, #d1b070); }
.space__planet--saturn i::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 175%;
	height: 60%;
	margin: -30% 0 0 -87%;
	border-radius: 50%;
	border: 2px solid rgba(230, 210, 160, 0.65);
	transform: rotateZ(-16deg);
}

/* плавающие ссылки-кубы */
/* слой на всю комнату, поэтому сам он пропускает клики —
   иначе перекрывает вывеску со ссылкой на главную */
.space__items {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
	pointer-events: none;
}

.space__items .shelf-item {
	pointer-events: auto;
}

.space-item {
	position: absolute;
	animation: floaty 6s ease-in-out infinite alternate;
}

.space-item--1 { left: 21%;  top: 26%; }
.space-item--2 { right: 15%; top: 15%; animation-delay: 1.6s; }
.space-item--3 { left: 19%;  bottom: 20%; animation-delay: 3.1s; }
.space-item--4 { right: 19%; bottom: 22%; animation-delay: 4.4s; }

@keyframes floaty {
	from { transform: translateY(-7px); }
	to   { transform: translateY(9px); }
}

/* ============================================================
   ФАБРИКА (electronics.html): та же комната, вместо стеллажей —
   конвейерные ленты, промышленные лампы в голубых тонах
   ============================================================ */
.room--factory .lamp__cable { height: 54px; }

.room--factory .lamp__strip {
	top: 74px;
	background: #eaf4ff;
	box-shadow:
		0 0 18px 4px rgba(140, 190, 255, 0.7),
		0 0 46px 14px rgba(77, 163, 255, 0.3);
}

.room--factory .lamp__beam {
	top: 80px;
	height: 210px;
	background: linear-gradient(180deg, rgba(150, 190, 255, 0.18), rgba(150, 190, 255, 0.02));
}

.room--factory .lamp__beam--1,
.room--factory .lamp__beam--3 {
	display: none;
}

.lamp--a { left: 22%; }
.lamp--b { left: 50%; }
.lamp--c { left: 78%; }

/* конвейерная лента */
.belt {
	position: absolute;
	z-index: 3;
}

.belt--far  { top: 33%; left: 22%; right: 22%; height: 20px; opacity: 0.9; }
.belt--near1 { top: 56%; left: 10%; right: 10%; height: 28px; }
.belt--near2 { top: 82%; left: 14%; right: 14%; height: 28px; }

.belt__surface {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: repeating-linear-gradient(90deg, #2b343e 0 10px, #1d242c 10px 24px);
	border: 2px solid #39434f;
	border-radius: 6px;
	box-shadow:
		inset 0 2px 0 rgba(255, 255, 255, 0.06),
		0 6px 14px rgba(0, 0, 0, 0.45);
	animation: beltMove 0.9s linear infinite;
}

@keyframes beltMove {
	to { background-position: 24px 0; }
}

/* направляющая поверх ленты */
.belt::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -7px;
	height: 7px;
	background: #4a5966;
	border-radius: 3px;
}

/* ножки ленты */
.belt__leg {
	position: absolute;
	top: 100%;
	width: 12px;
	background: linear-gradient(90deg, #2e3944, #1b232c);
	border-radius: 0 0 3px 3px;
	box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.05);
}

.belt__leg--l { left: 5%; }
.belt__leg--r { right: 5%; }

.belt--far .belt__leg   { height: 70px; }
.belt--near1 .belt__leg { height: 118px; }
.belt--near2 .belt__leg { height: 34px; }

/* барабаны по краям */
.belt__roller {
	position: absolute;
	top: 50%;
	width: 30px;
	height: 30px;
	margin-top: -15px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #5c6b78, #222c35);
	border: 2px solid #46545f;
}

.belt__roller--l { left: -15px; }
.belt__roller--r { right: -15px; }

.belt__roller::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 4px;
	width: 4px;
	height: 9px;
	margin-left: -2px;
	border-radius: 2px;
	background: #8fa3b3;
	animation: rollerSpin 0.9s linear infinite;
}

@keyframes rollerSpin {
	to { transform: rotate(360deg); }
}

/* коробки на дальней ленте */
.belt__box {
	position: absolute;
	top: -17px;
	width: 20px;
	height: 16px;
	background: linear-gradient(180deg, #42505d, #2a343f);
	border: 1px solid #55636f;
	border-radius: 2px;
	opacity: 0;
	animation: boxMove 9s linear infinite;
}

.belt__box--2 { animation-delay: 3s; }
.belt__box--3 { animation-delay: 6s; }

@keyframes boxMove {
	0%   { left: -4%;  opacity: 0; }
	6%   { opacity: 1; }
	92%  { opacity: 1; }
	100% { left: 99%;  opacity: 0; }
}

/* продукция на ленте */
.belt__items {
	position: absolute;
	left: 80px;
	right: 80px;
	bottom: 24px;
	display: flex;
	justify-content: space-around;
	align-items: flex-end;
	gap: 12px;
}
