/* ---- map ---- */
.city-marker {
  width: 100%;
  height: 100%;
  background: var(--pin);
  color: var(--pin-ink);
  border-radius: 50%;
  border: 2px solid var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s var(--spring);
  cursor: pointer;
}
.city-marker:hover {
  transform: scale(1.18);
}
.city-marker.fresh {
  animation: pop-in 0.5s var(--ease) both;
  animation-delay: var(--d, 0ms);
}
.city-marker.linked {
  animation: ring 3s ease-in-out infinite;
}
.city-marker.linked.fresh {
  animation:
    pop-in 0.5s var(--ease) both,
    ring 3s ease-in-out 0.6s infinite;
}
.city-marker.selected {
  transform: scale(1.3);
}
.you-pin {
  position: relative;
  width: 18px;
  height: 18px;
}
.you-pin .dot {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--text);
  box-shadow:
    0 0 0 3px var(--panel),
    0 2px 6px rgba(0, 0, 0, 0.35);
}
.you-pin .wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--text);
  animation: pulse 2.6s ease-out infinite;
}
.you-pin .tag {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  text-shadow:
    0 0 3px var(--bg),
    0 0 3px var(--bg);
}
.pin {
  cursor: pointer;
}
.city-marker.group {
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--pin) 28%, transparent),
    0 2px 6px rgba(0, 0, 0, 0.35);
}
.maplibregl-ctrl-group {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow) !important;
  border-radius: 12px;
  overflow: hidden;
}
.maplibregl-ctrl-group button + button {
  border-top-color: var(--border);
}
[data-theme="dark"] .maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(1);
}
.maplibregl-ctrl-attrib,
.maplibregl-ctrl-attrib.maplibregl-compact {
  background: var(--glass);
  color: var(--muted);
}
.maplibregl-ctrl-attrib a {
  color: var(--muted);
}
.maplibregl-ctrl-top-right {
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
}

/* ---- a person's mini map ---- */
.minimap {
  height: 190px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  background: var(--bg);
}
/* No position here: MapLibre's absolute one places the marker (and holds the tag). */
.mini-pin {
  width: 14px;
  height: 14px;
}
.mini-pin .dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--pin);
  box-shadow:
    0 0 0 3px var(--panel),
    0 2px 6px rgba(0, 0, 0, 0.35);
}
.mini-pin.mini-you .dot {
  background: var(--text);
  box-shadow:
    0 0 0 3px var(--panel),
    0 0 0 5px var(--text),
    0 2px 6px rgba(0, 0, 0, 0.35);
}
/* Big enough to show around their dot when you met near where they live. */
.mini-pin.mini-met {
  width: 22px;
  height: 22px;
}
.mini-pin.mini-met .dot {
  inset: 3px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: var(--panel);
  border: 2.5px solid var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
/* Labels sit beside the point, on the side with room (minimap.js). */
.mini-pin .tag {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  text-shadow:
    0 0 3px var(--bg),
    0 0 3px var(--bg),
    0 0 3px var(--bg);
}
.mini-pin.tag-right .tag {
  left: calc(100% + 8px);
}
.mini-pin.tag-left .tag {
  right: calc(100% + 8px);
}
/* You, right next to where you met: that one's label says it (minimap.js). */
.mini-pin.tag-none .tag {
  display: none;
}
/* Their name, when it's the only point (or where you met, near home): above it. */
.mini-pin.tag-above .tag {
  top: auto;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

/* Under the map: which point is what. */
.mini-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: -4px 0 14px;
  font-size: 0.8rem;
  color: var(--muted);
}
.mini-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.mini-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pin);
}
.mini-legend .mini-you .dot {
  background: var(--text);
}
.mini-legend .mini-met .dot {
  width: 8px;
  height: 8px;
  margin: 0 1px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: none;
  border: 2px solid var(--text);
}

/* When the browser can't draw the map (no WebGL). */
.no-map {
  max-width: 340px;
  margin: 30vh auto 0;
  padding: 0 24px;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}
.mini-pin.mini-met.tag-above .tag {
  bottom: 26px;
}
.mini-pin.tag-below .tag {
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
}
