/* Meteors — responsive, portrait-friendly, no page scroll during play. */
*, *::before, *::after { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #0b1020;
	color: #e8eaf2;
	font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

#stars {
	position: fixed;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(1px 1px at 12% 18%, #fff 0 50%, transparent 51%),
		radial-gradient(1px 1px at 28% 72%, #cde 0 50%, transparent 51%),
		radial-gradient(1.5px 1.5px at 47% 32%, #fff 0 50%, transparent 51%),
		radial-gradient(1px 1px at 63% 81%, #bbd 0 50%, transparent 51%),
		radial-gradient(1px 1px at 81% 22%, #fff 0 50%, transparent 51%),
		radial-gradient(1.5px 1.5px at 91% 64%, #def 0 50%, transparent 51%),
		radial-gradient(1px 1px at 8% 88%, #fff 0 50%, transparent 51%),
		radial-gradient(2px 2px at 72% 48%, #89a 0 50%, transparent 51%),
		linear-gradient(180deg, #0b1020 0%, #141a33 55%, #1a1440 100%);
	z-index: 0;
}

.screen {
	position: fixed;
	inset: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px 20px;
	text-align: center;
}

.screen[hidden], #hud[hidden], #game-over[hidden] { display: none !important; }

h1 {
	font-size: clamp(48px, 14vw, 96px);
	letter-spacing: 0.06em;
	margin: 0 0 8px;
	font-weight: 800;
	background: linear-gradient(180deg, #fff6c8 0%, #ff9a3a 45%, #e85d3a 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	filter: drop-shadow(0 2px 12px rgba(232, 93, 58, 0.55));
}

.tagline {
	margin: 0 0 28px;
	font-size: clamp(15px, 3.6vw, 20px);
	color: #c5cae0;
	max-width: 28em;
}

#btn-play {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-size: clamp(20px, 5vw, 28px);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #1a1020;
	background: linear-gradient(180deg, #ffe27a, #f0c53a 40%, #e89a20);
	padding: 14px 48px;
	border-radius: 999px;
	box-shadow:
		0 0 0 3px rgba(255, 220, 120, 0.25),
		0 8px 24px rgba(240, 197, 58, 0.45);
	touch-action: manipulation;
	min-height: 52px;
	min-width: 200px;
}

#btn-play:is(:hover, :focus-visible) {
	transform: translateY(-1px);
	box-shadow:
		0 0 0 3px rgba(255, 220, 120, 0.4),
		0 10px 28px rgba(240, 197, 58, 0.6);
}

#btn-play:active { transform: translateY(1px); }

.last-score {
	margin: 22px 0 0;
	font-size: clamp(16px, 4vw, 22px);
	color: #ffe27a;
}

.hint {
	margin: 36px auto 0;
	max-width: 32em;
	font-size: clamp(13px, 3.2vw, 16px);
	line-height: 1.45;
	color: #8e95b3;
}

#hud {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 4;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 4px;
	pointer-events: none;
	text-shadow: 0 1px 4px #000;
	gap: 12px;
}

.hud-label {
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #9aa3c2;
}

#score {
	font-size: clamp(28px, 8vw, 42px);
	font-weight: 800;
	line-height: 1;
	color: #fff6c8;
}

#planet-name {
	font-weight: 700;
	font-size: clamp(14px, 3.5vw, 18px);
	text-align: right;
}

#planet-stats {
	font-variant-numeric: tabular-nums;
	font-size: clamp(11px, 2.8vw, 14px);
	color: #b7bdd4;
	text-align: right;
	white-space: nowrap;
}

.overlay {
	background: rgba(8, 10, 22, 0.78);
	backdrop-filter: blur(6px);
}

.overlay h2 {
	font-size: clamp(32px, 9vw, 56px);
	margin: 0 0 8px;
	color: #ffb0a0;
}

.go-score {
	font-size: clamp(20px, 5vw, 28px);
	color: #ffe27a;
	margin-top: 18px;
}

/* Framework canvases sit on the body. Keep them above the starfield, below HUD. */
canvas {
	z-index: 2;
	touch-action: none;
	display: block;
}

/* Very narrow / short phones: shrink hints so the Play button stays on screen. */
@media (max-height: 520px) {
	.hint { display: none; }
	h1 { font-size: 42px; }
	#btn-play { padding: 10px 36px; }
}
