* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	background-color: #020617;
	color: #f8fafc;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.hidden {
	display: none;
}

.app-container {
	width: 100%;
	max-width: 72rem;
	padding: 2rem;
}

/* Header and instructions */

.app-header {
	text-align: center;
}

.app-meta {
	font-size: 0.85rem;
	color: #94a3b8;
	margin-bottom: 1.5rem;
}

.instructions {
	background-color: #020617;
	border: 2px solid #334155;
	border-radius: 0.75rem;
	padding: 2rem;
}

.instructions-lead {
	margin-top: 0.5rem;
	color: #cbd5f5;
}

.instructions-list {
	margin-top: 1rem;
	padding-left: 1.25rem;
}

.instructions-list li {
	margin-bottom: 0.5rem;
}

.start-button {
	margin-top: 2rem;
	padding: 0.75rem 2rem;
	font-size: 1.1rem;
	font-weight: 600;
	color: #020617;
	background-color: #38bdf8;
	border: none;
	border-radius: 9999px;
	cursor: pointer;
}

.start-button:hover {
	background-color: #7dd3fc;
}

.start-button:focus {
	outline: 3px solid #38bdf8;
	outline-offset: 3px;
}

/* Game screen */

.game-screen {
	text-align: center;
}

.typing-display {
	font-size: 2rem;
	font-weight: 600;
	margin-bottom: 1rem;
	line-height: 1.4;
}

.typing-display span {
	display: inline-block;
}

.typing-display .correct {
	color: #22c55e;
}

.typing-display .current {
	background-color: #1e3a8a;
	border-bottom: 4px solid #38bdf8;
}

.cursor {
	display: inline-block;
	width: 2px;
	height: 1.5em;
	background-color: #38bdf8;
	animation: blink 1s step-start infinite;
}

@keyframes blink {
	50% {
		opacity: 0;
	}
}

/* Keyboard activator input (sighted users) */

.typing-input-label {
	display: block;
	margin: 1rem auto 0.25rem;
	font-size: 0.9rem;
	color: #cbd5f5;
}

.typing-input {
	width: 100%;
	max-width: 32rem;
	margin: 0 auto 0.75rem;
	padding: 0.75rem;
	font-size: 1.1rem;
	border-radius: 0.5rem;
	border: 2px solid #334155;
	background-color: #0f172a;
	color: #f8fafc;
}

.typing-input:focus {
	outline: 3px solid #38bdf8;
	outline-offset: 2px;
}

/*
	Keyboard capture surface
	Non-editable, receives key events only.
	Kept visually minimal to avoid competing with gameplay.
*/

#keyboard-capture {
	width: 100%;
	max-width: 32rem;
	margin: 0 auto 1rem;
	height: 1px;
	overflow: hidden;
	outline: none;
}

/* Status bar */

.status-bar {
	display: flex;
	justify-content: space-between;
	max-width: 32rem;
	margin: 0 auto;
	font-size: 0.9rem;
	color: #cbd5f5;
}

/* Exit lesson button */

.exit-button {
	display: block;
	margin: 1.5rem auto 0;
	padding: 0.5rem 1.75rem;
	font-size: 1rem;
	font-weight: 600;
	color: #e2e8f0;
	background-color: transparent;
	border: 2px solid #334155;
	border-radius: 9999px;
	cursor: pointer;
}

.exit-button:hover {
	background-color: #1e293b;
}

.exit-button:focus {
	outline: 3px solid #38bdf8;
	outline-offset: 3px;
}

/* Results screen */

.results-screen {
	text-align: center;
}

.results-metrics {
	display: flex;
	justify-content: center;
	gap: 2rem;
	margin: 2rem 0;
	flex-wrap: wrap;
}

.metric {
	background-color: #020617;
	border: 2px solid #334155;
	border-radius: 0.75rem;
	padding: 1.5rem 2rem;
	min-width: 14rem;
}

.metric-label {
	font-size: 0.85rem;
	font-weight: 600;
	color: #94a3b8;
	margin-bottom: 0.5rem;
}

.metric-value {
	font-size: 2.5rem;
	font-weight: 700;
	color: #38bdf8;
}

.results-note {
	margin-bottom: 2rem;
	font-size: 1rem;
	color: #cbd5f5;
	font-style: italic;
	text-align: center;
}

/* Restart / close results */

.restart-button {
	padding: 0.75rem 2rem;
	font-size: 1.1rem;
	font-weight: 600;
	color: #020617;
	background-color: #38bdf8;
	border: none;
	border-radius: 9999px;
	cursor: pointer;
}

.restart-button:hover {
	background-color: #7dd3fc;
}

.restart-button:focus {
	outline: 3px solid #38bdf8;
	outline-offset: 3px;
}

/* Footer */

.footer-panel {
	width: 100%;
	max-width: 72rem;
	margin-top: 2rem;
	padding: 1.5rem 2rem;
	background-color: #020617;
	border-top: 2px solid #334155;
	text-align: center;
}

.footer-panel nav {
	margin-bottom: 1rem;
}

.footer-links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	justify-content: center;
	gap: 1.5rem;
	flex-wrap: wrap;
}

.footer-links li {
	margin: 0;
}

.footer-links a {
	color: #38bdf8;
	text-decoration: none;
	font-weight: 600;
}

.footer-links a:hover,
.footer-links a:focus {
	text-decoration: underline;
}

.footer-copy {
	font-size: 0.8rem;
	color: #94a3b8;
}

.footer-copy.small {
	font-size: 0.75rem;
}

.footer-copy.muted {
	color: #64748b;
}
