body {
	min-height: 100vh;
	background-repeat: repeat;
	background-image: url('../img/interface/skins/gw4/bg_map.png');
	margin: 0;
	overflow:hidden;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

img {
	filter: none !important;
	mix-blend-mode: normal !important;
}

body.map {
	position: relative;
	margin: 0;
	padding: 0;
	/*border: 4px solid rgba(255, 77, 59, 0.85);*/
}

@keyframes slideInScale {
	from {
		opacity: 0;
		transform: translateX(-50%) scale(0.3);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) scale(1);
	}
}

@keyframes slideOutScale {
	from {
		opacity: 1;
		transform: translateX(-50%) scale(1);
	}
	to {
		opacity: 0;
		transform: translateX(-50%) scale(0.3);
	}
}

@keyframes slideInScaleLandscape {
	from {
		opacity: 0;
		transform: scale(0.3);
		transform-origin: center center;
	}
	to {
		opacity: 1;
		transform: scale(1);
		transform-origin: center center;
	}
}

@keyframes slideOutScaleLandscape {
	from {
		opacity: 1;
		transform: scale(1);
		transform-origin: center center;
	}
	to {
		opacity: 0;
		transform: scale(0.3);
		transform-origin: center center;
	}
}

#div-main {
	display: flex;
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	height: 87vh;
	width: 800px;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	box-sizing: border-box;
	z-index: 200;
	opacity: 1;
	/*background-color: rgba(86, 77, 59);*/
}

#div-main.show {
	display: flex;
	animation: slideInScale 0.4s ease-out forwards;
}

#div-main.hide {
	display: flex;
	animation: slideOutScale 0.3s ease-in forwards;
}

#div-main.hidden {
	display: none;
	animation: none;
}

#iframe-main {
	width: 100%;
	height: 100%;
	border: none;
	margin: 0;
	padding: 0;
	scrollbar-width: thin;
	/*border-bottom: 4px solid rgba(255, 180, 0, 0.75);*/
	/*border: 4px solid rgba(86, 77, 59, 0.85)*/
}

#div-ui {
	position: fixed;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	height: 7dvh;
	width: min(800px, 100vw);
	box-sizing: border-box;
	z-index: 200;
	pointer-events: none;
	background-color: rgba(255, 128, 0, 0.25);
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	gap: 8px;
}

#div-ui span {
	position: relative;
	pointer-events: auto;
	cursor: pointer;
	/*border: 1px solid rgba(255, 255, 255, 0.5);*/
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
}

#div-ui span img {
	width: auto;
	height: 6dvh;
}

#div-ui span .profile-pic {
	position: absolute;
	top: 47%;
	left: 50%;
	width: 80%;
	height: 80%;
	object-fit: contain;
	transform: translate(-50%, -50%);
	z-index: 10;
}

#div-ap-timer {
	text-align: center;
	text-shadow: 0px 0px 4px rgb(255, 255, 255);
	font-weight: bold;
}

#div-close-button {
	position: absolute;
	top: 0px;
	right: -8px;
	z-index: 201;
	cursor: pointer;
	padding: 4px;
	opacity: 0.8;
	transition: opacity 0.2s;
	width: 32px;
	height: auto;
}

#div-close-button:hover {
	opacity: 1;
}

#DIV_opaque {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
}

/* Mobile landscape mode */
@media (orientation: landscape) and (max-height: 500px) {
	#div-main {
		position: fixed;
		top: 0;
		left: 7vw;
		width: 93vw;
		height: 100vh;
		z-index: 200;
		transform: none;
		overflow: hidden;
		border-radius: 0px;
	}

	#div-main.show {
		display: flex;
		animation: slideInScaleLandscape 0.4s ease-out forwards;
	}

	#div-main.hide {
		display: flex;
		animation: slideOutScaleLandscape 0.3s ease-in forwards;
	}
	
	#iframe-main {
		border-radius: 0px;
		flex-shrink: 0;
	}

	#div-ui {
		top: 0;
		left: 0;
		height: 100vh;
		width: 7vw;
		transform: none;
		flex-direction: column;
		overflow-y: auto;
		background-color: rgba(0, 0, 0, 0.25);
	}

	#div-ui span {
		/*flex: 1;*/
	}

	#div-ui span img {
		width: 5vw;
		height: auto;
	}

	#DIV_opaque {
		transform: scale(0.75);
		transform-origin: center center;
	} 
}

@media (orientation: portrait) and (max-width: 950px) {
	#div-main {
		width: 100vw;
		border-radius: 0px;
	}

	#iframe-main {
		border-radius: 0px;
		flex-shrink: 0;
	}

	#div-ui {
		height: 7dvh;
		gap: 4px;
	}

	#div-ui span {
		/*flex: 1;*/
	}

	#div-ui span img {
		width: 6vh;
		height: auto;
	}

	#DIV_opaque {
		transform-origin: center center;
		transform: scale(0.75);
	}
}

#iframe-status {
	display: none;
}

#map-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	transform-origin: 0 0;
	will-change: transform;
}

#map-image {
	position: relative;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

#map-warriors {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

#map-pois {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

#map-buildings {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

#map-grid-overlay {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
}

.grid-tile {
	position: absolute;
	width: var(--tile-size);
	height: var(--tile-size);
	background-color: transparent;
	border: 1px solid rgba(0,0,0,0.5);
	border-bottom: 0px;
	border-right: 0px;
	box-sizing: border-box;
	z-index: 0;
}

.warrior {
	position: absolute;
	width: 24px;
	height: 24px;
	color-scheme: only light;
	z-index: 100;
}

.warrior.automove {
	transition: margin-top 1s ease-in-out, margin-left 1s ease-in-out;
}

.warrior img {
	position: absolute;
	margin-top: -6px;
	margin-left: -4px;
	opacity: 1;
	color-scheme: only light;
	filter: none !important;
}

.warrior img.ghost {
	position: absolute;
	margin-top: -6px;
	margin-left: -4px;
	opacity: 0.15;
	color-scheme: only light;
	filter: none !important;
}

.warrior img.dark-only {
	filter: brightness(0) invert(1);
	mix-blend-mode: multiply;
}

/* Shadow element */
.warrior-shadow {
	position:absolute;
	bottom:-4px; /* place just below sprite */
	left:-2px;
	width:100%;
	height:100%;
	filter: brightness(0) opacity(0.25); /* black semi-transparent mask */
	transform-origin: bottom left;
	transform: scaleY(0.7) skewX(-40deg);
	z-index:-1;
	color-scheme: only light;
}
.warrior-shadow img {
	width:100%; height:auto;
	/*image-rendering:pixelated;*/
	display:block;
	color-scheme: only light;
	filter: none !important;
}

/* General element */
.warrior-general {
	position:absolute;
	top:-6px; /* place just above sprite */
	left:11px;
	width:100%;
	height:100%;
	z-index:1;
}

/* Name element */
.warrior-name {
	position: absolute;
	bottom: 0px; /* place below sprite */
	left: 0;
	right: 0;
	width: 100%;
	text-align: center;
	font-size: 8px;
	color: #fff;
	text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
	white-space: nowrap;
	display: none;
	z-index: 9999;
}

.gate-origin {
	position: absolute;
	color-scheme: only light;
	z-index: 103;
}

body.debug-mode .warrior-name {
	display: block;
}

.building {
	position: absolute;
	z-index: 102;
}

.building img {
	display: block;
}

.building a.disabled {
	pointer-events: none;
	opacity: 0.5;
	cursor: not-allowed;
}

.building-dom {
	position: absolute;
	background-color: rgba(0, 0, 0, 0.5);
	border: 1px dotted rgba(255, 255, 0, 0.5);
	padding: 0px;
	display: flex;
}

.arrow {
	display: block;
	position: absolute;
	width: 24px;
	height: 24px;
	z-index: 100;
	cursor: default;
	opacity: 1;
	transition: opacity 0.3s ease;
	color-scheme: only light;
	filter: none !important;
}

.arrow:hover {
	cursor: pointer;
}

.arrow.hide {
	opacity: 0;
	transition: opacity 0.05s ease;
}

.arrow img {
	color-scheme: only light;
	filter: none !important;
}

.exit-arrow {
	position: absolute;
	cursor: none;
	z-index: 10;
}

#conquest-lockdown {
	position: fixed;
	top: 10px;
	left: 10px;
	width: 64px;
	height: 28px;
	background-color: rgba(0, 0, 0, 0.5);
	border: 1px dotted rgba(255, 255, 0, 0.5);
	padding: 4px;
	z-index: 10001;
	color: #fff;
	display: none;
}

#conquest-lockdown .label {
	font-size: 10px;
	text-align: center;
}

#conquest-lockdown .timer {
	font-size: 12px;
	font-weight: bold;
	text-align: center;
}
