/* ============================================
   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 (.tertiary-mini-50a9) is a descendant of
   .chip_first_bade (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.card-green-ebc9 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".notification-b568" 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-cool-314b so it can't cause
   horizontal overflow anyway. */
.popup-liquid-124f,
.easy-4818,
.message-large-ec67,
.element_cold_8f2e,
.wrapper_middle_f0d9,
.first-67f5,
.middle_ae20,
.element-ba8a,
.carousel_fluid_0843,
.border_south_5014,
.hovered-eb0b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .feature_new_2266 {
    padding: 8px 0;
  }
  
  .wood-066a img {
    height: 28px;
    width: auto;
  }
  
  .green_69d2 {
    display: none !important;
  }
  
  .notification-yellow-bd8d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .notification-yellow-bd8d svg {
    width: 14px;
    height: 14px;
  }
  
  .shadow_bright_157d {
    padding: 6px;
  }
  
  .up-8fed {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .message-large-ec67,
  .easy-4818,
  .element_cold_8f2e,
  .wrapper_middle_f0d9,
  .up-e8c0,
  .basic-6e82,
  .detail_dim_59f1,
  .notice-130f,
  .shadow_51e5,
  .block-4f01,
  .feature_9b3f,
  .section_1137 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .block_black_45f9,
  .focus_7c44 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .item_0748,
  .north-ad08,
  .form-active-3733,
  .silver-7737,
  .modal-161f,
  .dropdown-b9f6,
  .description-ddcb {
    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 */
  .iron-1477,
  .pattern-49d2,
  .menu-red-7d02,
  .sidebar_old_2791,
  .form_prev_a5cb {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .form-aded,
  .text_static_567f,
  .table-1054,
  .detail-e861 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .card_c4f4,
  .label-efd1 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .text_e4d6,
  .content-c4e8,
  .breadcrumb_short_c40b,
  .search-b087 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .focus-hot-5251,
  .tooltip-9997,
  .element_a9df,
  .thumbnail_12a3,
  .dim-a06a,
  .shadow_b102 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .iron-1477,
  .pattern-49d2,
  .sidebar_old_2791 {
    max-width: none !important;
  }
  
  .notification-b568 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .form-aded {
    font-size: 1.5rem !important;
  }
  
  .text_static_567f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .feature-9439,
  .module-wood-9a8e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .table-1054 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .texture_2cd0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .gold_b023 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .iron-1477,
  .sidebar_old_2791 {
    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: 3f64 */
.ghost-box-l4 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.0;
}
