  /* Apply extra side padding for mobile and PWA */
  body.mobile-mode .container,
  body.mobile-mode .container-fluid,
  body.mobile-mode .row,
  body.mobile-mode main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Discord button styles */
  .btn-discord {
    background-color: #5865F2;
    color: #fff;
    border: none;
    transition: background-color 0.2s ease-in-out;
  }

  .btn-discord:hover {
    background-color: #4752c4;
    color: #fff;
  }

  .btn-discord:focus {
    box-shadow: 0 0 0 0.2rem rgba(88, 101, 242, 0.5);
  }

  .btn-discord i {
    vertical-align: middle;
  }

  .navbar-brand {
    margin-right: 1%;
  }

  #userDropdown {
    color: white !important;
  }

  #userDropdown:hover,
  #userDropdown:focus {
    color: #9c9b8d !important;
  }

  .navbar-brand:hover .home-icon {
    opacity: 1 !important;
  }

  .home-icon {
    transition: opacity 0.3s ease;
    font-size: 1rem;
  }

  /* Bottom navigation styles */
  #pwaBottomNav {
    z-index: 1070 !important;
    position: fixed;
    bottom: 0;
    width: 100%;
    padding-bottom: max(env(safe-area-inset-bottom, 0), 10px);
  }

  #pwaBottomNav a {
    font-size: 1.0rem;
    color: #f8f9fa;
    text-decoration: none;
  }

  #pwaBottomNav a:hover {
    color: #ffc107; /* Bootstrap warning yellow */
  }


  /* Slide-up menu */
  #pwaSlideMenu {
    position: fixed;
    bottom: 56px;
    right: 0;
    width: 100%;
    max-width: 60vw;
    z-index: 1060;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    pointer-events: none;
  }

  #pwaSlideMenu.show {
    transform: translateY(0%);
    pointer-events: auto;
  }

  .menu-content {
    background-color: #212529;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.4);
    max-height: 50vh;
    overflow-y: auto;
    padding: 0.75rem 0.75rem;
    padding-bottom: 2.5rem;
  }

  .menu-content > div {
    padding: 0;
    margin: 0;
  }

  .menu-content .menu-section-header {
    background-color: #343a40;
    color: #f8f9fa;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 10px;
    margin-top: 0.5rem;
  }

  .menu-section-header-inner {
    padding: 0.5rem 0.75rem;
  }

  .menu-link {
    display: block;
    padding: 0.45rem 0.75rem;
    color: #dee2e6;
    text-decoration: none;
    font-weight: 500;
    border-radius: 12px;
    transition: background-color 0.2s ease;
  }

  .menu-link:hover {
    background-color: #544545;
    color: white;
  }

  .menu-section-header + .menu-link {
    margin-top: 0.5rem;
  }

  .menu-content::-webkit-scrollbar {
    width: 0;
    background: transparent;
  }

  /* Fade page transitions */
  body.fade-in {
    opacity: 0;
    transition: opacity 200ms ease-in;
  }

  body.fade-in.visible {
    opacity: 1;
  }

  body.fade-out {
    opacity: 0 !important;
    transition: opacity 200ms ease-in;
  }

  /* Lock scrolling */
  body.lock-scroll {
    overflow: hidden;
  }

  /* Ensure scrollableMain never traps modal */
  #scrollableMain {
    position: relative;
    z-index: auto;
  }


  /* Hide scrollbars in standalone PWA mode */
  .pwa-standalone {
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE and Edge */
  }

  .pwa-standalone::-webkit-scrollbar {
    display: none;              /* Chrome, Safari */
  }


  /* ===========================
     Modal + Backdrop Z-Index Fix
     =========================== */

  .modal {
    z-index: 1080 !important;
    position: fixed !important;
  }

  .modal-backdrop {
    z-index: 1075 !important;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
  }

  .modal.show {
    display: block;
    opacity: 1;
  }

  body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
    position: static !important;
  }