body {
	margin: 0;
	background-color: #65c8a8;
	height: 100vh;
	overflow: hidden;

	font-family: Verdana;
	font-weight: bold;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.76);
	transition: background-color 2s ease-in-out;
}

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

.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;
}

.level-lbl {
	font-size: 0.38em;
	margin-top: 0.3em;
	display: inline-block;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 20px;
	padding: 2px 10px;
	letter-spacing: 0.1em;
	color: rgba(255, 255, 255, 0.9);
	text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.lives-lbl {
	font-size: 0.46em;
	margin-top: 0.25em;
	letter-spacing: 0.05em;
	transition: transform 0.15s ease, opacity 0.15s ease;
	display: block;
}

@keyframes lives-hit-flash {
	0% {
		transform: scale(1);
		opacity: 1;
	}

	25% {
		transform: scale(1.35);
		opacity: 0.4;
	}

	60% {
		transform: scale(0.9);
		opacity: 1;
	}

	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.lives-lbl.lives-hit {
	animation: lives-hit-flash 0.6s ease forwards;
}

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

.sound-btn {
	position: fixed;
	top: 0;
	right: 2.5em;
	/* placed left of pause btn */
	padding: 0.8em 0.65em;
	cursor: pointer;
	z-index: 1001;
	pointer-events: auto;
	font-size: calc(14px + 2vw + 1vh);
	user-select: none;
}


.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::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 {
	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.700);
	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;
}

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

button:active {
	opacity: 1;
}

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

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

a {
	color: rgb(255, 255, 255);
}

@media (min-width: 1025px) {
	button:hover {
		opacity: 1;
	}

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

.milestone-notify {
	position: fixed;
	top: 20%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 2rem;
	color: #fff;
	font-weight: bold;
	text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
	background: rgba(0, 0, 0, 0.6);
	padding: 15px 30px;
	border-radius: 12px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.5s ease, transform 0.5s ease;
	z-index: 1000;
}

.milestone-notify.show {
	opacity: 1;
	transform: translate(-50%, -40%);
}


/* ============================================================
   HOW IT WORKS PAGE
   ============================================================ */

.hiw-title {
	font-size: clamp(1.8rem, 6vw, 3.5rem);
	margin: 0 0 0.5em;
	line-height: 1.1;
}

.hiw-content {
	width: 90%;
	max-width: 580px;
	max-height: 65vh;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.78);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 14px;
	padding: 18px 20px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
	text-align: left;
	color: #fff;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.hiw-content::-webkit-scrollbar {
	width: 4px;
}

.hiw-content::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 4px;
}

.hiw-section {
	margin-bottom: 18px;
}

.hiw-section:last-child {
	margin-bottom: 0;
}

.hiw-heading {
	font-size: clamp(0.85rem, 3vw, 1.1rem);
	color: #65c8a8;
	margin: 0 0 6px;
	text-align: left;
	font-weight: bold;
	letter-spacing: 0.04em;
	line-height: 1.3;
}

.hiw-heading--danger {
	color: #ff6b6b;
	text-shadow: 0 0 8px rgba(255, 107, 107, 0.4);
}

.hiw-text {
	font-size: clamp(0.72rem, 2.5vw, 0.88rem);
	line-height: 1.6;
	margin: 0;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
	color: rgba(255, 255, 255, 0.88);
}

/* Controls table */
.hiw-table-wrap {
	overflow-x: auto;
}

.hiw-table {
	width: 100%;
	border-collapse: collapse;
	font-size: clamp(0.65rem, 2.2vw, 0.82rem);
	color: rgba(255, 255, 255, 0.88);
}

.hiw-table tr:nth-child(odd) {
	background: rgba(255, 255, 255, 0.05);
}

.hiw-table td {
	padding: 6px 8px;
	vertical-align: middle;
	line-height: 1.4;
}

.hiw-table td:first-child {
	white-space: nowrap;
	padding-right: 14px;
	color: rgba(255, 255, 255, 0.7);
}

.hiw-table td:last-child {
	font-weight: bold;
}

/* Game modes grid */
.hiw-modes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 6px;
}

.hiw-mode {
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	padding: 10px 12px;
}

.hiw-mode-title {
	display: block;
	font-size: clamp(0.8rem, 2.8vw, 1rem);
	color: #65c8a8;
	font-weight: bold;
	margin-bottom: 4px;
}

.hiw-mode p {
	margin: 0;
	font-size: clamp(0.65rem, 2vw, 0.78rem);
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.78);
}

/* Start button emphasis */
.hiw-start-btn {
	margin-top: 12px;
	margin-bottom: 4px;
	opacity: 1 !important;
	color: #050908 !important;
}


/* ============================================================
   MOBILE RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Phones (portrait) — up to 480px */
@media (max-width: 480px) {
	h1 {
		font-size: 2.4rem;
		margin: 0 0.4em 0.6em;
	}

	button {
		font-size: 1.1rem;
		width: 170px;
		padding: 10px 14px;
	}

	.sound-btn {
		right: 2em;
		font-size: calc(12px + 2vw + 1vh);
	}

	.hiw-content {
		max-height: 58vh;
		padding: 14px 14px;
	}

	.hiw-modes {
		grid-template-columns: 1fr;
	}

	.milestone-notify {
		font-size: 1.2rem;
		padding: 10px 18px;
	}

	.final-score-lbl {
		font-size: 3.5rem;
	}
}

/* Small tablets / large phones (landscape or 481–768px) */
@media (min-width: 481px) and (max-width: 768px) {
	h1 {
		font-size: 3rem;
	}

	.hiw-content {
		max-height: 60vh;
		max-width: 94%;
	}

	.milestone-notify {
		font-size: 1.4rem;
	}
}

/* Desktop hover styles (already existed, kept here for clarity) */
@media (min-width: 1025px) {
	button:hover {
		opacity: 1;
	}

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