/* Home viewport lock v153: the main artwork must stay fixed while the home screen is open. */
html:has(body.home-mode) {
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.home-mode {
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  overscroll-behavior: none !important;
}

body.home-mode .app-shell {
  display: flex !important;
  flex-direction: column !important;
  width: min(100%, 941px) !important;
  height: calc(100dvh - var(--bottom-nav-h, 76px)) !important;
  min-height: 0 !important;
  max-height: calc(100dvh - var(--bottom-nav-h, 76px)) !important;
  padding: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.home-mode .guild-hud {
  flex: 0 0 auto !important;
}

body.home-mode #hero.active {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) !important;
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.home-mode .home-hero-stage {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.home-mode .bottom-tabs {
  position: fixed !important;
  z-index: 300 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  transform: none !important;
}

/* The world map keeps only its standalone back arrow; the old sticky title plaque is removed. */
#battle.active .location-world-copy {
  display: none !important;
}

#battle.active .location-world-back {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  z-index: 12 !important;
  margin: 0 !important;
}
