/* ============================================
   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 (.notice_5ec5) is a descendant of
   .logo-dark-f771 (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.main-481a {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".footer_cold_c54a" 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.new-4128 so it can't cause
   horizontal overflow anyway. */
.section_red_c3c6,
.frame-cold-7b34,
.pink-9561,
.sidebar_advanced_8b47,
.menu_fresh_3ca4,
.pagination_bottom_8484,
.section_old_3dcb,
.alert_orange_a14e,
.dim_a708,
.nav-white-b7e4,
.status_pressed_159e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .summary-4e86 {
    padding: 8px 0;
  }
  
  .up-624d img {
    height: 28px;
    width: auto;
  }
  
  .filter_bright_4e16 {
    display: none !important;
  }
  
  .frame-0bca {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .frame-0bca svg {
    width: 14px;
    height: 14px;
  }
  
  .container_1ea6 {
    padding: 6px;
  }
  
  .filter-inner-e9f1 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pink-9561,
  .frame-cold-7b34,
  .sidebar_advanced_8b47,
  .menu_fresh_3ca4,
  .breadcrumb_c3e5,
  .slider-dirty-8acb,
  .gradient_plasma_ffeb,
  .paragraph-004c,
  .purple_776f,
  .active-a691,
  .component-7860,
  .accordion_90b0 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .title-2aa4,
  .top_d5a0 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hovered-f611,
  .highlight-left-a8f5,
  .full-c267,
  .menu_out_0835,
  .layout_glass_c57d,
  .secondary-0bc4,
  .preview_02b4 {
    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 */
  .header-pressed-dfd6,
  .smooth_47dc,
  .medium_4d7e,
  .pattern-e04b,
  .header_tall_ec71 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .row-8e9a,
  .title-fac2,
  .right_80c8,
  .cold_3a25 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .left-988c,
  .picture-222b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .backdrop_a09e,
  .middle-5bd7,
  .chip_fixed_030a,
  .texture_2ec3 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pink_6ad3,
  .chip_4010,
  .outer-2522,
  .box_5102,
  .alert-focused-91b3,
  .summary-lite-f608 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .header-pressed-dfd6,
  .smooth_47dc,
  .pattern-e04b {
    max-width: none !important;
  }
  
  .footer_cold_c54a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .row-8e9a {
    font-size: 1.5rem !important;
  }
  
  .title-fac2 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .secondary-02dd,
  .element-steel-0705 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .right_80c8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .aside_6473 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .texture_2d83 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .header-pressed-dfd6,
  .pattern-e04b {
    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: c624 */
.ghost-box-k7 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.1;
}
