*,
*::after,
*::before {
	box-sizing: border-box;
}

:root {
	font-size: 13px;
}

body {
	margin: 0;
	overflow: hidden;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	--color-text: #575972;
	--color-bg: #fff;
	--color-link: #eb5b4a ;
	--color-link-hover: #f1d796;
	--color-text-title: #f1d796;
	--color-bg-score: #f1d796;
	--color-accent: #101558;
	--color-line: #ab9c77;
	--color-message: #eb5b4a;
	--color-bg-scorescreen: #0e0e35;
	--gradient: linear-gradient(#101232, #101560);
	color: var(--color-text);
	background-color: var(--color-bg);
	font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

p {
	margin: 0;
}

a {
	text-decoration: none;
	color: var(--color-link);
	outline: none;
}

a:hover {
	color: var(--color-link-hover);
	outline: none;
}

/* Better focus styles from https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible */
a:focus {
	/* Provide a fallback style for browsers
	 that don't support :focus-visible */
	outline: none;
	background: lightgrey;
}

a:focus:not(:focus-visible) {
	/* Remove the focus indicator on mouse-focus for browsers
	 that do support :focus-visible */
	background: transparent;
}

a:focus-visible {
	/* Draw a very noticeable focus style for
	 keyboard-focus on browsers that do support
	 :focus-visible */
	outline: 2px solid red;
	background: transparent;
}

.game-holder {
	position: absolute;
	width: 100%;
	height: 100%;
	background: var(--gradient);
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.world {
	position: absolute;
	overflow: hidden;
	width: 100%;
	height: 100%;
}

.header {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	text-align: center;
	pointer-events: none;
	z-index: 1;
	padding: 1.5rem;
}

.header a {
	pointer-events: auto;
}

.header__title {
	line-height: 0.8;
	margin: 0;
	font-weight: 400;
	font-family: 'Dela Gothic One', sans-serif;
	color: var(--color-text-title);
}

.header__title-pre {
	display: block;
	font-size: 0.85rem;
	margin: 0 0 -0.75rem -12.5rem;
}

.header__title-main {
	font-size: 3.85rem;
}

.header__tagline {
	font-size: 1rem;
}

.links {
	position: absolute;
	z-index: 10;
	bottom: 0;
	left: 0;
	padding: 2rem 1.5rem;
	text-align: left;
	width: 100%;
	text-transform: uppercase;
	font-size: 0.65rem;
	letter-spacing: 0.2rem;
	font-weight: bold;
}

.links a {
	display: inline-block;
	margin: 0 0.75rem;
}

.score {
	display: flex;
	justify-content: center;
	background: var(--color-bg-score);
	margin: 0 0 0 auto;
	text-align: center;
	white-space: nowrap;
	border-radius: 1rem;
	padding: 1rem;
}

.score__content {
	position: relative;
	padding: 0 1rem;
	align-items: center;
	position: relative;
	display: grid;
	padding: 0 1rem;
	grid-template-columns: repeat(3,1fr);
	grid-template-areas:
	    'label label label'
	    'value value value';
	grid-column-gap: 2px;
}

.score__content--fixed {
	width: 8rem;
}

.score__content:not(:first-child) {
	border-left: 1px solid var(--color-line);
}

.score__label {
	grid-area: label;
	align-self: start;
	position: relative;
	text-align: center;
	color: var(--color-accent);
	text-transform: uppercase;
	font-size: 0.65rem;
	letter-spacing: 0.15rem;
	font-weight: bold;
}

.score__value {
	grid-area: value;
	font-weight: bold;
	color: var(--color-accent);
}

.score__value--level {
	font-size: 1.5rem;
}

.score__value--dist {
	font-size: 1.85rem;
	line-height: 1;
}

.level-circle {
	grid-area: value;
	width: 46px;
	transform: rotate(-90deg);
}

.score__value--energy {
	position: relative;
	width: 60px;
	height: 8px;
	margin-top: 20px;
	border-radius: 3px;
	background-color: var(--color-accent);
}

#lifes .heart {
	display: inline-block;
	width: 20px;
	height: 20px;
	margin-top: 10px;
	opacity: 0.7;
}

#lifes .heart img {
	width: 100%;
	height: 100%;
}

#lifes .heart.invisible {
	visibility: hidden;
}

#lifes .heart.visible {
	animation: appearScale 0.1s ease-in-out;
}

#lifes .heart.invisible {
	animation: disappearScale 0.1s ease-in-out;
}

#replayMessage {
	font-size: 1.25vw;
	bottom: 40vh;
	display: none;
	text-indent: 0.5em;
	letter-spacing: 0.5em;
	color: var(--color-message);
	font-weight: bold;
	position: absolute;
	left: 0;
	width: 100%;
	text-align: center;
	text-transform: uppercase;
	pointer-events: none;
}

@keyframes blinking {
	0% {
		opacity: 1;
	}

	50% {
		opacity: 0;
	}

	100% {
		opacity: 1;
	}

}

#error {
	visibility: hidden;
	text-align: center;
	display: flex;
	width: 100%;
	height: 100%;
	position: fixed;
	flex-direction: column;
	justify-content: center;
	z-index: 10;
	background: white;
}

#error p {
	margin: 0;
}

#new-level {
	visibility: hidden;
	color: white;
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	font-size: 50px;
	display: flex;
	flex-direction: column;
	align-content: center;
	align-items: center;
	justify-content: center;
}

#new-level.animating {

	/* animation duration is set in js code in informNextLevel() to keep it in sync */
	animation-name: scale;
	animation-timing-function: ease-in-out;
}

#new-level>p:first-child {
	margin: 0;
	font-size: 50px;
	font-weight: 600;
	line-height: 1em;
}

#new-level>p:last-child {
	margin: 0;
	font-size: 200px;
	line-height: 1em;
	font-weight: bold;
}

@keyframes scale {
	from {
		transform: scale(0.5);
		opacity: 1;
	}

	to {
		transform: scale(5);
		opacity: 0;
	}

}

#start-screen {
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	font-size: 50px;
	display: flex;
	justify-content: center;
	flex-direction: column;
	align-items: center;
	background: rgba(255, 255, 255, 0.8);
	z-index: 2;
}

#start-screen.hidden {
	display: none;
}

#start-screen .map-name {
	font-size: 50px;
	font-weight: 600;
	margin-bottom: 1em;
}

#start-screen .intro {
	font-size: 30px;
	margin-bottom: 40px;
}

#start-screen button {
	width: 200px;
	height: 60px;
	font-size: 40px;
}

#score-screen {
	position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    background: rgb(2 2 9 / 76%);
    z-index: 2;
    font-weight: bold;
    color: var(--color-text-title);
}

#score-screen:not(.visible) {
	display: none;
}

#score-screen.visible {
	animation: appearOpacity 2s ease-in;
}

#score-screen>div {
	display: table-cell;
    vertical-align: middle;
    text-align: center;
    padding: 2rem;
    background: var(--color-bg-scorescreen);
    border-radius: 2rem;
}

#score-screen .headline {
	font-size: 2rem;
	padding-bottom: 1rem;
	margin-bottom: 2rem;
	border-bottom: 1px solid rgba(100, 100, 100, 0.2);
}

#score-screen .lines {
	display: table;
	min-width: 40vw;
}

#score-screen .lines>div {
	display: table-row;
}

#score-screen .lines>div>span {
	display: table-cell;
	text-align: left;
	padding: 5px;
}

#score-screen .lines>div>span:last-child {
	text-align: right;
	padding-left: 50px;
}

#intro-screen {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	position: relative;
}

#intro-screen:not(.visible) {
	display: none;
}

#intro-screen button {
	width: 100px;
	height: 100px;
	display: grid;
	place-items: center;
	background: transparent;
	color: var(--color-text);
	font: inherit;
	border-radius: 50%;
	cursor: pointer;
	border: 1px solid;
}

@keyframes appearScale {
	0% {
		transform: scale(0.1);
		visibility: hidden;
	}

	100% {
		transform: scale(1.0);
		visibility: visible;
	}

}

@keyframes disappearScale {
	0% {
		transform: scale(1.0);
		visibility: visible;
	}

	100% {
		transform: scale(0.1);
		visibility: hidden;
	}

}

@keyframes appearOpacity {
	0% {
		opacity: 0;
	}

	100% {
		opacity: 1;
	}

}

@keyframes disappearOpacity {
	0% {
		opacity: 1;
	}

	100% {
		opacity: 0;
	}

}

@media screen and (min-width: 53em) {
	:root {
		font-size: 16px;
	}
	.header {
		display: flex;
		align-content: space-between;
	}
}
