*,* {margin: 0; padding: 0; }

body {
	color:  #fff;
	font-family: monospace;
	position: relative;
	user-select: none;
	scrollbar-color: rebeccapurple green;
	background: #111 url("img/space.png");
}

body.paused #world,
body.paused #ui {
	visibility: hidden;
}

*::-webkit-scrollbar {
  background-color: rgba(0, 0, 0, 1);
}
*::-webkit-scrollbar-thumb {
  background-color: #444;
}
*::-webkit-scrollbar-track {
  background-color: transparent;
}
*::-webkit-scrollbar-corner {
  background-color: transparent;
}

#world {
	position: relative;
}

#fogContainer, #fogContainerMM {
	  position: absolute;
	  top: 0;
	  left: 0;
	  bottom: 0;
	  right: 0;
	  z-index: 8000;
	  pointer-events: none;
}

#ui {
	position: fixed;
	background: #444;
	z-index: 9000;
	top: 0;
	left: 0;
	width: calc(128px + 32px);
	bottom: 0;
	padding: 16px;
	box-sizing: border-box;
	pointer-events: none;
}

button {
	width: 100%;
	display: block;
	position: relative;
	background: #333;
	border: 0;
	color:  #fff;
	padding: 4px 0;
	font: 12px monospace;
	pointer-events: all;
}

#ui button:hover {
	background: #666;
	color: #eee;
}

#ui button:active {
	background: #fff;
	color: #000;
}

#statusBar, #messageBar {
	pointer-events: none;
	position: fixed;
	top: 10px;
	left: 10px;
	right: 10px;
	right: 10px;
	font-size: 18px;
	white-space: nowrap;
	text-align: right;
	line-height: 24px;
}

#statusBar img {
	margin: 0 10px 0 0;
}

#statusBar span {
	line-height: 24px;
}

#messageBar {
	bottom: 32px;
	top: auto;
	text-align: center;
}

#minimap {
	position: relative;
	width: 128px;
	height: 128px;
	overflow: hidden;
	background: #222;
	z-index: 999999;
	margin: 8px 0;
	pointer-events: all;
}

#minimap div, #minimap em {
	position: absolute;
	width: 4px;
	height: 4px;
	top: 0;
	left: 0;
	margin-left: -2px;
	margin-top: -2px;
	background: #11FC17;
	z-index: 1000;
	pointer-events: none;
}

#minimap div[data-player="0"] {
	background-color: yellow;
	z-index: 10;
}
#minimap div[data-player="0"] {background-color: #00DFFB; }
#minimap div[data-player="2"] {background-color: #E70A0E; }
#minimap div[data-player="1"].selected {
	background-color: #fff;
	z-index: 2000;
}

#minimap span {
	position: absolute;
	width: 128px;
	height: 128px;
	top: 0;
	left: 0;
	border: 1px solid #888;
	background-color: rgba(255,255,255,0.2);
	transform:: translate3d(0, 0, 0) scale3d(0.1,0.1,1);
	transform-origin: top left;
	pointer-events: none;
}

#minimap em {
	width: 16px;
	height: 16px;
	margin-left: -8px;
	margin-top: -8px;
	background: transparent;
	border: 2px solid yellow;
  animation-duration: 0.6s;
  animation-name: ping;
}

#buildBar {
	margin: 8px 0;
}

#buildBar button, #trainButtons button {
	margin: 0 0 2px 0;
}

#unitInfo {
	font-family:  monospace;
	font-size: 12px;
	margin: 16px 0;
}

#unitPortrait {
	width: 100%;
	image-rendering: pixelated;
	background: #111;
}

#eventInfo {
	position: fixed;
	width: 128px;
	bottom: 16px;
	right: 16px;
}

#eventInfo span {
	display: block;
	overflow: auto;
	font-family:  monospace;
	font-size: 10px;
	margin-bottom: 6px;
	background: rgba(255, 255, 255, 0.7);
	color: #222;
	box-sizing: border-box;
	padding: 8px;
}

x-unit {
	position: absolute;
}

x-unit img, x-sprite img {
	position: absolute;
	filter: drop-shadow(0 0 10px rgba(0, 0, 0, 1));
	top: 0; 
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	image-rendering: pixelated;
	pointer-events: none;
}

x-unit.selected {
	outline: #fff solid 4px;
}

x-unit.selected[data-player="0"] {outline-color: yellow; }
x-unit.selected[data-player="2"] {outline-color: red; }

x-unit[data-player="2"] {filter: hue-rotate(300deg) }

x-sprite {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 600;
}

x-sprite img {
	position: absolute;
	top: 0; 
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	image-rendering: pixelated;
	pointer-events: none;
}

x-sprite.explosion {
  animation-duration: 0.3s;
  animation-name: expand;
}

@keyframes expand {
	from {transform: scale(100%); }
  to {transform: scale(10%); }
}

@keyframes ping {
	0% {transform: scale(10%); }
  33% {transform: scale(200%); }
  100% {transform: scale(100%); }
}

x-overlay {
	display: none;
	pointer-events: none;
	position: absolute;
	top: 0;
	left: 0;
	outline: 5px dashed rgba(178, 134, 57, 0.25);
}

body.showPowerRange [data-player="1"] x-overlay,
x-unit[data-player="1"].selected x-overlay {
	display: block;
}

#buildingPlacementGhost {
	display: none;
	background: rgba(255,0,0, 0.1);;
	position: absolute;
	width: 32px;
	height: 32px;
	top: 0;
	left: 0;
}
#buildingPlacementGhost.visible {
	display: block;
}
#buildingPlacementGhost.valid {
	background-color: rgba(255,255,255, 0.1);
}
#selectionRectangle {
	position: absolute;
	display: none;
	border: 2px solid #888;
	pointer-events: none;
	z-index: 1000000;
}
#selectionRectangle.visible {
	display: block;
}

#tooltip {
	position: fixed;
	display: none;
	width: 300px;
	padding: 16px;
	background-color: rgba(0,0,0, 0.2);
	box-sizing: border-box;
	background: #111;
	color:  #fff;
	font-family: monospace;
	z-index: 999999999;
}

#tooltip.visible {
	display: block;
}

#menu {
	position: fixed;
	background: #666;
	width: 300px;
	min-height: 300px;
	top: 50%;
	left: 50%;
	margin-left: -150px;
	margin-top: -150px;
	z-index: 9999999;	
	box-sizing: border-box;
	padding: 32px;
	display: none;
}

.paused #menu {
	display: block;
}

#menu h1 {
	text-align: left;
	margin: 16px 0;
	font-size: 32px;
}

#menu h2 {
	font-size: 16px;
	text-align: left;
	margin: 16px 0;
}

#menu p {
	margin: 16px 0 16px 0;
}

#menu button {
	margin: 0 0 6px 0;	
	padding: 16px 0;
}

#splash, #victorySplash {
	background: #222 url("img/splash.png") no-repeat center center;
	position: fixed;
	inset: 0 0 0 0;
	z-index: 999999999;
}

#victorySplash {
	background-image: url("img/victorySplash.png");
	display: none;
}
#victorySplash.visible { display: block; }

#mainMenuResumeButton {display: none;}
#mainMenuResumeButton.visible { display: block; }