/* ============================================
   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 (.pagination-8698) is a descendant of
   .surface-22a9 (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.card_glass_77ae {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".red-a4a6" 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.paper_fe9d so it can't cause
   horizontal overflow anyway. */
.thick-2dcf,
.action_7d21,
.texture-c58b,
.widget-61d8,
.stone-4106,
.light_b6b2,
.border_complex_fd0c,
.backdrop_current_75da,
.progress_brown_fc6b,
.primary-lite-5c41,
.gold_1ca8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .alert_huge_a439 {
    padding: 8px 0;
  }
  
  .panel_static_99bb img {
    height: 28px;
    width: auto;
  }
  
  .steel_538f {
    display: none !important;
  }
  
  .gallery_5b74 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .gallery_5b74 svg {
    width: 14px;
    height: 14px;
  }
  
  .carousel_d66a {
    padding: 6px;
  }
  
  .static-a2a4 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .texture-c58b,
  .action_7d21,
  .widget-61d8,
  .stone-4106,
  .simple-89c9,
  .east-7870,
  .white_3d0e,
  .short-c080,
  .widget_d6a4,
  .button_3c44,
  .row_huge_d6c1,
  .tiny-9f82 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .next_37c9,
  .sort_7bf5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .footer-bdda,
  .item-9d18,
  .wrapper-769c,
  .surface_outer_e9f7,
  .alert_dynamic_f9c3,
  .label_d663,
  .tooltip-ae3f {
    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 */
  .paper_6fcf,
  .media_huge_5682,
  .description_static_44d8,
  .dynamic-1110,
  .surface-complex-b20d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .solid_2819,
  .overlay-3c64,
  .main-9b9c,
  .middle-df77 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .column_bfc3,
  .inner_53e5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .component_dirty_3953,
  .column-bronze-f002,
  .sidebar_upper_08f7,
  .detail_08db {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .wood_6c37,
  .inner-2f77,
  .section_c842,
  .texture_bright_49bb,
  .article_bbed,
  .summary-b4c4 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .paper_6fcf,
  .media_huge_5682,
  .dynamic-1110 {
    max-width: none !important;
  }
  
  .red-a4a6 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .solid_2819 {
    font-size: 1.5rem !important;
  }
  
  .overlay-3c64 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .alert-5af9,
  .up_8d4a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .main-9b9c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .tag-8273 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .banner_1713 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .paper_6fcf,
  .dynamic-1110 {
    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: d82c */
.widget-item-a2 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.2;
}
