/* Five shortcuts. Preserve the existing side-column axes, divide the span
   between them into four equal intervals. Kept last to override older grids. */
/* Reserve a separate central scroll area above the shortcuts. Long menus
   remain reachable without putting their last action behind Laboratory. */
html.main-menu-view-active:not(.game-view-active) #mainMenuScreen > .main-menu__stack {
  position: fixed !important;
  top: clamp(96px, 27vh, 220px) !important;
  bottom: calc(clamp(24px, 5vh, 48px) + 162px) !important;
  left: 50%;
  grid-area: auto !important;
  align-self: stretch !important;
  justify-self: auto !important;
  translate: -50% 0;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #b6a16a transparent;
  overscroll-behavior: contain;
}
@media (orientation: landscape) and (max-height: 520px) {
  html.main-menu-view-active:not(.game-view-active) #mainMenuScreen > .main-menu__stack {
    top: max(8px, env(safe-area-inset-top, 0px)) !important;
    bottom: calc(max(12px, env(safe-area-inset-bottom, 0px)) + 102px) !important;
    padding: 8px;
    width: min(380px, 48vw);
  }
  html.main-menu-view-active:not(.game-view-active) #mainMenuScreen .main-menu__modes {
    gap: 6px;
  }
  html.main-menu-view-active:not(.game-view-active) #mainMenuScreen .main-menu__player-profile {
    min-height: 44px;
    padding: 4px 8px;
  }
  html.main-menu-view-active:not(.game-view-active) #mainMenuScreen .main-menu__footer--five .menu-btn__footer-img {
    width: 64px !important;
    height: 64px !important;
    object-fit: contain;
  }
  html.main-menu-view-active:not(.game-view-active) #mainMenuScreen .main-menu__footer--five .menu-btn__footer-label {
    font-size: 12px;
    line-height: 16px;
    margin-top: 0;
  }
}
html.main-menu-view-active:not(.game-view-active) .main-menu__footer--five {
  position: fixed;
  left: calc(clamp(12px, 3.5vw, 36px) + clamp(150px, 18vw, 210px) / 2);
  right: calc(clamp(12px, 3.5vw, 36px) + 4px + clamp(108px, 18vw, 136px) / 2);
  bottom: clamp(24px, 5vh, 48px);
  width: auto;
  height: 180px;
  display: block;
  padding: 0;
  margin: 0;
  z-index: 250;
  pointer-events: none;
}
html.main-menu-view-active:not(.game-view-active) .main-menu__footer--five > :is(#rankingBtn, #laboratoryBtn, #chestsBtn, .main-menu__inventory-slot) {
  position: absolute !important;
  bottom: 0;
  width: clamp(108px, 18vw, 136px);
  min-width: 0;
  margin: 0;
  translate: -50% 0;
  pointer-events: auto;
}
html.main-menu-view-active:not(.game-view-active) .main-menu__footer--five > #rankingBtn { left: 25%; }
html.main-menu-view-active:not(.game-view-active) .main-menu__footer--five > #laboratoryBtn { left: 50%; }
html.main-menu-view-active:not(.game-view-active) .main-menu__footer--five > #chestsBtn { left: 75%; }
html.main-menu-view-active:not(.game-view-active) .main-menu__footer--five > .main-menu__inventory-slot { left: 100%; }
.main-menu__footer--five #laboratoryBtn {
  grid-column: 3;
  justify-self: center;
  align-items: center;
  gap: clamp(6px, 1vh, 10px);
}
.main-menu__footer--five #laboratoryBtn .menu-btn__footer-img {
  height: auto;
  display: block;
  margin-inline: auto;
}
/* Mobile retains the side wrappers (and their notch/column offsets). */
html.main-menu-view-active:not(.game-view-active):is(.mobile-scroll, .native-app) .main-menu__footer--five {
  left: calc(max(8px, env(safe-area-inset-left, 0px)) + 8px + clamp(68px, 14vw, 96px) / 2);
  right: calc(clamp(14px, 3vw, 28px) + 52px);
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  transform: none !important;
  animation: none;
}
html.main-menu-view-active:not(.game-view-active):is(.mobile-scroll, .native-app) .main-menu__footer--five .main-menu__footer-left {
  position: absolute;
  left: 0;
  bottom: 0;
  margin: 0 !important;
  translate: -50% 0;
  pointer-events: auto;
}
html:is(.mobile-scroll, .native-app) .main-menu__footer--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(2px, 1vw, 8px);
}
html:is(.mobile-scroll, .native-app) .main-menu__footer--five #chestsBtn { grid-column: 4; }
html:is(.mobile-scroll, .native-app) .main-menu__footer--five .main-menu__inventory-slot { grid-column: 5; }
html:is(.mobile-scroll, .native-app) .main-menu__footer--five > :is(#rankingBtn, #laboratoryBtn, #chestsBtn) {
  width: 100%;
  min-width: 0;
}
html:is(.mobile-scroll, .native-app) .main-menu__footer--five > :is(#rankingBtn, #laboratoryBtn, #chestsBtn) .menu-btn__footer-img {
  max-width: 100%;
}
