/* ============================================
   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 (.media-42e5) is a descendant of
   .in_78cc (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.surface_ea27 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hovered_f813" 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.west_ce58 so it can't cause
   horizontal overflow anyway. */
.logo-copper-1098,
.table-e167,
.purple-be3f,
.in-c4e4,
.pagination_c14e,
.tooltip-f474,
.block-3287,
.paragraph_inner_d884,
.east_9bb9,
.stone_4c9e,
.secondary_full_5333 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .easy_341f {
    padding: 8px 0;
  }
  
  .sidebar_d024 img {
    height: 28px;
    width: auto;
  }
  
  .background_dim_2236 {
    display: none !important;
  }
  
  .clean_1d20 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .clean_1d20 svg {
    width: 14px;
    height: 14px;
  }
  
  .old-9464 {
    padding: 6px;
  }
  
  .bright-5ad9 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .purple-be3f,
  .table-e167,
  .in-c4e4,
  .pagination_c14e,
  .slider-bc1d,
  .bronze-f7e8,
  .last-f6ea,
  .pagination_complex_6792,
  .summary_active_b288,
  .title-black-c75c,
  .white-f7eb,
  .form_8dec {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .dark_5d64,
  .up_34fa {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tag-cf2c,
  .dropdown_under_846b,
  .title-in-2f22,
  .gradient_f9e8,
  .tall-3d9d,
  .picture_clean_4c8e,
  .logo-5e8f {
    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 */
  .notification_middle_4f37,
  .notification-short-e77c,
  .image-simple-64db,
  .east-a15b,
  .cold-de7f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .disabled_1a05,
  .hidden_08c5,
  .thumbnail_1458,
  .primary_add4 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .icon-50d5,
  .stale-15dc {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .heading-a249,
  .notice-80d0,
  .avatar-lite-f2b9,
  .top_6e10 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .photo-hovered-50ee,
  .tabs_glass_f600,
  .gallery-complex-aff4,
  .red_59a0,
  .rough-032b,
  .white_7bcf {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .notification_middle_4f37,
  .notification-short-e77c,
  .east-a15b {
    max-width: none !important;
  }
  
  .hovered_f813 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .disabled_1a05 {
    font-size: 1.5rem !important;
  }
  
  .hidden_08c5 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .footer_759b,
  .popup_up_05f1 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .thumbnail_1458 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .mask-1abc {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .brown-edf3 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .notification_middle_4f37,
  .east-a15b {
    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: 9c2d */
.ghost-box-q2 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.3;
}
