/* Space 2047 HD Edition v5.36.0 — lower action-map layout and waypoint message spacing. */

/* Keep the mission objective strip at the top centre. */
#s2047-mwo-hud {
  top: max(10px, env(safe-area-inset-top)) !important;
  bottom: auto !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
}

/* Place Local Map immediately to the left of the labelled action controls. */
.s2047-minimap-wrap,
#s2047-minimap-wrap {
  top: auto !important;
  bottom: max(18px, env(safe-area-inset-bottom)) !important;
  right: calc(max(18px, env(safe-area-inset-right)) + 262px) !important;
  margin: 0 !important;
  z-index: 2147482150 !important;
}

/* Each waypoint notification receives a stack index from the companion script,
   so simultaneous messages rise into separate rows instead of covering one another. */
.s2047-mwo-toast {
  bottom: calc(max(92px, env(safe-area-inset-bottom) + 92px) + (var(--s2047-waypoint-stack, 0) * 54px)) !important;
  transition: opacity .35s, transform .35s, bottom .18s ease !important;
}

@media (max-width: 899px), (pointer: coarse) {
  .s2047-minimap-wrap,
  #s2047-minimap-wrap {
    width: 92px !important;
    padding: 5px !important;
    right: calc(max(10px, env(safe-area-inset-right)) + min(244px, 49vw) + 10px) !important;
    bottom: max(14px, env(safe-area-inset-bottom)) !important;
  }
  .s2047-minimap-wrap canvas,
  #s2047-minimap-wrap canvas {
    width: 80px !important;
    height: 80px !important;
  }
  .s2047-minimap-wrap span,
  #s2047-minimap-wrap span {
    font-size: 8px !important;
    padding-top: 3px !important;
  }
}

@media (max-width: 560px) {
  .s2047-minimap-wrap,
  #s2047-minimap-wrap {
    width: 76px !important;
    right: calc(max(8px, env(safe-area-inset-right)) + min(228px, 49vw) + 7px) !important;
  }
  .s2047-minimap-wrap canvas,
  #s2047-minimap-wrap canvas {
    width: 64px !important;
    height: 64px !important;
  }
  .s2047-mwo-toast {
    max-width: calc(100vw - 20px) !important;
    border-radius: 14px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .s2047-mwo-toast { transition: none !important; }
}
