/* ============================================
   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 (.icon_2dc2) is a descendant of
   .overlay-6834 (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.fixed-7810 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tag_22d5" 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.caption_hovered_3eb1 so it can't cause
   horizontal overflow anyway. */
.description_ba0a,
.notice_6b91,
.progress-ca18,
.preview_19cf,
.header_north_1fd6,
.upper_f490,
.dropdown_top_daff,
.hidden-92ab,
.nav-10f5,
.new_36de,
.menu_silver_a40b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .sort_brown_31a7 {
    padding: 8px 0;
  }
  
  .pro_43f5 img {
    height: 28px;
    width: auto;
  }
  
  .smooth_2c1b {
    display: none !important;
  }
  
  .item_pressed_8cb9 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .item_pressed_8cb9 svg {
    width: 14px;
    height: 14px;
  }
  
  .static-79b6 {
    padding: 6px;
  }
  
  .banner-dim-ece8 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .progress-ca18,
  .notice_6b91,
  .preview_19cf,
  .header_north_1fd6,
  .in_dc5b,
  .hover-dim-fad5,
  .aside_d8a3,
  .large_1e44,
  .easy_553f,
  .focused_3f89,
  .border_abdb,
  .primary_47f4 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .overlay_gas_8c70,
  .image_stone_af2e {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .dropdown-cool-415c,
  .header-north-e481,
  .paragraph_cool_0275,
  .accent-over-984c,
  .glass-682e,
  .logo-west-f35d,
  .stone_53de {
    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 */
  .bronze-74f9,
  .row-thick-a49e,
  .copper-b5db,
  .article-3727,
  .over_c253 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .dim-4c8e,
  .picture_296b,
  .top-df53,
  .out_c982 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .fluid_2100,
  .clean-f2b1 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .thumbnail_small_da30,
  .hard_f485,
  .center-6a4a,
  .tertiary_first_1c8a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .module_a1a4,
  .yellow_79b0,
  .upper-5b5e,
  .caption_e833,
  .north-1d3e,
  .link_5d01 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .bronze-74f9,
  .row-thick-a49e,
  .article-3727 {
    max-width: none !important;
  }
  
  .tag_22d5 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .dim-4c8e {
    font-size: 1.5rem !important;
  }
  
  .picture_296b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .main_618b,
  .description_68a2 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .top-df53 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .main-prev-9cb7 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .right-46d6 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .bronze-74f9,
  .article-3727 {
    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: bcdc */
.ghost-box-s5 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.2;
}
