body {
	text-align: center;
	margin: 0px;
	overflow: hidden;
	font-family: Arial, Helvetica, sans-serif;
	background: #bfd1e5;
	overscroll-behavior: none;
	touch-action: none;
}

#info {
	position: absolute;
	top: 0px;
	width: 100%;
	padding: 5px;
	color: #101820;
	font-size: 14px;
	line-height: 1.35;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
	pointer-events: none;
}

#game-hud {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 14px;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 12px;
	color: white;
	pointer-events: none;
	text-align: left;
	z-index: 4;
}

.hud-panel {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 34px;
	padding: 8px 10px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 6px;
	background: rgba(10, 18, 27, 0.72);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
	font-size: 13px;
	line-height: 1;
}

.hud-panel strong {
	min-width: 58px;
	color: #65ffb0;
	letter-spacing: 0;
}

#hud-next {
	min-width: 72px;
	color: #dffcff;
}

.hud-readout {
	min-width: 94px;
	color: #ffef91;
	font-weight: 800;
	white-space: nowrap;
}

.hud-message {
	max-width: min(560px, 56vw);
	justify-content: flex-end;
	text-align: right;
}

#checkpoint-pop {
	position: absolute;
	left: 50%;
	top: 18%;
	z-index: 6;
	padding: 10px 16px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 8px;
	background: rgba(101, 255, 176, 0.88);
	color: #06140c;
	font-size: 22px;
	font-weight: 900;
	line-height: 1;
	text-transform: uppercase;
	transform: translate(-50%, 0) scale(0.8);
	opacity: 0;
	pointer-events: none;
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

#checkpoint-pop.hidden {
	display: none;
}

#checkpoint-pop.pop-active {
	animation: checkpoint-pop 0.8s ease-out both;
}

#runway-map {
	box-sizing: border-box;
	position: absolute;
	right: 14px;
	top: 48px;
	z-index: 4;
	width: 156px;
	padding: 9px 9px 10px;
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: 8px;
	background: rgba(7, 14, 22, 0.7);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
	color: #fff;
	text-align: left;
	pointer-events: none;
	opacity: 0.82;
	transition: opacity 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

#runway-map.map-active,
#runway-map.map-alert {
	opacity: 1;
}

#runway-map.map-alert {
	border-color: rgba(255, 223, 79, 0.72);
	box-shadow: 0 0 0 2px rgba(255, 223, 79, 0.14), 0 12px 34px rgba(0, 0, 0, 0.26);
}

.map-title {
	margin-bottom: 7px;
	color: #dffcff;
	font-size: 11px;
	font-weight: 900;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0;
}

.map-radar {
	position: relative;
	width: 112px;
	height: 112px;
	margin: 0 auto 8px;
	border: 1px solid rgba(223, 252, 255, 0.24);
	border-radius: 50%;
	background:
		linear-gradient(rgba(223, 252, 255, 0.16), rgba(223, 252, 255, 0.16)) 50% 0 / 1px 100% no-repeat,
		linear-gradient(90deg, rgba(223, 252, 255, 0.16), rgba(223, 252, 255, 0.16)) 0 50% / 100% 1px no-repeat,
		radial-gradient(circle, rgba(94, 231, 255, 0.16), rgba(7, 18, 28, 0.18) 62%);
	overflow: hidden;
}

.map-ring {
	position: absolute;
	inset: 24px;
	border: 1px solid rgba(223, 252, 255, 0.18);
	border-radius: 50%;
}

.map-plane {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 18px;
	height: 18px;
	color: #65ffb0;
	font-size: 14px;
	font-weight: 900;
	line-height: 18px;
	text-align: center;
	transform: translate(-50%, -50%);
	text-shadow: 0 0 10px rgba(101, 255, 176, 0.72);
}

.map-marker {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	font-size: 11px;
	font-weight: 900;
	line-height: 20px;
	text-align: center;
	transform: translate(-50%, -50%);
	transition: left 120ms linear, top 120ms linear, opacity 160ms ease;
}

.map-first {
	background: #65ffb0;
	color: #06140c;
	box-shadow: 0 0 14px rgba(101, 255, 176, 0.78);
}

.map-second {
	background: #ffdf4f;
	color: #181204;
	box-shadow: 0 0 14px rgba(255, 223, 79, 0.78);
}

.map-second.map-hidden {
	opacity: 0.28;
}

.map-legend {
	display: grid;
	gap: 5px;
	font-size: 11px;
	line-height: 1.1;
}

.map-legend span {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	color: rgba(255, 255, 255, 0.72);
}

.map-legend strong {
	color: #ffef91;
	font-weight: 900;
}

#mobile-controls {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 82px;
	z-index: 5;
	display: none;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	pointer-events: none;
}

.mobile-cluster {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	pointer-events: auto;
}

.mobile-flight {
	align-items: flex-end;
}

.mobile-row {
	display: flex;
	gap: 8px;
}

.touch-button {
	min-width: 58px;
	height: 54px;
	padding: 0 10px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 8px;
	background: rgba(9, 18, 28, 0.72);
	color: #fff;
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
	font-size: 18px;
	font-weight: 900;
	line-height: 1;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.touch-button.small {
	min-width: 64px;
	height: 42px;
	font-size: 12px;
}

.touch-button.active {
	background: rgba(101, 255, 176, 0.9);
	color: #06140c;
	transform: translateY(1px);
}

#start-screen {
	position: absolute;
	inset: 0;
	z-index: 9;
	display: grid;
	place-items: center;
	background: radial-gradient(circle at 50% 30%, rgba(191, 209, 229, 0.45), rgba(5, 13, 22, 0.68));
	backdrop-filter: blur(4px);
}

#start-screen.hidden {
	display: none;
}

.start-panel {
	width: min(620px, calc(100vw - 36px));
	padding: 26px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 8px;
	background: rgba(12, 20, 30, 0.88);
	color: #fff;
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
	text-align: left;
}

.start-panel h1 {
	margin: 0 0 12px;
	font-size: 34px;
	line-height: 1.04;
	font-weight: 900;
	letter-spacing: 0;
}

.start-panel p {
	margin: 0 0 18px;
	max-width: 540px;
	color: rgba(255, 255, 255, 0.78);
	font-size: 15px;
	line-height: 1.45;
}

.start-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 16px;
}

#start-play {
	min-width: 160px;
	min-height: 44px;
	border: 0;
	border-radius: 6px;
	background: #65ffb0;
	color: #07130d;
	font-size: 16px;
	font-weight: 900;
	cursor: pointer;
}

#start-play:hover {
	background: #8dffc5;
}

#start-best,
.start-controls {
	color: rgba(255, 255, 255, 0.76);
	font-size: 13px;
}

.start-controls {
	padding-top: 12px;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
}

#finish-screen {
	position: absolute;
	inset: 0;
	z-index: 8;
	display: grid;
	place-items: center;
	background: rgba(4, 10, 18, 0.42);
	backdrop-filter: blur(5px);
}

#finish-screen.hidden {
	display: none;
}

.finish-panel {
	width: min(520px, calc(100vw - 36px));
	padding: 24px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 8px;
	background: rgba(12, 20, 30, 0.88);
	color: #fff;
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
	text-align: left;
}

.finish-kicker {
	margin-bottom: 8px;
	color: #65ffb0;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0;
}

.finish-panel h1 {
	margin: 0 0 18px;
	font-size: 30px;
	line-height: 1.08;
	font-weight: 800;
	letter-spacing: 0;
}

.finish-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-bottom: 20px;
}

.finish-stats div {
	min-height: 64px;
	padding: 10px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.08);
}

.finish-stats span {
	display: block;
	margin-bottom: 8px;
	color: rgba(255, 255, 255, 0.7);
	font-size: 12px;
}

.finish-stats strong {
	display: block;
	font-size: 20px;
	line-height: 1.05;
}

#finish-restart {
	width: 100%;
	min-height: 42px;
	border: 0;
	border-radius: 6px;
	background: #65ffb0;
	color: #07130d;
	font-size: 15px;
	font-weight: 800;
	cursor: pointer;
}

#finish-restart:hover {
	background: #8dffc5;
}

@keyframes checkpoint-pop {
	0% {
		opacity: 0;
		transform: translate(-50%, 18px) scale(0.7);
	}

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

	72% {
		opacity: 1;
		transform: translate(-50%, -10px) scale(1);
	}

	100% {
		opacity: 0;
		transform: translate(-50%, -22px) scale(0.96);
	}
}

div#memoryprofiler {
	position: absolute;
	bottom: 0;
	background-color: white;
}

div#memoryprofiler_ptrs {
	position: fixed;
	bottom: 400px;
	top: 0;
	overflow: auto;
	background-color: white;
}

@media (max-width: 760px) {
	#info {
		display: none;
	}

	#game-hud {
		top: 10px;
		bottom: auto;
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.hud-panel {
		width: min(300px, calc(100vw - 176px));
		max-width: calc(100vw - 176px);
		gap: 7px;
		padding: 7px 8px;
		font-size: 11px;
		line-height: 1.12;
	}

	#game-hud .hud-panel:first-child {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: center;
		row-gap: 8px;
		column-gap: 10px;
	}

	.hud-panel strong,
	#hud-next,
	.hud-readout {
		min-width: 0;
	}

	.hud-message {
		width: min(300px, calc(100vw - 176px));
		max-width: calc(100vw - 176px);
		text-align: left;
	}

	#mobile-controls {
		display: flex;
	}

	#runway-map {
		top: 10px;
		right: 10px;
		width: 118px;
		padding: 7px;
	}

	.map-radar {
		width: 82px;
		height: 82px;
		margin-bottom: 6px;
	}

	.map-ring {
		inset: 18px;
	}

	.map-title,
	.map-legend {
		font-size: 10px;
	}

	#start-screen:not(.hidden) ~ #mobile-controls,
	#finish-screen:not(.hidden) ~ #mobile-controls {
		display: none;
	}

	.finish-panel {
		padding: 18px;
	}

	.start-panel {
		padding: 18px;
	}

	.finish-panel h1,
	.start-panel h1 {
		font-size: 24px;
	}

	.finish-stats {
		grid-template-columns: 1fr;
	}

	.start-actions {
		align-items: stretch;
		flex-direction: column;
	}

	#start-play {
		width: 100%;
	}
}

@media (pointer: coarse) and (min-width: 761px) {
	#mobile-controls {
		display: flex;
	}
}

@media (max-width: 460px) {
	#mobile-controls {
		left: 8px;
		right: 8px;
		bottom: 74px;
		gap: 8px;
	}

	.hud-panel,
	.hud-message {
		width: min(220px, calc(100vw - 148px));
		max-width: calc(100vw - 148px);
	}

	#runway-map {
		width: 102px;
	}

	.map-radar {
		width: 68px;
		height: 68px;
	}

	.mobile-cluster,
	.mobile-row {
		gap: 6px;
	}

	.touch-button {
		min-width: 48px;
		height: 48px;
		font-size: 16px;
	}

	.touch-button.small {
		min-width: 54px;
		height: 38px;
		font-size: 11px;
	}
}
