/* Space 2047 HD Edition v5.35.0 — top HUD alignment repair.
   Local Map sits immediately left of Options; mission objectives sit top-centre. */

/* Right-hand top controls form one clear row: [Local Map] [Options]. */
.s2047-minimap-wrap,
#s2047-minimap-wrap {
  top: max(10px, env(safe-area-inset-top)) !important;
  right: max(82px, calc(env(safe-area-inset-right) + 82px)) !important;
  margin: 0 !important;
}

/* The active mission/objective strip belongs at the top centre, not above
   the lower action controls. */
#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;
  width: min(540px, calc(100vw - 470px)) !important;
  max-width: 540px !important;
}

/* Keep expanded missions usable without covering the lower controls. */
#s2047-mwo-hud .s2047-mwo-list {
  max-height: min(52vh, 430px) !important;
}

@media (max-width: 1050px) {
  .s2047-minimap-wrap,
  #s2047-minimap-wrap {
    width: 122px !important;
    padding: 6px !important;
  }
  .s2047-minimap-wrap canvas,
  #s2047-minimap-wrap canvas {
    width: 108px !important;
    height: 108px !important;
  }
  #s2047-mwo-hud {
    width: min(440px, calc(100vw - 385px)) !important;
  }
}

/* Tablet and phone: preserve the same order while giving the mission strip
   its own centred row beneath the two top-right controls. */
@media (max-width: 760px) {
  .s2047-minimap-wrap,
  #s2047-minimap-wrap {
    top: max(8px, env(safe-area-inset-top)) !important;
    right: max(78px, calc(env(safe-area-inset-right) + 78px)) !important;
    width: 86px !important;
    padding: 5px !important;
    border-radius: 12px !important;
  }
  .s2047-minimap-wrap canvas,
  #s2047-minimap-wrap canvas {
    width: 74px !important;
    height: 74px !important;
  }
  .s2047-minimap-wrap span,
  #s2047-minimap-wrap span {
    font-size: 8px !important;
    padding-top: 3px !important;
  }
  #s2047-mwo-hud {
    top: max(104px, calc(env(safe-area-inset-top) + 104px)) !important;
    width: min(620px, calc(100vw - 20px)) !important;
    max-width: none !important;
  }
}

@media (max-width: 430px) {
  #s2047-mwo-hud {
    top: max(100px, calc(env(safe-area-inset-top) + 100px)) !important;
  }
}
