:root {
	color-scheme: light;
	font-family: Inter, system-ui, sans-serif;
	--bg1: #0b1020;
	--bg2: #151d38;
	--panel: rgba(10, 14, 28, 0.54);
	--panel-border: rgba(255, 255, 255, 0.16);
	--text: #f4f7ff;
	--muted: #a7b2d8;
	--accent: #7c5cff;
	--accent-2: #37e7ff;
	--danger: #ff5d8f;
	--gold: #ffd84d;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
	background:
		radial-gradient(circle at top, #25315f 0%, transparent 35%),
		linear-gradient(180deg, var(--bg2), var(--bg1));
	color: var(--text);
}

body {
	overflow: hidden;
	background-attachment: fixed;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

.game-shell {
	position: relative;
	width: 100vw;
	height: 100vh;
	overflow: hidden;
}

.game-shell::before {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	background:
		radial-gradient(circle at 20% 15%, rgba(55, 231, 255, 0.12), transparent 28%),
		radial-gradient(circle at 80% 20%, rgba(255, 79, 216, 0.12), transparent 30%),
		radial-gradient(circle at 50% 100%, rgba(124, 92, 255, 0.18), transparent 36%);
	mix-blend-mode: screen;
}

.game-shell::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 2;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.2)),
		radial-gradient(circle at 50% 20%, rgba(114, 232, 255, 0.05), transparent 28%),
		radial-gradient(circle at 50% 85%, rgba(255, 79, 216, 0.06), transparent 34%);
	opacity: 0.9;
}

#game {
	position: relative;
	z-index: 0;
	width: 100%;
	height: 100%;
	filter: saturate(1.12) contrast(1.08) brightness(1.02);
	touch-action: none;
}

#game::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.24)),
		repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.024) 0 2px, rgba(0, 0, 0, 0) 2px 6px);
	mix-blend-mode: screen;
	opacity: 0.42;
}

#game::before {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	background: radial-gradient(circle at 50% 45%, transparent 0%, transparent 52%, rgba(0, 0, 0, 0.24) 100%);
}

#game canvas {
	display: block;
	width: 100% !important;
	height: 100% !important;
	image-rendering: auto;
}

.fps-counter {
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 60;
	padding: 8px 12px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: linear-gradient(180deg, rgba(16, 22, 40, 0.84), rgba(8, 12, 24, 0.72));
	backdrop-filter: blur(10px) saturate(1.1);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
	color: #72e8ff;
	font: 800 12px/1 Inter, system-ui, sans-serif;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	pointer-events: none;
	user-select: none;
	min-width: 74px;
	text-align: center;
}

.hud {
	position: absolute;
	inset: 0 0 auto 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 18px;
	max-width: 960px;
	pointer-events: none;
}

.hud__brand {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border: 1px solid var(--panel-border);
	border-radius: 999px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)), var(--panel);
	backdrop-filter: blur(16px) saturate(1.25);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.14);
	font-weight: 900;
	letter-spacing: 0.16em;
	font-size: 0.9rem;
	text-shadow: 0 0 14px rgba(55, 231, 255, 0.18);
}

.hud__brand-glow {
	display: inline-grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 226, 122, 0.95), rgba(255, 143, 208, 0.85));
	color: #08111f;
	font-size: 12px;
	box-shadow: 0 0 16px rgba(255, 226, 122, 0.35);
}

.hud__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.hud__pill {
	padding: 10px 14px;
	border-radius: 999px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)), var(--panel);
	border: 1px solid var(--panel-border);
	backdrop-filter: blur(14px) saturate(1.2);
	font-weight: 700;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hud__hint {
	color: var(--muted);
	font-size: 0.95rem;
	line-height: 1.45;
	text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.hud__hint--strong {
	color: #fff0a8;
}

.meter {
	width: min(320px, 82vw);
	height: 12px;
	border-radius: 999px;
	overflow: hidden;
	border: 1px solid var(--panel-border);
	background: rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(12px);
}

.meter__fill {
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--gold), #ff9ecb, var(--accent-2));
	box-shadow: 0 0 18px rgba(255, 216, 77, 0.28);
	transition: width 0.18s ease;
}

.overlay {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 32px;
	z-index: 40;
}

.overlay--hidden {
	display: none;
}

.overlay__backdrop {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(circle at 50% 10%, rgba(255, 102, 196, 0.18), transparent 24%),
		radial-gradient(circle at 20% 80%, rgba(71, 224, 255, 0.12), transparent 24%),
		radial-gradient(circle at 80% 18%, rgba(124, 92, 255, 0.16), transparent 22%),
		linear-gradient(180deg, rgba(5, 8, 18, 0.62), rgba(5, 8, 18, 0.9));
	backdrop-filter: blur(14px) saturate(1.08);
}

.overlay__backdrop--danger {
	background:
		radial-gradient(circle at 50% 24%, rgba(255, 93, 143, 0.24), transparent 30%),
		radial-gradient(circle at 82% 18%, rgba(255, 216, 77, 0.12), transparent 24%),
		linear-gradient(180deg, rgba(14, 8, 14, 0.62), rgba(14, 8, 14, 0.9));
}

.overlay__card {
	position: relative;
	z-index: 1;
	width: min(660px, 100%);
	padding: 42px 42px 34px;
	border-radius: 28px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background:
		linear-gradient(180deg, rgba(20, 26, 46, 0.95), rgba(8, 12, 24, 0.98)),
		radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 40%);
	box-shadow:
		0 30px 90px rgba(0, 0, 0, 0.5),
		0 0 60px rgba(90, 120, 255, 0.12),
		0 0 120px rgba(255, 102, 196, 0.08),
		0 0 0 1px rgba(255, 255, 255, 0.04) inset,
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
	text-align: center;
	color: #f7f8ff;
	overflow: hidden;
}

.overlay__card::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 24%),
		radial-gradient(circle at top right, rgba(92, 118, 255, 0.14), transparent 24%),
		radial-gradient(circle at bottom left, rgba(255, 102, 196, 0.12), transparent 28%);
}

.overlay__card::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 1px;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.03));
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
}

.overlay__grid {
	position: absolute;
	left: -10%;
	right: -10%;
	bottom: -12%;
	height: 42%;
	background:
		linear-gradient(rgba(114, 232, 255, 0.15) 1px, transparent 1px),
		linear-gradient(90deg, rgba(114, 232, 255, 0.15) 1px, transparent 1px);
	background-size: 26px 26px;
	opacity: 0.22;
	transform: perspective(500px) rotateX(72deg);
	transform-origin: bottom;
	pointer-events: none;
}

.overlay__spark {
	position: absolute;
	border-radius: 999px;
	filter: blur(4px);
	pointer-events: none;
	animation: overlayFloat 5s ease-in-out infinite;
}

.overlay__spark--1 {
	width: 120px;
	height: 120px;
	left: -24px;
	top: 22px;
	background: radial-gradient(circle, rgba(114, 232, 255, 0.35), transparent 70%);
}

.overlay__spark--2 {
	width: 150px;
	height: 150px;
	right: -36px;
	top: -12px;
	background: radial-gradient(circle, rgba(255, 102, 196, 0.3), transparent 70%);
	animation-delay: -1.2s;
}

.overlay__spark--3 {
	width: 110px;
	height: 110px;
	right: 18%;
	bottom: 14%;
	background: radial-gradient(circle, rgba(255, 226, 122, 0.22), transparent 72%);
	animation-delay: -2.2s;
}

.overlay__spark--danger {
	width: 180px;
	height: 180px;
	right: -50px;
	top: -50px;
	background: radial-gradient(circle, rgba(255, 93, 143, 0.28), transparent 72%);
}

.overlay__card--danger {
	background: linear-gradient(180deg, rgba(41, 18, 28, 0.97), rgba(20, 10, 16, 0.99));
}

.overlay__eyebrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
	padding: 8px 13px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
	color: #ffe27a;
	font-size: 11px;
	font-weight: 900;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	box-shadow: 0 0 24px rgba(255, 226, 122, 0.08);
}

.overlay__card h1,
.overlay__card h2 {
	position: relative;
	margin: 0;
	font-size: clamp(36px, 5.8vw, 56px);
	line-height: 0.98;
	letter-spacing: -0.05em;
	font-weight: 900;
	text-wrap: balance;
	text-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
}

.overlay__lead {
	position: relative;
	max-width: 540px;
	margin: 16px auto 0;
	color: rgba(225, 233, 250, 0.82);
	font-size: clamp(15px, 2.1vw, 18px);
	line-height: 1.65;
}

.overlay__features {
	position: relative;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	margin: 30px 0 24px;
}

.overlay__feature {
	padding: 18px 14px;
	border-radius: 18px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 24px rgba(0, 0, 0, 0.16);
	display: grid;
	gap: 8px;
	transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.overlay__feature span {
	color: #9fdcff;
	font-size: 12px;
	font-weight: 900;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.overlay__feature strong {
	font-size: 14px;
	font-weight: 800;
	color: #f5f7ff;
}

.overlay__feature small {
	font-size: 12px;
	color: rgba(200, 212, 236, 0.7);
}

.overlay__actions {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 12px;
	margin-top: 10px;
}

.overlay button {
	appearance: none;
	-webkit-appearance: none;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: 16px 30px;
	min-width: 230px;
	font: inherit;
	font-weight: 900;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #0d1526;
	background: linear-gradient(135deg, #ffe27a 0%, #ff8fd0 52%, #72e8ff 100%);
	box-shadow: 0 18px 36px rgba(255, 120, 180, 0.28), 0 0 30px rgba(114, 232, 255, 0.14);
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
	touch-action: manipulation;
}

.overlay__subtext {
	font-size: 13px;
	color: rgba(196, 206, 230, 0.72);
	letter-spacing: 0.01em;
}

.overlay__chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 4px;
}

.overlay__chip {
	padding: 7px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #dfe8ff;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.overlay__score {
	position: relative;
	margin-top: 16px;
	font-size: clamp(56px, 10vw, 100px);
	line-height: 1;
	font-weight: 900;
	letter-spacing: -0.06em;
	color: #fff2a8;
	text-shadow: 0 0 24px rgba(255, 226, 122, 0.22), 0 8px 30px rgba(0, 0, 0, 0.18);
}

.overlay__burst {
	position: absolute;
	width: 180px;
	height: 180px;
	right: -40px;
	top: -40px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 93, 143, 0.22), rgba(255, 93, 143, 0) 68%);
	filter: blur(4px);
	pointer-events: none;
}

.mobile-controls {
	position: fixed;
	left: 0;
	right: 0;
	bottom: max(14px, env(safe-area-inset-bottom));
	display: none;
	justify-content: space-between;
	gap: 16px;
	padding: 0 14px;
	z-index: 30;
	pointer-events: none;
}

.mobile-controls__left,
.mobile-controls__right {
	display: flex;
	gap: 12px;
	pointer-events: auto;
}

.mobile-btn {
	-webkit-appearance: none;
	appearance: none;
	touch-action: manipulation;
	min-width: 64px;
	height: 64px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: linear-gradient(180deg, rgba(24, 34, 62, 0.86), rgba(8, 14, 28, 0.62));
	color: #fff;
	font: inherit;
	font-weight: 800;
	border-radius: 18px;
	backdrop-filter: blur(14px) saturate(1.2);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 0 22px rgba(82, 224, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mobile-btn--jump,
.mobile-btn--dash {
	min-width: 88px;
}

.mobile-btn--dash {
	color: #aefcff;
}

@media (hover: hover) {
	.overlay__feature:hover {
		transform: translateY(-4px);
		border-color: rgba(114, 232, 255, 0.28);
		box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 14px 28px rgba(0, 0, 0, 0.22), 0 0 24px rgba(114, 232, 255, 0.08);
	}

	.overlay button:hover {
		transform: translateY(-3px) scale(1.01);
		box-shadow: 0 22px 42px rgba(255, 120, 180, 0.34), 0 0 34px rgba(114, 232, 255, 0.18);
		filter: brightness(1.03) saturate(1.06);
	}
}

.overlay button:active,
.mobile-btn:active {
	transform: scale(0.98);
}

@media (max-width: 700px) {
	.overlay {
		padding: 16px;
	}

	.overlay__card {
		width: min(100%, 560px);
		padding: 28px 20px 22px;
		border-radius: 22px;
	}

	.overlay__card h1,
	.overlay__card h2 {
		font-size: clamp(30px, 10vw, 42px);
	}

	.overlay__features {
		grid-template-columns: 1fr;
		gap: 10px;
		margin: 22px 0 18px;
	}

	.overlay__grid {
		height: 34%;
		background-size: 22px 22px;
	}

	.overlay__burst {
		width: 120px;
		height: 120px;
		right: -24px;
		top: -24px;
	}

	.overlay button {
		width: 100%;
		min-width: 0;
	}
}

@media (max-width: 640px) {
	.hud {
		padding: 14px;
		gap: 10px;
	}

	.hud__brand {
		font-size: 0.78rem;
		letter-spacing: 0.12em;
	}

	.hud__stats {
		gap: 8px;
	}

	.hud__pill {
		padding: 8px 12px;
		font-size: 0.84rem;
	}

	.hud__hint {
		font-size: 0.85rem;
		max-width: min(92vw, 320px);
	}

	.meter {
		width: min(260px, 76vw);
		height: 11px;
	}

	.fps-counter {
		top: auto;
		bottom: calc(100px + env(safe-area-inset-bottom));
		right: 12px;
		font-size: 11px;
		padding: 7px 10px;
	}
}

@media (hover: none), (pointer: coarse) {
	.mobile-controls {
		display: flex;
	}
}

@keyframes overlayFloat {

	0%,
	100% {
		transform: translateY(0px) scale(1);
	}

	50% {
		transform: translateY(-10px) scale(1.04);
	}
}