/* ============================================
   CRITICAL MOBILE FIXES
   Additional layer to ensure perfect mobile display
   ============================================ */

/* Prevent horizontal scroll at all costs */
html {
  width: 100%;
  scroll-behavior: smooth;
  /* NO position:relative - it breaks sticky! */
  /* NO overflow-x here either - mixed with body's overflow-x: hidden
     it makes <html> its own scroll container and breaks sticky too! */
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  /* NO position:relative - it breaks sticky! */
}

/* Ensure all major containers respect viewport */
/* NOTE: "nav" is intentionally excluded here. Giving a <nav> element
   overflow-x: hidden makes its overflow-y auto-compute to "auto" (per the
   CSS overflow spec), turning it into a clipping/scroll container. Since
   the header's dropdown submenu (.menu-aba2) is a descendant of
   .thumbnail_lower_c144 (a <nav>), it was getting clipped and forced into a tiny
   internal scrollbar instead of opening naturally below the nav link. */
main,
section,
article,
footer {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header must NOT have max-width restriction for sticky to work */
header.sidebar-338b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".row-focused-e31a" is intentionally excluded here for the same reason as
   "nav" above — the header's <div class="container"> wraps the nav and
   must not clip the dropdown submenu with an auto-computed overflow-y.
   It's already width-capped via max-width in style.hot_507d so it can't cause
   horizontal overflow anyway. */
.mask_basic_0c2a,
.overlay-e907,
.input-e173,
.purple-262c,
.block_8627,
.aside-clean-b6fe,
.gradient-dim-3f8e,
.accent_13e3,
.content_down_7839,
.column_310c,
.lite-35a2 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .aside_blue_e6e7 {
    padding: 8px 0;
  }
  
  .right_2c75 img {
    height: 28px;
    width: auto;
  }
  
  .status_1dbb {
    display: none !important;
  }
  
  .button_bac4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .button_bac4 svg {
    width: 14px;
    height: 14px;
  }
  
  .card-f48d {
    padding: 6px;
  }
  
  .tiny-946c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .input-e173,
  .overlay-e907,
  .purple-262c,
  .block_8627,
  .modal-df13,
  .box-pressed-1e7b,
  .orange-6926,
  .module_warm_9396,
  .solid-8059,
  .nav-outer-322e,
  .list_east_d227,
  .label-dim-4295 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .pattern_72ab,
  .gradient_ead1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .stone_b340,
  .glass_ce04,
  .wrapper-3023,
  .small_fdc7,
  .button-black-b49f,
  .wide-bc05,
  .avatar-72fc {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  
  /* Ensure images are responsive */
  img,
  svg,
  picture {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Better padding for mobile */
  .soft_366f,
  .form-dark-75fb,
  .pressed_7aba,
  .title_slow_c7d8,
  .photo-b8a2 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hard-8cff,
  .header-glass-45d5,
  .modal_291f,
  .cold-da27 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .caption_copper_02a8,
  .next-e68c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .shadow-12f6,
  .alert-focused-0a28,
  .layout_3afd,
  .wood-dfe0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .sort_focused_a27c,
  .rough-7a33,
  .steel_c40a,
  .image-1014,
  .icon_7747,
  .primary-3cfc {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .soft_366f,
  .form-dark-75fb,
  .title_slow_c7d8 {
    max-width: none !important;
  }
  
  .row-focused-e31a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hard-8cff {
    font-size: 1.5rem !important;
  }
  
  .header-glass-45d5 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .sort_c012,
  .surface-0dfb {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .modal_291f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .silver_4ed1 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .over_1736 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .soft_366f,
  .title_slow_c7d8 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* iPhone X and notch devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

/* css-noise: 9014 */
.promo-block-s6 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.1;
}
