#map {
	width: 100%;
	background: #000;
	position: relative;
	overflow: hidden;
}

#map canvas {
	width: 100%;
	height: 100%;
	display: block;
	image-rendering: pixelated;
	image-rendering: crisp-edges;
}

/* Floating custom HUD control panel. */
.map-controls {
	position: absolute;
	top: 15px;
	left: 15px;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 6px;
	padding: 6px;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.map-control-group {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.05);
	border-radius: 4px;
	overflow: hidden;
}

.map-btn {
	background: transparent;
	border: none;
	color: #333;
	text-decoration: none;
	font-family: sans-serif;
	width: 30px;
	height: 30px;
	font-size: 14px;
	font-weight: bold;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	outline: none;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.map-btn:last-child {
	border-bottom: none;
}

.map-btn:hover,
.map-btn:focus-visible {
	background-color: #f4f4f4;
}

.map-btn:focus-visible {
	outline: 2px solid #005fcc;
	outline-offset: -2px;
}

.map-btn:active {
	transform: scale(0.95);
}

.map-btn.active {
	background-color: #ccc;
	color: #000;
}

.map-floor-display {
	color: #333;
	font-size: 16px;
	font-weight: bold;
	text-align: center;
	padding: 4px 0;
	user-select: none;
	background: #eee;
	font-family: sans-serif;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Coordinate HUD display. */
.coords-overlay {
	position: absolute;
	bottom: 15px;
	left: 15px;
	z-index: 1000;
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 5px;
	padding: 4px 8px;
	color: #333;
	font-size: 11px;
	font-family: sans-serif;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
	display: flex;
	gap: 12px;
}

.coords-overlay span {
	font-weight: bold;
}

/* Tooltip popup bubble for markers. */
.map-marker-tooltip {
	position: absolute;
	background: rgba(20, 20, 20, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.15);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
	padding: 6px 10px;
	border-radius: 6px;
	color: #fff;
	font-size: 11px;
	font-family: sans-serif;
	pointer-events: none;
	z-index: 10000;
	display: none;
	white-space: nowrap;
}

/* Subarea labels and dimming. */
.map-labels-container {
	position: absolute;
	top: 0;
	left: 0;
	width: 0;
	height: 0;
	z-index: 900;
	pointer-events: none;
}

.map-subarea-label {
	position: absolute;
	background: transparent;
	border: none;
	text-align: center;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.map-subarea-label span {
	white-space: nowrap;
	color: #fff;
	text-shadow:
		-1px -1px 0 #000,
		1px -1px 0 #000,
		-1px 1px 0 #000,
		1px 1px 0 #000;
	font-weight: bold;
	font-size: 11px;
	font-family: sans-serif;
	pointer-events: auto;
	cursor: default;
	transition: opacity 0.15s;
}

.map-dimmed .map-subarea-label span {
	opacity: 0.35;
}

.map-dimmed .map-subarea-label.active span {
	opacity: 1;
}

/* Pseudo fullscreen mode. */
.map-pseudo-fullscreen {
	overflow: hidden !important;
}

.map-pseudo-fullscreen #map {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	z-index: 99999 !important;
}

.map-pseudo-fullscreen .map-controls,
.map-pseudo-fullscreen .coords-overlay,
.map-pseudo-fullscreen .map-labels-container {
	z-index: 100000 !important;
}
