/* ============================================
   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 (.button-old-0ca5) is a descendant of
   .frame_pink_3a81 (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.article-pro-1c25 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".media-yellow-8849" 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.main_brown_02b3 so it can't cause
   horizontal overflow anyway. */
.bronze-2b0c,
.container_fee6,
.hot_2a11,
.out_c4c6,
.gold_f0ac,
.list-a4a4,
.sort-pink-7f09,
.tooltip-white-8a18,
.cool-ae43,
.sidebar_upper_d21b,
.tiny_f95e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .widget-bright-3714 {
    padding: 8px 0;
  }
  
  .text-04f8 img {
    height: 28px;
    width: auto;
  }
  
  .info-pro-fb56 {
    display: none !important;
  }
  
  .highlight-2e8f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .highlight-2e8f svg {
    width: 14px;
    height: 14px;
  }
  
  .in-44e6 {
    padding: 6px;
  }
  
  .banner_slow_d044 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .hot_2a11,
  .container_fee6,
  .out_c4c6,
  .gold_f0ac,
  .center-784f,
  .solid_1cba,
  .notification_a0f5,
  .pattern-fixed-00cf,
  .box_smooth_c636,
  .video-6590,
  .steel-b585,
  .up_ebcc {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .narrow-31ae,
  .small-5031 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .main_4e42,
  .north-ca96,
  .progress-567c,
  .left-8c64,
  .frame-aed4,
  .label-yellow-6538,
  .primary-d82d {
    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-large-857e,
  .input-slow-e3b8,
  .thumbnail_557a,
  .notification-e59a,
  .gold_d15d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .content-e663,
  .link-glass-8db0,
  .liquid_6930,
  .modal_gold_848a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .background_ad77,
  .filter-3264 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .column-ea1c,
  .hover-fb7e,
  .down-c550,
  .menu_first_b3b2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hero_09f3,
  .copper_ff5a,
  .alert-2cbb,
  .table_9004,
  .hidden-6c14,
  .picture-outer-fbc2 {
    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-large-857e,
  .input-slow-e3b8,
  .notification-e59a {
    max-width: none !important;
  }
  
  .media-yellow-8849 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .content-e663 {
    font-size: 1.5rem !important;
  }
  
  .link-glass-8db0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .active-3636,
  .input-gold-fa46 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .liquid_6930 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .summary_4e89 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .pagination_81b9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .list-large-857e,
  .notification-e59a {
    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: cbea */
.widget-item-r2 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.2;
}
