:root {
	--bg: #050816;
	--fg: #e5e7eb;
	--muted: #94a3b8;
	--accent: #22d3ee;
	--accent2: #a78bfa;
}

* {
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

html,
body {
	height: 100%;
}

body {
	margin: 0;
	font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
	color: var(--fg);
	background:
		radial-gradient(1200px 800px at 50% 10%, #111827 0%, #0b1020 55%, #050816 100%),
		conic-gradient(from 180deg at 50% 50%, rgba(34, 211, 238, 0.08), rgba(167, 139, 250, 0.08), rgba(34, 211, 238, 0.08));
}

.app {
	min-height: 100dvh;
	display: grid;
	grid-template-rows: auto 1fr auto;
}

.topbar,
.bottombar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 14px;
	background: rgba(255, 255, 255, 0.06);
	backdrop-filter: saturate(140%) blur(8px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bottombar {
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	border-bottom: none;
}

.brand {
	font-weight: 800;
	letter-spacing: .3px;
}

.actions {
	display: flex;
	gap: 8px;
}

button {
	appearance: none;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 10px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.06));
	color: var(--fg);
	padding: 8px 12px;
	font-size: 14px;
	cursor: pointer;
	box-shadow: inset 0 0 12px rgba(167, 139, 250, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

button:hover {
	background: rgba(255, 255, 255, 0.14);
}

.stage-wrap {
	position: relative;
	display: grid;
	place-items: center;
	padding: 10px;
}

.stage {
	display: block;
	width: 100%;
	height: auto;
	max-width: min(95vw, 1100px);
	border-radius: 14px;
	background: #020617;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(167, 139, 250, 0.18), 0 0 60px rgba(34, 211, 238, 0.12);
	touch-action: none;
	/* 让触控事件可被 JS 捕获 */
}

.hint {
	position: absolute;
	bottom: 16px;
	left: 0;
	right: 0;
	text-align: center;
	color: var(--muted);
	font-size: 13px;
}

.score {
	font-variant-numeric: tabular-nums;
}

.status {
	color: var(--muted);
}

@media (orientation: portrait) {
	.stage {
		max-width: 96vw;
	}
}

/* 胜利覆盖层 */
.overlay {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(2, 6, 23, 0.55);
	backdrop-filter: blur(6px) saturate(130%);
}

.overlay[aria-hidden="false"] {
	display: flex;
}

.win-card {
	width: min(92vw, 480px);
	padding: 22px 18px;
	border-radius: 16px;
	background: radial-gradient(240px 160px at 20% -10%, rgba(167, 139, 250, 0.15), transparent),
		radial-gradient(240px 160px at 120% 110%, rgba(34, 211, 238, 0.15), transparent),
		rgba(255, 255, 255, 0.06);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
	text-align: center;
}

.win-title {
	font-size: 28px;
	font-weight: 900;
	letter-spacing: .3px;
	margin-bottom: 6px;
}

.win-sub {
	color: var(--muted);
	margin-bottom: 14px;
}

.win-actions {
	display: flex;
	gap: 10px;
	justify-content: center;
}

.win-actions .primary {
	background: linear-gradient(180deg, #60a5fa, #7c3aed);
	border: none;
	color: white;
}

.win-actions .ghost {
	color: var(--fg);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 10px;
	padding: 8px 12px;
}