/* ============================================================
   Секция hero — интерактивное кино на весь первый экран
   Состояния корня: .is-intro (заголовок+старт) → .is-live (игра)
   → .is-final (оверлей финала). .is-postermode — нет видео.
   ============================================================ */
.s-hero {
	position: relative;
	min-height: 100svh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-top: 88px; /* под sticky-шапку */
	background-color: var(--c-black);
	overflow: hidden;
}

/* Атрибут hidden должен побеждать любые display этого блока */
.s-hero [hidden] { display: none !important; }

/* ---------- Экран (видео/постер на весь хиро) ---------- */
.s-hero__screen { position: absolute; inset: 0; z-index: 0; }

.s-hero__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* В роликах Kling водяной знак «KlingAI» в правом нижнем углу (нижние ~5% кадра).
	   Лёгкий зум с опорой чуть выше центра уводит низ кадра за край и прячет знак.
	   Временная мера: правильно — выгрузить ролики без знака, тогда эти две строки убрать. */
	transform: scale(1.12);
	transform-origin: 50% 35%;
}

/* Постер-режим: тёмная сцена с фирменным свечением */
.s-hero__poster {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--c-black);
	background-image: var(--grad-glow);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease, visibility 0.4s ease;
}
.s-hero.is-postermode .s-hero__poster {
	opacity: 1;
	visibility: visible;
}

/* Карточка кадра — «стекло» по центру экрана; в интро прячется за лид-слоем */
.s-hero__frame {
	position: relative;
	max-width: 620px;
	margin-inline: 16px;
	padding: clamp(18px, 3vw, 28px) clamp(20px, 4vw, 36px);
	display: grid;
	justify-items: center;
	gap: 10px;
	text-align: center;
	color: var(--c-white);
	background: rgba(18, 20, 42, 0.55);
	border: 1px solid var(--surface-line);
	border-radius: var(--r-card);
	backdrop-filter: blur(6px);
	transform: translateY(-6vh);
	transition: opacity 0.4s ease;
}
.s-hero.is-intro .s-hero__frame,
.s-hero.is-final .s-hero__frame { opacity: 0; }
.s-hero__frame-emoji { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1; }
.s-hero__frame-title {
	font-size: clamp(1.3rem, 3vw, 1.9rem);
	line-height: var(--lh-head);
}
.s-hero__frame-text {
	margin: 0;
	font-size: var(--fs-text);
	color: rgba(255, 255, 255, 0.85);
}

/* Затемнения для читаемости шапки и нижних слоёв */
.s-hero__scrim {
	position: absolute;
	left: 0; right: 0;
	pointer-events: none;
}
.s-hero__scrim--top {
	top: 0; height: 140px;
	background: linear-gradient(180deg, rgba(7, 8, 21, 0.85) 0%, rgba(7, 8, 21, 0) 100%);
}
.s-hero__scrim--bottom {
	bottom: 0; height: 45%;
	background: linear-gradient(0deg, rgba(7, 8, 21, 0.9) 0%, rgba(7, 8, 21, 0) 100%);
}

/* Вспышка при верном ответе */
.s-hero.is-celebrate::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 4;
	background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 60%);
	animation: hero-flash 0.9s ease-out forwards;
	pointer-events: none;
}
@keyframes hero-flash {
	0% { opacity: 0; }
	25% { opacity: 1; }
	100% { opacity: 0; }
}

/* ---------- Декор-ленты: только в интро и финале ---------- */
.s-hero__deco {
	z-index: 1;
	transition: opacity 0.5s ease;
}
.s-hero.is-live .s-hero__deco { opacity: 0; }

/* ---------- Лид-слой: заголовок, старт, пилюли ---------- */
.s-hero__lead {
	position: relative;
	z-index: 2;
	display: grid;
	justify-items: center;
	text-align: center;
	gap: clamp(16px, 3vw, 28px);
	transition: opacity 0.5s ease, transform 0.5s ease;
}
.s-hero.is-live .s-hero__lead,
.s-hero.is-final .s-hero__lead {
	opacity: 0;
	transform: translateY(-24px);
	pointer-events: none;
	/* Убираем из потока, чтобы невидимый лид не растягивал секцию выше вьюпорта */
	position: absolute;
	left: 0;
	right: 0;
}
/* Во время игры/финала хиро строго = высоте экрана (шапка теперь fixed и места
   не занимает), чтобы нижний лист с ответами и «Дальше» были в зоне видимости. */
.s-hero.is-live,
.s-hero.is-final {
	height: 100svh;
	min-height: 0;
}

.s-hero__eyebrow {
	display: inline-flex;
	align-items: center;
	padding: 7px 16px;
	border-radius: var(--r-pill);
	background: var(--c-blue-t40);
	border: 1px solid var(--surface-line);
	font-size: var(--fs-caption);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--c-grey-light);
}
.s-hero__title { margin-bottom: 0; max-width: 900px; }
.s-hero__subline {
	color: var(--c-grey-light);
	max-width: 660px;
	margin: 0;
}

.s-hero__startrow {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
}
.s-hero__start {
	height: 56px;
	padding-inline: 36px;
	font-size: var(--fs-h4);
	box-shadow: 0 14px 44px rgba(7, 8, 21, 0.45);
	animation: hero-pulse 1.8s ease-in-out infinite;
}
@keyframes hero-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.045); }
}

/* «Подобрать игру» — рядом со стартом и появляется только вместе с ним */
.s-hero__pick {
	height: 56px;
	padding-inline: 28px;
	font-size: var(--fs-h4);
	background: rgba(7, 8, 21, 0.45);
	backdrop-filter: blur(6px);
}
.s-hero__start[hidden] + .s-hero__pick { display: none; }

.s-hero__proof {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

/* ---------- Оверлеи игры ---------- */
.s-hero__overlay {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: clamp(14px, 3vw, 32px);
	pointer-events: none;
}
.s-hero__overlay > * { pointer-events: auto; }

/* Карточка вопроса — нижний лист поверх играющей петли */
.s-hero__qcard {
	width: min(680px, 100%);
	background: rgba(7, 8, 21, 0.85);
	backdrop-filter: blur(10px);
	border: 1px solid var(--surface-line);
	border-radius: var(--r-card);
	padding: 18px 18px 16px;
	display: grid;
	gap: 12px;
	text-align: left;
	animation: hero-sheet-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes hero-sheet-in {
	from { transform: translateY(24px); opacity: 0; }
	to { transform: none; opacity: 1; }
}

.s-hero__qtimer {
	height: 4px;
	border-radius: 2px;
	background: rgba(227, 228, 241, 0.15);
	overflow: hidden;
}
.s-hero__qtimer i {
	display: block;
	height: 100%;
	width: 100%;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--c-blue), #b517c8, var(--c-red));
}

.s-hero__qtext {
	margin: 0;
	font: 600 var(--fs-h4)/1.3 var(--font-body);
	color: var(--c-white);
}

.s-hero__answers {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.s-hero__answer {
	position: relative;
	min-height: 44px;
	padding: 10px 14px;
	border-radius: var(--r-btn);
	border: 1px solid var(--surface-line);
	background: var(--c-blue-t40);
	color: var(--c-grey-light);
	font: 500 var(--fs-caption)/1.25 var(--font-body);
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}
.s-hero__answer:hover:not(:disabled) {
	border-color: rgba(227, 228, 241, 0.45);
	color: var(--c-white);
}
.s-hero__answer:active:not(:disabled) { transform: scale(0.98); }
.s-hero__answer:disabled { cursor: default; }

/* Верный — зелёный с галочкой */
.s-hero__answer.is-correct {
	background: rgba(18, 138, 66, 0.4);
	border-color: #2ecc71;
	color: #fff;
	padding-right: 38px;
}
.s-hero__answer.is-correct::after {
	content: '✓';
	position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
	font-weight: 700; color: #2ecc71;
}
/* Твой неверный — красный с крестиком */
.s-hero__answer.is-wrong {
	background: rgba(255, 0, 4, 0.28);
	border-color: var(--c-red);
	color: #fff;
	padding-right: 38px;
}
.s-hero__answer.is-wrong::after {
	content: '✕';
	position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
	font-weight: 700; color: #ff6b6d;
}

.s-hero__qfoot {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}
.s-hero__qnote { margin: 0; min-height: 1.2em; flex: 1 1 240px; }
.s-hero__qnote.is-good { color: #2ecc71; }
.s-hero__qnote.is-bad { color: #ff8a8c; }
.s-hero__next { flex-shrink: 0; }

/* После ответа: верный — зелёный, твой неверный — красный; остаются на экране.
   Прячем таймер и текст вопроса (уже прочитан), незадействованные — приглушаем. */
.s-hero__qcard { max-height: calc(100svh - 140px); overflow-y: auto; }
.s-hero__qcard.is-answered .s-hero__qtimer,
.s-hero__qcard.is-answered .s-hero__qtext { display: none; }
.s-hero__qcard.is-answered .s-hero__answer:not(.is-correct):not(.is-wrong) { opacity: 0.4; }

/* Финал */
.s-hero__overlay--final { align-items: center; }
.s-hero__final {
	width: min(600px, 100%);
	background: rgba(7, 8, 21, 0.85);
	backdrop-filter: blur(10px);
	border: 1px solid var(--surface-line);
	border-radius: var(--r-card);
	padding: clamp(22px, 4vw, 36px);
	display: grid;
	justify-items: center;
	gap: 14px;
	text-align: center;
	animation: hero-sheet-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.s-hero__final-score {
	font-size: clamp(1.5rem, 3.4vw, 2.2rem);
	line-height: var(--lh-head);
	color: var(--c-white);
	margin: 0;
}
.s-hero__final-note { margin: 0; color: var(--c-grey-light); font-size: var(--fs-caption); }
.s-hero__final-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---------- HUD: один компактный блок сверху по центру ---------- */
.s-hero__hud {
	position: absolute;
	top: 88px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 6;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 8px 8px 8px 16px;
	border-radius: var(--r-pill);
	background: rgba(7, 8, 21, 0.72);
	border: 1px solid rgba(227, 228, 241, 0.22);
	backdrop-filter: blur(10px);
	box-shadow: 0 6px 24px rgba(7, 8, 21, 0.4);
	transition: opacity 0.3s ease, visibility 0.3s ease;
}
.s-hero.is-final .s-hero__hud { opacity: 0; visibility: hidden; }

.s-hero__progress { display: flex; gap: 6px; }
.s-hero__progress i {
	width: 20px;
	height: 5px;
	border-radius: 3px;
	background: rgba(227, 228, 241, 0.28);
	transition: background 0.25s ease;
}
.s-hero__progress i.is-done { background: rgba(227, 228, 241, 0.75); }
.s-hero__progress i.is-current {
	background: linear-gradient(90deg, var(--c-blue), #b517c8, var(--c-red));
}

.s-hero__hud-sep {
	width: 1px;
	height: 18px;
	background: rgba(227, 228, 241, 0.2);
}

/* Отдельная кнопка звука — справа сверху, видна и во время финала (когда играет трек) */
.s-hero__sound {
	position: absolute;
	top: 88px;
	right: 16px;
	z-index: 7;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	border: 1px solid rgba(227, 228, 241, 0.22);
	background: rgba(7, 8, 21, 0.6);
	backdrop-filter: blur(8px);
	font-size: 18px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.12s ease;
}
.s-hero__sound:hover { background: rgba(7, 8, 21, 0.82); }
.s-hero__sound:active { transform: scale(0.94); }
/* На мобиле HUD по центру почти во всю ширину — кнопка звука встаёт под ним, а не рядом
   (раньше налезала на «Пропустить») */
@media (max-width: 700px) { .s-hero__sound { top: 134px; right: 12px; } }

.s-hero__skip {
	height: 30px;
	min-width: 130px;
	padding-inline: 14px;
	border-radius: var(--r-pill);
	border: none;
	background: rgba(227, 228, 241, 0.12);
	color: var(--c-white);
	font: 600 var(--fs-m-text)/1 var(--font-body);
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.15s ease;
}
.s-hero__skip:hover { background: rgba(227, 228, 241, 0.24); }
.s-hero__skip::after { content: ' →'; opacity: 0.7; white-space: nowrap; }

/* Стрелка «Что это за игра ↓» — приглашение листать (скрыта, пока скролл заблокирован) */
.s-hero__more {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 5;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border-radius: var(--r-pill);
	border: 1px solid rgba(227, 228, 241, 0.22);
	background: rgba(7, 8, 21, 0.5);
	backdrop-filter: blur(8px);
	color: var(--c-grey-light);
	font: 500 var(--fs-caption)/1 var(--font-body);
	animation: hero-bounce 2.4s ease-in-out infinite;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.s-hero__more:hover { color: var(--c-white); border-color: rgba(227, 228, 241, 0.4); }
@keyframes hero-bounce {
	0%, 100% { transform: translate(-50%, 0); }
	50% { transform: translate(-50%, 5px); }
}

/* ---------- Скролл заблокирован на интро ---------- */
html.mozgva-scroll-lock,
html.mozgva-scroll-lock body { overflow: hidden; }
html.mozgva-scroll-lock .s-hero__more { display: none; }

/* Подсказка «Смотрите — вы входите в игру…» — только пока скролл заблокирован */
.s-hero__lead-hint {
	display: none;
	font-size: var(--fs-caption);
	color: var(--c-grey-dark);
	letter-spacing: 0.02em;
}
html.mozgva-scroll-lock .s-hero__lead-hint { display: block; }
/* Кнопку старта и пилюли-доказательства прячем, пока идёт интро */
html.mozgva-scroll-lock .s-hero__startrow,
html.mozgva-scroll-lock .s-hero__proof { display: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 700px) {
	.s-hero { padding-top: 80px; }
	.s-hero__answers { grid-template-columns: 1fr; }
	.s-hero__overlay { padding: 10px 10px 66px; }
	.s-hero__qcard { padding: 14px; }
	/* После ответа на мобиле показываем только верный (зелёный) и твой (красный) —
	   карточка компактная, «Дальше» всегда в зоне видимости */
	.s-hero__qcard.is-answered .s-hero__answer:not(.is-correct):not(.is-wrong) { display: none; }
	/* Кнопка старта на мобиле — примерно на четверть компактнее: во всю ширину
	   она выходила крупнее самого заголовка и перетягивала на себя внимание */
	.s-hero__startrow { width: 100%; flex-direction: row; justify-content: center; gap: 10px; }
	.s-hero__startrow .btn { width: auto; }
	.s-hero__start { height: 42px; padding-inline: 26px; font-size: var(--fs-caption); }
	.s-hero__pick { height: 42px; padding-inline: 22px; font-size: var(--fs-caption); }
	.s-hero__hud { top: 78px; }
	.s-hero__frame { transform: translateY(-4vh); }
	.s-hero__frame-text { font-size: var(--fs-caption); }
	.s-hero__more { bottom: 12px; }
}

/* Подсказка «вопрос со звуком»: музыкальный вопрос держится на треке,
   а заметная часть людей смотрит без звука */
.s-hero__qsound {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px;
	font-size: var(--fs-caption);
	font-weight: 600;
	color: inherit;
}
.s-hero__eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.s-hero__eq i {
	width: 3px;
	height: 100%;
	border-radius: 2px;
	background: #6d5cff;
	transform-origin: bottom;
	animation: hero-eq 0.9s ease-in-out infinite;
}
.s-hero__eq i:nth-child(2) { animation-delay: -0.3s; }
.s-hero__eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes hero-eq {
	0%, 100% { transform: scaleY(0.35); }
	50% { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
	.s-hero__eq i { animation: none; transform: scaleY(0.7); }
	.s-hero__start, .s-hero__more { animation: none; }
	.s-hero__qcard, .s-hero__final { animation: none; }
}
