:root {
	--bg: #eee;
	--text: #444;
	--header-height: 3em;
}

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

body {
	background: var(--bg);
	color: var(--text);
	display: flex;
	flex-direction: column;
	font-family: -apple-system, system-ui, sans-serif;
	overflow: hidden;
	padding: .5em;
}

article {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	margin-top: var(--header-height);
	overflow: auto;
	overflow-x: hidden;
}

.viz {
	flex: 3 3 auto;
}

article section {
	flex: 1 1 suto;
}

header {
	align-items: center;
	background: #0ff5bb;
	box-shadow: 0 .125em .25em #42937e55;
	display: flex;
	height: var(--header-height);
	justify-content: center;
	left: 0;
	margin: -.5em -.5em .5em;
	position: fixed;
	right: 0;
	top: 0;
}

header h1 {
	flex: 0;
	font-size: 1.125em;
	margin: 0;
	text-align: center;
}

button {
	background: none;
	border: none;
	border-radius: .25em;
	color: inherit;
	font-size: 100%;
	padding: .4em .7em;
}

button:disabled {
	text-decoration: line-through;
}

button:hover {
	background: rgba(0,0,0,.05);
}

.letters,
.mask {
	list-style: none;
	margin: 1em 0;
	padding: 0;
}

.letters {
	text-align: center;
}

.letters li {
	display: inline-block;
	font-size: 1.25em;
	margin: 0 .1em;
}

.letters button {
	font-weight: 500;
	width: 2.25em;
}

.toolbar {
	display: flex;
	font-size: 1.5em;
	justify-content: space-between;
	left: 0;
	line-height: .7;
	margin: auto 0 0;
	position: absolute;
	right: 0;
	top: 0;
	z-index: 2;
}

.mask {
	align-items: flex-end;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	text-align: center;
}

.mask li {
	border-bottom: .15em solid;
	display: inline-block;
	font-size: 1.5em;
	font-weight: bold;
	margin: 0 .2em;
	min-height: 1.25em;
	padding: .1em 0 0;
	width: 1.75em;
}

.mask .space {
	border-color: transparent;
	width: .2em;
}

@media (min-width:40em) {
	.mask li {
		font-size: 3em;
	}
}

.screen {
	font-size: 3vw;
}

@media (min-width:40em) {
	.screen {
		font-size: 1.2em;
	}
}

.death-screen,
.win-screen {
	animation: slowin 3s ease 1 forwards;
	background: rgba(0,0,0,.5);
	-webkit-backdrop-filter: blur(10px);
	bottom: 0;
	color: white;
	left: 0;
	padding: 10%;
	position: fixed;
	right: 0;
	text-align: center;
	top: 0;
}

.win-screen {
	background: rgba(255,255,255,.5);
	border-radius: 2em;
	color: inherit;
	margin: auto;
	max-height: 15em;
	max-width: 18em;
}

.word-repeat {
	font-size: 1.5em;
	font-weight: 600;
	letter-spacing: .1em;
	margin: 1em auto;
	text-align: center;
	text-transform: uppercase;
}

@keyframes slowin {
	from {
		opacity: .01;
	}
	to {
		opacity: .99;
	}
}

.screen h1 {
	animation: swing 2s ease infinite;
	font-size: 6em;
	margin: 0;
	transform-origin: center bottom;
}

@keyframes swing {
	0% {
		transform: rotate(0deg);
	}
	25% {
		transform: rotate(25deg);
	}
	50% {
		transform: rotate(0deg);
	}
	75% {
		transform: rotate(-25deg);
	}
	100% {
		transform: rotate(0deg);
	}
}

.screen button {
	border: .15em solid;
	font-size: 1.5em;
	padding: .5em 1.2em;
}

.viz {
	background: #ddd;
	height: auto;
	max-height: 35vh;
	min-height: 4em;
	width: auto;
}

@media (min-height:40em) {
	.viz {
		max-height: 50vh;
	}
}

.viz .progress > * {
	opacity: 0;
	transition: opacity .3s ease;
}
