/*General*/
html,
body {
	font-family: sans-serif;
	margin: 0;
	padding: 0;
}

input,
button {
	font: inherit;
}

#wrapper {
	min-width: 20rem;
	max-width: 46rem;
	margin: auto;
}

header {
	background: #48a;
	color: #fff;
	height: 3rem;
}

header button {
	float: left;
}

header h1 {
	margin: 0 3rem;
	font-size: 150%;
	font-weight: bold;
	line-height: 2;
	text-align: center;
}

header > span {
	float: right;
	padding-right: 1em;
}

#sound-checkbox,
#sound-checkbox:checked ~ label .off,
#sound-checkbox:not(:checked) ~ label .on {
	display: none;
}

#level-menu,
#level-wrapper {
	margin: 0.5rem;
}

h2 {
	font-size: 150%;
	font-weight: bold;
	border-bottom: thin solid #aaa;
}

/*SVG*/
svg {
	width: 1.5rem;
	height: 1.5rem;
	fill: currentColor;
}

svg.highlight {
	background: #eea;
}

svg.lock {
	color: #b55;
}

svg.cancel {
	color: #d33;
}

svg.reset,
svg.code-2,
svg.code-3,
svg.code-4,
svg.code-5,
svg.code-6,
svg.code-7,
svg.code-8,
svg.code-9,
svg.code-repeat {
	color: #a60;
}

svg.star,
svg.star-2 {
	color: #d80;
}

svg.ok,
svg.go,
svg.code-go,
svg.code-left,
svg.code-right {
	color: #282;
}

svg.code-up,
svg.code-down {
	color: #36c;
}

/*Buttons*/
.button:not([hidden]) {
	display: inline-block;
	border: thin solid;
	border-radius: 4px;
	padding: 0.75rem;
	margin: 0.1rem 0;
	height: 3rem;
	width: 3rem;
	cursor: pointer;
	background: #fff;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}

.button:disabled {
	cursor: default;
}

.button:disabled svg {
	color: #aaa;
}

header .button:not([hidden]) {
	border: none;
	margin: 0;
	background: transparent;
	color: #fff;
}

/*Level Selection*/
#level-menu button {
	margin: 0.5rem;
	background: #fff;
	color: #000;
	width: 8rem;
	text-align: left;
	height: 2.5rem;
	border: thin solid;
	border-radius: 0.5rem;
	padding: 0;
	position: relative;
	cursor: pointer;
}

#level-menu button:disabled {
	color: #aaa;
	cursor: default;
}

#level-menu button svg {
	position: absolute;
	top: 3px;
	right: 0;
}

/*Level Screen*/
#map table {
	margin: auto;
	border-collapse: collapse;
	border: 1.5rem solid #000;
}

#map table td {
	border: thin solid;
	padding: 0;
	width: 1.5rem;
	height: 1.5rem;
	line-height: 0;
}

#code {
	margin: 2rem 0;
	border: thin solid;
	padding: 0.1rem;
	line-height: 0;
}

#error {
	margin: 2rem 0;
	color: #d33;
	font-family: monospace, monospace;
	font-weight: bold;
}

#pause-input {
	display: inline-block;
	margin: 0.05em;
	height: 3rem;
	width: 6.1rem;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
	vertical-align: top;
}

/*Level Editor*/
input[type="number"] {
	width: 2em;
}

#play-button {
	float: right;
}

#radio-input svg {
	border: thin solid #000;
	cursor: pointer;
	margin: 5px;
}

#radio-input input {
	display: none;
}

#radio-input :checked ~ svg {
	outline: solid #d33;
	cursor: default;
}

#radio-input [value="A"] ~ svg {
	outline-color: #2cc;
}

#editor-area:not([hidden]) ~ #map td {
	cursor: pointer;
}

/*Infobox*/
#overlay {
	background: rgba(100, 100, 100, .5);
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	height: 0;
}

#overlay > div {
	border: thin solid #000;
	border-radius: 5px;
	padding: 0.5rem;
	background: #fff;
	position: fixed;
	overflow: hidden;
	height: 0;
	top: -10rem;
	left: 0;
	right: 0;
	margin: auto;
	max-width: 30rem;
}

#overlay button {
	float: right;
}

#overlay.visible {
	height: auto;
}

#overlay.visible > div {
	top: 5rem;
	height: auto;
	transition: top 0.3s;
}

#info-box {
	padding: 0.5rem;
	max-height: 70vh;
	overflow: auto;
}

kbd {
	border: thin solid #aaa;
	border-radius: 3px;
	white-space: nowrap;
	height: 1.5rem;
	display: inline-block;
	vertical-align: middle;
}