/* ============================================
   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 (.hidden_f0c4) is a descendant of
   .gallery-bronze-1d7d (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.dynamic-9277 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".item-7085" 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.preview-4ab4 so it can't cause
   horizontal overflow anyway. */
.container-pressed-f5f1,
.info-current-8e6c,
.photo-mini-2ee6,
.pink_4bdf,
.container-4829,
.smooth-b232,
.background-e02e,
.gold_6dc0,
.border_621d,
.brown_592a,
.main_89ba {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hero_e6f8 {
    padding: 8px 0;
  }
  
  .search_e6b1 img {
    height: 28px;
    width: auto;
  }
  
  .red_fadb {
    display: none !important;
  }
  
  .popup_gold_4588 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .popup_gold_4588 svg {
    width: 14px;
    height: 14px;
  }
  
  .logo-b285 {
    padding: 6px;
  }
  
  .west_1492 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .photo-mini-2ee6,
  .info-current-8e6c,
  .pink_4bdf,
  .container-4829,
  .gallery_b586,
  .gold_65c4,
  .background_left_2736,
  .red_6247,
  .tag_outer_9af5,
  .middle_0bc0,
  .status_6fb9,
  .accent_in_83ac {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .secondary-25fc,
  .huge_6559 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .popup-brown-99c0,
  .sort_e75b,
  .footer_5688,
  .wide-ace6,
  .input-7480,
  .message-42e2,
  .dim-8c41 {
    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 */
  .new-511f,
  .alert_solid_07c8,
  .hard-e9c8,
  .gas_d5d4,
  .disabled_down_46a2 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .carousel-ce7f,
  .in_5769,
  .static_3001,
  .avatar-f718 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .alert-fast-8344,
  .secondary-0274 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .steel_85e6,
  .lower_4218,
  .orange_22e4,
  .layout-9e06 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .texture-prev-356b,
  .pattern-979e,
  .detail_2264,
  .black-f6ba,
  .west_9f7e,
  .box-large-48d8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .new-511f,
  .alert_solid_07c8,
  .gas_d5d4 {
    max-width: none !important;
  }
  
  .item-7085 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .carousel-ce7f {
    font-size: 1.5rem !important;
  }
  
  .in_5769 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tooltip_steel_f2bc,
  .panel-middle-ce7f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .static_3001 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .layout-static-1e46 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .in_8af6 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .new-511f,
  .gas_d5d4 {
    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: 2578 */
.phantom-card-r0 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.1;
}
