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

html,
body {
	height: 100%;
}

/* Ensure HTML `hidden` always wins over component display rules. */
[hidden] {
	display: none !important;
}

body {
	overflow: hidden;
	background: #000;
	color: #fff;
	font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

#canvas-container {
	position: fixed;
	inset: 0;
	z-index: 1;
}

.fallback {
	position: fixed;
	inset: 0;
	z-index: 4;
	display: grid;
	place-content: center;
	padding: 24px;
	background: radial-gradient(circle at 30% 20%, rgba(122, 44, 255, 0.16), rgba(0, 0, 0, 0.92) 55%, rgba(0, 0, 0, 0.98));
	color: rgba(255, 255, 255, 0.9);
	text-align: left;
}

.fallback__title {
	font-size: 14px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.92;
	margin-bottom: 10px;
}

.fallback__body {
	max-width: 56ch;
	line-height: 1.45;
	font-size: 14px;
	opacity: 0.78;
}

.debug {
	position: fixed;
	right: 16px;
	top: 16px;
	z-index: 3;
	width: min(360px, calc(100vw - 32px));
	padding: 12px 12px 10px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.72);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: rgba(255, 255, 255, 0.9);
	box-shadow:
		0 0 22px rgba(255, 90, 230, 0.08),
		0 0 46px rgba(90, 170, 255, 0.08);
}

.debug__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.debug__title {
	font-size: 12px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.85;
}

.debug__hint {
	font-size: 12px;
	opacity: 0.6;
	white-space: nowrap;
}

kbd {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 11px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-bottom-color: rgba(255, 255, 255, 0.28);
	padding: 1px 6px;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.06);
}

.debug__row {
	display: grid;
	grid-template-columns: 86px 1fr 44px;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
}

.debug__select {
	width: 100%;
	height: 30px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	background: linear-gradient(90deg, rgba(0, 194, 255, 0.14), rgba(122, 44, 255, 0.14), rgba(255, 79, 216, 0.14));
	color: rgba(255, 255, 255, 0.9);
	padding: 0 10px;
	font-size: 12px;
	letter-spacing: 0.02em;
	box-shadow: 0 0 18px rgba(255, 80, 220, 0.08), 0 0 18px rgba(60, 140, 255, 0.08);
	appearance: none;
	-webkit-appearance: none;
}
.debug__select:focus-visible {
	outline: 2px solid rgba(0, 194, 255, 0.55);
	outline-offset: 3px;
}

.debug__label {
	font-size: 12px;
	opacity: 0.82;
}

.debug__range {
	width: 100%;
}

/* Outrun slider styling */
.debug__range {
	accent-color: #ff4fd8;
}
.debug__range::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 999px;
	background: linear-gradient(90deg, #00c2ff, #7a2cff, #ff4fd8);
	box-shadow: 0 0 18px rgba(255, 80, 220, 0.12), 0 0 22px rgba(60, 140, 255, 0.12);
}
.debug__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	height: 16px;
	width: 16px;
	margin-top: -5px;
	border-radius: 999px;
	background: radial-gradient(circle at 30% 30%, #ffffff, #ffd1f3 45%, #ff4fd8 70%, #7a2cff);
	border: 1px solid rgba(255, 255, 255, 0.35);
	box-shadow: 0 0 16px rgba(255, 80, 220, 0.25), 0 0 18px rgba(60, 140, 255, 0.18);
}
.debug__range:focus-visible {
	outline: 2px solid rgba(0, 194, 255, 0.55);
	outline-offset: 4px;
	border-radius: 12px;
}

.debug__range::-moz-range-track {
	height: 6px;
	border-radius: 999px;
	background: linear-gradient(90deg, #00c2ff, #7a2cff, #ff4fd8);
	box-shadow: 0 0 18px rgba(255, 80, 220, 0.12), 0 0 22px rgba(60, 140, 255, 0.12);
}
.debug__range::-moz-range-thumb {
	height: 16px;
	width: 16px;
	border-radius: 999px;
	background: radial-gradient(circle at 30% 30%, #ffffff, #ffd1f3 45%, #ff4fd8 70%, #7a2cff);
	border: 1px solid rgba(255, 255, 255, 0.35);
	box-shadow: 0 0 16px rgba(255, 80, 220, 0.25), 0 0 18px rgba(60, 140, 255, 0.18);
}

.debug__value {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
	text-align: right;
	opacity: 0.75;
}

.debug__button {
	width: 100%;
	height: 30px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	background: linear-gradient(
		90deg,
		rgba(0, 194, 255, 0.14),
		rgba(122, 44, 255, 0.14),
		rgba(255, 79, 216, 0.14)
	);
	color: rgba(255, 255, 255, 0.92);
	padding: 0 10px;
	font-size: 12px;
	letter-spacing: 0.02em;
	box-shadow: 0 0 18px rgba(255, 80, 220, 0.08), 0 0 18px rgba(60, 140, 255, 0.08);
	cursor: pointer;
}
.debug__button:hover {
	border-color: rgba(255, 255, 255, 0.26);
}
.debug__button:active {
	transform: translateY(1px);
}
.debug__button:focus-visible {
	outline: 2px solid rgba(0, 194, 255, 0.55);
	outline-offset: 3px;
}

.debug__toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 30px;
	padding: 0 10px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	background: rgba(255, 255, 255, 0.06);
	cursor: pointer;
	user-select: none;
}
.debug__toggle:hover {
	border-color: rgba(255, 255, 255, 0.26);
}
.debug__toggle input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}
.debug__toggleUi {
	position: relative;
	width: 34px;
	height: 18px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
	flex: none;
}
.debug__toggleUi::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 14px;
	height: 14px;
	border-radius: 999px;
	background: radial-gradient(circle at 30% 30%, #ffffff, #ffd1f3 45%, #ff4fd8 70%, #7a2cff);
	box-shadow: 0 0 14px rgba(255, 80, 220, 0.18), 0 0 14px rgba(60, 140, 255, 0.12);
	transition: transform 120ms ease;
}
.debug__toggle input:checked + .debug__toggleUi::after {
	transform: translateX(16px);
}
.debug__toggleText {
	font-size: 12px;
	letter-spacing: 0.02em;
	color: rgba(255, 255, 255, 0.9);
}
.debug__toggle:has(input:focus-visible) {
	outline: 2px solid rgba(0, 194, 255, 0.55);
	outline-offset: 3px;
}

.hud {
	position: fixed;
	top: 16px;
	left: 16px;
	z-index: 2;
	pointer-events: none;
	opacity: 0.6;
	mix-blend-mode: screen;
}

.hud__titleRow {
	display: inline-flex;
	align-items: baseline;
	gap: 12px;
	pointer-events: auto;
}

.hud__title {
	font-size: 12px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.85);
	text-shadow:
		0 0 10px rgba(255, 120, 220, 0.18),
		0 0 24px rgba(140, 120, 255, 0.12);
}

.hud__more {
	font-size: 12px;
	letter-spacing: 0.02em;
	color: rgba(122, 44, 255, 0.55);
	text-decoration: none;
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity 140ms ease, transform 140ms ease, color 140ms ease;
}
.hud__titleRow:hover .hud__more {
	opacity: 1;
	transform: translateX(0);
}
.hud__more:hover {
	color: #7a2cff;
}
.hud__more:focus-visible {
	opacity: 1;
	outline: 2px solid rgba(122, 44, 255, 0.65);
	outline-offset: 3px;
	border-radius: 6px;
}

.creditLink {
	position: fixed;
	right: 16px;
	bottom: 14px;
	z-index: 2;
	pointer-events: auto;
	font-size: 12px;
	letter-spacing: 0.02em;
	color: rgba(168, 118, 255, 0.8);
	text-decoration: none;
	opacity: 0.35;
	mix-blend-mode: screen;
	transition: opacity 140ms ease, color 140ms ease;
}
.creditLink:hover {
	opacity: 0.9;
	color: #7a2cff;
}
.creditLink:focus-visible {
	opacity: 1;
	outline: 2px solid rgba(122, 44, 255, 0.65);
	outline-offset: 3px;
	border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
	.hud {
		display: none;
	}
	.debug {
		display: none;
	}
}

