.world-map {
  /* Taller than the window, the page scrolls from its top rather than cutting the title off. */
  justify-content: safe center;
  padding: 14px;
  gap: 10px;
  overflow: auto;
  font:
    14px/1.4 system-ui,
    sans-serif;
}
.world-map[hidden] {
  display: none;
}
.world-map header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  width: min(640px, 94 * var(--vw));
}
.world-map h2 {
  flex: 1;
}
.world-map .map-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
}
.world-map .map-span {
  min-width: 108px;
  text-align: center;
}
.world-map button {
  font: inherit;
  color: #fff;
  background: #354e41;
  border: 1px solid #80988a;
  border-radius: 5px;
  padding: 6px 12px;
  cursor: pointer;
}
.world-map button:disabled {
  opacity: 0.45;
  cursor: default;
}
.world-map button:focus-visible {
  outline: 2px solid #f1dd8a;
  outline-offset: 2px;
}
.world-map .map-surface {
  position: relative;
  flex-shrink: 0;
  width: min(60 * var(--vh), 640px, 94 * var(--vw));
  height: min(60 * var(--vh), 640px, 94 * var(--vw));
  border: 2px solid #789484;
  background: #192e2b;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.world-map .map-surface canvas {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}
.world-map .map-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.world-map .map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0;
  width: 30px;
  height: 30px;
  font:
    bold 24px/28px system-ui,
    sans-serif;
  background: #253c30;
  text-shadow: 0 1px #000;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}
.world-map .map-marker.automatic {
  color: #ffe7a6;
  cursor: default;
  pointer-events: none;
}
.world-map .map-marker.selected {
  outline: 2px solid #ffe7a6;
}
.world-map .map-marker.dragging {
  pointer-events: none;
}
.world-map .map-player {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  color: #fff;
  filter: drop-shadow(0 1px 2px #000);
  pointer-events: none;
}
.world-map .map-player svg {
  width: 100%;
  height: 100%;
  transform-origin: center;
}
.world-map .map-north {
  position: absolute;
  top: 6px;
  left: 8px;
  color: #fff;
  background: #192e2bdd;
  padding: 2px 5px;
  pointer-events: none;
}
.world-map .map-palette {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.world-map .map-palette button {
  font-size: 24px;
  width: 46px;
  height: 40px;
  padding: 0;
  touch-action: none;
  cursor: grab;
}
.world-map .map-colors {
  position: fixed;
  z-index: 92;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #192e2bf2;
  border: 1px solid #80988a;
  border-radius: 6px;
  box-shadow: 0 4px 14px #000a;
}
.world-map .map-colors[hidden] {
  display: none;
}
.world-map .map-colors button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid #192e2b;
  border-radius: 50%;
}
.world-map .map-colors button.chosen {
  outline: 2px solid #fff;
  outline-offset: 1px;
}
.world-map .map-info {
  margin: 0;
  max-width: 640px;
  text-align: center;
}
.world-map .map-places {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
#map-open {
  position: fixed;
  right: 18px;
  top: 82px;
  z-index: 5;
  color: #fff;
  background: #26382cdd;
  border: 1px solid #80988a;
  border-radius: 5px;
  padding: 7px 11px;
  font:
    13px system-ui,
    sans-serif;
  cursor: pointer;
}
body.map-open #map-open {
  z-index: 91;
}
body:not(.playing) #map-open,
body.hud-hidden #map-open {
  display: none;
}

/* The places compass (web/compass.js): a strip across the top of the screen, 180 degrees wide. */
.place-compass {
  position: fixed;
  top: calc(3 * var(--mc-px, 2px));
  left: 50%;
  z-index: 5;
  width: min(480px, 46 * var(--vw));
  height: 38px;
  transform: translateX(-50%);
  overflow: hidden;
  background: linear-gradient(90deg, #0000, #0007 15% 85%, #0000);
  border-bottom: 1px solid #fff5;
  color: #fff;
  font:
    bold 13px/1 system-ui,
    sans-serif;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
.place-compass[hidden],
body:not(.playing) .place-compass,
body.hud-hidden .place-compass,
body.map-open .place-compass {
  display: none;
}
.place-compass::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 7px;
  border-left: 2px solid #fff;
}
.place-compass > span {
  position: absolute;
  top: 3px;
  transform: translateX(-50%);
  white-space: nowrap;
}
.place-compass .cardinal {
  top: 9px;
  opacity: 0.85;
}
.place-compass .cardinal.north {
  color: #ff8c7a;
}
.place-compass .place {
  font-size: 18px;
}
.place-compass .place small {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  text-align: center;
  color: #fff;
}
/* vmon's region (map.js setRegion): town and route names, and the badges earned. */
.world-map .map-badges {
  display: flex;
  gap: 4px;
}
.world-map .map-badge {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 231, 166, 0.5);
}
.world-map .map-badge.earned {
  background: radial-gradient(circle at 35% 35%, #fff6c8, var(--type, #f2b632) 60%, #333);
  border-color: #ffe7a6;
}
.world-map .map-next-gym {
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  /* The light cards' quiet button (the CD, vmon.css :is(.vm-menu, .vm-dialog-card) .vb-button), so it
     reads as one (member run, 15 Nov 2026: "no Fernwood Town is drawn"). */
  color: var(--vu-ink, #192e2b);
  background: var(--vu-paper, #fff);
  border: 0;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px var(--vu-rule, #d7e0ee);
  padding: 4px 14px;
  cursor: pointer;
}
@media (pointer: coarse) {
  .world-map .map-next-gym {
    min-height: 44px;
  }
}
/* The key to the region's marks, under the map. */
.world-map .map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  width: min(640px, 94 * var(--vw));
  margin: 0;
  font-size: 13px;
}
.world-map .map-legend[hidden] {
  display: none;
}
.world-map .map-legend i {
  font-style: normal;
}
/* A Pokémon Center: a white cross on red, after a town's name. */
.world-map i.map-center {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 5px;
  border-radius: 3px;
  /* Green, not red: a red cross is a protected emblem (the creative director). */
  background: #2e9d4f;
  color: #fff;
  font: 700 13px/14px system-ui, sans-serif;
  text-align: center;
  font-style: normal;
  vertical-align: -1px;
}
.world-map .map-legend i.map-center {
  margin-left: 0;
}
/* The next gym: a gold ring round its name, on the map and in the key. */
.world-map .map-area.next {
  box-shadow: 0 0 0 2px #f2b632;
}
.world-map .map-next-key {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 3px;
  box-shadow: 0 0 0 2px #f2b632;
  vertical-align: -1px;
}
.world-map .map-area {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  font: 600 13px/1.3 system-ui, sans-serif;
  color: #fff;
  background: rgba(16, 26, 24, 0.72);
  text-shadow: 0 1px 2px #000;
}
.world-map .map-area.town {
  font-size: 15px;
  border: 1px solid #ff9f8f;
}
/* A map under 400 px wide (a phone; map.js drawRegion): smaller town names, so all 8 gym tags fit.
   The creative director: never under 11 px. */
.world-map .map-narrow .map-area.town {
  font-size: 12px;
  padding: 1px 6px;
}
.world-map .map-area.route {
  color: #ffe7a6;
}
/* vmon's towns: a tap on the name selects it and shows Fly to <town>, or Not visited yet (map.js
   setFlySpots). The button is the blue primary one, as Play and Resume. */
.world-map .map-area.fly {
  pointer-events: auto;
  cursor: pointer;
}
.world-map .map-area.unvisited {
  color: rgba(255, 255, 255, 0.6);
  border-style: dashed;
}
.world-map .map-area.selected {
  outline: 2px solid #fff;
  outline-offset: 1px;
}
.world-map .map-fly button.map-fly-go {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--vu-sky, #38a3f1);
  color: #fff;
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 18%);
  font: 600 16px/1.2 var(--vu-font-display, system-ui, sans-serif);
}
.world-map .map-fly button.map-fly-go:hover {
  background: var(--vu-sky-dark, #1b6fd1);
}
.world-map .map-fly {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  font: 600 13px/1.3 system-ui, sans-serif;
}
.world-map .map-fly [hidden],
.world-map .map-fly[hidden] {
  display: none;
}
.world-map .map-fly span {
  padding: 2px 8px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(16, 26, 24, 0.85);
}
.world-map .map-area.gate {
  font-size: 11px;
  padding: 1px 6px;
}
/* A gym's door: a GYM tag in the gym's type colour where the building is (new-player test, 15 Nov
   2026); the next gym's has the gold ring of its name, a won gym's is dimmed. */
.world-map i.map-gym-door {
  display: inline-block;
  font: 800 10px/14px system-ui, sans-serif;
  font-style: normal;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--type, #f2b632);
  border: 1px solid rgba(16, 26, 24, 0.8);
  border-radius: 4px;
  padding: 0 4px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
  vertical-align: 1px;
}
.world-map .map-marks i.map-gym-door {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.world-map i.map-gym-door.next {
  box-shadow: 0 0 0 2px #f2b632;
}
.world-map i.map-gym-door.won {
  opacity: 0.6;
}
.world-map i.map-gym-door.ink {
  color: var(--vu-ink, #192e2b);
  text-shadow: none;
}
/* What the place icons are for, on its own line above them. */
.world-map .map-palette-label {
  flex-basis: 100%;
  text-align: center;
  font-size: 13px;
  /* The card's own ink, dimmed: on vmon's white card a white line did not show. */
  color: inherit;
  opacity: 0.75;
}
