/* ============================================
   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 (.surface-d5e1) is a descendant of
   .action_9935 (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.purple_2596 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hero_65a9" 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.fast-74a0 so it can't cause
   horizontal overflow anyway. */
.filter-2399,
.texture-7b34,
.white_0bb8,
.item_green_ddf6,
.element-inner-1bb4,
.shadow_b529,
.next-3448,
.left-edab,
.accordion_64ee,
.column-thick-afa0,
.chip-dark-fcb9 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .picture-west-58fd {
    padding: 8px 0;
  }
  
  .pagination-1cd1 img {
    height: 28px;
    width: auto;
  }
  
  .secondary_2855 {
    display: none !important;
  }
  
  .status_huge_f7ec {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .status_huge_f7ec svg {
    width: 14px;
    height: 14px;
  }
  
  .wrapper-65df {
    padding: 6px;
  }
  
  .item-db3c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .white_0bb8,
  .texture-7b34,
  .item_green_ddf6,
  .element-inner-1bb4,
  .smooth-a528,
  .focus_light_b484,
  .picture_c837,
  .description_093e,
  .outline-585c,
  .section-paper-ca56,
  .badge_upper_1091,
  .header-5e26 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .wood-5c99,
  .motion_eda1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hard_bcd8,
  .glass_db84,
  .section_rough_0474,
  .tag_upper_bdd2,
  .container-b5af,
  .badge-brown-276e,
  .warm_433f {
    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 */
  .media_bronze_80d7,
  .wood-99c9,
  .dropdown-cc70,
  .mask_red_9e03,
  .soft_6ba4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .message-d9f6,
  .aside_2aae,
  .bright_06bb,
  .info_d949 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .photo-huge-4b92,
  .tooltip_smooth_2d4f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .primary-blue-f2e6,
  .out-81c8,
  .header-pro-b6db,
  .grid-middle-3b95 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .status_old_6d4d,
  .complex-3781,
  .hovered_00ff,
  .purple_6bfc,
  .link-3413,
  .caption_hard_476a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .media_bronze_80d7,
  .wood-99c9,
  .mask_red_9e03 {
    max-width: none !important;
  }
  
  .hero_65a9 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .message-d9f6 {
    font-size: 1.5rem !important;
  }
  
  .aside_2aae {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .section_7a69,
  .logo_outer_7b6b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .bright_06bb {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .status_hard_1208 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .simple_97ab {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .media_bronze_80d7,
  .mask_red_9e03 {
    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: 5316 */
.phantom-card-v3 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.0;
}
