/** @format */

@font-face {
	font-family: 'Montserrat';
	src: url('./fonts/Montserrat-Medium.ttf') format('truetype');
	font-weight: 500;
	font-display: swap;
}
@font-face {
	font-family: 'Montserrat';
	src: url('./fonts/Montserrat-Bold.ttf') format('truetype');
	font-weight: 700;
	font-display: swap;
}
@font-face {
	font-family: 'Montserrat';
	src: url('./fonts/Montserrat-ExtraBold.ttf') format('truetype');
	font-weight: 800;
	font-display: swap;
}

:root {
	--GREEN: #037c3d;
	--GREEN-DARK: #016b34;
	--TITLE: #027233;
	--BAR-BG: #fef7df;
	--BAR-FILL: #fde412;
	--DIM: rgba(0, 0, 0, 0.5);
}

canvas:focus {
	outline: none;
}

html,
body {
	padding: 0;
	margin: 0;
	overflow: hidden;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
	height: 100%;
	background: var(--GREEN);
	font-family: 'Montserrat', Arial, sans-serif;
}

#unity-container {
	position: fixed;
	width: 100%;
	height: 100%;
	background: var(--GREEN);
}

#unity-canvas {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 100%;
	height: 100%;
}

/* ---------- shared: full-screen layers and Figma "stages" ---------- */

.screen {
	position: fixed;
	inset: 0;
	overflow: hidden;
}

.cover {
	position: absolute;
	inset: 0;
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

/* design frame in Figma px; resize.js scales it to the viewport (contain, or cover with data-fit="cover") */
.stage {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) scale(var(--k, 1));
	transform-origin: 50% 50%;
	pointer-events: none;
}

/* edge decor scaled by width and pinned to the top / bottom of the screen */
.stage.anchor-top {
	top: 0;
	transform: translateX(-50%) scale(var(--k, 1));
	transform-origin: 50% 0;
}

.stage.anchor-bottom {
	top: auto;
	bottom: 0;
	transform: translateX(-50%) scale(var(--k, 1));
	transform-origin: 50% 100%;
}

.stage .abs {
	position: absolute;
	display: block;
	box-sizing: border-box;
}

.stage .txt {
	font-family: 'Montserrat', Arial, sans-serif;
	margin: 0;
	transform-origin: 50% 50%;
}

.dim {
	position: absolute;
	inset: 0;
	background: var(--DIM);
}

.popup {
	pointer-events: auto;
}

.popup .abs:not([id]) {
	pointer-events: none;
}

.popup [id] {
	cursor: pointer;
	transition: transform 0.1s ease;
}

.popup [id]:active {
	transform: scale(0.97);
}

/* ---------- loader ---------- */

/* fills the space around the 9:16 stage on taller/wider screens with the edge colors of the art */
.loader-bg {
	background: linear-gradient(to bottom, #31b5fd 0%, #31b5fd 50%, #339a3c 50%, #339a3c 100%);
}

#unity-loading-bar {
	z-index: 10;
	opacity: 1;
}

.loader-title {
	font-weight: 700;
	font-size: 20px;
	line-height: 48px;
	color: var(--TITLE);
	text-align: center;
	white-space: nowrap;
}

.loader-status {
	font-weight: 700;
	font-size: 16px;
	line-height: 20px;
	color: #fff;
	text-align: center;
	white-space: nowrap;
}

.loading-container {
	background: var(--BAR-BG);
	border-radius: 8px;
	box-shadow: 0 0 0 4px var(--GREEN-DARK);
	padding: 4px;
	overflow: hidden;
}

.loading-bar {
	height: 100%;
	width: 8%;
	background: var(--BAR-FILL);
	border-radius: 4px;
	transition: width 0.3s ease;
}

#loading-screen {
	position: fixed;
	inset: 0;
	background: var(--GREEN) url('./img/ui/loader-bg.jpg?v=v0.1') center / cover no-repeat;
	z-index: 9999;
	transition: opacity 0.5s ease;
	opacity: 1;
}

#loading-screen.hidden {
	opacity: 0;
	pointer-events: none;
}

/* ---------- preloader ---------- */

.preloader {
	z-index: 20;
	display: none;
	background: var(--DIM);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.preloader.visible {
	opacity: 1;
}

.spinner {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* ---------- rotate device ---------- */

.overlay {
	z-index: 10000;
	display: none;
}

.rotate-bg {
	background-color: var(--GREEN);
	background-image: url('./img/ui/rotate-bg.jpg?v=v0.1');
}

@media screen and (max-width: 1024px) and (orientation: landscape) {
	.overlay {
		display: block;
	}
}

/* ---------- connection error ---------- */

.error {
	z-index: 9998;
	display: none;
}

input,
textarea {
	caret-color: transparent;
	-webkit-user-select: none;
}
