/* 전체 지도 (ui/map-atlas.js): kinds list on the left, the zoomable map on the right. */
.ma {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - 210px);
  min-height: 560px;
  /* keeps the map's own layers under the site's sticky header */
  isolation: isolate;
}
.ma-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.ma-search {
  padding: 12px 12px 8px;
}
.ma-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--n-50);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.ma-all,
.ma-floor {
  display: flex;
  gap: 6px;
  padding: 0 12px 8px;
}
.ma-all button,
.ma-floor button {
  flex: 1;
  min-height: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.ma-floor button[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.ma-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 6px 6px;
  border-top: 1px solid var(--line);
}
.ma-list h4 {
  margin: 12px 8px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.ma-row {
  display: grid;
  grid-template-columns: 18px 26px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 14px;
  cursor: pointer;
}
.ma-row:hover {
  background: var(--n-200);
}
.ma-row input {
  margin: 0;
  accent-color: var(--accent);
}
.ma-row small {
  min-width: 26px;
  padding: 1px 6px;
  border-radius: 9px;
  background: var(--n-200);
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}
.ma-row:has(input:not(:checked)) > span:not(.ma-ico) {
  color: var(--muted);
}
.ma-row:has(input:not(:checked)) .ma-ico {
  opacity: 0.45;
}
.ma-src {
  margin: 0;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}
/* An icon in a coloured disc: the list rows, the card and the markers share it. */
.ma-ico,
.ma-m {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: var(--c);
  color: #fff;
}
.ma-ico img,
.ma-m img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  pointer-events: none;
}
.ma-ico svg,
.ma-m svg {
  width: 72%;
  height: 72%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* The map */
.ma-view {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 50%, #1b2024 0%, #0c0e10 75%);
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.ma-view.grab {
  cursor: grabbing;
}
.ma-view:focus-visible {
  outline: 2px solid var(--accent);
}
.ma-stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  --inv: 1;
  --rot: 0deg;
}
.ma-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* The game's minimap is dark streets on clear; turned light so the streets read on the dark view. */
.ma-base.street {
  filter: invert(1) brightness(0.55);
}
/* The tunnel pictures are dark corridors with a green glow, drawn over the streets as in the game. */
.ma-base.tun,
.ma-base.rat {
  opacity: 0.45;
}
.ma[data-floor='street'] .ma-base.tun,
.ma[data-floor='street'] .ma-base.rat {
  opacity: 0;
}
.ma[data-floor='under'] .ma-base.street {
  opacity: 0.55;
}
.ma[data-floor='under'] .ma-base.tun,
.ma[data-floor='under'] .ma-base.rat {
  opacity: 1;
}
.ma-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.ma-zip {
  fill: none;
  stroke: var(--c);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.85;
}
.ma-tp,
.ma-jp {
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.ma-tp {
  stroke: #6cc4ff;
  stroke-dasharray: 6 5;
  opacity: 0.75;
}
.ma-jp {
  stroke: #9fd47a;
  marker-end: url(#ma-arrow);
  opacity: 0.8;
}
.ma-tp.on,
.ma-jp.on {
  stroke-width: 3.5;
  opacity: 1;
}
.ma-label {
  position: absolute;
  left: 50%;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(10, 12, 14, 0.75);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  transform: translate(-50%, 0) scale(var(--inv)) rotate(var(--rot));
  pointer-events: none;
}
.ma-label.top {
  top: 1%;
}
.ma-label.bottom {
  bottom: 1%;
  transform: translate(-50%, 0) scale(var(--inv)) rotate(var(--rot));
}
.ma-m {
  position: absolute;
  padding: 0;
  min-height: 0;
  transform: translate(-50%, -50%) scale(var(--inv)) rotate(var(--rot));
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  z-index: 2;
}
.ma-m.sm {
  width: 18px;
  height: 18px;
  border-width: 1.5px;
  z-index: 1;
}
.ma-m.big {
  width: 34px;
  height: 34px;
  z-index: 3;
}
/* Below street level: a dashed ring. */
.ma-m.u {
  border-style: dashed;
  border-color: #b9f0d6;
}
.ma-m b {
  position: absolute;
  right: -7px;
  top: -7px;
  min-width: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: #fff;
  color: #000;
  font-size: 10px;
  line-height: 14px;
}
.ma-m:hover,
.ma-m:focus-visible {
  z-index: 5;
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.ma-m.on {
  z-index: 6;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
/* Shown kinds, the floor and the search. */
.ma[data-floor='street'] .ma-m.u,
.ma[data-floor='under'] .ma-m:not(.u),
.ma[data-floor='under'] .ma-zip,
.ma.searching .ma-m.miss {
  display: none;
}
.ma[data-floor='all'] .ma-m.u {
  opacity: 0.8;
}
.ma.hide-guardian:not(.searching) .k-guardian,
.ma.hide-walker:not(.searching) .k-walker,
.ma.hide-base_guardian:not(.searching) .k-base_guardian,
.ma.hide-shrine:not(.searching) .k-shrine,
.ma.hide-patron:not(.searching) .k-patron,
.ma.hide-sentry:not(.searching) .k-sentry,
.ma.hide-camp-small:not(.searching) .k-camp-small,
.ma.hide-camp-medium:not(.searching) .k-camp-medium,
.ma.hide-camp-large:not(.searching) .k-camp-large,
.ma.hide-vault:not(.searching) .k-vault,
.ma.hide-bell:not(.searching) .k-bell,
.ma.hide-mid_boss:not(.searching) .k-mid_boss,
.ma.hide-urn:not(.searching) .k-urn,
.ma.hide-rift:not(.searching) .k-rift,
.ma.hide-powerup:not(.searching) .k-powerup,
.ma.hide-shop:not(.searching) .k-shop,
.ma.hide-secret-shop:not(.searching) .k-secret-shop,
.ma.hide-teleporter:not(.searching) .k-teleporter,
.ma.hide-teleporter .ma-tp,
.ma.hide-jump-pad:not(.searching) .k-jump-pad,
.ma.hide-jump-pad .ma-jp,
.ma.hide-rope:not(.searching) .k-rope,
.ma.hide-crate:not(.searching) .k-crate,
.ma.hide-tough:not(.searching) .k-tough,
.ma.hide-statue:not(.searching) .k-statue,
.ma.hide-snack:not(.searching) .k-snack,
.ma.hide-vent:not(.searching) .k-vent,
.ma.hide-veil:not(.searching) .k-veil,
.ma.hide-zipline [data-k='zipline'] {
  display: none;
}
.ma-m.k-secret-shop {
  border-color: #c49bff;
}

/* Over the map: tools, colour key, hover name, the picked marker's card. */
.ma-tools {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}
.ma-tools button {
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 25, 28, 0.92);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.ma-tools button:hover {
  border-color: var(--accent);
}
.ma.flipped [data-ma='flip'] {
  color: var(--accent);
}
.ma-legend {
  position: absolute;
  left: 10px;
  top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  max-width: calc(100% - 20px);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(10, 12, 14, 0.82);
  font-size: 12px;
  z-index: 10;
}
.ma-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: -1px;
}
.ma-tip {
  position: absolute;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(10, 12, 14, 0.94);
  border: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 11;
}
.ma-card {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 300px;
  max-width: calc(100% - 72px);
  max-height: calc(100% - 70px);
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(21, 25, 28, 0.97);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
  font-size: 13.5px;
  line-height: 1.55;
  z-index: 12;
  cursor: auto;
  user-select: text;
}
.ma-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 22px;
}
.ma-card-head b {
  display: block;
  font-size: 15.5px;
}
.ma-card-head small {
  color: var(--muted);
  font-size: 12px;
}
.ma-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.ma-card li {
  margin: 2px 0;
}
.ma-card p {
  margin: 8px 0 0;
}
.ma-photo {
  display: block;
  width: 100%;
  margin-top: 10px;
  border-radius: 6px;
}
.ma-x {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}
.ma.full {
  height: 100vh;
  padding: 10px;
  background: var(--bg);
  box-sizing: border-box;
}

@media (max-width: 820px) {
  .ma {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .ma-view {
    order: -1;
    height: 72vh;
    min-height: 360px;
  }
  .ma-list {
    max-height: 46vh;
  }
  .ma-card {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    width: auto;
    max-width: none;
    max-height: 55%;
  }
  .ma-legend {
    display: none;
  }
}
/* An open card sits where the legend is: the legend steps aside. */
.ma-view:has(.ma-card:not([hidden])) .ma-legend {
  display: none;
}
