:root {
	color-scheme: dark;
	--bg: #1a1a2e;
	--surface: #16213e;
	--surface-2: #1a1a40;
	--text: #eef0ff;
	--text-muted: #8888aa;
	--accent: #e94560;
	--accent-glow: #ff6b81;
	--gold: #ffc947;
	font-family: 'Syne', sans-serif;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html, body {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: var(--bg);
	color: var(--text);
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}

#game-container {
	position: relative;
	width: 100%;
	height: 100dvh;
	overflow: hidden;
}

#game-canvas {
	display: block;
	width: 100%;
	height: 100%;
}

#particle-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 5;
}

#ui-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	z-index: 10;
}

#score-panel {
	display: flex;
	gap: 1.5rem;
	padding: 1.25rem 1.5rem;
	margin-top: env(safe-area-inset-top, 12px);
}

.score-block {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: rgba(22, 33, 62, 0.85);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	padding: 0.5rem 1.25rem;
	min-width: 80px;
	transition: transform 0.2s ease;
}

.score-block.score-bump {
	animation: scoreBump 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scoreBump {
	0% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.15);
	}

	100% {
		transform: scale(1);
	}
}

.score-label {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 0.6rem;
	font-weight: 600;
	letter-spacing: 0.15em;
	color: var(--text-muted);
	text-transform: uppercase;
}

.score-value {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--text);
	line-height: 1.2;
}

#start-screen {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	pointer-events: auto;
}

.game-title {
	font-size: clamp(3.5rem, 12vw, 6rem);
	font-weight: 800;
	letter-spacing: 0.08em;
	background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 50%, #a78bfa 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	background-size: 200% 200%;
	line-height: 1;
	text-shadow: none;
	animation: titleShimmer 4s ease-in-out infinite;
}

@keyframes titleShimmer {
	0%, 100% {
		background-position: 0% 50%;
		filter: brightness(1);
	}

	50% {
		background-position: 100% 50%;
		filter: brightness(1.2);
	}
}

.game-subtitle {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 0.85rem;
	color: var(--text-muted);
	letter-spacing: 0.1em;
	margin-bottom: 1.5rem;
}

.btn-play {
	pointer-events: auto;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: linear-gradient(135deg, var(--accent), #c23152);
	color: white;
	border: none;
	border-radius: 50px;
	padding: 0.85rem 2rem;
	font-family: 'Syne', sans-serif;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
	box-shadow: 0 4px 24px rgba(233, 69, 96, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-play:hover {
	transform: translateY(-3px) scale(1.03);
	box-shadow: 0 8px 40px rgba(233, 69, 96, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-play:active {
	transform: translateY(0) scale(0.98);
}

.btn-play__icon {
	width: 18px;
	height: 18px;
}

#game-over-screen {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: auto;
	background: rgba(26, 26, 46, 0.7);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	animation: fadeIn 0.5s ease;
}

.game-over-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	background: linear-gradient(145deg, var(--surface), var(--surface-2));
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 24px;
	padding: 2.5rem 3rem;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(233, 69, 96, 0.08);
	animation: cardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardSlideUp {
	from {
		opacity: 0;
		transform: translateY(40px) scale(0.92);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

.game-over-title {
	font-size: 1.5rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	color: var(--text-muted);
}

.final-score-display {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.final-score-label {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 0.6rem;
	letter-spacing: 0.15em;
	color: var(--text-muted);
}

.final-score-num {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 3.5rem;
	font-weight: 700;
	line-height: 1.1;
	background: linear-gradient(135deg, var(--accent), var(--gold));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.new-best {
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	color: var(--gold);
	animation: bestPulse 1s ease-in-out infinite;
}

@keyframes bestPulse {
	0%, 100% {
		opacity: 1;
	}

	50% {
		opacity: 0.5;
	}
}

#tap-hint {
	position: absolute;
	bottom: max(2rem, env(safe-area-inset-bottom, 1rem));
	left: 50%;
	transform: translateX(-50%);
	font-family: 'IBM Plex Mono', monospace;
	font-size: 0.7rem;
	letter-spacing: 0.2em;
	color: var(--text-muted);
	animation: hintBlink 2s ease-in-out infinite;
}

@keyframes hintBlink {
	0%, 100% {
		opacity: 0.3;
	}

	50% {
		opacity: 0.9;
	}
}

#combo-display {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 2.2rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	pointer-events: none;
	z-index: 20;
}

.combo-animate {
	animation: comboFlash 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes comboFlash {
	0% {
		opacity: 0;
		transform: translate(-50%, -50%) scale(0.3);
	}

	20% {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1.3);
	}

	100% {
		opacity: 0;
		transform: translate(-50%, -65%) scale(1);
	}
}

.hidden {
	display: none !important;
}

@media (max-width: 480px) {
	.game-over-card {
		padding: 2rem 2rem;
		margin: 0 1rem;
	}
}