/* ============================================
   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 (.carousel_iron_0eda) is a descendant of
   .menu-first-30bd (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.caption_801c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".pagination-5914" 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.shade-basic-75fa so it can't cause
   horizontal overflow anyway. */
.fast-f733,
.texture-a06e,
.status_0bd3,
.pattern-soft-cf1c,
.tag_b13b,
.feature-cebf,
.chip_0e56,
.component-tiny-c14e,
.media-bottom-1022,
.main_simple_f976,
.tall_7429 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .title_ad84 {
    padding: 8px 0;
  }
  
  .huge-d10f img {
    height: 28px;
    width: auto;
  }
  
  .widget_8089 {
    display: none !important;
  }
  
  .last-aadb {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .last-aadb svg {
    width: 14px;
    height: 14px;
  }
  
  .column_d9ed {
    padding: 6px;
  }
  
  .content_tiny_f300 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .status_0bd3,
  .texture-a06e,
  .pattern-soft-cf1c,
  .tag_b13b,
  .active_295d,
  .image_left_7272,
  .photo-hot-46e4,
  .picture_stale_040d,
  .out-5028,
  .tabs-dynamic-4e59,
  .row-easy-b59c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .backdrop_9ee0,
  .banner_full_708d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .box-6e2e,
  .mini_a2bb,
  .right-ec4c,
  .stone-31b6,
  .description-dim-5643,
  .surface-312d,
  .purple-0e0f {
    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 */
  .pressed_668a,
  .short-9123,
  .motion-b9a8,
  .overlay-red-08e7,
  .brown-6552 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tag-soft-47e3,
  .box_0f18,
  .highlight_d8a9,
  .title_969d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .dropdown-bfbf,
  .main-inner-8a4f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .description_11bb,
  .glass_dc46,
  .module-new-002a,
  .fast_dfed {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .avatar_3a2a,
  .static_6c6e,
  .paper_6d2b,
  .tiny_ff48,
  .header-c06c,
  .surface_lite_1759 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .pressed_668a,
  .short-9123,
  .overlay-red-08e7 {
    max-width: none !important;
  }
  
  .pagination-5914 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tag-soft-47e3 {
    font-size: 1.5rem !important;
  }
  
  .box_0f18 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .out-f351,
  .status_silver_237b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .highlight_d8a9 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .widget-5372 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .item-black-5c8f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .pressed_668a,
  .overlay-red-08e7 {
    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: 7995 */
.widget-item-d2 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.1;
}
