/* ═══════════════════════════════════════════════════
   VBallStars GLOBAL MOBILE HARDENING — v2026
   Future-leaning: clamp(), dvh, safe-area, touch
   ═══════════════════════════════════════════════════ */

/* ── Base reset for all mobile screen sizes ── */
@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
    width: 100%;
  }

  /* Ensure ALL containers use border-box and don't overflow */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  /* Responsive media */
  img, svg, canvas, video, iframe {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Tables scroll instead of breaking layout */
  table {
    max-width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent 16px font zoom on iOS */
  input, select, textarea, button {
    max-width: 100%;
    font-size: 16px !important;
  }

  /* Touch-friendly interaction */
  button, [role="button"], .btn, .er-button, .team-btn,
  .cd-team-tab, .menu-toggle, a, select, .cd-player-card {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* ── UNIVERSAL CONTAINER FIX ──
     Catches ALL pages: every container gets consistent mobile padding.
     Uses attribute selectors for inline-style + class selectors. */
  [style*="max-width:"],
  .container, .container-wide,
  .content-area-standard, .dashboard-container,
  .profile-container, .team-builder-container,
  .mood-check-container, .assessment-container,
  .results-container, .team-dashboard-wrapper,
  .coach-dashboard, .cd-wrap, .cd-post-roster,
  .er-container, .page-wrap, .dashboard-grid,
  .pr-container, .pr-wrap, .cad-wrap,
  .fc-hero-inner, .mc-body-pad,
  .team-header, .coach-athlete-profile,
  .page-header-standard, .page-header,
  .cd-header-inner {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: clamp(0.75rem, 4vw, 1.25rem) !important;
    padding-right: clamp(0.75rem, 4vw, 1.25rem) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* ── PADDING OVERRIDE: catch padding:0 5% and similar ── */
  [style*="padding: 0 5%"],
  [style*="padding:0 5%"],
  [style*="padding: 0 2rem"],
  [style*="padding:0 2rem"] {
    padding-left: clamp(0.75rem, 4vw, 1.25rem) !important;
    padding-right: clamp(0.75rem, 4vw, 1.25rem) !important;
  }

  /* ── HEADER/FIXED ELEMENTS don't get container padding ── */
  header, .header, .site-header, .er-hero,
  .dashboard-header, .team-header,
  .page-header, .cd-header {
    padding-left: clamp(0.75rem, 4vw, 1.25rem) !important;
    padding-right: clamp(0.75rem, 4vw, 1.25rem) !important;
  }

  /* ── GRID OVERRIDES ──
     Keep 2-column for pair-like grids, 1-column for denser grids */
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: clamp(0.5rem, 2vw, 0.75rem) !important;
  }

  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* ── KEYPAD / STATS CARDS: 2-col on mobile ── */
  [class*="kpi-row"],
  [class*="stats-grid"],
  [class*="stat-cards"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  /* ── RESPONSIVE FONT SCALING ── */
  h1 { font-size: clamp(1.25rem, 5vw, 1.75rem) !important; }
  h2 { font-size: clamp(1.1rem, 4.5vw, 1.5rem) !important; }
  h3 { font-size: clamp(0.95rem, 4vw, 1.25rem) !important; }
  h4 { font-size: clamp(0.85rem, 3.5vw, 1.1rem) !important; }
  p, li, label, .text-body { font-size: clamp(0.8rem, 3.2vw, 0.95rem) !important; }

  /* ── FLEX SAFETY ── */
  [style*="display: flex"],
  [style*="display:flex"] {
    min-width: 0;
    flex-wrap: wrap;
  }

  /* ── OVERFLOW SAFETY ── */
  .athlete-table,
  .table-responsive,
  .wp-block-table,
  [style*="overflow-x: auto"] {
    -webkit-overflow-scrolling: touch;
  }
}

/* ── EXTRA SMALL SCREENS (≤480px) ── */
@media (max-width: 480px) {
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns:repeat(2"],
  [class*="kpi-row"],
  [class*="stats-grid"] {
    grid-template-columns: 1fr !important;
  }

  h1 { font-size: clamp(1.1rem, 4.5vw, 1.5rem) !important; }
  h2 { font-size: clamp(1rem, 4vw, 1.35rem) !important; }

  /* Prevent long words from breaking layout */
  h1, h2, .page-title, [class*="title"], [class*="heading"] {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
/*
 * VBallStars Compact Layout System v2.1
 * Professional SVG card grid + section launchers
 * 3x3 card grid eliminates scrolling by hiding sections behind cards
 */
:root {
  --c-gap-xs: 0.375rem;
  --c-gap-sm: 0.5rem;
  --c-gap: 0.75rem;
  --c-gap-md: 1rem;
  --c-pad-xs: 0.5rem;
  --c-pad-sm: 0.75rem;
  --c-pad: 1rem;
  --c-pad-md: 1.25rem;
  --c-radius: 12px;
  --c-radius-sm: 8px;
  --c-shadow: 0 2px 8px rgba(0,0,0,.06);
  --c-shadow-hover: 0 8px 24px -4px rgba(30,58,138,.12);
  --c-border: #e5e7eb;
  --c-border-light: #f3f4f6;
  --c-bg: #ffffff;
  --c-bg-subtle: #f8fafc;
  --c-primary: #1e3a8a;
  --c-primary-light: #eff6ff;
  --c-accent: #d4af37;
  --c-text: #1f2937;
  --c-text-secondary: #6b7280;
  --c-success: #10b981;
  --c-warning: #f59e0b;
  --c-danger: #ef4444;
}
/* ═══ PROFESSIONAL GRID SYSTEM ═══ */
.p-grid {
  display: grid;
  gap: var(--c-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.p-grid-2 { display: grid; gap: var(--c-gap); grid-template-columns: repeat(2, 1fr); }
.p-grid-3 { display: grid; gap: var(--c-gap); grid-template-columns: repeat(3, 1fr); }
.p-grid-4 { display: grid; gap: var(--c-gap); grid-template-columns: repeat(4, 1fr); }
.p-grid-5 { display: grid; gap: var(--c-gap); grid-template-columns: repeat(5, 1fr); }
.p-grid-6 { display: grid; gap: var(--c-gap); grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1024px) {
  .p-launcher { grid-template-columns: repeat(2, 1fr); }
  .p-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .p-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .p-grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .p-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .p-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .p-grid-6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .p-launcher { grid-template-columns: repeat(2, 1fr); }
  .p-launcher-item { min-height: 80px; padding: var(--c-pad-xs); }
  .p-launcher-item .p-launcher-desc { display: none; }
  .p-grid-2, .p-grid-3, .p-grid-4, .p-grid-5, .p-grid-6 { grid-template-columns: 1fr; }
}
/* ═══ PROFESSIONAL CARD ═══ */
.p-card {
  background: var(--c-bg);
  border-radius: var(--c-radius);
  padding: var(--c-pad);
  border: 1px solid var(--c-border);
  transition: all .2s ease;
  overflow: hidden;
  position: relative;
}
.p-card:hover { border-color: var(--c-primary); }
.p-card-elevated {
  background: var(--c-bg);
  border-radius: var(--c-radius);
  padding: var(--c-pad);
  box-shadow: var(--c-shadow);
  border: none;
  transition: all .25s ease;
  overflow: hidden;
}
.p-card-elevated:hover {
  box-shadow: var(--c-shadow-hover);
  transform: translateY(-2px);
}
.p-card-flat { background: var(--c-bg-subtle); border-radius: var(--c-radius); padding: var(--c-pad); border: none; }
.p-card-accent { border-left: 3px solid var(--c-primary); background: var(--c-bg); border-radius: 0 var(--c-radius) var(--c-radius) 0; padding: var(--c-pad); }
.p-card-compact { padding: var(--c-pad-xs); }
.p-card-sm { padding: var(--c-pad-sm); }
.p-card-hdr { display: flex; align-items: center; justify-content: space-between; gap: var(--c-gap-sm); margin-bottom: var(--c-gap-sm); font-size: .8rem; font-weight: 600; color: var(--c-text); }
.p-card-hdr .p-icon { font-size: 1.25rem; flex-shrink: 0; }
.p-card-hdr .p-label { flex: 1; min-width: 0; }
.p-card-hdr .p-action { font-size: .7rem; color: var(--c-primary); text-decoration: none; white-space: nowrap; font-weight: 600; }
.p-card-body { font-size: .8rem; color: var(--c-text-secondary); line-height: 1.5; }
.p-card-body p { margin-bottom: var(--c-gap-xs); }
.p-card-body p:last-child { margin-bottom: 0; }
.p-card-ftr { margin-top: var(--c-gap-sm); padding-top: var(--c-gap-sm); border-top: 1px solid var(--c-border-light); font-size: .7rem; color: var(--c-text-secondary); }
/* ═══ STAT CARD ═══ */
.p-stat { text-align: center; padding: var(--c-pad-sm); }
.p-stat .p-stat-num { font-size: 1.75rem; font-weight: 800; color: var(--c-primary); line-height: 1; font-variant-numeric: tabular-nums; }
.p-stat .p-stat-lbl { font-size: .65rem; color: var(--c-text-secondary); margin-top: .15rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.p-stat .p-stat-sub { font-size: .6rem; color: var(--c-text-secondary); margin-top: .1rem; opacity: .7; }
.p-stat-row { display: flex; align-items: center; gap: var(--c-gap-sm); padding: var(--c-pad-xs); background: var(--c-bg-subtle); border-radius: var(--c-radius-sm); }
.p-stat-row .p-stat-num { font-size: 1.1rem; min-width: 32px; text-align: right; }
.p-stat-row .p-stat-lbl { font-size: .65rem; text-transform: none; letter-spacing: 0; }
/* ═══ METRIC ROW ═══ */
.p-metric { margin-bottom: var(--c-gap-sm); }
.p-metric:last-child { margin-bottom: 0; }
.p-metric-hdr { display: flex; justify-content: space-between; font-size: .7rem; font-weight: 600; color: var(--c-text); margin-bottom: .2rem; }
.p-metric-bar { height: 6px; background: var(--c-border-light); border-radius: 3px; overflow: hidden; }
.p-metric-bar-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
/* ═══ FOLDABLE ACCORDION ═══ */
.fd-section {
  border: 1px solid var(--c-border);
  border-radius: var(--c-radius-sm);
  margin-bottom: var(--c-gap);
  background: var(--c-bg);
  overflow: hidden;
}
.fd-section .fd-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--c-pad-xs) var(--c-pad-sm);
  background: var(--c-bg-subtle);
  cursor: pointer;
  font-weight: 600;
  font-size: .8rem;
  color: var(--c-primary);
  gap: var(--c-gap-sm);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.fd-section .fd-hdr:active { background: var(--c-primary-light); }
.fd-section .fd-hdr .fd-arrow { font-size: .6rem; color: var(--c-primary); transition: transform .25s; flex-shrink: 0; opacity: .6; }
.fd-section.open .fd-hdr .fd-arrow { transform: rotate(180deg); }
.fd-section .fd-bd { padding: 0 var(--c-pad-sm) var(--c-pad-sm); }
/* ═══ HORIZONTAL SCROLL ═══ */
.h-scroll { display: flex; gap: var(--c-gap); overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding-bottom: var(--c-gap-xs); }
.h-scroll > * { flex: 0 0 auto; scroll-snap-align: start; min-width: 200px; max-width: 260px; }
.h-scroll-wide > * { min-width: 250px; max-width: 300px; }
/* ═══ STICKY NAV ═══ */
.sticky-nav { position: sticky; top: 0; z-index: 500; display: flex; gap: .2rem; overflow-x: auto; padding: var(--c-pad-xs); background: rgba(255,255,255,.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--c-border); scrollbar-width: thin; }
.sticky-nav a { white-space: nowrap; padding: .25rem .6rem; border-radius: 20px; font-size: .65rem; font-weight: 600; color: var(--c-text-secondary); text-decoration: none; transition: all .15s; flex-shrink: 0; }
.sticky-nav a:hover, .sticky-nav a.active { background: var(--c-primary); color: #fff; }
/* ═══ GLOBAL INLINE OVERRIDES ═══ */
[style*="padding: 6rem"], [style*="padding:6rem"],
[style*="padding: 5rem"], [style*="padding:5rem"],
[style*="padding: 4rem"], [style*="padding:4rem"] { padding-top: var(--c-pad-md) !important; padding-bottom: var(--c-pad-md) !important; }
[style*="padding: 3rem"], [style*="padding:3rem"] { padding-top: var(--c-pad) !important; padding-bottom: var(--c-pad) !important; }
[style*="padding: 2rem 1"], [style*="padding:2rem 1"] { padding: var(--c-pad) !important; }
[style*="gap: 3rem"], [style*="gap:3rem"] { gap: var(--c-gap-md) !important; }
[style*="gap: 4rem"], [style*="gap:4rem"] { gap: var(--c-gap-md) !important; }
[style*="gap: 2rem"], [style*="gap:2rem"] { gap: var(--c-gap) !important; }
[style*="margin-bottom: 3rem"], [style*="margin-bottom:3rem"] { margin-bottom: var(--c-gap-md) !important; }
[style*="margin-bottom: 2rem"], [style*="margin-bottom:2rem"] { margin-bottom: var(--c-gap-md) !important; }
[style*="margin-bottom: 1.5rem"]:not(.section-header):not(.section-card) { margin-bottom: var(--c-gap) !important; }
[style*="font-size: 2.75rem"] { font-size: clamp(1.25rem, 4vw, 1.75rem) !important; line-height: 1.2 !important; }
[style*="font-size: 2.5rem"]:not(.pr-price):not(.stat-counter *) { font-size: clamp(1.1rem, 3.5vw, 1.5rem) !important; }
[style*="margin-top: 2rem"]:not(.next-step-banner *) { margin-top: var(--c-gap) !important; }
[style*="margin-top: 1.5rem"]:not(.section-header):not(.next-step-banner *) { margin-top: var(--c-gap) !important; }
h1:where(.wp-block-heading).has-background,h2:where(.wp-block-heading).has-background,h3:where(.wp-block-heading).has-background,h4:where(.wp-block-heading).has-background,h5:where(.wp-block-heading).has-background,h6:where(.wp-block-heading).has-background{padding:1.25em 2.375em}h1.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h1.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]),h2.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h2.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]),h3.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h3.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]),h4.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h4.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]),h5.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h5.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]),h6.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h6.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]){rotate:180deg}.wp-block-table{overflow-x:auto}.wp-block-table table{border-collapse:collapse;width:100%}.wp-block-table thead{border-bottom:3px solid}.wp-block-table tfoot{border-top:3px solid}.wp-block-table td,.wp-block-table th{border:1px solid;padding:.5em}.wp-block-table .has-fixed-layout{table-layout:fixed;width:100%}.wp-block-table .has-fixed-layout td,.wp-block-table .has-fixed-layout th{word-break:break-word}.wp-block-table.aligncenter,.wp-block-table.alignleft,.wp-block-table.alignright{display:table;width:auto}.wp-block-table.aligncenter td,.wp-block-table.aligncenter th,.wp-block-table.alignleft td,.wp-block-table.alignleft th,.wp-block-table.alignright td,.wp-block-table.alignright th{word-break:break-word}.wp-block-table .has-subtle-light-gray-background-color{background-color:#f3f4f5}.wp-block-table .has-subtle-pale-green-background-color{background-color:#e9fbe5}.wp-block-table .has-subtle-pale-blue-background-color{background-color:#e7f5fe}.wp-block-table .has-subtle-pale-pink-background-color{background-color:#fcf0ef}.wp-block-table.is-style-stripes{background-color:initial;border-collapse:inherit;border-spacing:0}.wp-block-table.is-style-stripes tbody tr:nth-child(odd){background-color:#f0f0f0}.wp-block-table.is-style-stripes.has-subtle-light-gray-background-color tbody tr:nth-child(odd){background-color:#f3f4f5}.wp-block-table.is-style-stripes.has-subtle-pale-green-background-color tbody tr:nth-child(odd){background-color:#e9fbe5}.wp-block-table.is-style-stripes.has-subtle-pale-blue-background-color tbody tr:nth-child(odd){background-color:#e7f5fe}.wp-block-table.is-style-stripes.has-subtle-pale-pink-background-color tbody tr:nth-child(odd){background-color:#fcf0ef}.wp-block-table.is-style-stripes td,.wp-block-table.is-style-stripes th{border-color:#0000}.wp-block-table.is-style-stripes{border-bottom:1px solid #f0f0f0}.wp-block-table .has-border-color td,.wp-block-table .has-border-color th,.wp-block-table .has-border-color tr,.wp-block-table .has-border-color>*{border-color:inherit}.wp-block-table table[style*=border-top-color] tr:first-child,.wp-block-table table[style*=border-top-color] tr:first-child td,.wp-block-table table[style*=border-top-color] tr:first-child th,.wp-block-table table[style*=border-top-color]>*,.wp-block-table table[style*=border-top-color]>* td,.wp-block-table table[style*=border-top-color]>* th{border-top-color:inherit}.wp-block-table table[style*=border-top-color] tr:not(:first-child){border-top-color:initial}.wp-block-table table[style*=border-right-color] td:last-child,.wp-block-table table[style*=border-right-color] th,.wp-block-table table[style*=border-right-color] tr,.wp-block-table table[style*=border-right-color]>*{border-right-color:inherit}.wp-block-table table[style*=border-bottom-color] tr:last-child,.wp-block-table table[style*=border-bottom-color] tr:last-child td,.wp-block-table table[style*=border-bottom-color] tr:last-child th,.wp-block-table table[style*=border-bottom-color]>*,.wp-block-table table[style*=border-bottom-color]>* td,.wp-block-table table[style*=border-bottom-color]>* th{border-bottom-color:inherit}.wp-block-table table[style*=border-bottom-color] tr:not(:last-child){border-bottom-color:initial}.wp-block-table table[style*=border-left-color] td:first-child,.wp-block-table table[style*=border-left-color] th,.wp-block-table table[style*=border-left-color] tr,.wp-block-table table[style*=border-left-color]>*{border-left-color:inherit}.wp-block-table table[style*=border-style] td,.wp-block-table table[style*=border-style] th,.wp-block-table table[style*=border-style] tr,.wp-block-table table[style*=border-style]>*{border-style:inherit}.wp-block-table table[style*=border-width] td,.wp-block-table table[style*=border-width] th,.wp-block-table table[style*=border-width] tr,.wp-block-table table[style*=border-width]>*{border-style:inherit;border-width:inherit}.is-small-text{font-size:.875em}.is-regular-text{font-size:1em}.is-large-text{font-size:2.25em}.is-larger-text{font-size:3em}.has-drop-cap:not(:focus):first-letter{float:left;font-size:8.4em;font-style:normal;font-weight:100;line-height:.68;margin:.05em .1em 0 0;text-transform:uppercase}body.rtl .has-drop-cap:not(:focus):first-letter{float:none;margin-left:.1em}p.has-drop-cap.has-background{overflow:hidden}:root :where(p.has-background){padding:1.25em 2.375em}:where(p.has-text-color:not(.has-link-color)) a{color:inherit}p.has-text-align-left[style*="writing-mode:vertical-lr"],p.has-text-align-right[style*="writing-mode:vertical-rl"]{rotate:180deg}