/* The town map uses one aerial WebP and lightweight CSS overlays. */
.world { background: #0b0d0e; }
.map-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 370px);
  background: #0b0e0f;
  border: 1px solid #3b413e;
  box-shadow: 0 35px 90px rgba(0, 0, 0, .28);
}
.map-viewport { display: flex; align-items: center; min-width: 0; overflow: hidden; background: #080b0c; }
.map-canvas { position: relative; width: 100%; aspect-ratio: 1672 / 941; isolation: isolate; }
.map-aerial { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 4, 5, .56), transparent 23%, transparent 73%, rgba(2, 4, 5, .72)),
              linear-gradient(90deg, rgba(2, 4, 5, .22), transparent 18%, transparent 83%, rgba(2, 4, 5, .25));
}
.map-mist {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .16;
  background: radial-gradient(ellipse 42% 19% at 24% 69%, #c4d0c7, transparent 80%),
              radial-gradient(ellipse 40% 15% at 78% 38%, #b6c2ba, transparent 82%);
  animation: map-mist-drift 24s ease-in-out infinite alternate;
}
@keyframes map-mist-drift { from { transform: translateX(-2%); } to { transform: translateX(3%); } }
.map-canvas-top, .map-canvas-bottom {
  position: absolute;
  z-index: 4;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #d8dcd6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-shadow: 0 2px 8px #000;
  pointer-events: none;
}
.map-canvas-top { top: 20px; }
.map-canvas-top b { color: #b6bdb5; font-weight: 500; }
.map-canvas-bottom { bottom: 17px; color: #a5ada5; }
.map-compass {
  position: absolute;
  z-index: 4;
  top: 58px;
  left: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #d6dbd4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-shadow: 0 1px 5px #000;
}
.map-compass i {
  display: block;
  margin-top: 4px;
  width: 1px;
  height: 28px;
  background: linear-gradient(#d9dcd6 55%, #9d2f31 55%);
}
/* Markers sit over actual districts in the aerial image, with a larger invisible tap target. */
.map-hotspot {
  position: absolute;
  z-index: 5;
  left: var(--x);
  top: var(--y);
  width: 38px;
  height: 38px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  color: #eff0e9;
}
.hotspot-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 2px solid #e5e9df;
  border-radius: 50%;
  background: #202b2a;
  box-shadow: 0 0 0 5px rgba(8, 12, 12, .78), 0 0 0 6px rgba(229, 233, 223, .48);
  transform: translate(-50%, -50%);
  transition: background .2s, box-shadow .2s, transform .2s;
}
.map-hotspot:hover .hotspot-core, .map-hotspot:focus-visible .hotspot-core {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 0 0 5px rgba(8, 12, 12, .85), 0 0 0 7px rgba(238, 242, 232, .7), 0 0 21px rgba(238, 242, 232, .8);
}
.map-hotspot.active .hotspot-core {
  background: #d53639;
  border-color: #f0dddd;
  box-shadow: 0 0 0 5px rgba(8, 12, 12, .82), 0 0 0 7px rgba(213, 54, 57, .88), 0 0 23px rgba(225, 47, 51, .75);
}
.map-hotspot.active .hotspot-core::after {
  content: "";
  position: absolute;
  inset: -13px;
  border: 1px solid rgba(220, 57, 61, .95);
  border-radius: 50%;
  animation: map-zone-pulse 2.8s ease-out infinite;
}
@keyframes map-zone-pulse { from { transform: scale(.65); opacity: .9; } to { transform: scale(1.55); opacity: 0; } }
.hotspot-name {
  position: absolute;
  left: 33px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 8px 6px 9px;
  border-left: 2px solid rgba(219, 225, 215, .65);
  background: rgba(8, 11, 12, .82);
  color: #dce1d8;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .11em;
  white-space: nowrap;
  text-shadow: 0 1px 4px #000;
  transition: background .2s, border-color .2s, color .2s;
}
.map-hotspot.active .hotspot-name, .map-hotspot:hover .hotspot-name, .map-hotspot:focus-visible .hotspot-name {
  border-color: #d53639;
  background: rgba(36, 10, 12, .94);
  color: #fff;
}
.map-hotspot[data-place="cemetery"] .hotspot-name { left: auto; right: 31px; top: -2px; }
.map-hotspot[data-place="forest"] .hotspot-name { left: auto; right: 33px; }
.map-swipe-hint { display: none; }
/* Case file panel */
.map-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  border-left: 1px solid #3b413e;
  background: linear-gradient(145deg, #171b1c, #0e1112 72%);
}
.map-info-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.map-info .mini-label, .map-overline { color: #c44a4b; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.map-signal { color: #8f9a90; font-size: 10px; font-weight: 800; letter-spacing: .13em; white-space: nowrap; }
.map-signal i { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: #b04346; vertical-align: 2px; }
.map-panel-body { transition: opacity .18s ease, transform .18s ease; }
.map-info.is-changing .map-panel-body { opacity: .28; transform: translateY(5px); }
.map-info-image { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 16px 0 20px; overflow: hidden; background: #202526; }
.map-info-image::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.68)); pointer-events: none; }
.map-info-image img { width: 100%; height: 100%; object-fit: cover; }
.map-info-image>span { position: absolute; z-index: 1; left: 12px; bottom: 9px; color: #e3e7df; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.map-info-copy h3 { margin: 8px 0 7px; font: 700 38px/.95 var(--heading); letter-spacing: .035em; }
.map-info-copy p { min-height: 44px; margin: 0 0 16px; color: #b4bdb5; font-size: 13px; line-height: 1.5; }
.map-detail-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; padding: 11px 0; border-top: 1px solid #353e39; }
.map-detail-row>span:first-child, .map-loot>span { color: #929d94; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.map-detail-row strong { color: #d7dad1; font-size: 11px; letter-spacing: .1em; }
.map-danger-meter { grid-column: 1 / -1; display: flex; gap: 4px; }
.map-danger-meter i { display: block; width: 33.3%; height: 4px; background: #303733; }
.map-danger-meter.low i:first-child { background: #9aa99d; }
.map-danger-meter.medium i:nth-child(-n+2) { background: #a76d57; }
.map-danger-meter.high i { background: #c43b3e; }
.map-loot { padding: 11px 0 14px; border-top: 1px solid #353e39; }
.map-loot ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 9px 0 0; padding: 0; }
.map-loot li { padding: 5px 7px; border: 1px solid #454f48; color: #d5dbd2; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.map-inspect { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; margin-top: auto; padding: 0 12px; border: 1px solid #a3393c; background: #772529; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .13em; transition: background .2s; }
.map-inspect:hover, .map-inspect:focus-visible { background: #a83236; }
.map-inspect span { font-size: 18px; font-weight: 400; }
.map-report { margin-top: 12px; padding: 13px; border-left: 2px solid #b53d3e; background: #202122; }
.map-report[hidden] { display: none; }
.map-report span { color: #d95355; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.map-report p { margin: 7px 0 0; color: #cad1c8; font-size: 12px; line-height: 1.5; }
/* Bottom severity key is part of the map, never a separate technical chart. */
.map-legend { grid-column: 1 / -1; display: flex; align-items: center; gap: 23px; min-height: 52px; padding: 12px 22px; border-top: 1px solid #3b413e; background: #111516; color: #a6aea5; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.map-legend-title { color: #d9dfd5; margin-right: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.legend-item i { display: inline-block; width: 13px; height: 4px; }
.legend-low { background: #9aa99d; }.legend-medium { background: #a76d57; }.legend-high { background: #c43b3e; }
.map-legend-count { margin-left: auto; color: #768078; white-space: nowrap; }
@media (max-width: 1280px) {
  .map-shell { grid-template-columns: 1fr; }
  .map-info { border-left: 0; border-top: 1px solid #3b413e; padding: 22px; }
  .map-panel-body { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(0, 1.1fr); column-gap: 24px; }
  .map-info-image { grid-column: 1; grid-row: 1 / 4; height: calc(100% - 16px); min-height: 250px; aspect-ratio: auto; margin: 16px 0 0; }
  .map-info-copy { grid-column: 2; grid-row: 1; padding-top: 16px; }
  .map-detail-row { grid-column: 2; grid-row: 2; }
  .map-loot { grid-column: 2; grid-row: 3; }
  .map-inspect { margin-top: 12px; }
}
@media (max-width: 900px) {
  .map-panel-body { display: block; }
  .map-info-image { height: auto; min-height: 0; max-height: 280px; aspect-ratio: 16 / 9; margin: 16px 0 20px; }
  .map-info-copy { padding-top: 0; }
  .map-info-copy h3 { font-size: 40px; }
  .map-info-copy p { min-height: 0; font-size: 14px; }
  .map-legend { flex-wrap: wrap; gap: 12px 20px; }
}
@media (max-width: 620px) {
  .map-viewport { display: block; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scrollbar-width: thin; scrollbar-color: #8b3a3d #101415; }
  .map-canvas { width: 720px; height: 405px; aspect-ratio: auto; }
  .map-canvas-top, .map-canvas-bottom { left: 15px; right: 15px; font-size: 9px; }
  .map-canvas-top span:last-child { display: none; }
  .map-compass { left: 15px; top: 54px; }
  .map-hotspot { width: 44px; height: 44px; }
  .hotspot-name { display: none; }
  .map-hotspot.active .hotspot-name, .map-hotspot:focus-visible .hotspot-name { display: block; top: -3px; left: 50%; right: auto; transform: translate(-50%, -100%); font-size: 10px; }
  .map-hotspot[data-place="cemetery"].active .hotspot-name { top: auto; bottom: -4px; transform: translate(-50%, 100%); }
  .map-swipe-hint { display: flex; justify-content: space-between; gap: 10px; margin: 0; padding: 10px 15px; background: #181d1d; color: #b7c0b6; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
  .map-swipe-hint span { color: #d24749; font-size: 15px; line-height: 1; }
  .map-info { padding: 16px; }
  .map-info-image { max-height: none; margin-top: 13px; }
  .map-info-copy h3 { font-size: 36px; }
  .map-info-copy p { font-size: 13px; }
  .map-legend { padding: 14px 16px; gap: 10px 15px; font-size: 9px; }
  .map-legend-title { width: 100%; margin: 0; }
  .map-legend-count { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .map-mist, .map-hotspot.active .hotspot-core::after { animation: none; }
  .map-panel-body, .hotspot-core, .hotspot-name { transition: none; }
}
