@font-face {
	font-family: 'Metrophobic';
	font-style: normal;
	font-weight: 400;
	src: url('metrophobic-v23-latin-regular.woff2') format('woff2');
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background-color: #000;
	color: #aaa;
	font: 18px Metrophobic, sans-serif;
}

a:link, a:visited, a:active {
	color: #58a;
	text-decoration: none;
}
a:hover {
	color: #5ad;
}

main.buy form {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	line-height: 2;
}
main.roi form {
	display: flex;
	justify-content: space-evenly;
}
input, select, textarea {
	background-color: #171120;
	color: inherit;
	font-family: inherit;
	padding: 4px;
	border: 1px solid #888;
}
input[type="checkbox"] {
	accent-color: #f70;
}

main, footer {
	width: 900px;
	margin: 10px auto;
	background-color: #111;
}
main {
	padding: 40px 50px;
}
footer {
	padding: 25px 50px;
	margin-bottom: 50px;
	font-size: 16px;
}

table {
	width: 100%;
	margin-top: 1em;
	border-collapse: collapse;
	th {
		white-space: no-wrap;
	}
	td {
		font-family: monospace;
		text-align: right;
		border-top: 1px solid #222;
	}
}
main.buy table {
	td:nth-child(1) {
		font-family: inherit;
		text-align: inherit;
	}
	td.red {
		color: #c66;
	}
}
main.roi table {
	td:nth-child(1),
	td:nth-child(2) {
		font-family: inherit;
		text-align: inherit;
	}
}

main.buy {
	h2 {
		margin-bottom: 4px;
	}
	section.xit-act {
		margin-top: 1em;

		textarea {
			height: 26px;
		}
		textarea, input {
			vertical-align: middle;
		}
	}
}

main.corps {
	table {
		td:nth-child(1),
		td:nth-child(2),
		td:nth-child(4) {
			padding: 0 16px;
			text-align: inherit;
		}
		td:nth-child(2),
		td:nth-child(4) {
			font-family: inherit;
		}
	}
}

main.gov {
	form input#planet {
		margin-bottom: 1em;
	}
	div#gov {
		margin-top: 2em;

		table.options {
			td {
				padding: 0 6px;

				&:first-child {
					width: 320px;
					font-size: 16px;
				}
			}
		}
	}
	.positive {
		color: #0aa;
	}
	.negative {
		color: #f80;
	}
}

main.kit {
	width: 1200px;

	img {
		display: block;
		max-width: 100%;
		margin: 0.5em auto;
	}
}

main.mat {
	width: 90%;
	min-width: 500px;

	#charts {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		row-gap: 2em;
		margin-top: 2em;

		svg {
			display: inline-block;
		}

		div.cxob {
			max-height: 10em;
			overflow-y: scroll;
			font-size: 12px;

			tr.sell {
				color: #f80;
			}
			tr.buy {
				color: #0aa;
			}
		}

		div.recipe {
			margin-bottom: 1em;

			span.building {
				display: inline-flex;
				height: 50px;
				width: 50px;
				align-items: center;
				justify-content: center;
				background-color: #222;
				border: 1px solid #555;
			}
		}
	}
}

main.ledger {
	textarea#ledger {
		margin-top: 2em;
		width: 100%;
		height: 70vh;
	}
}

main.production {
	summary {
		cursor: pointer;
	}
	.analysis-node {
		padding-left: 40px;
	}
	.analysis-node.root {
		margin-top: 2em;
		padding-left: 0;
	}
	div.building-row > div {
		display: inline-block;
		margin-left: 10px;
	}
}

#loader {
	display: none;
	width: 48px;
	height: 48px;
	margin: 0 auto;
	border-radius: 50%;
	position: relative;
	border: 3px solid;
	border-color: #ccc #ccc transparent transparent;
	animation: rotation 1s linear infinite;
}
#loader::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	margin: auto;
	border: 3px solid;
	border-color: transparent transparent #c8c #c8c;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	animation: rotationBack 0.5s linear infinite;
	transform-origin: center center;
}
@keyframes rotation {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}
@keyframes rotationBack {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(-360deg);
	}
}

*[data-tooltip] {
	text-decoration: underline dashed;
	cursor: help;
}

[popover="hint"] {
	white-space: pre-wrap;
	inset: unset;
	max-width: 400px;
	padding: 0.5em 0.7em;
	color: inherit;
	background-color: #222;
	border: none;
	opacity: 0.9;
}

@media (max-width: 600px) {
	main {
		padding: 5px;
	}
}
