/* Variables */
:root {
	--main-color: rgb(32,36,255);       /* cobal blue */
	--secondary-color: rgb(85,186,255); /* light blue */
	--accent-color: rgb(255,204,0);     /* yellow */
	--text-color: rgb(255,255,255);     /* white */
	--max-width: 1400px;                /* set on body for big screens */
}

/* Resets */
* {box-sizing: border-box;}

html, body, div, h1, h2, p, span, main, button {margin: 0; padding: 0;}

h1 {color: var(--main-color); font-size: 28vw; line-height: 1; text-shadow: -2px .05em 0 rgba(0,0,0,.5);}
h2 {font-size: 1.4em;font-weight: normal;}

a, a:visited, a:active, a:hover {color: inherit; text-decoration: none;}

button {
	color:var(--text-color);
	font-family:inherit;
	font-size:inherit;
	text-transform: uppercase;
	background-color:var(--main-color);
	box-shadow:none;
	border:none;
	outline:none;
	-webkit-appearance:none;
	-moz-appearance:none;
	appearance:none;
	padding:.6em .8em;
	margin-top: 1em;
	cursor: pointer;
}

/* Layout and Styling */
html, body {
	width: 100%; height: 100%;
}

html {
	/* Background Pattern by Nicholas Gallagher - http://lea.verou.me/css3patterns/ */
	background-color: var(--main-color);
	background-size: 58px 58px;
	background-position: 0px 2px, 4px 35px, 29px 31px, 33px 6px, 0px 36px, 4px 2px, 29px 6px, 33px 30px;
	background-image: 
		linear-gradient(335deg, var(--text-color) 23px, transparent 23px),
		linear-gradient(155deg, var(--text-color) 23px, transparent 23px),
		linear-gradient(335deg, var(--text-color) 23px, transparent 23px),
		linear-gradient(155deg, var(--text-color) 23px, transparent 23px),

		linear-gradient(335deg, var(--text-color) 10px, transparent 10px),
		linear-gradient(155deg, var(--text-color) 10px, transparent 10px),
		linear-gradient(335deg, var(--text-color) 10px, transparent 10px),
		linear-gradient(155deg, var(--text-color) 10px, transparent 10px);
}

body {
	max-width: var(--max-width); margin: 0 auto;
	font-size: 120%;
	font-family: 'Anonymous Pro', monospace;
	font-weight: 400;
	text-align: center;
	line-height: 1.6;
	color: var(--text-color);
	background-color: var(--main-color);
  -webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.top-bar {
	position: fixed;
	max-width: var(--max-width);
	margin: auto;
	top: 0; left: 0; right:0;
	padding: .5em 1em;
	display: flex;
	flex-flow: row wrap;
	align-items: center;
	justify-content: space-between;
	z-index: 100;
}

.page {
	display: block;
	position: relative;
	width: 100%; height: 100%;
	overflow-x: hidden;
}

.flex-container {
	display: flex;
	flex-flow: row wrap;
	align-items: flex-end;
	justify-content: center;
	height: 100%;
}

.underlined, .action-btn {
	padding: .2em 0;
	border-bottom: 2px solid var(--secondary-color);
}

.action-btn_primary {
	text-transform: uppercase;
}

.action-btn:hover {
	color: var(--secondary-color);
	cursor: pointer;
}

.modal {
	position: fixed;
	top: 50%; left: 50%;
	transform: translateX(-50%) translateY(-50%);
	max-width: 30em;
	padding: 2em 3em;
	background-color: #fff;
	color: var(--main-color);
	z-index: 100;
}

.modal > button {
	width: 100%;
	color: #fff;
}

.shrink {
	animation: shrink 600ms ease-in-out forwards;
}
@keyframes shrink {
	0% {
		transform: translateX(-50%) translateY(-50%) scale(1);
	}
	20% {
		transform: translateX(-50%) translateY(-50%) scale(1.2);
	}
	100% {
		transform: translateX(-50%) translateY(-50%) scale(0);
	}
}

.fade-in {
	animation: fadeIn 400ms ease-in-out forwards;
}
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

main {
	padding: 2.5em 1.4em;
}

p {
	max-width: 48em;
	margin: 1.2em auto;
}

/* Game */
.game-counter-panel {
	font-size: .9em;
	padding: .2em .8em;
	border: 1px solid var(--secondary-color);
}

.game-counter {
	font-size: 1.2em;
	display: inline-block;
	transform: translateY(1px);
	width: 1.4em;
	text-align: center;
}

#game-canvas {
	position: absolute;
	top: 0; left: 0;
	width: 100%; height: 100%;
	cursor: grab;
	overflow: hidden;
}

.bug {
	display: block;
	height: 30px;
	position: absolute;
	top: 50%; left: 50%;
	transform: rotate(0deg);
	transform-origin: center center;
	z-index: 0;
}

/* Crawling animation */
#bug-legs {
	transform-origin: center center;
	animation: crawlcrawlcrawl 80ms infinite ease-in-out both;
}
@keyframes crawlcrawlcrawl {
	from {
		transform: translateX(0) translateY(0) rotate(20deg);
	}
	to {
		transform: translateX(0) translateY(0) rotate(-15deg);
	}
}