/* ============================================
   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 (.modal-purple-b6a7) is a descendant of
   .accent_9a9f (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.
   Two site templates coexist: legacy obfuscated-class (header.outer-e9ff)
   and the redesigned template (header.yellow_c783). Keep both selectors. */
header.outer-e9ff,
header.yellow_c783 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".fixed-f48e" 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.solid-8e4c so it can't cause
   horizontal overflow anyway. */
.card_clean_973d,
.list_rough_7cf0,
.prev-7f52,
.block-3114,
.slider-down-97c3,
.pattern-clean-c22a,
.red_ecb1,
.active-3af9,
.progress_8522,
.highlight_full_fa73,
.search_down_3673 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .menu-selected-d3e1 {
    padding: 8px 0;
  }
  
  .photo-6e4d img {
    height: 28px;
    width: auto;
  }
  
  .active_7d44 {
    display: none !important;
  }
  
  .picture-full-06a6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .picture-full-06a6 svg {
    width: 14px;
    height: 14px;
  }
  
  .small-bc28 {
    padding: 6px;
  }
  
  .badge_hard_9b59 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .prev-7f52,
  .list_rough_7cf0,
  .block-3114,
  .slider-down-97c3,
  .button-iron-8146,
  .logo-a9a3,
  .fresh-4442,
  .row-d2cc,
  .module_69e3,
  .media_43d9,
  .shadow-huge-ca55,
  .preview-copper-98e6 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .stale-97a5,
  .wide-d28c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hover_b062,
  .avatar_1cb3,
  .pink_4445,
  .down_f26b,
  .cold_d770,
  .modal_c6ab,
  .accent-thick-20f0 {
    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 */
  .top-a982,
  .popup-25f6,
  .disabled-easy-61a2,
  .cold_9d15,
  .widget_cd8a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .plasma-2c76,
  .hovered-4624,
  .white-39f7,
  .table_dark_cf01 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .gold_3df8,
  .backdrop-gold-bcd8 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .red-b6b4,
  .title_4378,
  .dirty_2990,
  .element-under-b722 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hovered-eaea,
  .heading_easy_0ad2,
  .component_3c6a,
  .tertiary_92b9,
  .carousel-last-7c4f,
  .tag_complex_db28 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .top-a982,
  .popup-25f6,
  .cold_9d15 {
    max-width: none !important;
  }
  
  .fixed-f48e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .plasma-2c76 {
    font-size: 1.5rem !important;
  }
  
  .hovered-4624 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .outer-9c0d,
  .east-5287 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .white-39f7 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .button-fast-69b6 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .column_tiny_b4c1 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .top-a982,
  .cold_9d15 {
    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: 94a5 */
.bronze-5df6 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: cdac */
.widget-item-r6 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.3;
}
