:root {
	--bg-0: #0c0e12;
	--bg-1: #0c0e12;
	--ink: #e8e2d6;
	--muted: #9aa3b2;
	--accent: #f2b847;
	--frame: #2a3140;
	--danger: #5b3943;
	--danger-border: #9b3943;
	--font-body: system-ui, sans-serif;
}

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

html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	color: var(--ink);
	background: var(--bg-0);
	font-family: var(--font-body);
	touch-action: none;
	overflow: hidden;
}

.stage {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	background: var(--bg-1);
	overflow: hidden;
}

#canvas {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	background: #000;
}

#canvas:focus {
	outline: none;
}

#status,
#status-splash,
#status-panel {
	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-panel,
#status-notice {
	display: none;
}

#status-panel {
	bottom: max(10%, env(safe-area-inset-bottom, 0px) + 2rem);
	width: min(70%, 22rem);
	margin: 0 auto;
	flex-direction: column;
	align-items: stretch;
	gap: 0.55rem;
	z-index: 3;
	padding: 0 1rem;
}

#status-label {
	margin: 0;
	text-align: center;
	color: var(--muted);
	font-family: var(--font-body);
	font-size: 0.95rem;
}

#status-track {
	height: 10px;
	border-radius: 999px;
	background: #1c2230;
	border: 1px solid var(--frame);
	overflow: hidden;
}

#status-fill {
	height: 100%;
	width: 0%;
	border-radius: inherit;
	background: linear-gradient(90deg, #c4892a, var(--accent));
	transform-origin: left center;
	transition: width 0.15s linear;
}

#status-fill.indeterminate {
	width: 40%;
	transition: none;
	animation: status-indeterminate 1.1s ease-in-out infinite;
}

#status-fill.building {
	width: 100%;
	transition: none;
	background: linear-gradient(
		90deg,
		#6a4a18 0%,
		var(--accent) 35%,
		#fff0c2 50%,
		var(--accent) 65%,
		#6a4a18 100%
	);
	background-size: 220% 100%;
	animation: status-building 1.25s linear infinite;
}

@keyframes status-indeterminate {
	0% { transform: translateX(-120%); }
	100% { transform: translateX(280%); }
}

@keyframes status-building {
	0% { background-position: 100% 0; }
	100% { background-position: -100% 0; }
}

#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);
}
