/* ============================================
   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 (.accordion_complex_c2d6) is a descendant of
   .focus-current-7fbe (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.focused-896e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".sort-f9ca" 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.main_up_032a so it can't cause
   horizontal overflow anyway. */
.gold-0feb,
.south_1484,
.old-deed,
.texture_42d2,
.row-hovered-674b,
.main-right-f0ff,
.icon-40ad,
.hover-e2db,
.media-hard-5b2c,
.menu-e9b1,
.dropdown_773c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .frame_f6fe {
    padding: 8px 0;
  }
  
  .full-4c40 img {
    height: 28px;
    width: auto;
  }
  
  .container-7a90 {
    display: none !important;
  }
  
  .shade_14c0 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .shade_14c0 svg {
    width: 14px;
    height: 14px;
  }
  
  .under_315c {
    padding: 6px;
  }
  
  .red_9912 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .old-deed,
  .south_1484,
  .texture_42d2,
  .row-hovered-674b,
  .simple_73da,
  .logo_in_8983,
  .footer-5008,
  .background_easy_cb1f,
  .sort_939d,
  .fluid-3ca8,
  .large-5d33 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .short_d409,
  .popup-998a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .out_2843,
  .form_gold_385f,
  .component_1644,
  .next-c7a2,
  .huge-acba,
  .layout_brown_f4d4,
  .detail-hovered-cbcf {
    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 */
  .thumbnail_red_ed67,
  .bright_3f1b,
  .border_320d,
  .backdrop-6c1e,
  .sidebar-5dc9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .notification-wide-3f24,
  .selected_4b8d,
  .column_3f25,
  .shade_04ec {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .alert_smooth_892a,
  .next-7d54 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .dim_23cf,
  .gallery-9ae2,
  .chip_wood_ce83,
  .breadcrumb_down_5b4a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .middle-7c34,
  .main-9f3a,
  .green-838f,
  .summary-7722,
  .soft_dbf0,
  .top_61a9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .thumbnail_red_ed67,
  .bright_3f1b,
  .backdrop-6c1e {
    max-width: none !important;
  }
  
  .sort-f9ca {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .notification-wide-3f24 {
    font-size: 1.5rem !important;
  }
  
  .selected_4b8d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .hidden-37cc,
  .button-c460 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .column_3f25 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .brown_48a8 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tooltip-97d2 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .thumbnail_red_ed67,
  .backdrop-6c1e {
    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: f2fe */
.ghost-box-m7 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.3;
}
