* {
	box-sizing: border-box;
}

:root {
	color-scheme: dark;
	font-family: "Segoe UI", Tahoma, sans-serif;
	--panel-bg: rgba(11, 17, 27, 0.72);
	--panel-border: rgba(255, 255, 255, 0.14);
	--ink-soft: rgba(237, 244, 255, 0.8);
	--ink-strong: #f4f8ff;
	--accent: #62f1ff;
	--accent-warm: #ffb45f;
}

html,
body {
	margin: 0;
	min-height: 100%;
	background:
		radial-gradient(circle at top, rgba(132, 189, 255, 0.48) 0%, rgba(10, 15, 24, 0) 32%),
		linear-gradient(180deg, #6ec0ff 0%, #1f5f8f 30%, #09131d 100%);
	overflow: hidden;
}

body {
	color: var(--ink-strong);
}

#app {
	position: relative;
	width: 100vw;
	height: 100vh;
}

#scene-root,
#scene-root canvas {
	width: 100%;
	height: 100%;
	display: block;
}

.hud {
	position: absolute;
	inset: 0 0 auto 0;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 22px;
	pointer-events: none;
	z-index: 30;
}

.hud-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 999px;
	background: rgba(12, 19, 31, 0.68);
	backdrop-filter: blur(16px);
	color: var(--ink-strong);
	font: 700 0.95rem/1 "Segoe UI", sans-serif;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	pointer-events: auto;
	cursor: pointer;
	transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.hud-button:hover,
.hud-button:focus-visible {
	transform: translateY(-2px);
	border-color: rgba(98, 241, 255, 0.48);
	background: rgba(19, 29, 48, 0.82);
	outline: none;
}

.hud-button__icon {
	display: inline-grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: linear-gradient(135deg, rgba(98, 241, 255, 0.24), rgba(255, 180, 95, 0.24));
	font-size: 1.1rem;
}

.hud-stats {
	display: flex;
	gap: 12px;
	pointer-events: auto;
}

.stat-card {
	min-width: 118px;
	padding: 14px 16px 12px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 20px;
	background: linear-gradient(180deg, rgba(10, 16, 27, 0.82), rgba(17, 27, 42, 0.68));
	backdrop-filter: blur(18px);
	box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
	text-align: right;
}

.stat-label {
	display: block;
	font-size: 0.74rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ink-soft);
}

.stat-card strong {
	display: block;
	margin-top: 6px;
	font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
	font-size: clamp(2rem, 5vw, 2.6rem);
	font-weight: 400;
	letter-spacing: 0.06em;
}

.settings-panel {
	position: absolute;
	top: 88px;
	left: 22px;
	width: min(320px, calc(100vw - 44px));
	padding: 22px;
	border: 1px solid var(--panel-border);
	border-radius: 28px;
	background:
		linear-gradient(180deg, rgba(17, 29, 46, 0.94), rgba(9, 15, 24, 0.86)),
		var(--panel-bg);
	box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
	backdrop-filter: blur(18px);
	transform: translateY(-10px) scale(0.98);
	opacity: 0;
	pointer-events: none;
	transition: opacity 180ms ease, transform 180ms ease;
	z-index: 40;
}

.settings-panel.is-open {
	transform: translateY(0) scale(1);
	opacity: 1;
	pointer-events: auto;
}

.settings-panel__header p {
	margin: 0;
	font-size: 0.78rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.58);
}

.settings-panel__header h2 {
	margin: 8px 0 18px;
	font: 400 clamp(2rem, 5vw, 3rem)/0.92 Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
	letter-spacing: 0.08em;
}

.settings-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 12px 0;
	color: var(--ink-soft);
}

.settings-row input[type="checkbox"] {
	width: 20px;
	height: 20px;
	accent-color: #62f1ff;
}

.settings-row input[type="range"] {
	width: 126px;
	accent-color: #ffb45f;
}

.settings-actions {
	display: flex;
	gap: 12px;
	margin-top: 20px;
}

.panel-button {
	flex: 1;
	padding: 12px 14px;
	border: 0;
	border-radius: 16px;
	background: linear-gradient(135deg, #62f1ff, #7ee7b3);
	color: #08111b;
	font: 700 0.95rem/1 "Segoe UI", sans-serif;
	cursor: pointer;
}

.panel-button--ghost {
	background: rgba(255, 255, 255, 0.08);
	color: var(--ink-strong);
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.settings-tip {
	margin: 18px 0 0;
	color: rgba(255, 255, 255, 0.68);
	font-size: 0.9rem;
}

.status-overlay {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 24px;
	background: rgba(6, 10, 18, 0.4);
	backdrop-filter: blur(10px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 220ms ease;
	z-index: 25;
}

.status-overlay.is-visible {
	opacity: 1;
	pointer-events: auto;
}

.status-card {
	width: min(540px, 100%);
	padding: 28px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 32px;
	background:
		linear-gradient(180deg, rgba(13, 20, 31, 0.94), rgba(8, 12, 20, 0.9)),
		var(--panel-bg);
	box-shadow: 0 36px 80px rgba(0, 0, 0, 0.35);
	text-align: center;
}

.status-eyebrow {
	margin: 0 0 10px;
	font-size: 0.82rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.58);
}

.status-card h1 {
	margin: 0;
	font: 400 clamp(2.7rem, 10vw, 5.2rem)/0.9 Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
	letter-spacing: 0.08em;
}

.status-card p {
	margin: 14px auto 0;
	max-width: 38ch;
	color: var(--ink-soft);
	font-size: 1rem;
	line-height: 1.5;
}

.status-actions {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 24px;
}

.status-actions .panel-button {
	flex: 0 0 auto;
	min-width: 140px;
}

.toast {
	position: absolute;
	left: 50%;
	bottom: 86px;
	transform: translateX(-50%) translateY(16px);
	padding: 14px 18px;
	border-radius: 999px;
	background: rgba(6, 11, 19, 0.82);
	border: 1px solid rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(14px);
	color: var(--ink-strong);
	font-size: 0.95rem;
	opacity: 0;
	pointer-events: none;
	transition: opacity 180ms ease, transform 180ms ease;
	z-index: 45;
}

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

.footer-hint {
	position: absolute;
	left: 22px;
	bottom: 22px;
	padding: 14px 18px;
	border-radius: 22px;
	background: rgba(7, 12, 20, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(12px);
	color: rgba(255, 255, 255, 0.78);
	font-size: 0.92rem;
	z-index: 20;
}

.footer-hint p {
	margin: 0;
}

.footer-hint p + p {
	margin-top: 4px;
}

@media (max-width: 900px) {
	.hud {
		flex-direction: column;
		gap: 12px;
	}

	.hud-stats {
		width: 100%;
		justify-content: space-between;
	}

	.stat-card {
		flex: 1;
		min-width: 0;
	}

	.footer-hint {
		right: 22px;
	}
}

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

	.settings-panel {
		top: 76px;
		left: 16px;
		width: calc(100vw - 32px);
	}

	.footer-hint {
		left: 16px;
		right: 16px;
		bottom: 16px;
	}

	.hud-stats {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
