/* ============================================
   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 (.card_c6b3) is a descendant of
   .old-c28d (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.new_4186 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".pagination-c08d" 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.bronze-abe4 so it can't cause
   horizontal overflow anyway. */
.inner_dead,
.badge_4b3d,
.menu_5868,
.card_thick_07fa,
.text-17f1,
.secondary_east_b6a1,
.stone-a63f,
.button-old-38b8,
.heading_1450,
.box_f96e,
.focused_cce3 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .notification_0a53 {
    padding: 8px 0;
  }
  
  .surface_19c3 img {
    height: 28px;
    width: auto;
  }
  
  .right-f845 {
    display: none !important;
  }
  
  .article_medium_ed0f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .article_medium_ed0f svg {
    width: 14px;
    height: 14px;
  }
  
  .hovered-2bc3 {
    padding: 6px;
  }
  
  .badge-3142 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .menu_5868,
  .badge_4b3d,
  .card_thick_07fa,
  .text-17f1,
  .accent_3164,
  .heading-96d5,
  .wrapper_orange_8a5e,
  .overlay_pink_634c,
  .alert_selected_74bf,
  .main_yellow_7c01,
  .outline_soft_0f7d,
  .filter_prev_fe84 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .secondary-fast-feb5,
  .dirty-6398 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .shade-under-d252,
  .tag-current-bbc4,
  .sidebar-south-5f84,
  .aside-4c65,
  .hover_next_9eec,
  .complex_629f,
  .article_da55 {
    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 */
  .easy-3365,
  .texture_iron_a1bd,
  .block-301b,
  .panel_focused_c0d2,
  .widget_first_ac1f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .paragraph-d0cd,
  .accent-5a36,
  .preview-cb29,
  .stone_9ecb {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .complex-29e2,
  .next_3f28 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .dropdown-over-e6e3,
  .pattern_ea75,
  .card_small_1b39,
  .title_2ae4 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .dynamic_75c4,
  .gallery-down-bfae,
  .easy_7020,
  .chip_b3d7,
  .gas_ee96,
  .frame-gas-4502 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .easy-3365,
  .texture_iron_a1bd,
  .panel_focused_c0d2 {
    max-width: none !important;
  }
  
  .pagination-c08d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .paragraph-d0cd {
    font-size: 1.5rem !important;
  }
  
  .accent-5a36 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .dropdown-8ccd,
  .iron-d9f7 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .preview-cb29 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .main-dirty-f1df {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .photo_408b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .easy-3365,
  .panel_focused_c0d2 {
    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: 69ea */
.shadow-element-n5 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.2;
}
