/*
 * Station markers: each site is a logo set in a drawn frame that belongs to its
 * project (evidence folder, gig ticket, record sleeve, enamel instrument,
 * cartridge, stone arch, string-light frame, camera ring). The name appears
 * as a small tag on hover, focus and when the car is at the door.
 */
#labels .map-label,
#labels.compact .map-label {
  --size: 58px;
  --rim: 4px;
  width: var(--size);
  height: var(--size);
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  display: grid;
  place-items: center;
  isolation: isolate;
  color: #fff;
  margin-top: -6px;
  filter: drop-shadow(0 4px 3px #02060cc4);
  /* The label is placed by an inline transform every frame, so it must never use the
     standalone scale property: that would multiply the label's position and make it
     slide away from the pointer. The zoom lives on its own layers instead. */
  --zoom: 1;
}
#labels .map-label::before,
#labels .map-label::after {
  content: "";
  position: absolute;
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  border-radius: 0;
  transform: none;
  vertical-align: baseline;
  pointer-events: none;
}
#labels .map-label::before {
  inset: 0;
  z-index: -2;
  background: var(--frame);
  clip-path: var(--shape);
}
#labels .map-label::after {
  inset: 0;
  z-index: -1;
  background: var(--panel);
  clip-path: var(--panel-shape);
}
#labels .map-label img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px #0009);
}
#labels .map-label[data-station=sunniva] img,
#labels .map-label[data-station=sam] img { width: 34px; height: 34px; }

/* The name tag. */
#labels .map-label span {
  position: absolute;
  left: 50%;
  top: calc(100% + 5px);
  translate: -50% 0;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--tint) 60%, #22303c);
  border-radius: 5px;
  background: #0a121ef0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease-out;
}
#labels .map-label:hover span,
#labels .map-label:focus-visible span,
#labels .map-label[data-active=true] span { opacity: 1; }
#labels.compact .map-label span { display: none; }
#labels .map-label::before,
#labels .map-label::after,
#labels .map-label img {
  transform: scale(var(--zoom));
  transition: transform .12s ease-out;
}
#labels .map-label:hover,
#labels .map-label:focus-visible { --zoom: 1.08; }
#labels .map-label[data-active=true] {
  --zoom: 1.12;
  filter: drop-shadow(0 0 9px var(--tint)) drop-shadow(0 4px 3px #02060cc4);
}

/* Heist Masters: a gold-edged evidence folder with a tab and a blueprint grid. */
#labels .map-label[data-station=heist] {
  --shape: polygon(0 16%, 9% 16%, 15% 0, 47% 0, 53% 16%, 100% 16%, 100% 100%, 0 100%);
  --panel-shape: polygon(var(--rim) calc(16% + var(--rim)), calc(100% - var(--rim)) calc(16% + var(--rim)), calc(100% - var(--rim)) calc(100% - var(--rim)), var(--rim) calc(100% - var(--rim)));
  --frame: linear-gradient(160deg, #f6dc97, #b98b3e 55%, #e8c47c);
  --panel: repeating-linear-gradient(0deg, #5193a233 0 1px, transparent 1px 6px), repeating-linear-gradient(90deg, #5193a233 0 1px, transparent 1px 6px), #13263f;
}
/* ARCHANGEL: a screen-printed gig ticket with notched edges and a tear line. */
#labels .map-label[data-station=archangel] {
  --shape: polygon(0 0, 100% 0, 100% 36%, 94% 50%, 100% 64%, 100% 100%, 0 100%, 0 64%, 6% 50%, 0 36%);
  --panel-shape: polygon(var(--rim) var(--rim), calc(100% - var(--rim)) var(--rim), calc(100% - var(--rim)) 35%, calc(100% - 10px) 50%, calc(100% - var(--rim)) 65%, calc(100% - var(--rim)) calc(100% - var(--rim)), var(--rim) calc(100% - var(--rim)), var(--rim) 65%, 10px 50%, var(--rim) 35%);
  --frame: linear-gradient(150deg, #ffc1de, #ff6eb4 60%, #ffa6d0);
  --panel: repeating-linear-gradient(115deg, #ff85bf2e 0 2px, transparent 2px 7px), linear-gradient(#4a1745, #2a0f33);
}
/* Sam Davies: a square record sleeve with a cream edge and pressed grooves. */
#labels .map-label[data-station=sam] {
  --shape: inset(0 round 2px);
  --panel-shape: inset(var(--rim) round 1px);
  --frame: linear-gradient(145deg, #f3e1c7, #d4b693 55%, #ead3b4);
  --panel: repeating-radial-gradient(circle at 56% 50%, #1b1618 0 1px, #2c2528 1px 2px), #231d20;
}
/* StellarEng: an enamel instrument housing with chamfered corners and cyan ridge. */
#labels .map-label[data-station=stellar] {
  --shape: polygon(28% 0, 72% 0, 100% 28%, 100% 72%, 72% 100%, 28% 100%, 0 72%, 0 28%);
  --panel-shape: polygon(calc(28% + 2px) var(--rim), calc(72% - 2px) var(--rim), calc(100% - var(--rim)) calc(28% + 2px), calc(100% - var(--rim)) calc(72% - 2px), calc(72% - 2px) calc(100% - var(--rim)), calc(28% + 2px) calc(100% - var(--rim)), var(--rim) calc(72% - 2px), var(--rim) calc(28% + 2px));
  --frame: linear-gradient(150deg, #bfe9f4, #5fa7bc 55%, #9ad6e8);
  --panel: radial-gradient(circle at 22% 24%, #dff6ff 0 1px, transparent 1.6px), radial-gradient(circle at 78% 66%, #dff6ff 0 1px, transparent 1.6px), radial-gradient(circle at 64% 18%, #dff6ff 0 .8px, transparent 1.4px), radial-gradient(circle at 50% 120%, #1f5a78, transparent 70%), #0d2236;
}
/* PokéLore: a game cartridge with a notched shoulder and finger grips. */
#labels .map-label[data-station=pokelore] {
  --shape: polygon(0 0, 30% 0, 34% 9%, 66% 9%, 70% 0, 100% 0, 100% 82%, 90% 100%, 10% 100%, 0 82%);
  --panel-shape: polygon(var(--rim) 0, 30% 0, 34% calc(9% + 2px), 66% calc(9% + 2px), 70% 0, calc(100% - var(--rim)) 0, calc(100% - var(--rim)) 80%, calc(90% - 2px) calc(100% - var(--rim)), calc(10% + 2px) calc(100% - var(--rim)), var(--rim) 80%);
  --frame: linear-gradient(155deg, #cdb8ff, #8167cf 58%, #b79cf5);
  --panel: repeating-linear-gradient(90deg, #ffffff12 0 2px, transparent 2px 5px) 0 88% / 100% 9px no-repeat, linear-gradient(#37285a, #251a41);
}
/* Nori-Dex: a stone arch altar with a mossy rim. */
#labels .map-label[data-station=nori] {
  --shape: inset(0 round 50% 50% 7px 7px / 40% 40% 7px 7px);
  --panel-shape: inset(var(--rim) round 50% 50% 4px 4px / 38% 38% 4px 4px);
  --frame: radial-gradient(circle at 50% 0, #d7f6dd, transparent 55%), linear-gradient(160deg, #9ce9c1, #4f9a74 60%, #7fd0a2);
  --panel: radial-gradient(circle at 50% 30%, #2b5a4a, #132d27 80%);
}
/* Sunniva Room: a wooden frame hung with warm string lights. */
#labels .map-label[data-station=sunniva] {
  --shape: inset(0 round 7px);
  --panel-shape: inset(var(--rim) round 4px);
  --frame: radial-gradient(circle, #ffe3a0 0 1.6px, #ffcf7a66 2.4px, transparent 4.6px) 0 -1px / 12px 9px repeat-x, linear-gradient(150deg, #c98c5c, #84573a 55%, #b57a4e);
  --panel: radial-gradient(circle at 50% 0, #ffc47a40, transparent 60%), linear-gradient(#3a2a27, #261c1d);
}
/* The creator: a camera lens ring with aperture blades. */
#labels .map-label[data-station=profile] {
  --shape: circle(50%);
  --panel-shape: circle(calc(50% - var(--rim)));
  --frame: conic-gradient(from 20deg, #e9edc6, #86957a, #e9edc6, #86957a, #e9edc6, #86957a, #e9edc6, #86957a, #e9edc6);
  --panel: radial-gradient(circle, #1c2a2d 0 60%, #0f1a1d);
}
#labels .map-label[data-station=profile] img { width: 34px; height: 34px; }

@media (max-width: 640px) {
  #labels .map-label,
  #labels.compact .map-label { --size: 46px; --rim: 3px; }
  #labels .map-label img { width: 26px; height: 26px; }
  #labels .map-label[data-station=sunniva] img,
  #labels .map-label[data-station=sam] img,
  #labels .map-label[data-station=profile] img { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  #labels .map-label::before, #labels .map-label::after, #labels .map-label img, #labels .map-label span { transition: none; }
}
@media (forced-colors: active) {
  #labels .map-label::before, #labels .map-label::after { display: none; }
  #labels .map-label { border: 2px solid ButtonText; }
}
