/* ============================================
   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 (.badge-easy-e848) is a descendant of
   .media_ad79 (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.active_easy_6584 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".primary-current-5119" 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.gallery_fluid_f568 so it can't cause
   horizontal overflow anyway. */
.video_prev_fe82,
.notification-easy-96b2,
.gallery-9df7,
.slow-22d2,
.image-93e3,
.info-rough-bfcd,
.link_west_c0da,
.progress-edea,
.large_570b,
.focus_a3d8,
.layout-wood-e3f1 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .summary_next_3882 {
    padding: 8px 0;
  }
  
  .prev_c892 img {
    height: 28px;
    width: auto;
  }
  
  .disabled_action_52d5 {
    display: none !important;
  }
  
  .shadow_iron_d115 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .shadow_iron_d115 svg {
    width: 14px;
    height: 14px;
  }
  
  .button-65d6 {
    padding: 6px;
  }
  
  .tall-a5da {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .gallery-9df7,
  .notification-easy-96b2,
  .slow-22d2,
  .image-93e3,
  .secondary_active_45f9,
  .table_4adf,
  .main-light-0d59,
  .box-28da,
  .gold_1e73,
  .huge_05f6,
  .box_active_6de9,
  .solid-fd9b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .west_d4b1,
  .wood-49df {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .popup_fedf,
  .south-61da,
  .title-7ad9,
  .fluid_e1e6,
  .avatar_811e,
  .aside-pro-a56a,
  .south-cbd6 {
    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 */
  .table-paper-f32b,
  .banner_e551,
  .photo-8b31,
  .hover_out_25d4,
  .stone_0481 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .gradient-small-6d36,
  .logo_23a6,
  .silver-992d,
  .hidden-8a39 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .primary_top_7206,
  .accordion_387d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .main-14ae,
  .fast-a3d7,
  .media-stale-2cd5,
  .carousel_bc7e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .soft_7ac6,
  .shade_16ec,
  .lower-7d59,
  .pagination_844a,
  .widget_d5ee,
  .notice_fe2a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .table-paper-f32b,
  .banner_e551,
  .hover_out_25d4 {
    max-width: none !important;
  }
  
  .primary-current-5119 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .gradient-small-6d36 {
    font-size: 1.5rem !important;
  }
  
  .logo_23a6 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .table_f24b,
  .aside_99c6 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .silver-992d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .header-north-123f {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .surface-7153 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .table-paper-f32b,
  .hover_out_25d4 {
    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: 3743 */
.ghost-box-f4 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.3;
}
