:root {
	--tile-base-size: 128px;
}

#game-body {
	overflow: hidden;
	display: flex;
	flex-flow: column;
	width: 100vw;
	height: 100vh;
}


.user-panel {
	width: 100%;
	flex: 0 1 auto;
}

#game-container {
	/* width: 100vw; */
	/* height: 100vh; */
	width: 100%;
	height: 100%;
	position: relative;
	flex: 1 1 auto;
}

#map-container {
	/* width: 100vw; */
	/* height: 100vh; */
	width: 100%;
	height: 100%;
	background-image: 
		radial-gradient(rgba(0,0,0,0), rgba(0,0,0,0.5)),
		url("../img/bg.png"),
		url("../img/bg.png");
	background-blend-mode: 
		normal,
		lighten,
		normal;
	background-size:
		cover,
		calc(var(--tile-base-size) * 2),
		var(--tile-base-size);
	backdrop-filter: blur(10px);
	position: absolute;
	overflow: hidden;
	user-select: none;
}

#overlay-container {
	/* width: 100vw; */
	/* height: 100vh; */
	width: 100%;
	height: 100%;
	position: absolute;
	overflow: hidden;
	pointer-events: none;
}

.map-overlay {
	/* width: 100vw; */
	/* height: 100vh; */
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0px;
	pointer-events: none;
}

.resources {
	width: 500px;
	height: 100px;
	background-color: red;
	z-index: 2;
	position: relative;
}

.map-bg-blurrer {
	backdrop-filter: blur(2px);
}

.map-vignette {
	background: radial-gradient(rgba(0,0,0,0), rgba(0,0,0,0.5));
}

.map-darken {
	background-color: rgba(0,0,0,0.5);
}

.map-mockup-warning {
	text-align: center;
	font-size: 48px;
	color: red;
	padding-top: 20px;
}

#map {
	margin: 0px;
	padding: 0px;
	line-height: 0;
	width: fit-content;
	overflow-x: visible;
	white-space: nowrap;
	box-shadow: 2px 5px 100px rgba(0, 0, 25, 0.5);
}

/*
.map, #map-playarea {
	border: 2px solid red;
}
*/


.tile {
	margin: 0px;
	padding: 0px;
	width: var(--tile-base-size);
	display: inline-block;
	position: relative;
}

.game-tile {
	height: var(--tile-base-size);
}

.tile-layer {
	width: 100%;
	height: 100%;
	position: absolute;
}

.tile-hover-overlay {
	background-color: rgba(255, 255, 0, 0.2);
	background-image: url("../img/hover_select.png");
	background-size: 100%;
}

/*
.tile:hover .tile-hover-overlay {
	background-color: rgba(255, 255, 0, 0.5);
}
*/

.tile-label {
	text-align: center;
	font-weight: bold;
	color: white;
	line-height: var(--tile-base-size);
	z-index: 1;
	pointer-events: none;
	text-shadow:
		-2px  0px 3px black,
		-2px  2px 3px black,
		 0px  2px 3px black,
		 2px  2px 3px black,
		 2px  0px 3px black,
		 2px -2px 3px black,
		 0px -2px 3px black,
		-2px -2px 3px black;
}

.bottom-tile {
	height: calc(var(--tile-base-size) / 4);
}

.bottom-tile .tile-image {
	height: 100%;
}

.game-box {
	border-image-source: url("../img/box.png");
	border-image-slice: calc(100% / 3) fill;
	border-image-repeat: repeat;
	border-image-width: 24px;
	padding: 24px;
	position: absolute;
	pointer-events: initial;
	color: white;
	box-shadow: 0px 0px 10px black;
}


.resource-box {
	display: flex;
	width: fit-content;
	top: 32px;
	left: 32px;
}

.resource-type {
	display: inline;
	margin: 10px;
	height: 24px;
	line-height: 24px;
	text-align: center;
	user-select: none;
}

.resource-type:first-of-type {
	margin-left: 5px;
}

.resource-type:last-of-type {
	margin-right: 0px;
}

.resource-type img {
	vertical-align: middle;
}

.notifications-box {
	width: fit-content;
	top: 32px;
	right: 32px;
}

.coords-box {
	bottom: 32px;
	right: 32px;
}

@media (max-width: 720px) {
	.coords-box {
		display: none !important;
	}
	.resource-box {
		top: initial;
		bottom: 32px;
		left: 0;
		right: 0;
		margin: auto;
	}
}

.tile-info-box {
	width: fit-content;
	height: fit-content;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	margin: auto;
}
.tile-info-box h1 {
	text-align: center;
}


.close-button {
	background-image: url("../img/close_default.png");
	background-size: 100%;
	position: absolute;
	width: 48px;
	height: 48px;
	top: -12px;
	left: -12px;
	box-shadow: 0px 0px 5px black;
}

.close-button:hover {
	background-image: url("../img/close_hover.png");
}

.close-button:active {
	background-image: url("../img/close_active.png");
}

/*
tile info box
*/

.tileinfo-container-main {
	display: flex;
}

.tileinfo-container-left {
	display: grid;
	grid-template-columns: 35% 65%;
	grid-template-rows: 35% 65%;
	grid-template-areas: 
		"header header"
		"image buildings";
	justify-items: stretch;
}

.tileinfo-header {
	grid-area: header;
	margin: 10px;
	height: fit-content;
}


.tileinfo-pic {
	grid-area: image;
	margin: 10px;
}

.tileinfo-buildings {
	grid-area: buildings;
	margin: 10px;
	margin-left: 20px;
}

.tileinfo-container-right {
	padding: 10px;
	display: flex;
	flex-direction: column;
}

.tileinfo-container-right button {
	margin-bottom: 10px;
}

.tileinfo-building img {
	width: 64px;
	vertical-align: middle;
}

.tileinfo-tile {
	width: var(--tile-base-size);
	height: var(--tile-base-size);
	position: relative;
}

.tileinfo-tile img {
	position: absolute;
}

.tileinfo-bottomtile {
	height: calc(var(--tile-base-size) / 4);
}

.tileinfo-coords {
	position: absolute;
	bottom: 32px;
	right: 32px;
}

@media (max-width: 720px) {	
	.tileinfo-coords {
		position: absolute;
		top: 16px;
		right: 16px;
	}
	
	.tile-info-box {
		margin-top: 0px;
		height: auto;
		width: 100%;
		overflow-y: auto;
		box-sizing: border-box;
	}
	
	.tile-info-box .close-button {
		top: 10px;
		left: 10px;
	}
	
	.tileinfo-container-main {
		flex-direction: column;
	}
	
	.tileinfo-container-left {
		grid-template-columns: 100%;
		grid-template-rows: auto auto auto;
		grid-template-areas: 
			"header"
			"image"
			"buildings";
		justify-items: stretch;
	}
	
	.tileinfo-header, .tileinfo-buildings, .tileinfo-pic {
		/* border: 1px solid red; */
		margin: 10px;
	}
	
	.tileinfo-tile {
		margin: auto;
	}
}