/* ============================================
   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 (.huge_5432) is a descendant of
   .thumbnail-5ebe (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.static_15ba {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hot-94d5" 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.gallery_2a06 so it can't cause
   horizontal overflow anyway. */
.tertiary_stale_6e81,
.up_336f,
.form_bright_0a6f,
.tiny-4100,
.badge-advanced-59c8,
.dirty_781e,
.module-c300,
.accordion-53a6,
.first-7949,
.black-0af8,
.in_2cd3 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .search_e70c {
    padding: 8px 0;
  }
  
  .info-ff25 img {
    height: 28px;
    width: auto;
  }
  
  .modal-6c91 {
    display: none !important;
  }
  
  .main_medium_3232 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .main_medium_3232 svg {
    width: 14px;
    height: 14px;
  }
  
  .paragraph-new-28e3 {
    padding: 6px;
  }
  
  .border-d261 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .form_bright_0a6f,
  .up_336f,
  .tiny-4100,
  .badge-advanced-59c8,
  .shadow_copper_6cfc,
  .secondary-f529,
  .simple-cbd2,
  .logo_hard_0b6b,
  .huge_843d,
  .gas-1f71,
  .thick_cd8d,
  .panel_gold_69bb {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .stone_4a10,
  .backdrop-east-77a7 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hovered_da62,
  .hidden_last_2e9b,
  .tertiary-4d50,
  .status_purple_d18b,
  .tag_9e40,
  .steel-98ac,
  .gallery_dirty_2333 {
    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 */
  .card_medium_04b6,
  .element-blue-c460,
  .bottom_13d8,
  .caption_lower_fcbe,
  .paragraph_silver_3927 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .container_ae31,
  .rough-baba,
  .header_4fb5,
  .bottom-56d1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .slow_4f39,
  .thumbnail-down-f332 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .large-a409,
  .tag-steel-0dc4,
  .alert_11d9,
  .paragraph-fast-d914 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .sidebar_simple_a88e,
  .up-9c4a,
  .stale-9b29,
  .selected_d0f3,
  .iron_3fe3,
  .section-085a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .card_medium_04b6,
  .element-blue-c460,
  .caption_lower_fcbe {
    max-width: none !important;
  }
  
  .hot-94d5 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .container_ae31 {
    font-size: 1.5rem !important;
  }
  
  .rough-baba {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tall-64d1,
  .link-6fec {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .header_4fb5 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .gradient-acf5 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .status_fd0a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .card_medium_04b6,
  .caption_lower_fcbe {
    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: 7017 */
.widget-item-b8 {
  padding: 0.3rem;
  font-size: 13px;
  line-height: 1.3;
}
