@font-face {
	font-family: Quadrata;
	font-weight: normal;
	font-style: normal;
	src: url(fonts/FrizQuadrata.woff2) format("woff2");
}

@font-face {
	font-family: Quadrata;
	font-weight: normal;
	font-style: italic;
	src: url(fonts/FrizQuadrata-Italic.woff2) format("woff2");
}

*.hidden, a#download {
	display: none;
}

*.player1 {
	background: none;
	color: #f00;
}

*.player2 {
	background: none;
	color: #00f;
}

*.player3 {
	background: none;
	color: #00c0c0;
}

*.player4 {
	background: none;
	color: #c000c0;
}

*.player5 {
	background: none;
	color: #ff8040;
}

*.player6 {
	background: none;
	color: #808080;
}

*.player7 {
	background: none;
	color: #fff;
}

*.player8 {
	background: none;
	color: #ff0;
}

a {
	background: none;
	color: inherit;
	text-decoration: underline;
}

a, button, div#filename {
	cursor: pointer;
}

a.dir {
	background-image: url(icon-open.svg);
}

a.dir, a.pud {
	text-decoration: none;
}

a.pud {
	background-image: url(icon-map.svg);
}

body {
	margin: 0;
	padding: 0;
}

button {
	background: none;
	border: 0;
	color: inherit;
	font: inherit;
	margin: 0;
	padding: 0;
}

button.action img {
	height: 1em;
	width: 1em;
}

button.unit img, img.icon {
	height: 38px;
	width: 46px;
}

button.unit img, div#terrain img, fieldset, img.icon, fieldset {
	border: 2px solid #808080;
}

button.unit img:hover, div#terrain img:hover {
	border-color: #fff;
}

canvas#frame {
	padding: 25px;
}

canvas#frame, canvas#grid {
	z-index: 3;
}

canvas#frame, canvas#miniUnitMap {
	left: 0;
	position: absolute;
	top: 0;
}

canvas#grid {
	background: url(grid.svg);
	border-color: #808080;
	border-style: solid;
	border-width: 1px 0 0 1px;
	color: inherit;
}

canvas#grid, canvas#select, canvas#tileMap, canvas#unitMap {
	left: 270px;
	position: absolute;
	top: 0;
}

canvas#miniTileMap {
	outline: 2px solid #808080;
}

canvas#miniTileMap, canvas#tileMap {
	z-index: 1;
}

canvas#miniTileMap, canvas#miniUnitMap {
	margin: 25px;
}

canvas#miniUnitMap, canvas#unitMap {
	z-index: 2;
}

canvas#select {
	z-index: 4;
}

div#editor div, div#filename, div#map, div#terrain {
	text-align: center;
}

div#editor img {
	height: 16px;
	margin: 0 0.5em;
	vertical-align: middle;
	width: 16px;
}

div#filename {
	margin-top: 1em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

div#filename, div.overlay, fieldset, select {
	background: rgba(64, 64, 64, 0.8);
	color: inherit;
}

div#filename, div.palette {
	line-height: 200%;
}

div#filename, h2 {
	text-shadow: 2px 2px #000;
}

div#overlay_create fieldset {
	width: 16em;
}

div#overlay_startingConditions input {
	width: 6em;
}

div#miniMap {
	position: relative;
}

div#miniMap canvas {
	height: 200px;
	width: 200px;
}

div#terrain img {
	margin: 0 4px;
}

div#terrain img, ul#basic img {
	height: 32px;
	width: 32px;
}

div#terrain ul {
	display: flex;
	flex-wrap: wrap;
}

div#units select {
	width: 100%;
}

div.overlay {
	left: 50%;
	opacity: 0;
	padding: 1em;
	top: 50%;
	transform: translate(-50%, -50%);
	visibility: hidden;
	z-index: 6;
}

div.overlay, nav {
	border: 4px solid #808080;
	border-radius: 1em;
	box-shadow: 4px 4px 8px 0 #000;
	position: fixed;
}

div.overlay.open {
	opacity: 1;
	transition: opacity 0.3s;
	visibility: visible;
}

div.overlay table {
	white-space: nowrap;
}

div.palette {
	border-radius: 0 0.5em 0.5em 0.5em;
	border-width: 2px;
	display: none;
	margin: 0 0.5em 0.5em;
	padding: 1em 0;
}

div.palette, ul#basic button, ul#mode button, ul#players button {
	border-color: #404040;
	border-style: solid;
}

div.palette.open {
	display: block;
}

div.title {
	align-items: baseline;
	display: flex;
}

div.title h2 {
	flex-grow: 1;
}

div.title img {
	height: 24px;
	margin-left: 8px;
	width: 24px;
}

div.view {
	display: flex;
}

div.view fieldset {
	height: 20em;
	overflow: auto;
	width: 30em;
}

div.view img.icon {
	float: left;
}

div.view>select {
	height: 21em;
	margin-right: 1em;
	min-width: 15em;
}

footer, h1 {
	display: none;
}

h2 {
	font-size: 1.25rem;
	font-weight: bold;
	margin: 0 0 1em;
}

html {
	background: #000;
	color: #fff;
	font: 12pt/200% Quadrata, Georgia, serif;
	padding: 0;
	user-select: none;
	-moz-user-select: none;
	-webkit-user-select: none;
}

img.icon {
	margin-right: 0.5em;
}

input {
	background: none;
	border-width: 1px;
	color: inherit;
}

input#text_link {
	width: 40em;
}

input, select {
	border-color: #c0c0c0;
	border-style: solid;
	font: inherit;
	line-height: 150%;
}

input.gold {
	background-image: url(../icons/resources/gold.png);
}

input.gold, input.lumber, input.oil {
	background-position: 4px 50%;
	background-repeat: no-repeat;
	background-size: 1em 1em;
	padding-left: 1em;
}

input.lumber {
	background-image: url(../icons/resources/lumber.png);
}

input.oil {
	background-image: url(../icons/resources/oil.png);
}

input[type="number"] {
	box-sizing: border-box;
	text-align: right;
	width: 5em;
}

input[type="text"]:disabled {
	border: 0;
	text-align: center;
}

input:invalid {
	border-color: #f00;
	color: #f00;
}

nav {
	background: rgba(32, 32, 32, 0.8);
	color: inherit;
	left: 6px;
	line-height: 100%;
	top: 6px;
	width: 250px;
	z-index: 5;
}

optgroup {
	font-family: inherit;
	font-size: inherit;
	font-style: normal;
	font-weight: bold;
}

optgroup option {
	font-weight: normal;
}

select {
	border-radius: 0.5em;
	border-width: 2px;
	line-height: 100%;
	padding-right: 1em;
	-moz-appearance: none;
	-webkit-appearance: none;
}

select:not([size]) {
	background-image: url(select.svg);
	background-position: 100% 50%;
	background-repeat: no-repeat;
}

td {
	border: 0;
	border-collapse: collapse;
}

td, th {
	padding: 0 0.5em;
}

th {
	font-weight: bold;
	white-space: nowrap;
}

ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

ul#basic, ul#players {
	justify-content: space-evenly;
}

ul#basic, ul#mode, ul#players {
	display: flex;
}

ul#basic button {
	border-radius: 0.5em;
	border-width: 3px;
	margin-top: 0.5em;
	padding: 0.5em;
}

ul#basic button:hover, ul#mode button:hover, ul#players button:hover {
	border-color: #c0c0c0;
}

ul#basic button:hover, ul#mode button.current, ul#players button.current {
	background: #606060;
	color: inherit;
}

ul#files {
	column-count: 3;
	margin-bottom: 2em;
	white-space: nowrap;
}

ul#files a {
	background-repeat: no-repeat;
	padding-left: 1.5em;
}

ul#mode {
	line-height: 150%;
	margin: 1em 0.5em 0;
}

ul#mode button {
	border-radius: 0.5em 0.5em 0 0;
	border-width: 2px 2px 0 2px;
	margin-right: 0.1em;
	padding: 0.25em;
}

ul#mode button.current, ul#players button.current {
	border-color: #fff;
}

ul#players button {
	border-radius: 1em;
	border-width: 2px;
	height: 1.25em;
	width: 1.25em;
}

ul#unitsPalette {
	display: grid;
	grid-gap: 8px 8px;
	grid-template-columns: 46px 46px 46px 46px;
	grid-template-rows: 38px 38px 38px 38px 38px;
	margin: 1em auto;
	padding: 0.25em;
	width: 208px;
}