/* ── Reset / prevent any page scroll ───────────────────────── */
html, body {
	padding: 0;
	margin: 0;
	overflow: hidden;
	height: 100%;
	font-family: 'Roboto', sans-serif;
}

/* ── Page background (category art) ────────────────────────── */
#background {
	width: 100vw;
	height: 100vh;
	overflow: hidden;
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center center;
}

/* ── Scene: hidden until JS adds .scene-active ──────────────── */
#scene {
	display: none;
	box-sizing: border-box;
	width: 100%;
	max-width: 920px;
	height: 100vh;
	margin: 0 auto;
	overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   PORTRAIT  —  vertical stack: question → image → choices → footer
   ═══════════════════════════════════════════════════════════════ */
#scene.scene-active {
	display: flex;
	flex-direction: column;
	padding: 1.4vh 3.5vw;
	gap: 1.1vh;
}

/* Question: natural height, can compress; JS sets exact height */
#question {
	flex: 0 1 auto;
	min-height: 0;
	box-sizing: border-box;
	background-color: #ffffff;
	border-radius: 1.5vmin;
	padding: 0.55em 1.5em;
	text-align: center;
	user-select: none;
	font-size: 1.2rem;   /* JS overrides immediately */
	line-height: 1.4;
	color: #111111;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.42);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

#qtext {
	width: 100%;
	text-align: center;
}

/* Image: elastic buffer in portrait — gets all leftover height */
#image {
	flex: 1 1 0;
	min-height: 0;
	box-sizing: border-box;
	background-color: #dde0e5;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center center;
	border-radius: 1.5vmin;
	border: 4px solid #ffffff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.42);
}

/* Answers column */
#choices {
	flex: 0 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 0.9vh;
}

.answer {
	box-sizing: border-box;
	background-color: #ffffff;
	border-radius: 1.5vmin;
	font-size: 1.1rem;   /* JS overrides immediately */
	line-height: 1.35;
	text-align: center;
	padding: 0.5em 1.4em;
	min-height: 44px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	user-select: none;
	-webkit-user-select: none;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	color: #111111;
	width: 100%;
	overflow: hidden;
}

#atext1, #atext2, #atext3 {
	width: 100%;
	text-align: center;
}

.answer:active {
	opacity: 0.8;
}

.answer.correct {
	background-color: #2a9d50;
	color: #ffffff;
}

.answer.wrong {
	background-color: #c0392b;
	color: #ffffff;
}

/* Footer */
#footer {
	flex: 0 0 auto;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.6vh;
}

/* ═══════════════════════════════════════════════════════════════
   LANDSCAPE  —  3-row × 2-column grid, true full-screen:
     Row 1 : question  — spans BOTH columns (full width)
     Row 2 : left = answers  |  right = image  (50 / 50)
     Row 3 : footer    — spans BOTH columns (full width)
   ═══════════════════════════════════════════════════════════════ */
@media (orientation: landscape) {
	/* Remove the portrait max-width cap so the scene fills the screen */
	#scene {
		max-width: none;
	}

	#scene.scene-active {
		display: grid;
		grid-template-columns: 50fr 50fr;
		grid-template-rows: auto 1fr auto;
		gap: 0.8vh 1vw;
		padding: 0.8vh 1.5vw;
	}

	/* Question spans full width across the top */
	#question {
		grid-column: 1 / 3;
		grid-row: 1;
	}

	/* Answers fill the left half of the middle row */
	#choices {
		grid-column: 1;
		grid-row: 2;
		justify-content: center;
	}

	/* Image fills the right half of the middle row.
	   contain = always shows the full image, never crops. */
	#image {
		grid-column: 2;
		grid-row: 2;
		flex: none;        /* cancel portrait flex:1 */
		min-height: 0;
		width: 100%;
		height: 100%;
		background-size: contain;
		background-position: center center;
	}

	/* Footer spans full width across the bottom */
	#footer {
		grid-column: 1 / 3;
		grid-row: 3;
	}
}

/* ── Score & Skip ───────────────────────────────────────────── */
#score {
	background-color: #5c6bc0;
	height: max(36px, 5vh);
	display: inline-flex;
	align-items: center;
	font-size: clamp(0.8rem, 2.5vmin, 1.2rem);
	padding: 0 1.3em;
	border-radius: 0.5vmin;
	user-select: none;
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.55);
	white-space: nowrap;
}

#skipbtn {
	height: max(36px, 5vh);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: clamp(0.8rem, 2.5vmin, 1.2rem);
	padding: 0 1.4em;
	border-radius: 0.5vmin;
	cursor: pointer;
	user-select: none;
	background-color: #7e57c2;
	color: #ffffff;
	border: 3px solid #ffffff;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
	white-space: nowrap;
	font-family: 'Roboto', sans-serif;
	font-weight: 400;
}

#skipbtn:active {
	opacity: 0.8;
}

/* ── Hidden preload img ─────────────────────────────────────── */
#testimg {
	position: absolute;
	z-index: -1;
	width: 1px;
	height: 1px;
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.answer, #skipbtn {
		transition: none;
	}
}
