:root {
	--riso-pink: #ff48b0;
	--riso-blue: #0078bf;
	--riso-yellow: #ffe800;
	--riso-orange: #ff6c2f;
	--riso-black: #1a1a1a;
	--riso-paper: #f5f0e8;
	--riso-paper-dark: #ece5d8;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	background: var(--riso-black);
	margin: 2rem;
	min-height: calc(100dvh - 4rem);
	
	font-family: 'Space Mono', monospace;
	font-size: 0.8rem;
	line-height: 1.3;
	letter-spacing: 0.04em;
	font-weight: 400;
}

body:not(.full-scale) {
	display: flex;
	/* flex-direction: column; */
	justify-content: center;
	align-items: center;
	/* gap: 2em; */
}

canvas {
	display: block;
}

body:not(.full-scale) canvas {
	height: auto !important;
	width: auto !important;
	max-height: calc(100dvh - 4rem);
	max-width: calc(100vw - 4rem);
}

#p5_loading {
	color: var(--riso-paper);
}

#controls {
	list-style: none;
	position: absolute;
	top: 2rem;
	left: 2rem;

	transition: opacity 0.1s linear;

	background: var(--riso-paper);
	color: var(--riso-black);
	padding: 0.3rem 0.55rem;
}

#controls b {
	font-weight: 700;
}

#controls u {
	font-weight: 700;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 0.17em;
}

#controls hr {
	border: none;
	border-top: 2px dotted var(--riso-black);
	margin: 0.5rem 0;
}

#controls a {
	color: var(--riso-blue);
	text-decoration-thickness: 1.5px;
	text-underline-offset: 0.17em;
}

#controls a.active {
	color: var(--riso-black);
	pointer-events: none;
	text-decoration: none;
}

#controls a.active:before {
	content: "✔ ";
	font-weight: bold;
	color: var(--riso-pink);
}

#controls a:not(.active):before {
	content: "--";
	opacity: 0;
	font-weight: bold;
	text-decoration: none;
}

#controls a:not(.active):hover:before {
	content: "→ ";
	opacity: 1;
	color: var(--riso-pink);
}

#controls a:hover {
	color: var(--riso-pink);
}

#controls.hide {
	opacity: 0;
}

@media (pointer:coarse) {
	body {
		font-size: 1rem;
		line-height: 1.6;
	}
	#controls li.key, #controls hr {
		display: none;
	}
}

@media (max-width: 800px) {
	body {
		margin: 1rem;
		min-height: calc(100dvh - 2rem);
	}
	
	body:not(.full-scale) canvas {
		height: auto !important;
		width: auto !important;
		max-height: calc(100dvh - 2rem);
		max-width: calc(100vw - 2rem);
	}
	
	#controls {
		position: absolute;
		top: 0;
		left: 0;
		padding: 0.5rem 1rem 0.8rem;
	}
	#controls li {
		display: inline-block;
		margin-right: 0.5em;
	}
	#controls a:before {
		content: none !important;
	}
	#controls .ext {
		display: none;
	}
}