.atlas {
  color: var(--vice-text, #fff4ee);
  --atlas-surface: var(--vice-panel, #211827);
  --atlas-border: var(--vice-line, #56394c);
  --atlas-muted: var(--vice-muted, #d2bdcb);
}

.atlas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(285px, 1fr);
  gap: clamp(14px, 2.4vw, 30px);
  align-items: start;
}

.atlas-map-column,
.atlas-browser { min-width: 0; }

.atlas-map {
  position: relative;
  isolation: isolate;
  height: clamp(480px, 66dvh, 740px);
  overflow: hidden;
  border: 1px solid #6e94af;
  border-radius: 22px;
  background: #2b639b;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.atlas-map.atlas-dragging { cursor: grabbing; }

.atlas-map[data-view="3d"] {
  border-color: #574f73;
  background: radial-gradient(ellipse at 58% 29%, #35476a, #211930 66%, #151123);
}

.atlas-basemap {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  max-width: none;
  width: 1008px;
  height: 1536px;
  transform-origin: left top;
  pointer-events: none;
}

.atlas-map[data-view="3d"] .atlas-basemap {
  border-radius: 10px;
  outline: 2px solid #c3eaff8c;
  box-shadow: 0 22px 0 #203d64, 0 30px 0 #182c4b, 6px 48px 45px #0a081ec9;
  filter: saturate(1.14) contrast(1.045);
}

.atlas-pin-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.atlas-pin,
.atlas-result {
  --atlas-marker: #ede5ec;
}

.atlas [data-kind="egg"] { --atlas-marker: #ff9aab; }
.atlas [data-kind="mission"] { --atlas-marker: #f9bf7e; }
.atlas [data-kind="vehicle"] { --atlas-marker: #a3f3dd; }
.atlas [data-kind="weapon"] { --atlas-marker: #adccff; }
.atlas [data-kind="clothing"] { --atlas-marker: #edc1ff; }
.atlas [data-kind="group"] { --atlas-marker: #faf0e1; }

.atlas-pin {
  position: absolute;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 2px solid #fff8ef;
  border-radius: 50%;
  background: var(--atlas-marker);
  box-shadow: 0 3px 12px #10172cb0;
  color: #22182b;
  font: 800 1.25rem/1 system-ui, sans-serif;
  cursor: pointer;
  pointer-events: auto;
}

.atlas-pin[aria-pressed="true"] {
  z-index: 2;
  box-shadow: 0 0 0 4px #261634, 0 0 0 7px #fff8f3;
}

.atlas-pin[data-kind="group"] { font-size: 1rem; }
.atlas-map[data-view="3d"] .atlas-pin:not([aria-pressed="true"]) { box-shadow: 0 4px 0 #17243eb0, 0 7px 12px #10172c98; }
.atlas-pin:hover,
.atlas-pin:focus-visible { z-index: 3; }
.atlas-dragging .atlas-pin { pointer-events: none; }

.atlas-controls {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 14px;
  display: grid;
  overflow: hidden;
  border: 1px solid #f5d8e66e;
  border-radius: 12px;
  box-shadow: 0 5px 17px #1821386b;
}

.atlas-controls button {
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  background: #26192b;
  color: #fff1ed;
  font: 650 24px/1 system-ui, sans-serif;
  cursor: pointer;
}

.atlas-controls button + button { border-top: 1px solid #f5d8e644; }
.atlas-controls button:hover { background: #59334d; }
.atlas-controls button:disabled { color: #bb9eae; cursor: default; }
.atlas-controls button:focus-visible { outline-offset: -4px; }

.atlas-view-control {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 14px;
  display: flex;
  padding: 3px;
  border: 1px solid #f5d8e66e;
  border-radius: 12px;
  background: #26192b;
  box-shadow: 0 5px 17px #1821386b;
}

.atlas-view-control button {
  min-width: 46px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: #fff1ed;
  font: 750 0.9rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.atlas-view-control button:hover { background: #59334d; }
.atlas-view-control button[aria-pressed="true"] { background: var(--vice-accent, #a3f3dd); color: #112728; }
.atlas-view-control button:focus-visible { outline-offset: -4px; }

.atlas-map-label,
.atlas-skip {
  position: absolute;
  bottom: 14px;
  z-index: 4;
  border-radius: 9px;
  color: #fff4ef;
  background: #26192beb;
  font-size: 0.78rem;
  line-height: 1.25;
}

.atlas-map-label { right: 14px; padding: 7px 10px; }
.atlas-skip { left: 14px; display: none; padding: 13px 12px; text-decoration: none; }

.atlas-caption {
  display: grid;
  gap: 2px;
  padding: 8px 4px;
  color: var(--atlas-muted);
  font-size: 0.79rem;
}

.atlas-caption p { margin: 0; }
.atlas-license summary { cursor: pointer; width: fit-content; }
.atlas-license span { overflow-wrap: anywhere; }

.atlas-browser {
  max-height: clamp(480px, 66dvh, 740px);
  overflow: auto;
  scrollbar-color: var(--atlas-border) var(--atlas-surface);
  border: 1px solid var(--atlas-border);
  border-radius: 22px;
  background: var(--atlas-surface);
}

.atlas-lookup {
  display: grid;
  gap: 7px;
  padding: 19px 17px 15px;
  border-bottom: 1px solid var(--atlas-border);
}

.atlas-lookup label { font-weight: 700; }
.atlas-lookup .atlas-filter-label { font-size: 0.83rem; color: var(--atlas-muted); margin-top: 4px; }

.atlas-lookup input,
.atlas-lookup select,
.atlas-share-url {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--atlas-border);
  border-radius: 10px;
  padding: 8px 11px;
  color: var(--vice-text, #fff4ee);
  background: var(--vice-bg, #211221);
  color-scheme: dark;
  font: inherit;
  font-size: 16px;
}

.atlas-lookup input::placeholder { color: var(--atlas-muted); }
.atlas-results-status { margin: 14px 17px 6px; color: var(--atlas-muted); font-size: 0.86rem; }

.atlas-results {
  margin: 0;
  padding: 0 10px 10px;
  list-style: none;
}

.atlas-result {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 60px;
  margin: 2px 0;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 8px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.atlas-result:hover,
.atlas-result[aria-pressed="true"] {
  border-color: var(--atlas-border);
  background: var(--vice-bg, #211221);
}

.atlas-result-icon {
  display: grid;
  flex: 0 0 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #201628;
  background: var(--atlas-marker);
  font: 700 1rem/1 system-ui, sans-serif;
}

.atlas-result-text { display: grid; gap: 2px; min-width: 0; }
.atlas-result strong { line-height: 1.2; }
.atlas-result small { color: var(--atlas-muted); font-size: 0.79rem; line-height: 1.35; }

.atlas-detail:not([hidden]) {
  display: grid;
  gap: 8px;
  margin: 12px;
  padding: 10px 14px 14px;
  scroll-margin: 12px;
  border: 1px solid var(--atlas-border);
  border-radius: 14px;
  background: var(--vice-bg, #211221);
}

.atlas-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.atlas-detail h2 { margin: 0; font-size: clamp(1.08rem, 3vw, 1.4rem); line-height: 1.2; }
.atlas-detail p { margin: 0; }
.atlas-location { color: var(--atlas-muted); font-size: 0.88rem; }
.atlas-accuracy { color: var(--vice-accent, #ffb39e); font-size: 0.8rem; font-weight: 680; }
.atlas-summary { font-size: 0.92rem; }

.atlas-dismiss,
.atlas-guide,
.atlas-share {
  display: inline-grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--atlas-border);
  border-radius: 9px;
  padding: 6px 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}

.atlas-guide { background: var(--vice-accent, #ffb39e); color: #200f22; }
.atlas-dismiss { min-width: 44px; flex-shrink: 0; font-size: 1.25rem; }
.atlas-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.atlas-share-message { color: var(--atlas-muted); font-size: 0.8rem; }
.atlas-share-message:has(input) { width: 100%; }
.atlas-map-error { position: absolute; inset: 30% 15% auto; padding: 12px; border-radius: 12px; background: #211221; color: white; }

.atlas :focus-visible {
  outline: 3px solid #fff2ac;
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .atlas-layout { grid-template-columns: minmax(0, 1fr); }
  .atlas-map { height: clamp(365px, 63dvh, 620px); border-radius: 16px; }
  .atlas-browser { max-height: none; overflow: visible; border-radius: 16px; }
  .atlas-skip { display: inline-block; }
}

@media (pointer: coarse) {
  .atlas-map { overscroll-behavior: contain; }
}
