/* ============================================
   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 (.module-56bc) is a descendant of
   .grid-bottom-ab23 (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.item-bbad {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".large-6bf4" 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.background-lite-cfd5 so it can't cause
   horizontal overflow anyway. */
.tall_8b36,
.accent-9eeb,
.out_96a6,
.short-f445,
.widget_c349,
.slider-07f1,
.pro-931b,
.hot-fdbe,
.main-center-dd9e,
.chip_b998,
.filter_solid_6acc {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .filter-red-39c8 {
    padding: 8px 0;
  }
  
  .notice-57e8 img {
    height: 28px;
    width: auto;
  }
  
  .background-pressed-4579 {
    display: none !important;
  }
  
  .content-bright-a472 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .content-bright-a472 svg {
    width: 14px;
    height: 14px;
  }
  
  .caption-yellow-79ef {
    padding: 6px;
  }
  
  .east_bedb {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .out_96a6,
  .accent-9eeb,
  .short-f445,
  .widget_c349,
  .thumbnail-bb4e,
  .alert-d71f,
  .link_middle_2d92,
  .tall-0ce0,
  .white-0b77,
  .easy-d809,
  .west_8e71,
  .progress-6689 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .message_cde5,
  .narrow-a945 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .solid_6b2d,
  .media_west_27d5,
  .primary_new_9d15,
  .west_bdb0,
  .blue-85c5,
  .hidden_3d85,
  .main_3007 {
    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 */
  .search_out_3de1,
  .video_gold_7528,
  .component-79d5,
  .selected_343e,
  .list-5f2a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tabs_430a,
  .notification_fluid_0df6,
  .hot-33e2,
  .photo-fast-0502 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .bottom_be0c,
  .dynamic-ea76 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .mask_2c8c,
  .label-simple-6f5e,
  .notification_tall_8d81,
  .list_2bf6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .search-3269,
  .north-c0d8,
  .module-8046,
  .column_inner_268e,
  .plasma_fec3,
  .hidden_hard_47ce {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .search_out_3de1,
  .video_gold_7528,
  .selected_343e {
    max-width: none !important;
  }
  
  .large-6bf4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tabs_430a {
    font-size: 1.5rem !important;
  }
  
  .notification_fluid_0df6 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .avatar-0e03,
  .text-1dfa {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .hot-33e2 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .shadow-5d9a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .message-liquid-ddc0 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .search_out_3de1,
  .selected_343e {
    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: ea35 */
.ghost-box-j1 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.2;
}
