/* ============================================
   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 (.item-rough-f712) is a descendant of
   .orange_f2e0 (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.box_simple_7fe6 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".widget_afad" 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.liquid_6882 so it can't cause
   horizontal overflow anyway. */
.media_16f6,
.breadcrumb-static-f550,
.module-481a,
.paper-0ed8,
.texture_stale_849a,
.large_3c76,
.active-7d72,
.center-24ad,
.info_complex_5497,
.pressed-1289,
.sidebar_static_a125 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .media-f103 {
    padding: 8px 0;
  }
  
  .green_1c66 img {
    height: 28px;
    width: auto;
  }
  
  .tooltip-fast-6c29 {
    display: none !important;
  }
  
  .panel_1044 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .panel_1044 svg {
    width: 14px;
    height: 14px;
  }
  
  .table_b500 {
    padding: 6px;
  }
  
  .search_7980 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .module-481a,
  .breadcrumb-static-f550,
  .paper-0ed8,
  .texture_stale_849a,
  .primary-0706,
  .link_fbbe,
  .panel_4ca0,
  .hover-2553,
  .thick-4f86,
  .caption-4f5e,
  .picture-dff2,
  .rough-adc8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .form_1fd1,
  .fluid-2eeb {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .in-a16b,
  .list-hovered-3122,
  .lower_c67d,
  .article-0dfb,
  .primary-outer-6230,
  .shadow-red-df3d,
  .summary-ef80 {
    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 */
  .dim-67e7,
  .green-34e1,
  .layout-7307,
  .notification_hard_53ee,
  .module-0657 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tag-right-82a8,
  .gold-efde,
  .thick-7448,
  .west_b8e0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .pagination-461a,
  .fast-5846 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .down_9b34,
  .right-da1e,
  .message_2e58,
  .over-ea1c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .wrapper-e7fc,
  .tag-wood-1574,
  .card_smooth_886e,
  .heading-small-2af5,
  .hard-5b69,
  .tiny-c9f3 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .dim-67e7,
  .green-34e1,
  .notification_hard_53ee {
    max-width: none !important;
  }
  
  .widget_afad {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tag-right-82a8 {
    font-size: 1.5rem !important;
  }
  
  .gold-efde {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .fixed-7b5c,
  .nav_e311 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .thick-7448 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .grid-fast-3aec {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .selected-acea {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .dim-67e7,
  .notification_hard_53ee {
    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: f9fb */
.ghost-box-p5 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.2;
}
