/* =====================================================================
   SUPERVIVENCIA · TEST
   Quiz responsive mobile-first. Mismo lenguaje visual que las slides
   pero layout vertical pensado para móvil escaneando el QR.
   ===================================================================== */

html, body {
	min-height: 100dvh;
	min-height: 100vh;
	background: var(--ink);
	color: var(--bone);
	overflow-x: hidden;
	overflow-y: auto;
}

/* Fondo cinematográfico + texturas de la slide */
body.supervivencia-test::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: -2;
	background:
		radial-gradient(ellipse 100% 60% at 50% 30%, #2a2e32 0%, #16191c 50%, #0a0c0e 80%, #050608 100%);
}

body.supervivencia-test::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: -1;
	opacity: calc(0.22 * var(--grain-intensity));
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='3' stitchTiles='stitch' seed='3'/><feColorMatrix values='0 0 0 0 0.85, 0 0 0 0 0.78, 0 0 0 0 0.58, 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
	animation: grain 0.5s steps(5) infinite;
}

@keyframes grain {
	0%   { transform: translate(0, 0); }
	25%  { transform: translate(-3px, 2px); }
	50%  { transform: translate(2px, -2px); }
	75%  { transform: translate(-1px, -2px); }
	100% { transform: translate(1px, 1px); }
}

/* ---------- LAYOUT ---------- */
.quiz-app {
	max-width: 720px;
	margin: 0 auto;
	padding: 20px 20px 60px;
	min-height: 100dvh;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* ---------- HEADER ---------- */
.quiz-app-header {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--ochre-dim);
}

.quiz-app-brand {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: 'Special Elite', monospace;
	font-size: 12px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--ochre);
}

.brand-stamp {
	border: 1px solid var(--ochre-dim);
	padding: 3px 8px;
	color: var(--ochre);
}

.brand-sep {
	color: var(--rust);
}

.brand-name {
	color: var(--bone-dim);
}

.quiz-app-progress {
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: 'Special Elite', monospace;
	font-size: 11px;
	letter-spacing: 0.18em;
	color: var(--bone-dim);
	text-transform: uppercase;
}

.quiz-progress-track {
	flex: 1;
	height: 4px;
	background: var(--bg-soft);
	overflow: hidden;
	position: relative;
}

.quiz-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--rust-deep), var(--rust));
	width: 0%;
	transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
	box-shadow: 0 0 12px rgba(194, 90, 31, 0.5);
}

.quiz-progress-text {
	white-space: nowrap;
}

/* ---------- SCREENS ---------- */
.quiz-screen {
	display: flex;
	flex-direction: column;
	gap: 20px;
	animation: screen-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes screen-in {
	0%   { opacity: 0; transform: translateY(16px); }
	100% { opacity: 1; transform: translateY(0); }
}

[hidden] { display: none !important; }

/* ---------- HEADINGS ---------- */
.quiz-eyebrow {
	font-family: 'Special Elite', monospace;
	font-size: 12px;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--rust);
}

.quiz-h1 {
	font-family: 'Cinzel', serif;
	font-weight: 700;
	font-size: clamp(36px, 9vw, 64px);
	line-height: 1;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--bone);
	text-shadow: 0 4px 0 rgba(0,0,0,0.7), 0 0 30px rgba(0,0,0,0.6);
}

.quiz-h1 .accent {
	color: var(--rust);
}

.quiz-sub {
	font-size: clamp(16px, 4.2vw, 20px);
	color: var(--ochre);
	line-height: 1.45;
	max-width: 60ch;
}

/* ---------- INTRO RULES ---------- */
.quiz-rules {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 8px 0 12px;
	padding: 22px;
	background: rgba(28, 32, 36, 0.6);
	border: 1px solid rgba(154, 146, 133, 0.18);
	border-left: 3px solid var(--rust);
}

.quiz-rules li {
	font-family: 'Special Elite', monospace;
	font-size: 14px;
	color: var(--bone);
	letter-spacing: 0.02em;
	line-height: 1.5;
	display: flex;
	gap: 12px;
}

.quiz-rules .dot {
	color: var(--rust);
	font-family: 'Cinzel', serif;
	font-size: 18px;
	line-height: 1;
	flex-shrink: 0;
}

.quiz-footnote {
	font-family: 'IM Fell English', serif;
	font-style: italic;
	font-size: 16px;
	color: var(--bone-dim);
	text-align: center;
	margin-top: 8px;
	opacity: 0.7;
}

/* ---------- BUTTONS ---------- */
.quiz-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 56px;
	padding: 14px 24px;
	font-family: 'Cinzel', serif;
	font-weight: 700;
	font-size: 16px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	border: none;
	cursor: pointer;
	transition:
		background 0.2s ease,
		transform 0.2s ease,
		box-shadow 0.2s ease;
	width: 100%;
	-webkit-tap-highlight-color: transparent;
}

.quiz-btn-primary {
	background: var(--rust);
	color: var(--ink);
	box-shadow: 0 6px 20px rgba(194, 90, 31, 0.35), inset 0 -3px 0 rgba(0,0,0,0.35);
}

.quiz-btn-primary:hover {
	background: var(--warning);
	transform: translateY(-1px);
	box-shadow: 0 8px 24px rgba(216, 104, 40, 0.45), inset 0 -3px 0 rgba(0,0,0,0.35);
}

.quiz-btn-primary:active {
	transform: translateY(0);
	box-shadow: 0 3px 12px rgba(194, 90, 31, 0.3), inset 0 -1px 0 rgba(0,0,0,0.35);
}

.quiz-btn-next {
	background: transparent;
	color: var(--bone);
	border: 1px solid var(--ochre);
}

.quiz-btn-next:hover {
	background: var(--ochre);
	color: var(--ink);
}

.quiz-btn .arrow {
	font-family: 'Cinzel', serif;
	font-size: 22px;
	line-height: 1;
}

/* ---------- QUESTION ---------- */
.quiz-q-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-family: 'Special Elite', monospace;
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	margin-top: 8px;
}

.quiz-q-num {
	color: var(--rust);
	font-family: 'Cinzel', serif;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.25em;
}

.quiz-q-num .num {
	font-size: 22px;
}

.quiz-q-num .of {
	color: var(--bone-dim);
	margin-left: 4px;
}

.quiz-q-status {
	color: var(--warning);
}

.quiz-q-zone {
	font-family: 'Special Elite', monospace;
	font-size: 11px;
	letter-spacing: 0.2em;
	color: var(--ochre);
	text-transform: uppercase;
	padding: 4px 10px;
	border: 1px solid var(--ochre-dim);
	display: inline-block;
	align-self: flex-start;
	margin-top: -4px;
}

.quiz-q-text {
	font-family: 'IM Fell English', serif;
	font-style: italic;
	font-size: clamp(22px, 6vw, 30px);
	line-height: 1.3;
	color: var(--bone);
	margin: 4px 0 12px;
	max-width: 60ch;
}

/* ---------- ANSWERS ---------- */
.quiz-answers {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.quiz-answer {
	display: flex;
	align-items: stretch;
	gap: 14px;
	background: rgba(28, 32, 36, 0.7);
	border: 1px solid rgba(154, 146, 133, 0.25);
	border-left: 4px solid rgba(154, 146, 133, 0.45);
	padding: 14px 16px;
	min-height: 56px;
	cursor: pointer;
	text-align: left;
	font-family: 'Special Elite', monospace;
	font-size: 15px;
	color: var(--bone);
	letter-spacing: 0.01em;
	line-height: 1.4;
	transition: background 0.18s ease, border-left-color 0.18s ease, transform 0.18s ease;
	-webkit-tap-highlight-color: transparent;
}

.quiz-answer:hover:not(:disabled) {
	background: rgba(194, 90, 31, 0.12);
	border-left-color: var(--rust);
	transform: translateX(4px);
}

.quiz-answer:disabled {
	cursor: default;
}

.quiz-answer .letter {
	font-family: 'Cinzel', serif;
	font-weight: 700;
	font-size: 22px;
	color: var(--ochre);
	min-width: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border-right: 1px solid rgba(154, 146, 133, 0.2);
	padding-right: 12px;
	line-height: 1;
}

.quiz-answer .text {
	display: flex;
	align-items: center;
	flex: 1;
}

.quiz-answer.correct {
	background: rgba(74, 84, 64, 0.4);
	border-left-color: var(--moss);
	animation: correct-flash 0.4s ease-out;
}

.quiz-answer.correct .letter {
	color: var(--moss);
}

.quiz-answer.wrong {
	background: rgba(106, 32, 24, 0.4);
	border-left-color: var(--blood);
	animation: wrong-shake 0.5s ease-out;
}

.quiz-answer.wrong .letter {
	color: var(--blood);
}

.quiz-answer.dimmed {
	opacity: 0.4;
}

@keyframes correct-flash {
	0%   { background: rgba(74, 84, 64, 0.8); }
	100% { background: rgba(74, 84, 64, 0.4); }
}

@keyframes wrong-shake {
	0%, 100% { transform: translateX(0); }
	20%      { transform: translateX(-8px); }
	40%      { transform: translateX(8px); }
	60%      { transform: translateX(-5px); }
	80%      { transform: translateX(5px); }
}

/* ---------- EXPLANATION ---------- */
.quiz-explanation {
	background: rgba(28, 32, 36, 0.7);
	border: 1px solid rgba(154, 146, 133, 0.18);
	border-left: 3px solid var(--moss);
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	animation: screen-in 0.4s ease-out;
}

.explanation-tag {
	font-family: 'Cinzel', serif;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: var(--moss);
}

.explanation-text {
	font-family: 'Special Elite', monospace;
	font-size: 14px;
	line-height: 1.55;
	color: var(--bone);
}

.explanation-text strong {
	color: var(--bone);
	font-weight: 700;
}

/* ---------- DEATH ---------- */
.quiz-death {
	min-height: 70dvh;
	min-height: 70vh;
	justify-content: center;
	align-items: center;
	text-align: center;
	padding: 40px 0;
	gap: 24px;
}

.death-word {
	font-family: 'Cinzel', serif;
	font-weight: 700;
	font-size: clamp(58px, 16vw, 110px);
	line-height: 1;
	color: var(--blood);
	letter-spacing: 0.08em;
	text-shadow:
		0 0 50px rgba(122, 36, 24, 0.7),
		0 6px 0 rgba(0,0,0,0.9);
	animation: death-throb 1.6s ease-in-out infinite;
}

@keyframes death-throb {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%      { opacity: 0.75; transform: scale(1.03); }
}

.death-q-num {
	font-family: 'Special Elite', monospace;
	font-size: 13px;
	letter-spacing: 0.25em;
	color: var(--bone-dim);
	text-transform: uppercase;
}

.death-epitaph {
	font-family: 'IM Fell English', serif;
	font-style: italic;
	font-size: clamp(18px, 5vw, 22px);
	color: var(--ochre);
	line-height: 1.5;
	max-width: 44ch;
	padding: 0 8px;
}

.death-epitaph strong {
	color: var(--bone);
	font-style: normal;
}

/* ---------- WIN ---------- */
.quiz-win {
	min-height: 75dvh;
	min-height: 75vh;
	justify-content: center;
	align-items: center;
	text-align: center;
	padding: 40px 0;
	gap: 18px;
}

.win-score {
	font-family: 'Cinzel', serif;
	font-weight: 700;
	line-height: 0.9;
	color: var(--bone);
	text-shadow: 0 0 60px rgba(212, 205, 191, 0.2), 0 6px 0 rgba(0,0,0,0.85);
	margin: 12px 0;
}

.win-score .num {
	font-size: clamp(100px, 28vw, 180px);
}

.win-score .total {
	font-size: clamp(40px, 10vw, 64px);
	color: var(--ochre-dim);
}

.win-title {
	font-family: 'Cinzel', serif;
	font-weight: 700;
	font-size: clamp(28px, 7vw, 44px);
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--rust);
	line-height: 1.05;
}

.win-desc {
	font-family: 'IM Fell English', serif;
	font-style: italic;
	font-size: clamp(17px, 4.5vw, 21px);
	color: var(--bone);
	line-height: 1.5;
	max-width: 44ch;
	padding: 0 8px;
}

.win-time {
	font-family: 'Special Elite', monospace;
	font-size: 13px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--bone-dim);
	margin: 8px 0 16px;
}

.win-time span {
	color: var(--rust);
}

/* ---------- TABLET / DESKTOP ---------- */
@media (min-width: 720px) {
	.quiz-app {
		padding: 36px 36px 80px;
		gap: 32px;
	}
	.quiz-app-header {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 24px;
		padding-bottom: 22px;
	}
	.quiz-app-progress {
		min-width: 260px;
	}
	.quiz-rules {
		padding: 28px 32px;
	}
	.quiz-rules li {
		font-size: 16px;
	}
	.quiz-btn {
		min-height: 64px;
		font-size: 17px;
		max-width: 380px;
		align-self: flex-start;
	}
	.quiz-win .quiz-btn,
	.quiz-death .quiz-btn {
		align-self: center;
	}
	.quiz-answer {
		font-size: 16px;
		padding: 16px 20px;
	}
	.quiz-answer .letter {
		font-size: 26px;
		min-width: 38px;
	}
}

@media (min-width: 960px) {
	.quiz-app {
		max-width: 800px;
	}
}
