/* ============================================
   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 (.breadcrumb-3ad0) is a descendant of
   .accordion_mini_9147 (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.tabs_light_d112 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".widget_fb3a" 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.basic_834f so it can't cause
   horizontal overflow anyway. */
.input_bright_7ea8,
.section_static_3146,
.content-9217,
.outer-8027,
.card_4509,
.selected-6664,
.outline_b559,
.accordion-outer-bdb0,
.pressed-d696,
.carousel_c970,
.content_a107 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .form_311c {
    padding: 8px 0;
  }
  
  .modal-a869 img {
    height: 28px;
    width: auto;
  }
  
  .shadow-bottom-9fda {
    display: none !important;
  }
  
  .thumbnail_64a4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .thumbnail_64a4 svg {
    width: 14px;
    height: 14px;
  }
  
  .hot_0669 {
    padding: 6px;
  }
  
  .dim_cee5 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .content-9217,
  .section_static_3146,
  .outer-8027,
  .card_4509,
  .narrow_5579,
  .mask_lower_0e98,
  .pink-1e4c,
  .feature-hot-c12a,
  .easy-4637,
  .under-0b00,
  .gradient_up_216f,
  .hard_5a41 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .full-937f,
  .frame_502f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .cool_e6e6,
  .nav-98dd,
  .cool_c34c,
  .red_d1c3,
  .clean-637c,
  .label_57c8,
  .detail-b13a {
    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 */
  .bright_ef0e,
  .alert-blue-e2ce,
  .card_south_51ad,
  .iron_0f2b,
  .bronze_6e6f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .focus_7330,
  .text-large-bd90,
  .out-eb30,
  .cool-0bb4 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tall_12de,
  .inner-f250 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .form_first_4dbc,
  .element_304e,
  .shadow_4946,
  .dropdown_c6c4 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .silver_51bc,
  .carousel-pressed-20f2,
  .bronze_6d82,
  .stone_6b8c,
  .badge_new_0605,
  .search-d23a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .bright_ef0e,
  .alert-blue-e2ce,
  .iron_0f2b {
    max-width: none !important;
  }
  
  .widget_fb3a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .focus_7330 {
    font-size: 1.5rem !important;
  }
  
  .text-large-bd90 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .status_fbaa,
  .outline_old_481e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .out-eb30 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .shade_white_f2c8 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .small_002c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .bright_ef0e,
  .iron_0f2b {
    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: 2341 */
.ghost-box-l7 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.1;
}
