
/* Basic layout */

:root {
	--settings-height: 40vh;
}

* {
	margin: 0;
	padding: 0;
}

html {
	font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif;
}

body {
	background: #444;
	text-align: center;
}

button {
	color: #888;
	background: none;
	border: .3vh solid #888;
	border-radius: 1vh;
	outline: none;
	cursor: pointer;
}




/* Content */

.content {
	opacity: 0.3;
	transition: opacity .5s, fill .5s;
}

body.connected .content {
	opacity: 1;
}




/* Racer */

.content .racer {
	position: absolute;
	top: 5vh;
	left: 10vw;
	width: 80vw;
	height: calc(100vh - var(--settings-height) - 10vh);
}

.content svg {
	position: absolute;
	left: 0;
	width: 100%;
	height: 100%;

	filter: drop-shadow(0 0 3em #333);
}


/* Animations */

#batmobile {
	transform-origin: center center;
	transition: transform .2s ease-out;
}
.forward #batmobile {
	transform: translateY(-30px);
}
.reverse #batmobile {
	transform: translateY(30px);
}
.left #batmobile {
	transform: rotate(-15deg);
}
.right #batmobile {
	transform: rotate(15deg);
}



/* Settings */

.settings {
	position: absolute;
	top: calc(100vh - var(--settings-height));
	width: 100%;
	min-height: var(--settings-height);
	background: #333;

	transition: opacity .3s ease-in-out;
	opacity: 0.3;
	pointer-events: none;
}
body.connected .settings {
	opacity: 1;
	pointer-events: auto;
}



/* Pills */

.pills {
	margin-top: -2.4vh;
	margin-bottom: 0;
	display: flex;
}
.pills button {
	margin: 0;
	padding: 1vh 2vh;
	border-radius: 0;
	border-left: none;
	font-size: 2vh;
	background: #333;
}
.pills button:first-of-type {
	border-left: .3vh solid #888;
	border-top-left-radius: 1vh;
	border-bottom-left-radius: 1vh;
	margin-left: auto;
}
.pills button:last-of-type {
	border-top-right-radius: 1vh;
	border-bottom-right-radius: 1vh;
	margin-right: auto;
}

body.control button#control,
body.customize button#customize {
	background: #888;
	color: #fff;
}





/* Views */

.views {
	padding: 6vh 0;
	min-height: 6vh;
	display: block;
}
.views > div {
	display: none;
}

body.control div#controlView,
body.customize div#customizeView {
	display: block;
}




/* Controls */

#controls {
	margin: 2vh 0 6vh;
	display: inline-grid;
	
	grid-template-columns: 8vh 8vh 8vh;
	grid-template-rows: 8vh 8vh 8vh;
	grid-gap: 0;
}	
#controls #button-forward {
	grid-column: 2;
	grid-row: 1;
}
#controls #button-left {
	grid-column: 1;
	grid-row: 2;
}
#controls #button-right {
	grid-column: 3;
	grid-row: 2;
}
#controls #button-reverse {
	grid-column: 2;
	grid-row: 3;
}

#controls button {
	padding: 1vh 2vh;
	font-size: 2vh;
}

#controls button:active,
.forward #controls button#button-forward,
.reverse #controls button#button-reverse,
.left #controls button#button-left,
.right #controls button#button-right {
	background: #888;
	color: #444;
}





/* Style editor */

style[contenteditable] {
	white-space: pre;
	font-family: monospace;
	color: #fff;
	
	font-size: 2vh;
	text-align: left;
	margin: 0 10vh 10vh;
	outline: none;
}

.connected style[contenteditable] {
	display: block;
}



