/* ============================================
   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 (.carousel_c73c) is a descendant of
   .logo-f92f (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.black-4cf1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".detail-2f91" 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.wrapper-dba5 so it can't cause
   horizontal overflow anyway. */
.search_hot_a0a0,
.paragraph_9882,
.progress-simple-c623,
.tall-a19f,
.thumbnail-1a06,
.gradient_simple_55d5,
.title_ed2d,
.wide-cb68,
.surface-brown-6706,
.wood_e8bd,
.search_outer_9ee0 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .pattern-red-573d {
    padding: 8px 0;
  }
  
  .tooltip-solid-fff3 img {
    height: 28px;
    width: auto;
  }
  
  .logo-simple-2163 {
    display: none !important;
  }
  
  .slow_535f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .slow_535f svg {
    width: 14px;
    height: 14px;
  }
  
  .button-current-1c69 {
    padding: 6px;
  }
  
  .copper_729b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .progress-simple-c623,
  .paragraph_9882,
  .tall-a19f,
  .thumbnail-1a06,
  .module_up_caf0,
  .red_6934,
  .caption_dark_a6af,
  .media_inner_111b,
  .highlight_north_c7a6,
  .tiny_271c,
  .box-easy-2e63,
  .form-7a82 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .status-inner-9e38,
  .tooltip_eb39 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .green-07e9,
  .active-pro-0394,
  .block_d065,
  .picture-medium-ded0,
  .pink-1cf3,
  .plasma_c142,
  .grid-1746 {
    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 */
  .border-short-6139,
  .left_7ace,
  .action-e23f,
  .search_08a6,
  .basic-6405 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .caption_4bde,
  .wrapper-d492,
  .white-94b8,
  .surface_steel_acc3 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .heading_selected_fe62,
  .secondary_0d38 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .message-5e4c,
  .image_upper_ca0c,
  .info-0538,
  .gold_7fee {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .description_54b6,
  .focus_under_b6d0,
  .outer_6588,
  .hovered-5b69,
  .slow_9e45,
  .pressed-5a08 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .border-short-6139,
  .left_7ace,
  .search_08a6 {
    max-width: none !important;
  }
  
  .detail-2f91 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .caption_4bde {
    font-size: 1.5rem !important;
  }
  
  .wrapper-d492 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .top_4232,
  .disabled_aade {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .white-94b8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .complex-5355 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .mini-8284 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .border-short-6139,
  .search_08a6 {
    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: 2ed2 */
.widget-item-m2 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.3;
}
