/* ============================================
   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 (.focused-f6ae) is a descendant of
   .cool-8de1 (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.basic-0bbb {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".image-205a" 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.component_steel_e753 so it can't cause
   horizontal overflow anyway. */
.feature-fe03,
.gallery-pro-1430,
.huge-22dd,
.popup-paper-8f90,
.tertiary_huge_f0e0,
.hidden-new-8277,
.pagination-mini-5adc,
.top-90c8,
.form-26e2,
.selected_e467,
.active-2c56 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .silver_9d30 {
    padding: 8px 0;
  }
  
  .picture_ee07 img {
    height: 28px;
    width: auto;
  }
  
  .thumbnail-huge-31d4 {
    display: none !important;
  }
  
  .hard-8282 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hard-8282 svg {
    width: 14px;
    height: 14px;
  }
  
  .static_0727 {
    padding: 6px;
  }
  
  .input_e734 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .huge-22dd,
  .gallery-pro-1430,
  .popup-paper-8f90,
  .tertiary_huge_f0e0,
  .clean_8b12,
  .south-0a9f,
  .item-be79,
  .badge-new-1633,
  .primary-clean-28bc,
  .disabled-2859,
  .accent_2463,
  .mask_0a23 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .layout-action-02d4,
  .article-2a9d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tall-5216,
  .bronze-f016,
  .caption-silver-e34f,
  .north-3cd4,
  .frame_009f,
  .outer_5845,
  .mask_b19d {
    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 */
  .heading_1a24,
  .cold_3759,
  .carousel_7114,
  .outer_4f61,
  .up_91c5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .notice-blue-e4e1,
  .up_a1c1,
  .hard-65c5,
  .outer_07f8 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .breadcrumb-826d,
  .filter-full-ea4c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .text_action_4254,
  .tiny_a407,
  .bright_eb26,
  .soft_9a7c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .label-top-c4ff,
  .card-245f,
  .gallery-1182,
  .complex-b03d,
  .table_e48d,
  .bronze-2d20 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .heading_1a24,
  .cold_3759,
  .outer_4f61 {
    max-width: none !important;
  }
  
  .image-205a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .notice-blue-e4e1 {
    font-size: 1.5rem !important;
  }
  
  .up_a1c1 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .shadow_next_0f84,
  .primary-dynamic-1400 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .hard-65c5 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .slow-e681 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dropdown-2095 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .heading_1a24,
  .outer_4f61 {
    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: 4188 */
.shadow-element-i1 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.1;
}
