*,
*::before,
*::after {
	box-sizing: border-box;

	/* Disable long press on everything */
	-webkit-touch-callout: none; /* iOS Safari */
	-webkit-user-select: none; /* Safari */
	user-select: none; /* Standard syntax */
}

:root {
	--space-color: #000;
	--rocket-color: #fff;

	--onscreen-control-min-dim: 0px;
}

@font-face {
	font-family: Hyperspace;
	src: url("./font/Hyperspace.ttf");
}

html {
	/* font-size: clamp(0.5rem, 0.3793rem + 0.5517vw, 1rem); */
	font-size: clamp(0.4rem, 0.33rem + 0.5517vw, 1rem);
}

body {
	margin: 0;
	overflow: hidden;
	/* background-color: rgb(52, 50, 50); */
	background-color: var(--space-color);
	/* font-family: Arial, Helvetica, sans-serif; */
	/* font-family: monospace, Courier, "Courier New"; */
	font-family: Hyperspace, monospace, Courier, "Courier New";
	touch-action: none;
	overscroll-behavior-y: none;
	overscroll-behavior-block: none;
}

button {
	font-family: inherit;
	font-weight: bold;
	font-size: 2rem;
	cursor: pointer;
}

#gameCanvas {
	position: fixed;
	background-color: var(--space-color);
}

@media (orientation: landscape) {
	[data-touch-screen] #gameCanvas {
		left: var(--onscreen-control-min-dim);
	}
}

[data-game-active="true"] #gameCanvas {
	outline: 1px solid white;
}

.scoreArea {
	position: fixed;
	top: 2rem;
	left: 2rem;
	color: white;
	font-size: 3rem;
}

@media (orientation: landscape) {
	[data-touch-screen] .scoreArea {
		left: calc(2rem + var(--onscreen-control-min-dim));
	}
}

.scoreArea .lives {
	display: flex;
	justify-content: center;
}

.scoreArea .lives img {
	height: 2.5rem;
	margin-right: 0.25rem;
}

/* ============================= Text Overlay ================================ */

.textOverlay {
	display: flex;
	align-items: center;
	padding: 5rem 0;
	/* justify-content: center; */
	gap: 1rem;
	flex-direction: column;
	position: fixed;
	overflow: auto;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100dvh;
	color: white;
	background-color: rgba(0, 0, 0, 0.7);
}

[data-game-active="true"] .textOverlay {
	display: none;
}

.textOverlay .title {
	font-size: 4rem;
}

.textOverlay .subTitle {
	font-size: 3rem;
}

.textOverlay .instructions {
	text-align: center;
	font-size: 1.5rem;
}

/* ============================= Notify/Help Me Dialog ================================ */

#notifyMeDialog {
	/* position: fixed; */
	/* inset: 0; */
	color: white;
	background-color: var(--space-color);
	font-size: 1.5rem;
}

#helpDialog {
	color: white;
	background-color: var(--space-color);
	font-size: 1.5rem;
	max-width: 90dvw;
	max-height: 80dvh;

	& p {
		margin: 0;
	}
}

::backdrop {
	/* background-color: var(--space-color-dim); */
	background-color: rgba(0, 0, 0, 0.7);
}

#notifyMeDialog form > * {
	margin-bottom: 10px;
}

dialog .dialogCloseX {
	margin-bottom: 10px;
	display: block;
	margin-left: auto;
	position: sticky;
	top: 0;
}

#notifyMeDialog input {
	font-family: inherit;
	font-weight: bold;
	font-size: inherit;
}

#notifyMeDialog .addOrRemove {
	display: flex;
	justify-content: space-evenly;
}

#notifyMeDialog .addOrRemove > * {
	cursor: pointer;
}

#notifyMeDialog .buttons {
	display: flex;
	justify-content: right;
}

#notifyMeDialog .statusMsg {
	text-align: center;
}

#notifyMeDialog #notifyEmailWrapper {
	display: grid;
	grid-template-columns: auto 1fr;
}

/* ============================= On Screen Controls ================================ */

.onScreenCtrlWrapper {
	position: fixed;
	align-items: center;
	justify-content: center;
	color: white;
	user-select: none;
	display: flex;
	justify-content: space-around;
	/* outline: 1px solid white; */
}

.onScreenCtrlWrapper.left {
	left: 0;
	bottom: 0;
	width: clamp(100px, 40%, 160px);
	/* Now dynamically changed from app.js */
	height: var(--onscreen-control-min-dim);
}

.onScreenCtrlWrapper.right {
	right: 0;
	bottom: 0;
	width: clamp(100px, 60%, 230px);
	/* Now dynamically changed from app.js */
	height: var(--onscreen-control-min-dim);
}

@media (orientation: landscape) {
	.onScreenCtrlWrapper {
		flex-direction: column;
		margin-bottom: 50px;
	}

	.onScreenCtrlWrapper.left {
		left: 0;
		bottom: 0;
		height: clamp(100px, 50%, 180px);
		/* Now dynamically changed from app.js */
		width: var(--onscreen-control-min-dim);
	}

	.onScreenCtrlWrapper.right {
		right: 0;
		bottom: 0;
		height: clamp(100px, 70%, 240px);
		/* Now dynamically changed from app.js */
		width: var(--onscreen-control-min-dim);
	}
}

.onScreenCtrlWrapper .onScreenCtrl {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	/* outline: 2px solid red; */
	user-select: none;
	width: 100%;
	height: 100%;
}

.onScreenCtrlWrapper .onScreenCtrl svg {
	pointer-events: none;
	fill: currentColor;
	user-select: none;
	outline: 2px solid;
	border-radius: 9999px;
	height: 44px;
	/* pointer-events: none; */
}

footer {
	display: flex;
	width: 100%;
	height: 40px;
	justify-content: space-between;
	align-items: start;
	position: fixed;
	bottom: 0;
	padding: 0 1rem;
	color: white;
	font-size: 1.5rem;
}

body:not([data-touch-screen]) footer #btnNewGame {
	display: none;
}

/* ============================= Leaderboard ================================ */

.textOverlay .leaderboard {
	font-size: 2rem;
}

.textOverlay .leaderboard table {
	border-collapse: collapse;
}

.textOverlay .leaderboard table th,
td {
	padding: 0 0.5rem;
	border: 1px solid;
	text-align: center;
}

/* ============================= Utility ================================ */

.d-none {
	display: none !important;
}

/* @media (max-width: 768px) {
	html {
		font-size: 8px;
	}
} */
