:root {
	color-scheme: light;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-synthesis: none;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	width: 100%;
	min-width: 280px;
	height: 100%;
	min-height: 100%;
	margin: 0;
	overflow: hidden;
	background: #0f172a;
}

button {
	font: inherit;
}

.game-shell {
	position: relative;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	min-height: 420px;
	overflow: hidden;
	color: #142033;
	background: #fff;
}

.game-topbar {
	position: relative;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	min-height: 64px;
	padding: 10px clamp(14px, 3vw, 28px);
	background: rgba(255, 255, 255, 0.94);
	border-bottom: 1px solid rgba(148, 163, 184, 0.28);
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
	backdrop-filter: blur(12px);
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.brand-icon {
	display: grid;
	flex: 0 0 auto;
	width: 39px;
	height: 39px;
	place-items: center;
	color: #fff;
	background: var(--game-accent, #e11d48);
	border-radius: 12px;
	box-shadow: 0 8px 16px color-mix(in srgb, var(--game-accent, #e11d48) 24%, transparent);
	font-size: 20px;
}

.brand-copy {
	min-width: 0;
}

.brand-copy strong,
.brand-copy small {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.brand-copy strong {
	color: #111827;
	font-size: clamp(13px, 2vw, 16px);
	font-weight: 850;
}

.brand-copy small {
	margin-top: 2px;
	color: #6b7280;
	font-size: 10px;
}

.stats {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 7px;
}

.stat {
	min-width: 70px;
	padding: 7px 10px;
	text-align: center;
	background: #f4f6fa;
	border: 1px solid #e5e9f0;
	border-radius: 10px;
}

.stat span,
.stat strong {
	display: block;
}

.stat span {
	color: #737d8d;
	font-size: 9px;
	font-weight: 750;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.stat strong {
	margin-top: 1px;
	color: #172033;
	font-size: 15px;
	font-variant-numeric: tabular-nums;
}

.sound-button {
	display: grid;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	padding: 0;
	place-items: center;
	color: #384152;
	background: #fff;
	border: 1px solid #dce2eb;
	border-radius: 11px;
	cursor: pointer;
}

.sound-button:hover,
.sound-button:focus-visible {
	color: var(--game-accent, #e11d48);
	border-color: var(--game-accent, #e11d48);
	outline: none;
}

.stage {
	position: relative;
	min-height: 0;
	overflow: hidden;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.stage canvas {
	display: block;
	width: 100%;
	height: 100%;
	outline: none;
	touch-action: none;
}

.game-overlay {
	position: absolute;
	z-index: 8;
	inset: 0;
	display: grid;
	padding: 22px;
	place-items: center;
	text-align: center;
	background: rgba(10, 18, 35, 0.34);
	backdrop-filter: blur(3px);
	transition: opacity 180ms ease, visibility 180ms ease;
}

.game-overlay[hidden] {
	display: none;
}

.overlay-card {
	width: min(92%, 420px);
	padding: clamp(22px, 4vw, 34px);
	background: rgba(255, 255, 255, 0.96);
	border: 1px solid rgba(255, 255, 255, 0.8);
	border-radius: 22px;
	box-shadow: 0 25px 70px rgba(15, 23, 42, 0.28);
}

.overlay-icon {
	display: grid;
	width: 58px;
	height: 58px;
	margin: 0 auto 13px;
	place-items: center;
	color: #fff;
	background: var(--game-accent, #e11d48);
	border-radius: 18px;
	box-shadow: 0 10px 24px color-mix(in srgb, var(--game-accent, #e11d48) 30%, transparent);
	font-size: 28px;
	transform: rotate(-4deg);
}

.overlay-card h1 {
	margin: 0;
	color: #111827;
	font-size: clamp(22px, 4vw, 32px);
	font-weight: 900;
	line-height: 1.05;
	letter-spacing: -0.04em;
}

.overlay-card p {
	margin: 10px auto 19px;
	color: #5c6678;
	font-size: 13px;
	line-height: 1.55;
}

.primary-button {
	min-width: 170px;
	min-height: 45px;
	padding: 10px 20px;
	color: #fff;
	background: var(--game-accent, #e11d48);
	border: 0;
	border-radius: 12px;
	box-shadow: 0 10px 24px color-mix(in srgb, var(--game-accent, #e11d48) 28%, transparent);
	font-weight: 850;
	cursor: pointer;
	transition: transform 140ms ease, box-shadow 140ms ease;
}

.primary-button:hover,
.primary-button:focus-visible {
	box-shadow: 0 13px 28px color-mix(in srgb, var(--game-accent, #e11d48) 35%, transparent);
	outline: 3px solid color-mix(in srgb, var(--game-accent, #e11d48) 25%, transparent);
	transform: translateY(-1px);
}

.game-footer {
	position: relative;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 16px;
	color: #566174;
	background: #fff;
	border-top: 1px solid #e5e9f0;
	font-size: 11px;
	font-weight: 650;
	text-align: center;
}

.kbd {
	display: inline-flex;
	min-width: 24px;
	height: 23px;
	margin: 0 5px;
	padding: 0 7px;
	align-items: center;
	justify-content: center;
	color: #243047;
	background: #f5f7fa;
	border: 1px solid #cfd6e1;
	border-bottom-width: 2px;
	border-radius: 6px;
	font-size: 10px;
	font-weight: 850;
}

@media (max-width: 600px) {
	.game-topbar {
		min-height: 58px;
		padding-inline: 10px;
	}

	.brand-icon {
		width: 34px;
		height: 34px;
		border-radius: 10px;
		font-size: 17px;
	}

	.brand-copy small {
		display: none;
	}

	.stats {
		gap: 4px;
	}

	.stat {
		min-width: 55px;
		padding: 6px;
	}

	.stat span {
		font-size: 8px;
	}

	.stat strong {
		font-size: 13px;
	}

	.sound-button {
		width: 34px;
		height: 34px;
	}

	.game-footer {
		min-height: 40px;
	}
}

@media (max-width: 390px) {
	.brand-copy {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.game-overlay,
	.primary-button {
		transition: none;
	}
}
