html,
body {
	margin: 0;
	padding: 0;
}


#stage {
	--u: 1; 
	position: relative;
	width: min(100vw, calc(100vh * 1440 / 1050));
	aspect-ratio: 1440 / 1050;
	margin: 0 auto;
	overflow: hidden;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
	font-family: sans-serif;
	color: #fff;

	
	background: #6f747a url(assets/bg-1280.webp) center / 100% 100% no-repeat;
}
@media (min-width: 700px) and (min-resolution: 1.5dppx), (min-width: 700px) and (-webkit-min-device-pixel-ratio: 1.5), (min-width: 1300px) {
	#stage {
		background-image: url(assets/bg-1920.webp);
	}
}
@supports not (aspect-ratio: 1) {
	#stage {
		height: calc(min(100vw, 100vh * 1440 / 1050) * 1050 / 1440);
	}
}

#stage canvas {
	position: absolute;
	inset: 0;
	left: 0;
	top: 0;
	width: 100% !important;
	height: 100% !important;
	display: block;
	will-change: transform;
	touch-action: pan-x pan-y pinch-zoom;
	outline: none;
}

#banner,
#tip,
#ui,
#loading {
	position: absolute;
	z-index: 2;
}

#banner {
	left: calc(50% - 240px * var(--u));
	top: calc(50% - 180px * var(--u));
	width: calc(480px * var(--u));
	height: calc(210px * var(--u));
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	background: rgba(0, 0, 0, 0.4);
	font-size: calc(18px * var(--u));
	line-height: 1.25;
	text-align: center;
	white-space: pre;
	pointer-events: none;
}
#banner.done {
	height: calc(240px * var(--u));
}
#banner[hidden],
#tip[hidden],
#loading[hidden] {
	display: none;
}

#tip {
	left: 0;
	top: 0;
	padding: 0 calc(10px * var(--u));
	height: calc(24px * var(--u));
	line-height: calc(24px * var(--u));
	font-size: calc(10.8px * var(--u));
	white-space: nowrap;
	background: rgba(0, 0, 0, 0.4);
	pointer-events: none;
	will-change: transform;
	transition: transform 0.18s ease-out;
}
#tip.jump {
	transition: none;
}

#ui {
	left: calc(16px * var(--u));
	bottom: calc(16px * var(--u));
	display: flex;
	gap: calc(8px * var(--u));
}
#ui button {
	position: relative;
	width: calc(40px * var(--u));
	height: calc(40px * var(--u));
	min-width: 28px;
	min-height: 28px;
	padding: 0;
	border: 0;
	background: none;
	color: #000;
	font-family: sans-serif;
	line-height: 1;
	cursor: pointer;
	touch-action: manipulation;
}

#ui button span {
	display: block;
	transition: transform 0.15s;
}
#replay span {
	font-size: max(24px, calc(36px * var(--u)));
}
#volume span {
	font-size: max(18px, calc(26px * var(--u)));
	color: transparent;
	text-shadow: 0 0 0 #000;
}
#ui button:hover span,
#ui button:focus-visible span {
	transform: scale(1.2);
}
#replay:hover span {
	animation: spin 1.5s linear infinite;
}
@keyframes spin {
	from {
		transform: scale(1.2) rotate(0deg);
	}
	to {
		transform: scale(1.2) rotate(-360deg);
	}
}

#ui button::after {
	content: attr(data-tip);
	position: absolute;
	left: 50%;
	bottom: 100%;
	transform: translate(-50%, -4px);
	padding: 0 calc(10px * var(--u));
	height: calc(24px * var(--u));
	line-height: calc(24px * var(--u));
	font: calc(10.8px * var(--u)) sans-serif;
	color: #fff;
	white-space: nowrap;
	background: rgba(0, 0, 0, 0.4);
	opacity: 0;
	pointer-events: none;
}
#ui button:hover::after {
	opacity: 1;
}

#loading {
	left: 0;
	right: 0;
	top: 45%;
	margin: 0;
	text-align: center;
	font-size: max(14px, calc(22px * var(--u)));
	text-shadow: 0 1px 3px #000;
}
#stage.loading #banner,
#stage.loading #ui,
#stage.loading #tip {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	#replay:hover span {
		animation: none;
	}
	#tip {
		transition: none;
	}
}
