/* Give the complete sect map more room. The existing 941 x 1672 artwork,
   SVG labels and building hit shapes share this one untransformed rectangle. */
html[data-ui-theme="teal-cloud-a"] #game-root .page-panel.sect-page.is-scene-mode[data-sect-page-type="sect"] {
  padding: 8px 18px;
  gap: 0;
}

html[data-ui-theme="teal-cloud-a"] #game-root .page-panel.sect-page.is-scene-mode[data-sect-page-type="sect"] > .feature-page-heading {
  box-sizing: border-box;
  min-height: 54px;
  margin: 0 0 6px;
  padding: 4px 12px;
}

html[data-ui-theme="teal-cloud-a"] #game-root .page-panel.sect-page.is-scene-mode[data-sect-page-type="sect"] .sect-scene-view.has-scene-map {
  display: grid;
  place-items: start center;
  min-height: 0;
  container-type: size;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Older WebViews keep the complete image scrollable at its native ratio. */
html[data-ui-theme="teal-cloud-a"] #game-root .page-panel.sect-page.is-scene-mode[data-sect-page-type="sect"] .sect-scene.has-scene-map {
  box-sizing: border-box;
  width: 100%;
  max-width: 540px;
  height: auto;
  min-height: 0;
  aspect-ratio: 941 / 1672;
  flex-shrink: 0;
  border: 0;
  outline: 1px solid rgba(194, 151, 70, .32);
  outline-offset: -1px;
}

@supports (width: 1cqh) {
  html[data-ui-theme="teal-cloud-a"] #game-root .page-panel.sect-page.is-scene-mode[data-sect-page-type="sect"] .sect-scene.has-scene-map {
    width: min(100%, calc(100cqh * 941 / 1672));
  }
}

/* Pre-aspect-ratio WebViews still need a real height for the absolute layers. */
@supports not (aspect-ratio: 941 / 1672) {
  html[data-ui-theme="teal-cloud-a"] #game-root .page-panel.sect-page.is-scene-mode[data-sect-page-type="sect"] .sect-scene.has-scene-map::before {
    content: "";
    display: block;
    padding-top: 177.68331562%;
    pointer-events: none;
  }
}

html[data-ui-theme="teal-cloud-a"] #game-root .page-panel.sect-page.is-scene-mode[data-sect-page-type="sect"] .sect-scene.has-scene-map .sect-scene-background {
  display: block;
  object-fit: contain;
}
