html,
body {
	width: 100%;
	height: 100%;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	overflow: hidden;
	background: #030509;
	color: #f5f7fb;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	overscroll-behavior: none;
	touch-action: none;
}

button,
input,
select {
	font: inherit;
}

button {
	cursor: pointer;
}

canvas {
	display: block;
}

.seo-summary {
	position: absolute;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

#container {
	position: fixed;
	inset: 0;
}

#container::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(90deg, rgba(3, 5, 9, 0.84), rgba(3, 5, 9, 0.12) 28%, rgba(3, 5, 9, 0.36)),
		linear-gradient(180deg, rgba(3, 5, 9, 0.52), transparent 38%, rgba(3, 5, 9, 0.48));
}

#blocker {
	position: fixed;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(3, 5, 9, 0.76);
	backdrop-filter: blur(8px);
	transition: opacity 180ms ease, visibility 180ms ease;
}

#blocker.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

#blocker.is-ready #launchButton {
	border-color: rgba(112, 212, 176, 0.95);
	background: #70d4b0;
	color: #04110d;
}

#instructions {
	width: min(560px, calc(100vw - 48px));
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	padding: 28px;
	background: rgba(10, 16, 25, 0.88);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.eyebrow {
	margin: 0 0 8px;
	color: #70d4b0;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: uppercase;
}

h1,
h2 {
	margin: 0;
	letter-spacing: 0;
}

h1 {
	font-size: clamp(32px, 5vw, 56px);
	line-height: 1;
}

h2 {
	font-size: 28px;
	line-height: 1.1;
}

.launch-copy {
	max-width: 48ch;
	margin: 16px 0 22px;
	color: rgba(245, 247, 251, 0.78);
	font-size: 15px;
	line-height: 1.6;
}

.loading-meter {
	height: 8px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
}

#loadingBar {
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #70d4b0, #f3c969);
	transition: width 160ms ease;
}

.launch-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 18px;
}

.launch-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

#loadingText {
	color: rgba(245, 247, 251, 0.68);
	font-variant-numeric: tabular-nums;
}

#launchButton,
.ghost-button,
.body-nav button {
	height: 40px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 8px;
	padding: 0 16px;
	color: #f5f7fb;
	background: rgba(255, 255, 255, 0.08);
}

#launchButton {
	min-width: 140px;
}

.ghost-button:hover,
.body-nav button:hover,
#launchButton:hover {
	border-color: rgba(255, 255, 255, 0.34);
	background: rgba(255, 255, 255, 0.13);
}

.ghost-button:disabled,
.body-nav button:disabled,
#launchButton:disabled {
	cursor: default;
	opacity: 0.42;
}

.app-topbar,
.mode-dock,
.mission-panel,
.body-nav,
.flight-keys,
.touch-controls,
#selectionHint,
.cinematic-caption,
#hoverLabel,
#aimReticle,
#webglFallback,
#toast {
	position: fixed;
	z-index: 10;
}

.app-topbar {
	top: 18px;
	left: 18px;
	right: 18px;
	display: grid;
	grid-template-columns: minmax(150px, 1fr) auto auto auto auto;
	align-items: center;
	gap: 12px;
}

.app-topbar strong {
	display: block;
	font-size: 18px;
}

.mode-dock {
	top: 74px;
	right: 18px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.mode-dock .ghost-button {
	height: 36px;
	padding: 0 12px;
	font-size: 13px;
}

.mode-dock .is-active {
	border-color: rgba(243, 201, 105, 0.88);
	background: rgba(243, 201, 105, 0.18);
	color: #fff3c8;
}

.status-strip {
	display: flex;
	align-items: center;
	gap: 8px;
	color: rgba(245, 247, 251, 0.78);
	font-size: 13px;
}

.status-strip span {
	min-height: 30px;
	display: inline-flex;
	align-items: center;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	padding: 0 12px;
	background: rgba(8, 13, 21, 0.74);
	backdrop-filter: blur(10px);
}

.language-switch {
	min-height: 40px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	padding: 0 10px;
	color: rgba(245, 247, 251, 0.78);
	background: rgba(8, 13, 21, 0.74);
	backdrop-filter: blur(10px);
	font-size: 13px;
}

.language-switch select {
	border: 0;
	color: #f5f7fb;
	background: transparent;
	outline: 0;
}

.language-switch option {
	color: #071019;
}

.launch-language {
	margin-bottom: 18px;
}

.onboarding {
	position: fixed;
	inset: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(3, 5, 9, 0.58);
	backdrop-filter: blur(6px);
}

.onboarding[hidden] {
	display: none;
}

.onboarding-card {
	width: min(520px, 100%);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	padding: 24px;
	background: rgba(10, 16, 25, 0.94);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

#onboardingBody {
	margin: 14px 0 22px;
	color: rgba(245, 247, 251, 0.78);
	font-size: 15px;
	line-height: 1.6;
}

.onboarding-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.onboarding-actions div {
	display: flex;
	gap: 10px;
}

.mission-panel {
	top: 112px;
	left: 18px;
	width: 280px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	padding: 18px;
	background: rgba(8, 13, 21, 0.78);
	backdrop-filter: blur(10px);
}

.metric-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 16px;
	color: rgba(245, 247, 251, 0.7);
	font-size: 13px;
}

.metric-row strong {
	color: #f5f7fb;
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.speed-control {
	display: block;
	margin-top: 18px;
}

.slider {
	width: 100%;
	accent-color: #70d4b0;
}

.body-nav {
	left: 50%;
	bottom: 22px;
	display: flex;
	max-width: min(920px, calc(100vw - 36px));
	overflow-x: auto;
	gap: 8px;
	padding: 8px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	background: rgba(8, 13, 21, 0.78);
	backdrop-filter: blur(10px);
	transform: translateX(-50%);
}

.body-nav button {
	flex: 0 0 auto;
	min-width: 68px;
	padding: 0 10px;
	font-size: 14px;
}

.body-nav button.is-active {
	border-color: rgba(112, 212, 176, 0.85);
	background: rgba(112, 212, 176, 0.18);
	color: #dffbed;
}

.flight-keys {
	right: 18px;
	bottom: 88px;
	display: flex;
	gap: 6px;
}

.flight-keys span {
	min-width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 6px;
	color: rgba(245, 247, 251, 0.76);
	background: rgba(8, 13, 21, 0.72);
	font-size: 12px;
}

.touch-controls {
	right: 14px;
	bottom: 88px;
	display: none;
	grid-template-columns: repeat(3, 44px);
	grid-template-rows: repeat(3, 44px);
	gap: 7px;
	touch-action: none;
}

.touch-controls button {
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 8px;
	color: rgba(245, 247, 251, 0.86);
	background: rgba(8, 13, 21, 0.76);
	backdrop-filter: blur(10px);
	font-weight: 700;
}

.touch-controls button:active {
	border-color: rgba(112, 212, 176, 0.86);
	background: rgba(112, 212, 176, 0.22);
	color: #dffbed;
}

.touch-controls [data-move="forward"] {
	grid-column: 2;
	grid-row: 1;
}

.touch-controls [data-move="left"] {
	grid-column: 1;
	grid-row: 2;
}

.touch-controls [data-move="backward"] {
	grid-column: 2;
	grid-row: 3;
}

.touch-controls [data-move="right"] {
	grid-column: 3;
	grid-row: 2;
}

#selectionHint {
	right: 18px;
	bottom: 136px;
	max-width: 260px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	padding: 10px 12px;
	color: rgba(245, 247, 251, 0.78);
	background: rgba(8, 13, 21, 0.72);
	font-size: 12px;
}

.cinematic-caption {
	left: 50%;
	bottom: 104px;
	width: min(620px, calc(100vw - 36px));
	border: 1px solid rgba(112, 212, 176, 0.24);
	border-radius: 8px;
	padding: 14px 18px;
	color: #f5f7fb;
	background: rgba(8, 13, 21, 0.82);
	backdrop-filter: blur(10px);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
	font-size: 15px;
	line-height: 1.5;
	text-align: center;
	transform: translateX(-50%);
}

.cinematic-caption[hidden] {
	display: none;
}

#hoverLabel {
	z-index: 12;
	display: none;
	border: 1px solid rgba(112, 212, 176, 0.52);
	border-radius: 999px;
	padding: 6px 10px;
	color: #dffbed;
	background: rgba(8, 13, 21, 0.9);
	font-size: 12px;
	pointer-events: none;
	transform: translate(14px, 14px);
}

#aimReticle {
	left: 50%;
	top: 50%;
	width: 18px;
	height: 18px;
	display: none;
	border: 1px solid rgba(112, 212, 176, 0.88);
	border-radius: 50%;
	box-shadow: 0 0 18px rgba(112, 212, 176, 0.32);
	pointer-events: none;
	transform: translate(-50%, -50%);
}

#aimReticle::before,
#aimReticle::after {
	content: "";
	position: absolute;
	background: rgba(112, 212, 176, 0.88);
}

#aimReticle::before {
	left: 50%;
	top: -7px;
	width: 1px;
	height: 32px;
	transform: translateX(-50%);
}

#aimReticle::after {
	left: -7px;
	top: 50%;
	width: 32px;
	height: 1px;
	transform: translateY(-50%);
}

body.is-playing #aimReticle {
	display: block;
}

#toast {
	right: 18px;
	top: 86px;
	max-width: min(360px, calc(100vw - 36px));
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	padding: 12px 14px;
	color: #f5f7fb;
	background: rgba(8, 13, 21, 0.9);
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 160ms ease, transform 160ms ease;
	pointer-events: none;
}

#toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.webgl-fallback {
	inset: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(3, 5, 9, 0.9);
	backdrop-filter: blur(10px);
}

.webgl-fallback[hidden] {
	display: none;
}

.webgl-fallback div {
	width: min(520px, 100%);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	padding: 24px;
	background: rgba(10, 16, 25, 0.94);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.webgl-fallback p:not(.eyebrow) {
	margin: 14px 0 22px;
	color: rgba(245, 247, 251, 0.78);
	font-size: 15px;
	line-height: 1.6;
}

.webgl-fallback a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	border: 1px solid rgba(112, 212, 176, 0.72);
	border-radius: 8px;
	padding: 0 16px;
	color: #dffbed;
	background: rgba(112, 212, 176, 0.14);
	text-decoration: none;
}

@media (max-width: 860px) {
	.app-topbar {
		left: max(12px, env(safe-area-inset-left));
		right: max(12px, env(safe-area-inset-right));
		top: max(12px, env(safe-area-inset-top));
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 8px;
	}

	.app-topbar > div:first-child {
		flex: 1 1 145px;
		min-width: 0;
	}

	.app-topbar strong {
		font-size: 16px;
	}

	.app-topbar > .ghost-button {
		flex: 0 0 auto;
		height: 36px;
		padding: 0 12px;
	}

	.status-strip {
		order: 5;
		flex: 1 0 100%;
		overflow-x: auto;
		padding-bottom: 2px;
		scrollbar-width: none;
	}

	.status-strip::-webkit-scrollbar,
	.mode-dock::-webkit-scrollbar,
	.body-nav::-webkit-scrollbar {
		display: none;
	}

	.status-strip span {
		min-height: 28px;
		white-space: nowrap;
	}

	.mode-dock {
		top: calc(max(12px, env(safe-area-inset-top)) + 92px);
		left: max(12px, env(safe-area-inset-left));
		right: max(12px, env(safe-area-inset-right));
		overflow-x: auto;
		padding-bottom: 4px;
		scroll-snap-type: x proximity;
	}

	.mode-dock .ghost-button {
		flex: 0 0 auto;
		scroll-snap-align: start;
	}

	.language-switch {
		flex: 0 1 156px;
		min-width: 0;
		height: 36px;
		min-height: 36px;
	}

	.language-switch span {
		display: none;
	}

	.language-switch select {
		width: 100%;
	}

	.mission-panel {
		top: auto;
		left: max(12px, env(safe-area-inset-left));
		right: auto;
		bottom: calc(84px + env(safe-area-inset-bottom));
		width: min(260px, calc(100vw - 170px));
		min-width: 168px;
		padding: 12px;
	}

	.mission-panel .eyebrow,
	.metric-row:first-of-type {
		display: none;
	}

	.metric-row {
		margin-top: 10px;
		font-size: 12px;
	}

	.speed-control {
		margin-top: 10px;
	}

	.body-nav {
		left: max(12px, env(safe-area-inset-left));
		right: max(12px, env(safe-area-inset-right));
		bottom: calc(12px + env(safe-area-inset-bottom));
		max-width: none;
		transform: none;
		scroll-snap-type: x proximity;
	}

	.body-nav button {
		height: 38px;
		min-width: 72px;
		scroll-snap-align: start;
	}

	.flight-keys {
		display: none;
	}

	.touch-controls {
		display: grid;
		right: max(12px, env(safe-area-inset-right));
		bottom: calc(82px + env(safe-area-inset-bottom));
	}

	#selectionHint {
		display: none;
	}

	.cinematic-caption {
		bottom: calc(158px + env(safe-area-inset-bottom));
		width: min(420px, calc(100vw - 24px));
		padding: 10px 12px;
		font-size: 13px;
	}

	#toast {
		top: calc(max(12px, env(safe-area-inset-top)) + 136px);
		left: max(12px, env(safe-area-inset-left));
		right: max(12px, env(safe-area-inset-right));
		max-width: none;
	}

	h2 {
		font-size: 22px;
	}
}

@media (max-width: 540px) {
	#blocker,
	.onboarding {
		align-items: flex-start;
		overflow-y: auto;
		padding: calc(16px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
	}

	#instructions {
		width: min(100%, calc(100vw - 28px));
		margin-top: min(8vh, 46px);
		padding: 20px;
	}

	h1 {
		font-size: clamp(30px, 10vw, 40px);
	}

	.launch-copy {
		font-size: 14px;
	}

	.launch-footer {
		align-items: stretch;
		flex-direction: column;
	}

	.launch-actions,
	.onboarding-actions,
	.onboarding-actions div {
		align-items: stretch;
		flex-direction: column;
		width: 100%;
	}

	#launchButton {
		width: 100%;
	}

	.onboarding-card {
		width: 100%;
		margin-top: min(10vh, 52px);
		padding: 20px;
	}

	.mode-dock {
		top: calc(max(12px, env(safe-area-inset-top)) + 126px);
	}

	.mission-panel {
		bottom: calc(78px + env(safe-area-inset-bottom));
		width: min(218px, calc(100vw - 148px));
	}

	.mission-panel h2 {
		font-size: 18px;
	}

	.touch-controls {
		grid-template-columns: repeat(3, 38px);
		grid-template-rows: repeat(3, 38px);
		gap: 6px;
		bottom: calc(78px + env(safe-area-inset-bottom));
	}

	.body-nav button {
		min-width: 66px;
		padding: 0 9px;
		font-size: 13px;
	}

	.cinematic-caption {
		bottom: calc(144px + env(safe-area-inset-bottom));
	}
}

@media (max-width: 390px) {
	.app-topbar > div:first-child {
		flex-basis: 100%;
	}

	.mode-dock {
		top: calc(max(12px, env(safe-area-inset-top)) + 158px);
	}

	.mission-panel {
		display: none;
	}
}

@media (orientation: landscape) and (max-height: 520px) {
	.app-topbar {
		top: 8px;
	}

	.status-strip,
	.mission-panel {
		display: none;
	}

	.mode-dock {
		top: 58px;
		left: 10px;
		right: 10px;
	}

	.body-nav {
		bottom: 8px;
	}

	.touch-controls {
		bottom: 58px;
	}

	.cinematic-caption {
		bottom: 62px;
	}
}
