:root {
	--bg: #070a1a;
	--fg: #e6f0ff;
	--neon: #00f0ff;
	--pink: #ff4de3;
	--lime: #8aff3d;
	--warn: #ff5f5f;
}

* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	margin: 0;
	background: radial-gradient(1200px 800px at 50% 20%, #0f1638 0%, #0a0f24 40%, var(--bg) 100%);
	color: var(--fg);
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
}

#hud {
	position: fixed;
	inset: 12px 12px auto 12px;
	display: flex;
	align-items: center;
	gap: 10px;
	z-index: 10;
	background: rgba(8, 12, 32, .35);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, .08);
	border-radius: 12px;
	padding: 8px 10px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}

#hud .stat {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 10px;
	background: rgba(255, 255, 255, .05)
}

#hud .stat strong {
	font-size: 18px;
	color: var(--lime);
	text-shadow: 0 0 8px rgba(138, 255, 61, .6)
}

#hud .spacer {
	flex: 1
}

#hud button {
	appearance: none;
	border: 1px solid rgba(255, 255, 255, .15);
	background: rgba(20, 24, 48, .6);
	color: var(--fg);
	padding: 6px 10px;
	border-radius: 10px;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	box-shadow: 0 0 0 2px rgba(0, 240, 255, .0), 0 0 12px rgba(0, 240, 255, .2) inset;
}

#hud button:active {
	transform: translateY(1px)
}

canvas#game {
	width: 100vw;
	height: 100vh;
	display: block;
}

#overlay {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	opacity: 0;
	transition: opacity .3s ease;
	z-index: 20;
}

#overlay.show {
	pointer-events: auto;
	opacity: 1;
}

#overlay .panel {
	width: min(92vw, 560px);
	background: rgba(12, 16, 40, .8);
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 16px;
	padding: 22px 20px;
	text-align: center;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .45), 0 0 30px rgba(0, 240, 255, .2);
}

#overlay h1 {
	margin: 0 0 8px;
	font-size: 28px;
	letter-spacing: .5px;
	text-shadow: 0 0 12px rgba(0, 240, 255, .6)
}

#overlay p {
	margin: 0 0 8px;
	opacity: .9
}

#overlay .tips {
	list-style: disc;
	margin: 10px 24px 18px 24px;
	text-align: left;
	opacity: .9
}

#overlay button {
	appearance: none;
	background: linear-gradient(90deg, var(--neon), var(--pink));
	color: #051018;
	font-weight: 700;
	border: none;
	border-radius: 12px;
	padding: 12px 18px;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(0, 240, 255, .36), 0 0 24px rgba(255, 77, 227, .3);
}

/* Haptic feel via shake */
.shake {
	animation: shake .18s ease both
}

@keyframes shake {
	10% {
		transform: translate(-2px, 1px)
	}

	30% {
		transform: translate(2px, -2px)
	}

	50% {
		transform: translate(-1px, 2px)
	}

	70% {
		transform: translate(1px, -1px)
	}

	100% {
		transform: none
	}
}

/* Prevent accidental scroll & highlight on iOS */
body {
	touch-action: manipulation;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0)
}