@font-face {
	font-family: "Barlow Condensed";
	font-weight: 700;
	font-display: swap;
	src: url("fonts/BarlowCondensed-Bold.ttf") format("truetype");
}

:root {
	--blue: #2454ff;
	--deep: #0b1a55;
	--yellow: #ffe44d;
	--ink: #101b30;
	--paper: #fffbea;
	--mint: #b6f3ce;
	--coral: #ff8c82;
	font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
}

html, body {
	margin: 0;
	height: 100%;
	overflow: hidden;
	overscroll-behavior: none;
	background: var(--blue);
	color: var(--paper);
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
}

body {
	position: fixed;
	inset: 0;
	touch-action: none;
}

/* Desktop and tablets: the game keeps its phone proportions in the middle of the page. */
body.boxed {
	background:
		radial-gradient(circle at 20% 15%, rgba(255, 228, 77, .18), transparent 32%),
		radial-gradient(circle at 80% 85%, rgba(182, 243, 206, .16), transparent 30%),
		linear-gradient(160deg, var(--blue), var(--deep));
}

#frame {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: var(--blue);
}

body.boxed #frame {
	border-radius: 18px;
	box-shadow: 0 0 0 3px var(--ink), 0 18px 60px rgba(4, 10, 40, .55);
}

#canvas {
	display: block;
	width: 100%;
	height: 100%;
	outline: none;
	touch-action: none;
}

#loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 24px;
	text-align: center;
	background: var(--blue);
	z-index: 2;
}

#loading h1 {
	margin: 0;
	font-size: 64px;
	line-height: .82;
	letter-spacing: .5px;
	text-shadow: 4px 5px 0 var(--ink);
}

#loading img {
	border-radius: 22px;
	box-shadow: 0 0 0 3px var(--ink);
}

#loading p {
	margin: 0;
	max-width: 320px;
	font-size: 22px;
	line-height: 1.15;
}

#install-hint {
	font-size: 19px !important;
	padding: 10px 14px;
	border: 3px solid var(--ink);
	border-radius: 6px;
	background: rgba(16, 27, 48, .35);
}

progress {
	width: min(260px, 70%);
	height: 14px;
	appearance: none;
	-webkit-appearance: none;
	border: 3px solid var(--ink);
	border-radius: 5px;
	background: var(--paper);
	overflow: hidden;
}

progress::-webkit-progress-bar { background: var(--paper); }
progress::-webkit-progress-value { background: var(--yellow); }
progress::-moz-progress-bar { background: var(--yellow); }

button, .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 8px 18px;
	border: 3px solid var(--ink);
	border-radius: 5px;
	box-shadow: 4px 5px 0 var(--ink);
	background: var(--paper);
	color: var(--ink);
	font: inherit;
	font-size: 23px;
	text-decoration: none;
	cursor: pointer;
	touch-action: manipulation;
}

button:active, .button:active {
	transform: translate(3px, 4px);
	box-shadow: 1px 1px 0 var(--ink);
}

button:focus-visible, .button:focus-visible, input:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.primary { background: var(--yellow); }
.mint { background: var(--mint); }

#rotate {
	position: fixed;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--blue);
	text-align: center;
}

#rotate[hidden], #toast[hidden], [hidden] { display: none !important; }

#rotate div {
	display: grid;
	gap: 6px;
	padding: 20px;
}

#rotate b { font-size: 40px; color: var(--yellow); text-shadow: 3px 4px 0 var(--ink); }
#rotate span { font-size: 24px; }

#toast {
	position: fixed;
	left: 50%;
	top: max(12px, env(safe-area-inset-top));
	transform: translateX(-50%);
	z-index: 15;
	display: flex;
	align-items: center;
	gap: 12px;
	width: max-content;
	max-width: calc(100vw - 32px);
	padding: 8px 10px 8px 16px;
	border: 3px solid var(--ink);
	border-radius: 6px;
	background: var(--paper);
	color: var(--ink);
	font-size: 21px;
	box-shadow: 4px 5px 0 var(--ink);
}

#toast button { min-height: 40px; font-size: 20px; padding: 4px 12px; }

.modal {
	position: fixed;
	inset: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	background: rgba(5, 10, 28, .82);
	touch-action: auto;
}

.modal section {
	display: grid;
	gap: 14px;
	width: min(420px, 100%);
	max-height: 100%;
	overflow-y: auto;
	padding: 20px;
	border: 3px solid var(--ink);
	border-radius: 6px;
	background: var(--paper);
	color: var(--ink);
	box-shadow: 5px 6px 0 var(--ink);
	-webkit-user-select: text;
	user-select: text;
}

.modal h2 { margin: 0; font-size: 34px; line-height: 1; color: var(--blue); }
.modal p { margin: 0; font-size: 22px; line-height: 1.2; }
.modal .item { font-size: 27px; }
.modal .price { font-size: 44px; color: var(--blue); }
.modal .hint { font-size: 19px; color: #3b465e; }
.modal .code {
	font-size: 38px;
	letter-spacing: 2px;
	text-align: center;
	padding: 8px;
	border: 3px dashed var(--ink);
	border-radius: 5px;
	background: #fff;
}
.modal .error { color: #b3261e; }
.modal .actions { display: grid; gap: 12px; }
.modal hr { width: 100%; border: 0; border-top: 3px solid var(--ink); margin: 2px 0; }

.modal input {
	min-height: 52px;
	padding: 6px 12px;
	border: 3px solid var(--ink);
	border-radius: 5px;
	font: inherit;
	font-size: 28px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--ink);
	background: #fff;
}

.noscript {
	position: fixed;
	inset: 40% 16px auto;
	text-align: center;
	font-size: 24px;
}
