html,
body {
	margin: 0;
	padding: 0;
}

body {
	font-family: sans-serif;
	background: #f8f8f8;
}

.page {
	display: grid;
	grid-template-rows: auto 1fr;
	min-height: 100vh;
	box-sizing: border-box;
	padding: 10px 10px 50px;
	gap: 30px;
}

nav {
	position: sticky;
	top: 0;
	margin: -10px;
	padding: 10px;
	display: flex;
	flex-flow: row wrap;
	justify-items: space-between;
	align-items: center;
	background: #dbf1de;
	border-bottom: 1px solid #c6dbc9;
	gap: 10px;
	font-size: 0.8rem;
	z-index: 1;
}

nav > div {
	flex: 1;
	display: flex;
	flex-flow: row wrap;
	align-items: center;
	gap: 10px;
}

nav > div:last-child {
	justify-content: flex-end;
}

nav > h1 {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	font-weight: 400;
	font-size: 1.1rem;
	text-align: center;
}

nav button {
	font-size: 0.85rem;
	line-height: 1.5;
	min-width: 4rem;
	padding: 1px 10px;
	background: #eeeeee;
	border: 1px solid #808080;
	border-radius: 100px;
}

nav button:focus,
nav button:hover {
	background: #f8f8f8;
	border-color: #333333;
}

nav button:active:hover {
	background: #dddddd;
	border-color: #000000;
}

.center {
	align-self: center;
	justify-self: center;
}

.game-list {
	margin: 10px 20px;
	display: flex;
	flex-flow: row wrap;
	align-content: flex-start;
	gap: 40px 20px;
}

.game-list .item {
	border: 2px solid #000000;
	width: 100px;
	height: 100px;
	text-decoration: none;
}

.game-list .item.done {
	border-color: #88cc88;
}

.game-list .item:hover,
.game-list .item:active {
	text-decoration: none;
	border-color: #0b28cc;
	transform: scale(1.1);
}

.preview {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: #ffffff;
	overflow: hidden;
}

.game-list .item.done .preview {
	background: #ddffcc;
}

.preview .fuzzy {
	filter: blur(4px);
}

.started .preview .image {
	filter: blur(2px);
}

.preview .image {
	image-rendering: pixelated;
}

.game-list .item .label {
	width: 100%;
	padding-top: 5px;
	flex: 1;
	color: #000000;
	font-size: 0.8rem;
	text-align: center;
	overflow-wrap: break-word;
}

.validation {
	position: absolute;
	font-size: 0.8rem;
	line-height: 1;
	bottom: calc(-1em - 3px);
	right: 10px;
	padding: 3px 10px 3px 15px;
	background: #f1f1f1;
	border: 1px solid #c3c3c3;
	border-radius: 100px;
}

.validation.valid {
	background: #dbf1de;
	border-color: #a3b7a6;
}

.validation.ambiguous,
.validation.error {
	background: #f1dedb;
	border-color: #b6a7a3;
}

.game-player .decoration {
	box-shadow: 0 10px 20px #00000066;
	border-radius: 4px;
}

.game-player.complete .decoration::before {
	content: '';
	position: absolute;
	border: 2px solid #00cc00;
	pointer-events: none;
	animation: 1.5s ease-out infinite pulse-green;
}

.celebrate .game-player.complete::after {
	content: '\2713';
	font: 300px sans-serif;
	line-height: 0;
	margin: -150px;
	color: #00cc00;
	grid-area: 2 / 2;
	display: grid;
	align-self: center;
	justify-self: center;
	text-shadow:
		0 0 1px #003300,
		0 0 20px #cccccc;
	animation: 3s ease-in-out 0.3s both victory;
}

@keyframes pulse-green {
	0% {
		inset: 2px;
		opacity: 1.5;
		border-width: 3px;
		border-radius: 2px;
	}

	100% {
		inset: -16px;
		opacity: 0;
		border-width: 8px;
		border-radius: 20px;
	}
}

@keyframes victory {
	0% {
		transform: scale(0) rotate(10deg);
		opacity: 0.5;
	}

	40% {
		transform: scale(1.2) rotate(-5deg);
		opacity: 1;
	}

	65% {
		transform: scale(1);
		opacity: 1;
	}

	75% {
		transform: scale(1);
		opacity: 1;
	}

	100% {
		transform: scale(0.9);
		opacity: 0;
	}
}
