/*
 * The login page, in the game's Sprout Lands look: its wooden window, paper and buttons cut from
 * the same sheets the game's windows are (lobby.js sets each as a border image), its pixel fonts,
 * every art pixel drawn as 2 CSS pixels like the game's UI (Theme.js, PIXEL).
 */

@font-face {
	font-family: 'Nokia';
	src: url('/lobby/art/fonts/nokia-cellphone-fc.ttf');
}
@font-face {
	font-family: 'BoldPixels';
	src: url('/lobby/art/fonts/bold-pixels.ttf');
}

:root {
	/* The art's palette (Theme.js, ART). */
	--ink: #4f3640;
	--muted: #90625d;
	--cream: #f3e5c2;
	--deep: #6b4b5b;
	--notice: #a8503c;
	--paper: #e8cfa6;
	--rule: #dcb98a;
	--pixel: 2px;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
	background: #9fd0e8;
	color: var(--ink);
	font: 16px/1.5 'Nokia', monospace;
	-webkit-font-smoothing: none;
	font-smooth: never;
}

#scene {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	image-rendering: pixelated;
	z-index: 0;
}

main {
	position: relative;
	z-index: 1;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 24px;
	padding: 32px 16px 64px;
}

header {
	text-align: center;
}

.title {
	margin: 0;
	font: 64px/1 'BoldPixels', sans-serif;
	letter-spacing: 2px;
	color: var(--cream);
	/* An outline in the art's deepest ink, then its drop. */
	text-shadow:
		-4px 0 var(--deep), 4px 0 var(--deep), 0 -4px var(--deep), 0 4px var(--deep),
		-4px -4px var(--deep), 4px -4px var(--deep), -4px 4px var(--deep), 4px 4px var(--deep),
		0 10px var(--deep), 4px 10px var(--deep), -4px 10px var(--deep);
}

.tagline {
	margin: 12px 0 0;
	color: var(--cream);
	text-shadow: 0 var(--pixel) var(--deep);
}

.loading {
	color: var(--cream);
	text-shadow: 0 var(--pixel) var(--deep);
}

/* The window: wood, with a sheet of paper on it holding everything. Their border images are set
 * by lobby.js. */
.frame {
	width: min(460px, 100%);
	border-style: solid;
	border-color: transparent;
	image-rendering: pixelated;
	padding: 0;
}

.paper {
	border-style: solid;
	border-color: transparent;
	image-rendering: pixelated;
	/* Room between the paper's edge and what's on it. */
	padding: 4px 6px;
}

.step {
	display: none;
	flex-direction: column;
	gap: 14px;
}

.step.shown {
	display: flex;
}

h2 {
	margin: 0;
	font: 32px/1 'BoldPixels', sans-serif;
	color: var(--ink);
}

p {
	margin: 0;
}

b {
	font-weight: normal;
	color: var(--deep);
}

.small,
.hint {
	font-size: 16px;
	line-height: 1.4;
	color: var(--muted);
}

label {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

input {
	font: inherit;
	color: var(--ink);
	padding: 6px 4px;
	border-style: solid;
	border-color: transparent;
	image-rendering: pixelated;
	background: none;
	outline: none;
	width: 100%;
}

input:focus {
	filter: brightness(1.04);
}

.button {
	font: inherit;
	color: var(--ink);
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	background: none;
	border-style: solid;
	border-color: transparent;
	image-rendering: pixelated;
	padding: 2px 8px 0;
	min-height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* The raised picture's bottom border is its shadow: the label drops with the face. */
.button:active {
	padding-top: 6px;
}

.button.primary {
	font: 32px/1 'BoldPixels', sans-serif;
	min-height: 52px;
}

.button:disabled {
	opacity: 0.6;
	cursor: wait;
}

.link {
	font: inherit;
	background: none;
	border: none;
	color: var(--muted);
	text-decoration: underline;
	text-underline-offset: 4px;
	cursor: pointer;
	padding: 0;
	align-self: center;
}

.link:hover {
	color: var(--ink);
}

.notice {
	color: var(--notice);
	margin-bottom: 12px;
}

.row {
	display: flex;
	gap: 10px;
}

.row > * {
	flex: 1;
}

.realms {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* A realm: a plate darker than the paper, its name and what it is, its characters, and the way in. */
.realm {
	border-style: solid;
	border-color: transparent;
	image-rendering: pixelated;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 4px 12px;
	padding: 2px 6px;
}

.realm h3 {
	margin: 0;
	font: 32px/1 'BoldPixels', sans-serif;
}

.realm .what,
.realm .characters {
	grid-column: 1;
	color: var(--muted);
}

.realm .characters {
	color: var(--ink);
}

.realm .button {
	grid-column: 2;
	grid-row: 1 / span 3;
	min-width: 96px;
}

.realm.offline .button {
	opacity: 0.6;
	pointer-events: none;
}

@media (max-width: 480px) {
	.title {
		font-size: 48px;
	}
}
