/* BOOM_SUDOWOODO_OVERLAY_V14
   Force every Sudowoodo dialog to be a true viewport overlay,
   never normal-flow content below the WORLD canvas. */

#boom-sudo-v13,
#boom-sudo-hard-modal,
#boom-sudo-choice {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;

  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100vh !important;

  margin: 0 !important;
  padding: 16px !important;

  align-items: center !important;
  justify-content: center !important;

  z-index: 2147483000 !important;

  background: rgba(2, 8, 14, .82) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;

  box-sizing: border-box !important;
  overflow: auto !important;
  overscroll-behavior: contain !important;
}

#boom-sudo-v13.show,
#boom-sudo-hard-modal.show,
#boom-sudo-choice.show {
  display: flex !important;
}

/* Keep the actual card above every WORLD layer too. */
#boom-sudo-v13 > *,
#boom-sudo-hard-modal > *,
#boom-sudo-choice > * {
  position: relative !important;
  z-index: 2147483001 !important;
  max-height: calc(100dvh - 32px) !important;
  overflow: auto !important;
}

/* WORLD should not visually sit above the story encounter. */
body.world-layer-open #world-shell,
body.world-layer-open .world-shell,
body.world-layer-open #world-stage,
body.world-layer-open .world-stage,
body.world-layer-open canvas {
  isolation: auto;
}

@media (max-width: 620px) {
  #boom-sudo-v13,
  #boom-sudo-hard-modal,
  #boom-sudo-choice {
    padding: 10px !important;
  }

  #boom-sudo-v13 > *,
  #boom-sudo-hard-modal > *,
  #boom-sudo-choice > * {
    width: min(96vw, 520px) !important;
    max-height: calc(100dvh - 20px) !important;
  }
}
