body {
	margin: 0;
	background-color: #000;
	background-image: radial-gradient(ellipse at top, #335476 0.0%, #31506e 11.1%, #304b67 22.2%, #2f4760 33.3%, #2d4359 44.4%, #2c3f51 55.6%, #2a3a4a 66.7%, #293643 77.8%, #28323d 88.9%, #262e36 100.0%);
	height: 100vh;
	overflow: hidden;

	font-family: monospace;
	font-weight: bold;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.75);
}

#c {
	display: block;
	touch-action: none;
	transform: translateZ(0);
}


/*/////////////////////
//        HUD        //
/////////////////////*/


.hud__score,
.pause-btn {
	position: fixed;
	font-size: calc(14px + 2vw + 1vh);
}

.hud__score {
	top: 0.65em;
	left: 0.65em;
	pointer-events: none;
	user-select: none;
}

.cube-count-lbl {
	font-size: 0.46em;
}

.pause-btn {
	position: fixed;
	top: 0;
	right: 0;
	padding: 0.8em 0.65em;
}

.pause-btn > div {
	position: relative;
	width: 0.8em;
	height: 0.8em;
	opacity: 0.75;
}

.pause-btn > div::before,
.pause-btn > div::after {
	content: '';
	display: block;
	width: 34%;
	height: 100%;
	position: absolute;
	background-color: #fff;
}

.pause-btn > div::after {
	right: 0;
}

.slowmo {
	position: fixed;
	bottom: 0;
	width: 100%;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.4s;
	will-change: opacity;
}

.slowmo::before {
	content: 'SLOW-MO';
	display: block;
	font-size: calc(8px + 1vw + 0.5vh);
	margin-left: 0.5em;
	margin-bottom: 8px;
}

.slowmo::after {
	content: '';
	display: block;
	position: fixed;
	bottom: 0;
	width: 100%;
	height: 1.5vh;
	background-color: rgba(0, 0, 0, 0.25);
	z-index: -1;
}

.slowmo__bar {
	height: 1.5vh;
	background-color: rgba(255, 255, 255, 0.75);
	transform-origin: 0 0;
}



/*/////////////////////
//       MENUS       //
/////////////////////*/

.menus::before {
	content: '';
	pointer-events: none;
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background-color: #000;
	opacity: 0;
	transition: opacity 0.2s;
	transition-timing-function: ease-in;
}

.menus.has-active::before {
	opacity: 0.08;
	transition-duration: 0.4s;
	transition-timing-function: ease-out;
}

.menus.interactive-mode::before {
	opacity: 0.02;
}



/* Menu containers */
.menu {
	pointer-events: none;
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	user-select: none;
	text-align: center;
	color: rgba(255, 255, 255, 0.9);
	opacity: 0;
	visibility: hidden;
	transform: translateY(30px);
	transition-property: opacity, visibility, transform;
	transition-duration: 0.2s;
	transition-timing-function: ease-in;
}

.menu.active {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition-duration: 0.4s;
	transition-timing-function: ease-out;
}

.menus.interactive-mode .menu.active {
	opacity: 0.6;
}

.menus:not(.interactive-mode) .menu.active > * {
	pointer-events: auto;
}


/* Common menu elements */

h1 {
	font-size: 4rem;
	line-height: 0.95;
	text-align: center;
	font-weight: bold;
	margin: 0 0.65em 1em;
}

h2 {
	font-size: 1.2rem;
	line-height: 1;
	text-align: center;
	font-weight: bold;
	margin: -1em 0.65em 1em;
}

.final-score-lbl {
	font-size: 5rem;
	margin: -0.2em 0 0;
}

.high-score-lbl {
	font-size: 1.2rem;
	margin: 0 0 2.5em;
}

button {
	display: block;
	position: relative;
	width: 200px;
	padding: 12px 20px;
	background: transparent;
	border: none;
	outline: none;
	user-select: none;
	font-family: monospace;
	font-weight: bold;
	font-size: 1.4rem;
	color: #fff;
	opacity: 0.75;
	transition: opacity 0.3s;
}

button::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background-color: rgba(255, 255, 255, 0.15);
	transform: scale(0, 0);
	opacity: 0;
	transition: opacity 0.3s, transform 0.3s;
}

/* No `:focus` styles because this is a mouse/touch game! */
button:active {
	opacity: 1;
}

button:active::before {
	transform: scale(1, 1);
	opacity: 1;
}

.credits {
	position: fixed;
	width: 100%;
	left: 0;
	bottom: 20px;
}

a {
	color: white;
}

/* Only enable hover state on large screens */
@media (min-width: 1025px) {
	button:hover {
		opacity: 1;
	}

	button:hover::before {
		transform: scale(1, 1);
		opacity: 1;
	}
}

body { background: #081d29 url("conservatory.webp") center / cover no-repeat; font-family: ui-sans-serif, system-ui, sans-serif; letter-spacing: .02em; color: #f0f9ed; }
body::before { content: ''; position: fixed; inset: 0; background: linear-gradient(180deg,rgba(3,16,25,.25),rgba(3,16,25,.55)); pointer-events: none; }
#c { position: relative; }
h1 { font-family: Georgia, serif; font-weight: 400; font-size: clamp(48px,8vw,92px); margin: 0 0 20px; letter-spacing: -.035em; text-shadow: 0 4px 35px #061820; }
h1 span { display:block; font: 500 14px/2 system-ui; letter-spacing:.24em; text-transform:uppercase; margin-top:16px; color:#a7dacc; }
.eyebrow { font-size:11px; letter-spacing:.25em; color:#e7be7d; margin:0 0 20px; }
.intro { font-size:15px; line-height:1.7; margin:0 20px 24px; color:#e2eee8; }
.menu { background:radial-gradient(ellipse,rgba(3,18,26,.85),transparent 75%); }
.menu button { width:250px; border:1px solid #86b9a580; border-radius:12px; background:#102c36e8; margin:5px 0; font:600 16px/1.4 system-ui; padding:14px; opacity:1; }
.menu .play-normal-btn, .menu .resume-btn, .menu .play-again-btn { background:#d2eeb6; color:#17362d; border-color:#d2eeb6; }
button:focus-visible, a:focus-visible { outline:3px solid #ffcf85; outline-offset:5px; }
button::before { border-radius:12px; }
.guide { font:12px/1.8 system-ui; color:#b1c9c8; margin:18px 20px; }
.credits { font:11px/1.6 system-ui; color:#b9cac7; bottom:12px; }
.credits a { color:#d2eeb6; }
.pause-btn { width:60px; height:60px; background:#082330ba; border:1px solid #a6d3bc60; border-radius:12px; top:14px; right:14px; padding:18px; opacity:1; }
.pause-btn > div { width:20px;height:22px; }
.hud__score { background:#071d27c9; padding:12px 18px; border-radius:12px; font:600 clamp(20px,4vw,32px)/1.4 system-ui; }
.cube-count-lbl { font-size:12px; letter-spacing:.08em; }
@media(max-height:620px) { h1 {font-size:42px;margin-bottom:8px;} .eyebrow {margin-bottom:8px;} .intro {font-size:12px;margin-bottom:8px;} .guide {margin:8px;} .menu button {padding:9px;} .credits {font-size:10px;bottom:4px;} }
@media(max-width:480px) { .intro {font-size:13px;} .credits {font-size:10px;} h1 span {font-size:12px;} }
/* Keep the canvas from widening a mobile viewport during rotation/resizing. */
html { overflow: hidden; }
body { width: 100vw; }
#c { max-width: 100vw; max-height: 100dvh; }
