/* ============================================
   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 (.table-lite-b78f) is a descendant of
   .tag_top_3a7e (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.info-238b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tiny_a3de" 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.list-inner-1b19 so it can't cause
   horizontal overflow anyway. */
.video_1402,
.section_62aa,
.large-9341,
.pattern_tall_1500,
.wood_5e21,
.new-c881,
.silver-0776,
.silver-fe9a,
.paragraph-248c,
.upper-918b,
.tiny-d6f4 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .sidebar_dark_9a5e {
    padding: 8px 0;
  }
  
  .orange-920a img {
    height: 28px;
    width: auto;
  }
  
  .north-419c {
    display: none !important;
  }
  
  .background-pressed-3cdc {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .background-pressed-3cdc svg {
    width: 14px;
    height: 14px;
  }
  
  .table-816a {
    padding: 6px;
  }
  
  .rough-62c2 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .large-9341,
  .section_62aa,
  .pattern_tall_1500,
  .wood_5e21,
  .pattern-inner-9170,
  .secondary_38e1,
  .in-a89b,
  .upper_e28a,
  .preview-in-ac51,
  .notice_stone_dac5,
  .main-1de1,
  .modal-hard-615c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .accordion_b3a1,
  .under-eeec {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .primary_7462,
  .filter_175c,
  .out-d215,
  .mask_huge_fdb5,
  .basic_aeaf,
  .mask-d6c0,
  .block_white_eada {
    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 */
  .list_583d,
  .row_252c,
  .wide_5914,
  .tall_36aa,
  .main-7c84 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .header_prev_b6c9,
  .orange-4219,
  .row_mini_264d,
  .tag_pressed_9f79 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .yellow-3f25,
  .feature_fixed_6e94 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tabs_7b50,
  .gallery_1f20,
  .overlay_e418,
  .search-clean-6bb9 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .texture_active_bf1c,
  .stale-2ed0,
  .header-6b9a,
  .focused-5f9c,
  .surface-center-0509,
  .picture-large-ae23 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .list_583d,
  .row_252c,
  .tall_36aa {
    max-width: none !important;
  }
  
  .tiny_a3de {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .header_prev_b6c9 {
    font-size: 1.5rem !important;
  }
  
  .orange-4219 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .description_8151,
  .paragraph-copper-0083 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .row_mini_264d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .secondary_755e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .gold_d2dc {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .list_583d,
  .tall_36aa {
    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: 3e5a */
.widget-item-h6 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.3;
}
