.ig-map .map-detail-container:has(.gameok-atlas-frame) {
  width: 100% !important;
  max-width: none !important;
  padding-inline: clamp(10px, 1.4vw, 26px);
}

.ig-map .map-detail-container:has(.gameok-atlas-frame) .map-detail-grid {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'heading' 'viewer' 'copy' 'purchases';
}

.ig-map .map-detail-grid > .map-section:has(> .gameok-atlas-frame):not(:is(:fullscreen, .atlas-expanded)) {
  block-size: max(580px, calc(100svh - var(--atlas-header-height, 140px) - 16px), var(--atlas-legend-height, 0px));
}

.ig-map .map-detail-grid > .map-section:has(> .gameok-atlas-frame) > .map-toolbar:not(:has(.map-fullscreen-toggle:not([hidden]))) {
  display: none;
}

.ig-map .map-detail-grid .map-section > .gameok-atlas-frame {
  display: block;
  flex: 1 1 0;
  width: 100%;
  height: auto;
  min-height: 0;
  border: 1px solid #303741;
  border-radius: 13px;
  background: #0c0e12;
}

.atlas-page-legend #filters > :is(.sidebar-head, .groups) { flex-shrink: 0; }
.atlas-page-legend #filters > .groups { overflow: visible; overscroll-behavior: auto; }

.ig-map .map-detail-grid .map-section:is(:fullscreen, .atlas-expanded) > .gameok-atlas-frame,
.ig-map .map-detail-grid .map-section > .gameok-atlas-frame:fullscreen {
  border: 0;
  border-radius: 0;
}

.ig-map .map-detail-grid > .map-section.atlas-expanded {
  position: fixed;
  inset: 0;
  z-index: 2000;
  block-size: 100dvh;
  background: #0c0e12;
}

html:has(.ig-map .map-section.atlas-expanded) { overflow: hidden; }

.ig-map .map-detail-grid:has(.gameok-atlas-frame) .map-purchases {
  padding-top: 16px;
  border-top: 1px solid #303741;
}

.ig-map .map-detail-grid:has(.gameok-atlas-frame) .map-purchase-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  text-align: start;
  text-decoration: none;
  border: 1px solid #303741;
  border-radius: 14px;
  background: #15191f;
  box-shadow: none;
}

.ig-map .map-detail-grid:has(.gameok-atlas-frame) .map-purchase-cover {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1c222a;
}

.ig-map .map-detail-grid:has(.gameok-atlas-frame) .map-purchase-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ig-map .map-detail-grid:has(.gameok-atlas-frame) .map-purchase-cover img[hidden] { display: none; }
.ig-map .map-detail-grid:has(.gameok-atlas-frame) .map-purchase-cover:has(img[hidden]) {
  background: linear-gradient(140deg, #263124, #15191f);
}

.ig-map .map-detail-grid:has(.gameok-atlas-frame) .map-purchase-title,
.ig-map .map-detail-container:has(.gameok-atlas-frame) .mini-title {
  display: -webkit-box;
  block-size: 4.05em;
  margin: 10px 12px 12px;
  padding: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #f1f4f1;
  text-align: start;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.ig-map .map-detail-container:has(.gameok-atlas-frame) :is(.other-maps-grid, .map-purchases-track) {
  --atlas-tile-min: 166px;
  display: grid;
  grid-template-columns: repeat(var(--atlas-tile-columns, auto-fill), minmax(min(100%, var(--atlas-tile-min)), 1fr));
  grid-auto-flow: row;
  grid-auto-columns: auto;
  gap: 12px;
  min-width: 0;
  padding-bottom: 0;
  overflow: visible;
  scroll-snap-type: none;
}

.ig-map .map-detail-container:has(.gameok-atlas-frame) .other-maps-grid .mini-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #303741;
  border-radius: 14px;
  background: #15191f;
  box-shadow: none;
  text-decoration: none;
  transform: none;
}

.ig-map .map-detail-container:has(.gameok-atlas-frame) :is(.mini-card, .map-purchase-card)[hidden] { display: none; }
.ig-map .map-detail-container:has(.gameok-atlas-frame) .mini-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #1c222a;
}

.ig-map .map-detail-container:has(.gameok-atlas-frame) :is(.map-purchase-card, .mini-card):is(:hover, :focus-visible) {
  border-color: #d1ff75;
}

.ig-map .map-detail-container:has(.gameok-atlas-frame) :is(.map-purchase-card, .mini-card):is(:hover, :focus-visible) :is(.map-purchase-title, .mini-title) {
  color: #d1ff75;
}

.ig-map .map-detail-grid:has(.gameok-atlas-frame) .gameok-point-details {
  overflow-wrap: anywhere;
  scroll-margin-top: calc(var(--atlas-header-height, 85px) + 10px);
}

.ig-map .map-detail-grid:has(.gameok-atlas-frame) .point-facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
}

.ig-map .map-detail-grid:has(.gameok-atlas-frame) .point-facts dd { margin: 0; }
.ig-map .map-detail-grid:has(.gameok-atlas-frame) .point-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ig-map .map-detail-grid:has(.gameok-atlas-frame) .point-card :is(button, .point-source) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 12px;
}
.ig-map .map-detail-grid:has(.gameok-atlas-frame) .point-card button {
  border: 1px solid #303741;
  border-radius: 9px;
  background: #1c222a;
  color: #f1f4f1;
  font: inherit;
  cursor: pointer;
}

.topbar > .atlas-fullscreen-toggle {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  margin-inline-start: auto;
  padding: 0 12px;
  border: 1px solid var(--ig-line);
  border-radius: var(--ig-radius);
  background: var(--ig-raised);
  color: var(--ig-text);
  font: 700 14px var(--ig-font);
}

.topbar > .atlas-fullscreen-toggle:hover { background: var(--ig-hover); }
.topbar > .atlas-fullscreen-toggle[aria-pressed='true'] { border-color: var(--ig-accent); color: var(--ig-accent); }
.topbar > .atlas-fullscreen-toggle + .languages { margin-inline-start: 0; }

.atlas-marker-sheet {
  position: fixed;
  inset: auto max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  box-sizing: border-box;
  width: min(460px, calc(100% - 24px));
  max-height: min(65svh, 520px);
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #303741;
  border-radius: 16px;
  background: #15191f;
  color: #f1f4f1;
  font: 400 15px/1.45 var(--ig-font, Mulish, Arial, sans-serif);
  color-scheme: dark;
}

.atlas-marker-sheet[open] { display: flex; flex-direction: column; }
.atlas-marker-sheet::backdrop { background: #0c0e1299; }
.atlas-marker-sheet-body { overflow: auto; overscroll-behavior: contain; padding: 15px 58px 16px 16px; }
.atlas-marker-sheet h2 { margin: 4px 0 8px; padding: 0; font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.atlas-marker-sheet p { margin: 0 0 8px; overflow-wrap: anywhere; }
.atlas-marker-sheet .point-category { color: #d1ff75; font-size: 13px; font-weight: 750; }
.atlas-marker-sheet .point-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 5px 10px; margin: 8px 0; }
.atlas-marker-sheet .point-facts :is(dt, dd) { margin: 0; overflow-wrap: anywhere; }
.atlas-marker-sheet .point-source { display: inline-flex; align-items: center; min-height: 44px; color: #d1ff75; }
.atlas-marker-sheet button {
  min-width: 44px;
  min-height: 44px;
  padding: 5px 10px;
  border: 1px solid #303741;
  border-radius: 10px;
  background: #1c222a;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.atlas-marker-sheet button[aria-pressed='true'] { border-color: #d1ff75; color: #d1ff75; }
.atlas-marker-sheet-close { position: absolute; z-index: 1; inset: 9px 9px auto auto; }

@media (max-width: 700px) {
  .ig-map .map-detail-grid > .map-section:has(> .gameok-atlas-frame):not(:is(:fullscreen, .atlas-expanded)) {
    block-size: max(420px, calc(100svh - var(--atlas-header-height, 140px) - 12px), var(--atlas-legend-height, 0px));
  }
  .topbar > .atlas-fullscreen-toggle { padding: 0; font-size: 0; }
  .topbar > .atlas-fullscreen-toggle::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background:
      linear-gradient(currentColor, currentColor) left top / 6px 2px,
      linear-gradient(currentColor, currentColor) left top / 2px 6px,
      linear-gradient(currentColor, currentColor) right top / 6px 2px,
      linear-gradient(currentColor, currentColor) right top / 2px 6px,
      linear-gradient(currentColor, currentColor) left bottom / 6px 2px,
      linear-gradient(currentColor, currentColor) left bottom / 2px 6px,
      linear-gradient(currentColor, currentColor) right bottom / 6px 2px,
      linear-gradient(currentColor, currentColor) right bottom / 2px 6px;
    background-repeat: no-repeat;
    vertical-align: middle;
  }
}

@media (max-width: 410px) {
  .topbar:has(> .atlas-fullscreen-toggle) { gap: 6px; }
  .topbar:has(> .atlas-fullscreen-toggle) .mobile-filters { min-width: 44px; }
  .topbar:has(> .atlas-fullscreen-toggle) .mobile-filters span { display: none; }
}

@media (max-width: 520px) {
  .ig-map .map-detail-container:has(.gameok-atlas-frame) :is(.other-maps-grid, .map-purchases-track) {
    --atlas-tile-min: 145px;
  }
}
