/*
 * Mobile fixes, loaded on every logged-in page.
 *
 * Plain CSS on purpose: the site's Tailwind stylesheet is precompiled, so any
 * utility class it didn't already contain would silently do nothing.
 */

/* The phone header held logo + server/local clocks + language + bell + avatar
   + hamburger (~460px) on a ~390px screen, pushing the hamburger off the right
   edge where it couldn't be tapped. The clocks are already in the desktop
   header and the language switcher is also inside the slide-out menu, so on
   small screens those step aside and the hamburger always stays reachable. */
@media (max-width: 1023px) {
  #mobile-menu-toggle {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .mobile-header-clock {
    display: none !important;
  }
}

@media (max-width: 359px) {
  .mobile-header-lang {
    display: none !important;
  }
}

/* Slide-out menu: scroll inside itself on short screens so the last links
   (Withdrawals, Transactions, Referrals...) are always reachable, and stop the
   page behind it from scrolling while it's open. */
#mobile-sidebar {
  height: 100vh;
  height: 100dvh;
  max-width: 85vw;
}
#mobile-sidebar > nav,
#mobile-sidebar .mobile-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
body.mobile-menu-open {
  overflow: hidden;
  touch-action: none;
}
body.mobile-menu-open #mobile-sidebar {
  touch-action: pan-y;
}

/* Comfortable tap targets for the menu links on touch screens. */
@media (max-width: 1023px) {
  #mobile-sidebar a,
  #mobile-sidebar .submenu-toggle {
    min-height: 44px;
  }
}
