:root {
	--bg-0: #0c0e12;
	--bg-1: #151922;
	--ink: #e8e2d6;
	--muted: #9aa3b2;
	--accent: #f2b847;
	--frame: #2a3140;
	--frame-glow: rgba(242, 184, 71, 0.18);
	--danger: #5b3943;
	--danger-border: #9b3943;
	--font-display: "Bungee", system-ui, sans-serif;
	--font-body: "IBM Plex Sans", system-ui, sans-serif;
	/* Desktop: capped square. Mobile overrides to full bleed. */
	--stage-size: min(100vmin - 2rem, 1000px);
}

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

html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	color: var(--ink);
	background:
		radial-gradient(1200px 700px at 50% -10%, #243049 0%, transparent 55%),
		radial-gradient(900px 500px at 80% 110%, #3a2418 0%, transparent 50%),
		var(--bg-0);
	font-family: var(--font-body);
	touch-action: none;
	overflow: hidden;
}

.page {
	min-height: 100dvh;
	min-height: 100svh;
	display: grid;
	grid-template-rows: auto 1fr auto;
	align-items: center;
	justify-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom));
}

.chrome {
	text-align: center;
	max-width: 40rem;
}

.brand {
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(1.4rem, 3vw, 2rem);
	letter-spacing: 0.04em;
	color: var(--accent);
	text-shadow: 0 2px 0 #00000055;
}

.tagline,
.footer p {
	margin: 0.25rem 0 0;
	color: var(--muted);
	font-size: 0.9rem;
}

.stage {
	position: relative;
	width: var(--stage-size);
	height: var(--stage-size);
	background: var(--bg-1);
	border: 1px solid var(--frame);
	border-radius: 10px;
	box-shadow:
		0 0 0 1px #00000080 inset,
		0 18px 50px #00000088,
		0 0 40px var(--frame-glow);
	overflow: hidden;
}

#canvas {
	position: absolute;
	inset: 0;
	display: block;
	/* Godot may set inline pixel size; keep the bitmap stretched to the stage. */
	width: 100% !important;
	height: 100% !important;
	background: #000;
}

#canvas:focus {
	outline: none;
}

#status,
#status-splash,
#status-progress {
	position: absolute;
	left: 0;
	right: 0;
}

#status,
#status-splash {
	top: 0;
	bottom: 0;
}

#status {
	background-color: var(--splash-color, #0c0e12);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	visibility: hidden;
	z-index: 2;
}

#status-splash {
	max-height: 100%;
	max-width: 100%;
	margin: auto;
}

#status-splash.show-image--false {
	display: none;
}

#status-splash.fullsize--true {
	height: 100%;
	width: 100%;
	object-fit: contain;
}

#status-splash.use-filter--false {
	image-rendering: pixelated;
}

#status-progress,
#status-notice {
	display: none;
}

#status-progress {
	bottom: 12%;
	width: 55%;
	margin: 0 auto;
}

#status-notice {
	background-color: var(--danger);
	border-radius: 0.5rem;
	border: 1px solid var(--danger-border);
	color: #e0e0e0;
	line-height: 1.35;
	margin: 0 1.25rem;
	overflow: hidden;
	padding: 0.9rem 1rem;
	text-align: center;
	z-index: 3;
}

.notice {
	margin: 1rem;
	text-align: center;
	color: var(--muted);
}

/* Phones / narrow: full-bleed square stage, hide page chrome */
@media (max-width: 800px), (max-height: 800px) {
	.page {
		grid-template-rows: 1fr;
		padding: 0;
		gap: 0;
	}

	.chrome {
		display: none;
	}

	.stage {
		width: 100vmin;
		height: 100vmin;
		max-width: 100dvw;
		max-height: 100dvh;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}
}
