:root { 
	--yellow: darkorange;
	--orange: orange;
	--bg: var(--orange);
	--font-stack: Frutiger, 'Frutiger Linotype', Univers, 'Gill Sans',
	'Gill Sans MT', 'Myriad Pro', Myriad, 'DejaVu Sans Condensed',
	'Liberation Sans', 'Nimbus Sans L', Tahoma, Geneva, 'Helvetica Neue',
	Helvetica, Arial, sans-serif;
	--font-size-small: 1rem;
	--font-size: 1.2rem;
	--font-size-med: 1.4rem;
	--font-size-large: 1.6rem;
	--font-size-xlarge: 2.4rem;
	--font-size-svg: 8px;
	--font-weight: 600;
}

* {
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

html,
body {
	margin: 0;
	padding: 0;
	font-size: 62.5%;
	-moz-text-size-adjust: none;
	-webkit-text-size-adjust: none;
	text-size-adjust: none;
}

body {
	background: #f5f5f5;
	touch-action: manipulation;
}

body > img {
	position: absolute;
	top: 0;
	right: 20px;
	border: 1px solid black;
}

textarea {
	resize: none;
	outline: none;
	overflow: none;
	border: none;
}

pre {
	border: 1px solid gray;
	border-radius: 4px;
	padding: 4px;
	font-family: var(--font-stack);
    font-size: var(--font-size);
    font-weight: var(--font-weight);
    text-transform: uppercase;
}

button {
	margin: 0;
	padding: 0.5rem 1rem;
	appearance: none;
	background: black;
	color: white;
	border: 2px solid black;
	border-radius: 5px;
	font-family: var(--font-stack);
	font-size: var(--font-size);
	font-weight: var(--font-weight);
	text-transform: uppercase;
	-webkit-touch-callout: none;
    -webkit-user-select: none;
	user-select: none;
}

button:disabled {
	opacity: 0.5;
}

button.secondary {
	border: 2px solid var(--orange);
	background: var(--orange);
	color: black;
}

button.tertiary {
	background: white;
	color: black;
	border: 2px solid white; 
	transition: opacity 0.5s linear;
}

button.tertiary:hover {
	opacity: 0.5;
	transition: opacity 0.1s linear;
}

button.tertiary:disabled:hover, 
button.tertiary:disabled{
	opacity: 1;
}

button.modal {
	position: absolute;
	top: -3px;
	right: 0;
	border: none;
	background: white;
	color: black;
	padding: 0.25rem 0.5rem;
}

button.large {
	/* font-size: var(--font-size-large); */
	display: block;
}

button[name='hint'].button--numbered {
	position: relative;
	display: block;
	padding-right: 20px;
}

button[name='hint'].button--numbered::before {
	content: '';
	position: absolute;
	display: block;
	top: -2px;
	right: -2px;
	width: 15px;
	height: 25px;
	border-radius: 4px;
	background-color: white;
	opacity: 1;
	color: white;
	border: 2px solid var(--orange);
}

button[name='hint'].button--numbered::after {
	content: '' attr(data-count) '';
	position: absolute;
	display: block;
	top: 5px;
	right: 1px;
	width: 14px;
	height: 14px;
	color: black;
}

.hidden {
	visibility: hidden;
}

.typo--h1 {
	font-size: 24px;
	color: black;
	text-shadow: 2px 2px var(--orange);
}

.stat-counter-container {
	position: relative;
}

.stat-counter {
	opacity: 1;
	transform: translate3d(0, 0, 0);
	transition: opacity 0.5s linear, transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.stat-counter--in {
	opacity: 1;
	transform: translate3d(0, 0, 0);
	transition: opacity 0.2s ease-out, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); 
}

.stat-counter--out {
	opacity: 0;
	transform: translate3d(0, -12px, 0);
	transition: opacity 0.2s ease-out, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); 
}

.stat-counter--mid {
	opacity: 0;
	transform: translate3d(0, 12px, 0);
	transition: transform 0.1s linear;
}

.stat--highlight {
	color: var(--orange);
}

.typo--h1 span {
	color: black;
	text-shadow: 2px 2px var(--orange);
}

.typo--btn {
	display: inline-block;
	padding: 0.25rem 0.5rem;
}

@keyframes star-base {
	0% {
		opacity: 0;
	}
	100% {
		opacity: 0.15;
	}
}

@keyframes star-all {
	0% {
		opacity: 0;
		transform: rotate(-10deg) translate3d(0, 16px, 0);
	}
	20% {
		opacity: 1;
		transform: rotate(16deg) translate3d(0, -4px, 0);
	}
	40% {
		transform: rotate(-6deg) translate3d(0, 2px, 0);
	}
	60% {
		transform: rotate(4deg) translate3d(0, -2px, 0);
	}
	80% {
		transform: rotate(-2deg) translate3d(0, 1px, 0);
	}
	100% {
		opacity: 1;
		transform: rotate(0deg) translate3d(0, 0, 0);
	}
}

.stars {
	position: absolute;
	left: 0;
	right: 0;
	top: -20px;
	text-align: center;
}

.stars--hidden {
	display: none;
}

.star-line {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
}

.stars .star-line span {
	display: inline-block;
	opacity: 0;
	font-size: 3rem;
}

.stars .star-line--highlight span {
	animation-name: star-all;
	animation-duration: 1.4s;
	animation-delay: 3s;
	animation-timing-function: ease-in-out;
	animation-fill-mode: forwards;
	animation-iteration-count: 1;
	transform-origin: center;
}

.stars .star-line--base span {
	filter: grayscale(1) brightness(3);

	opacity: 0;
	animation-name: star-base;
	animation-duration: 0.8s;
	animation-delay: 2.2s;
	animation-fill-mode: forwards;
	animation-iteration-count: 1;
}

.stars .star-line--highlight span.star-hide {
	visibility: hidden;
}

.stars .star-line--highlight span:nth-child(2) {
	animation-delay: 3.35s;
}

.stars .star-line--highlight span:nth-child(3) {
	animation-delay: 3.6s;
}

.drawer {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 1rem;
	display: flex;
	justify-content: center;
	align-items: center;
	opacity: 0;
	transition: opacity 0.2s ease-in-out;
	pointer-events: none;
	background-color: rgba(0, 0, 0, 0.1);
}

.drawer.active {
	opacity: 1;
	pointer-events: auto;
}

div.modal {
	opacity: 0;
	transform: scale3d(0.95, 0.95, 0.95);
	transition: opacity 0.2s ease-in-out,
	transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
	background-color: white;
	border-radius: 8px;
	border: 4px solid black;
	padding: 1.5rem;
	width: 100%;
	max-width: 500px;
}

.drawer.active div.modal {
	opacity: 1;
	transform: scale3d(1, 1, 1);
}

div.modal header {
	position: relative;
	text-align: center;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid lightgray;
}

div.modal header h3 {
	font-family: var(--font-stack);
	font-size: var(--font-size);
	font-weight: var(--font-weight);
	text-transform: uppercase;
}

div.modal header h3.hide {
	visibility: hidden;
}

div.modal footer .footer-btns {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

div.modal footer .feedback {
	padding: 0 0 1rem;
	text-align: left;
}

div.modal footer .feedback p {
	margin: 0;
	font-family: var(--font-stack);
	font-size: var(--font-size);
	font-weight: var(--font-weight);
	text-transform: uppercase;
}

div.modal footer .feedback a {
	color: var(--orange);
	text-decoration: none;
}
div.modal footer .feedback a:hover {
	color: var(--yellow);
}

.stats-streak {
	display: flex;
	justify-content: space-between;
}

.stats-streak figure {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	margin: 0;
	padding: 1rem 1rem 0;
}

.stats-streak > figure > div {
	font-size: var(--font-size-xlarge);
}

.result-grid {
	padding: 1rem 0;
}

.result-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	padding: 0.5rem;
	border-radius: 0;
}

.result-row > span {
	display: flex;
	align-items: center;
	padding: 0 0.25rem;
	font-size: var(--font-size-small);
}

.result-row:nth-child(even) {
	background-color: #f5f5f5;
}

.result-row:nth-child(odd) {
	background-color: white;
}

.result-row.current {
	background-color: var(--orange);
}

.result-header-row.result-row {
	color: gray;
	font-size: var(--font-size);
	border-bottom: 1px solid rgb(158, 153, 153);
	border-top: 1px solid lightgray;
}

.container {
	height: calc(var(--vh) * 100);
	background: white;
	font-family: var(--font-stack);
	font-size: var(--font-size);
	font-weight: var(--font-weight);
	text-transform: uppercase;
}

.container > header {
	height: 10%;
	background-color: white;
}

.container > article {
	position: relative;
	height: 80%;
	background-color: transparent;
}

.container > footer {
	height: 10%;
}

.container > header > nav,
.container > footer > nav {
	display: flex;
	align-items: center;
	height: 100%;
}

.plum-container {
	--plum-bg: transparent;
	--plum-text: black;
	--plum-text-shadow: var(--yellow);
	position: relative;
}

.plum-container.plum-container--side {
	--plum-bg: black;
	--plum-text: white;
	--plum-text-shadow: var(--yellow);
}

.plum {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	text-align: center;
	opacity: 0;
	transform: translate3d(0, 10px, 0);
	display: inline-block;
	padding: 0.5rem 0.75rem;
	border-radius: 8px;
	border: 4px solid var(--plum-bg);
	background-color: var(--plum-bg);
	color: var(--plum-text);
	font-size: 2rem;
	text-shadow: 2px 2px var(--plum-text-shadow);
	animation-duration: 2s;
	animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
	animation-fill-mode: forwards;
	transition: top .1s linear; /* cubic-bezier(0.175, 0.885, 0.32, 1.275); */
}

.plum.plum--star {
	z-index: 1;
	font-size: 2.4rem;
	animation-duration: 12s;
}

.plum.plum--star.plum--enter {
	animation-name: plum-star-animation;
	animation-delay: 1s;
	animation-timing-function: ease-in-out;
}

.plum.plum--side {
	left: auto;
	text-align: right;
	font-size: 1rem;
	padding: 0.25rem 0.5rem;
	margin-right: 1rem;
	text-shadow: none;
}

.plum--enter {
	animation-name: plum-animation;
}

@keyframes plum-animation {
	0% {
		opacity: 0;
		transform: translate3d(0, 10px, 0);
	}
	10% {
		opacity: 1;
		transform: translate3d(0, -15px, 0);
	}
	80% {
		opacity: 1;
		transform: translate3d(0, -15px, 0);
	}
	100% {
		opacity: 0;
		transform: translate3d(0, -20px, 0);
	}
}

@keyframes plum-star-animation {
	0% {
		opacity: 0;
		transform: translate3d(0, 10px, 0);
	}
	10% {
		opacity: 1;
		transform: translate3d(0, -18px, 0);
	}
	20% {
		opacity: 1;
		transform: translate3d(0, -10px, 0); 
	}
	30% {
		opacity: 1;
		transform: translate3d(0, -17px, 0);
	}
	40% {
		opacity: 1;
		transform: translate3d(0, -13px, 0);
	}
	50% {
		opacity: 1;
		transform: translate3d(0, -16px, 0);
	}
	60% {
		opacity: 1;
		transform: translate3d(0, -14px, 0);
	}
	70% {
		opacity: 1;
		transform: translate3d(0, -15px, 0);
	}
	95% {
		opacity: 1;
		transform: translate3d(0, -15px, 0);
	}
	100% {
		opacity: 0;
		transform: translate3d(0, -18px, 0);
	}
}

.stats > footer {
	display: flex;
	align-items: flex-end;
}

.stats > footer aside {
	margin-left: auto;
}

ol {
	margin: 0;
	padding: 0 1rem;
	list-style-type: none;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: 100%;
}

ol li {
	flex: 1 1 50%;
	padding: 0;
}

dl {
	list-style-type: none;
	margin: 1rem 0;
	padding: 0;
}

dt {
	padding-top: 0.5rem;
	padding-bottom: 0.25rem;
}
dd {
	margin-left: 0.5rem;
}

ol li:nth-child(1) {
	text-align: left;
}

ol li:nth-child(2) {
	flex: 0 1 100%;
	text-align: center;
}

ol li:nth-child(3) {
	text-align: right;
}

.svg-container {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	bottom: 0;
	text-align: center;
	display: flex;
}

.svg-container svg {
	margin: 0 auto;
	width: auto;
	height: 100%;
	flex-grow: 0;
	flex-shrink: 1;
	flex-basis: 100%;
}

.layer--base {
	fill: var(--orange);
	stroke: none;
}

.layer--mask {
	fill: white;
	stroke: none;
}

rect.layer--edge {
	fill: transparent;
	stroke: black;
	stroke-linecap: round;
}

rect.layer--overlay {
	stroke-width: 1.5;
	stroke: var(--orange);
	stroke-linecap: butt;
	fill: transparent;
	animation-duration: 1s;
	animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
	animation-delay: 0;
	animation-iteration-count: 1;
	animation-play-state: running;
	animation-fill-mode: forwards;
	opacity: 0;
}

.state--focus > .layer--overlay {
	animation-name: showfocus;
}

.state--active > .layer--base {
	fill: var(--orange);
}

.state--complete > .layer--base {
	opacity: 1;
}

.state--blocked > .layer-edge {
	fill: black;
}

.state--in-use > .layer--base {
	fill: #ffd6a4;
}

.state--in-use.state--idle > text {
	fill: gray;
}

.layer--base {
	opacity: 0;
}

text {
	font-family: var(--font-stack);
	font-size: var(--font-size-small);
	font-weight: var(--font-weight);
	text-transform: uppercase;
	user-select: none;
	pointer-events: none;
}

@keyframes showfocus {
	0% {
		opacity: 0;
		transform: scale3d(1, 1, 1);
		-webkit-transform: scale3d(1, 1, 1);
	}
	10% {
		opacity: 0.5;
		transform: scale3d(1.05, 1.05, 1.05);
		-webkit-transform: scale3d(1.05, 1.05, 1.05);
	}
	100% {
		opacity: 0;
		transform: scale3d(1, 1, 1);
		-webkit-transform: scale3d(1, 1, 1);
	}
}

g[id^='b-'] rect {
	transform: rotate(0deg);
}

g[id^='b-']:active rect + rect {
	opacity: 0.2;
}

#results {
	position: absolute;
	top: 0;
	visibility: hidden;
}
