/* The chart uses game-space positions over the city's illustrated relief. */
#map-art.map-art {
  --territory-opacity: .16;
  aspect-ratio: 1672 / 941;
  min-height: 318px;
  max-height: none;
  background: #143b3f;
}
#map-viewport.map-viewport {
  container-type: normal;
  overscroll-behavior: contain;
  background: #143b3f;
  scrollbar-width: none;
  touch-action: pan-x pan-y pinch-zoom;
}
#map-viewport::-webkit-scrollbar { display: none; }
#map-viewport[data-zoomed="true"] { cursor: grab; }
#map-viewport.city-panning, #map-viewport.city-panning * { cursor: grabbing; }
#map-scene.city-scene {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  max-width: none;
  aspect-ratio: auto;
  background: #164448;
  mask-image: none;
  user-select: none;
}
.city-terrain, .city-surface { position: absolute; inset: 0; width: 100%; height: 100%; }
.city-terrain {
  background: center / 100% 100% no-repeat url("/assets/cidade-atlas.webp");
  pointer-events: none;
}
.city-surface {
  display: block;
}
.city-region {
  fill: #fff0ce;
  opacity: .78;
  stroke: #24342d;
  stroke-width: 2.4px;
  paint-order: stroke;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-style: italic;
  letter-spacing: .085em;
  pointer-events: none;
}
.city-boundaries, .city-labels { pointer-events: none; }
.city-area {
  fill-opacity: var(--territory-opacity);
  stroke: #27332c59;
  stroke-width: .55px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  outline: none;
}
.city-area.is-unowned { fill-opacity: calc(var(--territory-opacity) * .15); }
@media (hover: hover) {
  .city-area:hover { fill-opacity: min(1, calc(var(--territory-opacity) * 1.6)); }
}
.city-area.is-current, .city-area:focus-visible {
  fill-opacity: min(1, calc(var(--territory-opacity) * 1.9));
  stroke: #fff4d6;
  stroke-width: 1.8px;
}
.city-area.is-contested { stroke: #ffe09d; stroke-width: 1.5px; stroke-dasharray: 4 2; }
.city-boundary {
  fill: none;
  stroke: #f8f0d66b;
  stroke-width: .8px;
  stroke-dasharray: 3 3;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.city-boundary.is-related {
  stroke: #fff2cd;
  stroke-width: 1.35px;
}
.city-label rect { fill: #202b28f2; stroke: #eee2bc; stroke-width: 1; }
.city-label text {
  fill: #fff9e9;
  paint-order: stroke;
  stroke: #27362cf2;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  font: 650 11px var(--sans, "Segoe UI", sans-serif);
}
.city-label.is-current text { stroke: none; font-size: 12px; font-weight: 720; }
.city-tip {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -100%);
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 7px 5px;
  border: 1px solid #ddd9bb90;
  border-radius: 4px;
  color: #fff9e6;
  background: #202c29f5;
  font: 600 11px/1.2 var(--sans, "Segoe UI", sans-serif);
  white-space: nowrap;
  pointer-events: none;
}
#map-art .cartography {
  display: grid;
  top: 14px;
  right: 14px;
  color: #fff6dc;
  opacity: .88;
}
#map-art .map-controls {
  top: 12px;
  left: 12px;
  gap: 0;
  overflow: hidden;
  border: 1px solid #e4e2ca6e;
  border-radius: 5px;
  background: #212c2af0;
  box-shadow: 0 1px 4px #09171344;
}
#map-art .map-controls button {
  width: 33px;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff3d8;
  font-size: 22px;
}
#map-art .map-controls button + button { border-top: 1px solid #e4e2ca55; }
#map-art .map-controls button:not(:disabled):hover { background: #41514a; }
#map-art .map-controls button:focus-visible { outline-offset: -3px; }
.map-opacity {
  display: grid;
  grid-template-columns: auto minmax(80px, 128px) 4ch;
  align-items: center;
  column-gap: 9px;
  margin-inline-start: auto;
}
.map-opacity label { font-size: 12px; }
.map-opacity input { min-width: 0; margin: 0; }
#territory-opacity-value { color: var(--gold); text-align: right; font: 600 12px var(--mono); }
@media (max-width: 620px) {
  #map-art.map-art { min-height: clamp(300px, 46svh, 390px); }
  #map-art .map-controls { top: 8px; left: 8px; }
  #map-art .cartography { top: 10px; right: 10px; }
  .map-opacity {
    width: 100%;
    grid-template-columns: auto minmax(0, 1fr) 4ch;
    border-top: 1px solid #44483f;
    padding-top: 3px;
  }
  .map-opacity input { min-height: 40px; }
}
