/*
 * File: css/student_games_runner.css
 * Purpose: Styling for StudentGames' 'runner_collect' game_type, rendered by
 * secure/classes/460__student_games.php into a .sgr-root mount point that
 * js/student_games_runner.js then fills in. Scoped entirely under .sgr-*
 * classes / a .sgr-root custom-property scope (not :root) so nothing here
 * can leak into the rest of the page or collide with student_games.css's
 * .sg-* rules for the other game_type.
 */

.sgr-root {
	--sgr-peacock: #0b6e6e;
	--sgr-peacock-dark: #063f3f;
	--sgr-marigold: #f2a93b;
	--sgr-marigold-dark: #c97f16;
	--sgr-sand: #eac873;
	--sgr-sky-top: #fdf3e1;
	--sgr-sky-bottom: #bfe3e3;
	--sgr-ink: #21322b;
	--sgr-ink-soft: #4d5f56;
	--sgr-card: #ffffff;
	--sgr-line: #e3d6b4;
	--sgr-font-display: ui-rounded, "SF Pro Rounded", "Baloo 2", "Segoe UI", system-ui, sans-serif;

	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--sgr-ink);
}

.sgr-hud {
	display: flex;
	align-items: stretch;
	gap: 0.7rem;
	margin-bottom: 0.8rem;
	flex-wrap: wrap;
}

.sgr-stat {
	background: var(--sgr-card);
	border: 1px solid var(--sgr-line);
	border-radius: 14px;
	padding: 0.55rem 1rem;
	text-align: center;
	min-width: 88px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sgr-num {
	font-family: var(--sgr-font-display);
	font-weight: 800;
	font-size: 1.4rem;
	color: var(--sgr-peacock);
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.sgr-lbl {
	font-size: 0.68rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--sgr-ink-soft);
}

.sgr-flashcard {
	flex: 1;
	min-width: 220px;
	background: linear-gradient(135deg, var(--sgr-marigold), var(--sgr-marigold-dark));
	border-radius: 14px;
	padding: 0.5rem 1.1rem;
	display: flex;
	align-items: center;
	gap: 0.8rem;
	color: #3a2405;
	box-shadow: 0 2px 6px rgba(201, 127, 22, 0.35);
}

.sgr-fc-glyph {
	font-size: 2.1rem;
	font-weight: 800;
	min-width: 2.4ch;
	line-height: 1;
	transition: transform 0.25s ease;
}

.sgr-flashcard.pop .sgr-fc-glyph { animation: sgr-pop 0.35s ease; }

@keyframes sgr-pop {
	0% { transform: scale(1); }
	40% { transform: scale(1.35); }
	100% { transform: scale(1); }
}

.sgr-fc-meta {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.sgr-fc-translit { font-weight: 700; font-size: 0.95rem; }
.sgr-fc-en { font-size: 0.75rem; opacity: 0.85; }
.sgr-fc-hint { font-size: 0.8rem; font-weight: 600; opacity: 0.9; }

.sgr-stage {
	position: relative;
	border-radius: 20px;
	overflow: hidden;
	border: 1px solid var(--sgr-line);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08), 0 14px 30px rgba(0, 0, 0, 0.06);
	background: var(--sgr-sky-bottom);
	touch-action: none;
}

.sgr-canvas {
	display: block;
	width: 100%;
	height: auto;
}

.sgr-mute-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	border: none;
	background: rgba(255, 255, 255, 0.85);
	font-size: 1.1rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sgr-overlay {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(20, 30, 26, 0.55);
}

.sgr-overlay.show { display: flex; }

.sgr-overlay-card {
	background: var(--sgr-card);
	border-radius: 18px;
	padding: 1.4rem 1.6rem;
	text-align: center;
	max-width: 380px;
	width: 88%;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.sgr-over-title {
	font-family: var(--sgr-font-display);
	margin: 0 0 0.3rem;
	color: #c0392b;
	font-size: 1.3rem;
}

.sgr-final-score {
	font-family: var(--sgr-font-display);
	font-weight: 800;
	font-size: 2.2rem;
	color: var(--sgr-peacock);
}

.sgr-learned-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	justify-content: center;
	margin: 0.9rem 0 1.1rem;
	font-size: 1.15rem;
}

.sgr-learned-row span {
	background: var(--sgr-sand);
	color: #3a2405;
	border-radius: 8px;
	padding: 0.1rem 0.5rem;
}

.sgr-play-again-btn {
	font-family: var(--sgr-font-display);
	font-weight: 800;
	font-size: 1rem;
	border: none;
	border-radius: 999px;
	padding: 0.65rem 1.6rem;
	background: var(--sgr-peacock);
	color: white;
	cursor: pointer;
	transition: transform 0.1s ease, background 0.15s ease;
}

.sgr-play-again-btn:hover { background: var(--sgr-peacock-dark); transform: translateY(-1px); }
.sgr-play-again-btn:active { transform: translateY(0); }

.sgr-controls {
	display: flex;
	gap: 0.6rem;
	justify-content: center;
	margin-top: 1rem;
}

.sgr-ctl-btn {
	font-family: var(--sgr-font-display);
	font-weight: 700;
	font-size: 0.9rem;
	border: 1px solid var(--sgr-line);
	background: var(--sgr-card);
	color: var(--sgr-ink);
	border-radius: 12px;
	padding: 0.6rem 1.1rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 0.4rem;
	user-select: none;
	-webkit-user-select: none;
}

.sgr-ctl-btn:active { background: var(--sgr-sand); }

@media (max-width: 520px) {
	.sgr-stat { min-width: 70px; padding: 0.45rem 0.7rem; }
}
