/* ══════════════════════════════════════════════════════════════════════════
   MOBILE.CSS — ProbWin mobile-first overrides
   Loaded after all other stylesheets, scoped to @media (max-width: 850px)
   ══════════════════════════════════════════════════════════════════════════ */


/* ═══════════ 1) CRITICAL — iOS auto-zoom prevention ═══════════════════
   iOS Safari zooms in on any input with font-size < 16px.
   Force all inputs, selects, textareas to 16px on mobile.
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 850px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}


/* ═══════════ 2) VIEWPORT SATURATION — reduce fixed header stack ═══════
   navbar (88px) + promo-banner (~44px) + rail (~80px) = 212px = 26% of
   iPhone viewport. Compact it on mobile.
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 850px) {
  /* Compact navbar height */
  :root {
    --nav-height: 64px;
    --stick-top: 64px;
  }
  .topbar {
    height: 64px;
  }
  .nav-logo img, .nav-logo .logo-fallback {
    width: 32px;
    height: 32px;
  }
  .nav-logo span {
    font-size: 20px;
    letter-spacing: 1px;
  }
  .nav-logo {
    gap: 8px;
    padding-right: 12px;
  }
  .navbar {
    padding: 0 12px;
  }

  /* Promo banner: NOT sticky on mobile — scrolls with page to free viewport */
  .promo-banner {
    position: relative !important;
    top: 0 !important;
    font-size: 12px;
    padding: 6px 40px 6px 12px;
    min-height: 36px;
    z-index: 10;
  }
  .promo-banner::before {
    font-size: 14px;
  }
  .promo-banner a {
    padding: 3px 10px;
    font-size: 11px;
  }
  .promo-close {
    width: 20px;
    height: 20px;
    right: 8px;
  }

  /* Body padding: only navbar is fixed now (no promo offset) */
  body.has-promo,
  body:not(.has-promo) {
    padding-top: 64px;
  }
  body.has-promo.has-apology,
  body:not(.has-promo).has-apology {
    padding-top: 112px;
  }
  /* WC2026 sticky banner mobile : la .promo-banner est en position: relative
     (cf. règle ci-dessus), donc elle prend sa place dans le flow naturel.
     On garde le padding-top à 104 (navbar 64 + WC 40) — la promo-banner s'ajoute
     ensuite naturellement dans le flow. */
  body.has-wc-banner,
  body.has-promo.has-wc-banner {
    padding-top: 104px !important;
  }
  /* La .promo-banner reste relative (top:0) sur mobile — pas besoin de la pousser. */

  /* Apology banner: position relative like promo (scrolls with page) */
  .apology-banner {
    position: relative !important;
    top: 0 !important;
    height: auto;
    min-height: 40px;
    padding: 6px 36px 6px 8px;
  }

  /* Compact games rail */
  .gamesrail-wrap {
    border-bottom-width: 1px;
  }
  .gamesrail {
    padding: 10px 12px;
    gap: 8px;
    scroll-snap-type: x mandatory !important;
    scroll-padding-left: 12px !important;
  }
  .game-pill {
    min-width: 160px;
    padding: 10px 12px;
    gap: 8px;
    border-radius: 12px;
    scroll-snap-align: start !important;
  }
  .game-pill .team-col .team-logo {
    width: 40px;
    height: 40px;
  }
  .game-pill .team-col .name {
    font-size: 11px;
  }
  .game-pill .teams-row {
    gap: 10px;
  }
  .game-pill .vs-badge {
    font-size: 13px;
  }
  .game-pill .sport-badge {
    font-size: 9px;
    padding: 3px 7px;
  }
  .game-pill .game-time {
    font-size: 11px;
  }
  .game-pill .game-info {
    gap: 4px;
  }
  .date-badge {
    font-size: 11px;
    padding: 6px 10px;
  }

  /* Fade masks — stronger right fade to hint scrollable content */
  .gamesrail-wrap::before {
    width: 12px;
  }
  .gamesrail-wrap::after {
    width: 24px;
    background: linear-gradient(to right, transparent, #0B0F14) !important;
  }

  /* Hide rail nav buttons on mobile (swipe instead) */
  .rail-btn {
    display: none !important;
  }

  /* Rail scroll dots indicator */
  .rail-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 4px;
  }
  .rail-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.2s ease;
  }
  .rail-dot.active {
    background: #FFC73A;
    transform: scale(1.3);
  }
}


/* ═══════════ 3) TOUCH TARGETS — minimum 48x48px ══════════════════════
   WCAG 2.2 Success Criterion 2.5.8 Target Size (Minimum)
   All interactive elements must be at least 48x48px on mobile.
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 850px) {
  /* Challenge prediction buttons */
  .challenge-btn {
    padding: 14px 24px;
    min-height: 48px;
    font-size: .88rem;
  }

  /* Streak buttons */
  .streak-btn {
    padding: 14px 24px;
    min-height: 48px;
  }

  /* Filter chips — wider tap zone */
  .filter-chip span {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .pill-toggle {
    min-height: 44px;
  }

  /* Page buttons */
  .page-btn {
    min-width: 40px;
    min-height: 40px;
  }

  /* Cookie banner buttons */
  .cookie-btn {
    min-height: 48px;
    padding: 12px 20px;
  }

  /* Avatar buttons */
  .nav-avatar-btn {
    min-width: 44px;
    min-height: 44px;
  }

  /* CTA buttons */
  .cta-btn,
  .btn,
  .btn-primary,
  .pick-overlay-btn,
  .signup-cta-btn,
  .challenge-pro-btn {
    min-height: 48px;
  }

  /* Sport tabs */
  .sport-tab {
    min-height: 44px;
  }
}


/* ═══════════ 4) FLASH MESSAGES — account for stacked headers ═════════ */
@media (max-width: 850px) {
  .flash-messages {
    top: 68px !important;
    width: 94% !important;
    max-width: 400px;
    padding: 0 4px;
  }
  .flash-msg {
    font-size: .82rem;
    padding: 10px 12px;
  }
}


/* ═══════════ 5) HOMEPAGE MOBILE ══════════════════════════════════════ */
@media (max-width: 850px) {
  .hero {
    padding: 48px 0 32px;
  }
  .hero h1 {
    font-size: 28px;
    line-height: 1.15;
    padding: 0 8px;
  }
  .hero p {
    font-size: 14px;
    padding: 0 12px;
  }
  .hero .container {
    padding: 0 12px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 24px;
  }
}


/* ═══════════ 6) RESULTS PAGE — readable tables ══════════════════════ */
@media (max-width: 850px) {
  .results-page {
    padding: 16px 12px 48px;
  }

  /* Minimum 12px for all table cells */
  .picks-table td,
  .picks-table th {
    font-size: 11px;
    padding: 8px 5px;
  }

  /* Result pills bigger for readability */
  .result-pill {
    font-size: 11px;
    padding: 4px 8px;
  }

  /* Badges slightly bigger */
  .sport-badge,
  .market-badge,
  .side-chip,
  .conf-badge {
    font-size: 10px;
  }

  /* Horizontal scroll indicator */
  .table-responsive {
    position: relative;
  }
  .table-responsive::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(11,15,20,0.9));
    pointer-events: none;
    z-index: 2;
    opacity: 1;
    transition: opacity 0.3s;
  }

  /* Filters: scrollable row, not stacked */
  .filters-bar {
    padding: 12px;
    gap: 10px;
  }

  /* Charts responsive */
  .charts-row {
    grid-template-columns: 1fr;
  }

  /* KPIs: stack on very small */
  .kpis-row {
    gap: 12px;
    flex-wrap: wrap;
  }

  /* ROI display compact */
  .roi-display {
    padding: 10px 16px;
  }
  .roi-value {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .picks-table td,
  .picks-table th {
    font-size: 10px;
    padding: 6px 3px;
  }
}


/* ═══════════ 7) GAME DETAIL PAGES — mobile optimization ═════════════ */
@media (max-width: 850px) {
  /* ---- 7a) MATCHUP HERO — compact horizontal layout ---- */

  /* NHL matchup (uses .matchup, .team-logo, .team-name) */
  .hero-card {
    padding: 20px 14px !important;
    margin-bottom: 16px;
  }
  .matchup {
    flex-direction: row !important;
    gap: 12px !important;
    align-items: center;
  }
  .team-logo {
    width: 72px !important;
    height: 72px !important;
  }
  .team-name {
    font-size: 16px !important;
    line-height: 1.1;
  }
  .team-record {
    font-size: 12px;
  }
  .vs-center {
    order: 0 !important;
    margin: 0 4px !important;
  }
  .vs-text {
    font-size: 22px !important;
  }
  .game-info {
    margin-top: 12px;
    font-size: 13px !important;
    padding: 6px 14px !important;
  }
  .status-wrapper {
    margin-top: 8px;
  }
  .countdown {
    gap: 6px;
  }
  .countdown-item {
    padding: 6px 10px !important;
    min-width: 44px !important;
  }
  .countdown-value {
    font-size: 18px !important;
  }
  .countdown-unit {
    font-size: 8px;
  }
  .countdown-label {
    font-size: 9px;
    margin-bottom: 6px;
  }
  .b2b-badge {
    font-size: 9px;
    margin-top: 4px;
  }

  /* NBA matchup (uses .nba-hero-matchup, .nba-hero-logo, .nba-hero-name) */
  .nba-hero {
    padding: 16px 10px !important;
    border-radius: 16px;
  }
  .nba-hero-matchup {
    flex-direction: row !important;
    gap: 6px !important;
    align-items: center;
    justify-content: center !important;
  }
  .nba-hero-team {
    flex: 1;
    min-width: 0;
  }
  .nba-hero-logo {
    width: 56px !important;
    height: 56px !important;
    margin-bottom: 6px !important;
  }
  .nba-hero-name {
    font-size: 14px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .nba-hero-center {
    order: 0 !important;
    flex-shrink: 0;
  }
  .nba-hero-vs {
    font-size: 20px !important;
  }
  .nba-hero-date {
    font-size: 11px !important;
    padding: 6px 10px !important;
    margin-top: 8px !important;
  }
  .nba-hero-countdown {
    margin-top: 8px !important;
  }
  .nba-countdown-label {
    font-size: 9px;
    letter-spacing: 1px;
    margin-bottom: 4px;
  }
  .nba-b2b {
    font-size: 8px;
    padding: 1px 6px;
  }

  /* Soccer matchup (uses .soccer-hero-matchup, .soccer-hero-logo, .soccer-hero-name) */
  .soccer-hero {
    padding: 16px 10px !important;
    border-radius: 16px;
  }
  .soccer-hero-matchup {
    flex-direction: row !important;
    gap: 6px !important;
    align-items: center;
    justify-content: center !important;
  }
  .soccer-hero-team {
    flex: 1;
    min-width: 0;
  }
  .soccer-hero-logo {
    width: 56px !important;
    height: 56px !important;
    margin-bottom: 6px !important;
  }
  .soccer-hero-name {
    font-size: 14px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .soccer-hero-center {
    order: 0 !important;
    flex-shrink: 0;
  }
  .soccer-hero-vs {
    font-size: 20px !important;
  }
  .soccer-hero-date {
    font-size: 11px !important;
    padding: 6px 10px !important;
    margin-top: 8px !important;
  }
  .soccer-hero-countdown {
    margin-top: 8px !important;
  }
  .soccer-countdown-label {
    font-size: 9px;
    letter-spacing: 1px;
    margin-bottom: 4px;
  }
  .soccer-hero-label {
    font-size: 9px;
    padding: 2px 6px;
  }
  .league-badge {
    font-size: 10px;
    padding: 3px 8px;
    margin-bottom: 8px !important;
  }

  /* Tennis matchup (already row at 768px, just compact sizes) */
  .tennis-hero {
    padding: 16px 12px !important;
    border-radius: 16px;
  }

  /* ---- 7b) GOALIES — single column, no truncation ---- */
  .goalies-card {
    padding: 16px 14px;
  }
  .goalies-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .goalie-name {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    font-size: 13px;
  }
  .goalie-item {
    padding: 10px 12px !important;
    gap: 10px !important;
  }
  .goalie-team-logo {
    width: 32px !important;
    height: 32px !important;
  }
  .goalie-stats {
    gap: 12px;
  }
  .goalies-title {
    font-size: 15px;
  }

  /* ---- 7c) LOCK OVERLAYS — hide second one on mobile ---- */
  .picks-grid .pick-card:nth-child(2) .pick-overlay {
    display: none;
  }
  /* Show a single combined lock message before the grid */
  .picks-grid .pick-card:first-child .pick-overlay {
    border-radius: 16px;
  }
  .picks-grid .pick-card:first-child .pick-overlay-title {
    font-size: 16px;
  }
  .picks-grid .pick-card:first-child .pick-overlay-text {
    font-size: 13px;
  }

  /* Pick cards: single column */
  .picks-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pick-card {
    padding: 18px;
    border-radius: 16px;
  }

  /* Pick display compact */
  .pick-display {
    padding: 14px;
    gap: 12px;
  }
  .pick-team-logo {
    width: 40px;
    height: 40px;
  }
  .pick-team-name {
    font-size: 17px;
  }
  .pick-line-value {
    font-size: 28px;
  }

  /* Stats grid: 2 columns */
  .stats-grid,
  .stats-grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* AI card compact */
  .ai-card {
    padding: 20px 16px;
    border-radius: 16px;
  }
  .ai-header {
    gap: 12px;
    margin-bottom: 20px;
  }
  .ai-title-text h2 {
    font-size: 20px;
  }
  .ai-icon {
    width: 40px;
    height: 40px;
  }

  /* Section cards */
  .section-card {
    padding: 16px;
    border-radius: 14px;
  }

  /* CTA card */
  .cta-card {
    padding: 32px 20px;
    border-radius: 16px;
  }
  .cta-title {
    font-size: 24px;
  }
  .cta-text {
    font-size: 14px;
  }

  /* Form grid (soccer/tennis) */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Legend card compact */
  .legend-card {
    padding: 14px 16px;
  }
  .legend-items {
    gap: 16px;
  }

  /* Breadcrumbs: truncate on mobile */
  .breadcrumbs {
    font-size: 12px;
    gap: 4px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .breadcrumbs::-webkit-scrollbar {
    display: none;
  }

  /* H2H rows */
  .h2h-row {
    padding: 10px 12px;
  }
  .h2h-score {
    font-size: 15px;
    padding: 4px 10px;
    min-width: 60px;
  }
}


/* ═══════════ 8) STICKY BOTTOM CTA — FREE users on game pages ════════
   A persistent bottom bar with CTA for non-premium users viewing
   game detail pages. Mimics DraftKings/FanDuel sticky footer pattern.
   Added via JS/template, styled here.
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 850px) {
  .mobile-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(11,15,20,0.92), rgba(11,15,20,0.98));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,199,58,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
    animation: stickySlideUp 0.3s ease-out;
    transition: transform 0.3s ease-in, opacity 0.3s ease-in;
  }
  .mobile-sticky-cta.dismissing {
    transform: translateY(100%);
    opacity: 0;
  }
  .sticky-dismiss {
    position: absolute;
    top: -10px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1E293B;
    border: 1px solid rgba(255,255,255,0.15);
    color: #94A3B8;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
  }
  .sticky-dismiss:hover {
    color: #fff;
    background: #334155;
  }
  .mobile-sticky-cta .sticky-text {
    flex: 1;
    font-size: 13px;
    color: #94A3B8;
    line-height: 1.3;
  }
  .mobile-sticky-cta .sticky-text strong {
    color: #FFC73A;
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
  }
  .mobile-sticky-cta .sticky-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #FFD700, #FFC73A);
    color: #0B0F14;
    font-weight: 700;
    font-size: 13px;
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(255,199,58,0.3);
    transition: all 0.2s;
    flex-shrink: 0;
  }
  .mobile-sticky-cta .sticky-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255,199,58,0.4);
  }

  @keyframes stickySlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Extra padding on body to avoid content behind sticky CTA */
  body.has-sticky-cta {
    padding-bottom: 72px;
  }
}


/* ═══════════ 8.5) BOTTOM TAB BAR (UX app pattern) ═══════════════════════
   Replaces the single-CTA sticky bar. 5 tabs: Sports / Pick Gratuit /
   Résultats / Compte-Essai / Menu. Always visible on mobile pages.
   ═══════════════════════════════════════════════════════════════════════ */
.mobile-tab-bar {
  display: none;
}
@media (max-width: 850px) {
  /* Affichée UNIQUEMENT quand le body a has-tab-bar (posée par le JS de
     base.html, qui exclut les funnels auth/checkout). Sans ce gating, la barre
     apparaissait sur les pages exclues SANS le padding-bottom du body (contenu
     masqué) et AVEC le hamburger (redondant). */
  .mobile-tab-bar {
    display: none;
  }
  body.has-tab-bar .mobile-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 95;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: linear-gradient(180deg, rgba(11,15,20,0.92) 0%, rgba(6,8,12,0.98) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,199,58,0.15);
    box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    min-height: 60px;
  }

  .mobile-tab-bar .tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-family: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
    border-radius: 10px;
    transition: color .2s, background .2s, transform .15s;
    min-height: 48px;
    position: relative;
  }

  .mobile-tab-bar .tab-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    transition: stroke-width .2s;
  }

  /* Dot « en direct » sur l'onglet Live (has_live_matches, cache 15s) —
     état réel uniquement, jamais un ornement permanent */
  .mobile-tab-bar .tab-live-dot {
    position: absolute;
    top: 5px;
    left: calc(50% + 8px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
    animation: pw-live-pulse 1.6s infinite ease-out;
  }
  @keyframes pw-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
  }

  .mobile-tab-bar .tab-item span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1;
    text-align: center;
  }

  /* Active state */
  .mobile-tab-bar .tab-item.active {
    color: #FFD700;
  }
  .mobile-tab-bar .tab-item.active svg {
    stroke-width: 2.5;
  }
  .mobile-tab-bar .tab-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
    border-radius: 0 0 2px 2px;
  }

  /* Tap feedback */
  .mobile-tab-bar .tab-item:active {
    transform: scale(0.94);
    background: rgba(255,255,255,0.04);
  }

  /* Flagship tab (Pick Gratuit) — gold highlight */
  .mobile-tab-bar .tab-flagship {
    color: #FBBF24;
  }
  .mobile-tab-bar .tab-flagship svg {
    filter: drop-shadow(0 0 4px rgba(251,191,36,0.4));
  }

  /* CTA tab (non-logged Essai gratuit) — filled pill */
  .mobile-tab-bar .tab-cta {
    color: #0B0F14;
    background: linear-gradient(135deg, #FFD700, #FFC73A);
    margin: 4px;
    box-shadow: 0 2px 10px rgba(255,199,58,0.3);
    font-weight: 700;
  }
  .mobile-tab-bar .tab-cta span {
    font-weight: 800;
  }

  /* Body padding so content doesn't hide behind the bar */
  body.has-tab-bar {
    padding-bottom: 68px;
  }
  body.has-tab-bar.has-sticky-cta {
    /* Stacking protection — prefer tab bar, forget legacy sticky */
    padding-bottom: 68px;
  }
  /* Hide legacy sticky CTA if it ever appears (belt+suspenders) */
  body.has-tab-bar .mobile-sticky-cta {
    display: none !important;
  }

}
}


/* ═══════════ 9) SIGNUP / AUTH PAGES ═══════════════════════════════════ */
@media (max-width: 850px) {
  .auth-page {
    padding: 16px 12px;
  }
  .auth-card {
    padding: 24px 18px !important;
  }
  .auth-title {
    font-size: 22px;
  }

  /* Password reset page */
  .form-group input {
    font-size: 16px;
    padding: 14px 16px;
  }
  .auth-form .btn {
    font-size: 16px;
    padding: 16px 20px;
  }
}


/* ═══════════ 10) PRICING PAGE ════════════════════════════════════════ */
@media (max-width: 850px) {
  .pricing-hero {
    padding: 24px 0 8px;
  }
  .pricing-title {
    font-size: 28px;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .p-card {
    padding: 18px 16px;
  }
  .p-amount {
    font-size: 36px;
  }
  .p-title {
    font-size: 20px;
  }
  .p-feats li {
    font-size: 14px;
  }
  .billing-toggle {
    margin: 12px auto 6px;
    max-width: calc(100vw - 24px);
  }
  /* Sélecteur renforcé : homepage.css utilise .billing-toggle .bt-pill (spécificité
     supérieure à .bt-pill seul) → sans ça, la règle compacte ne s'applique jamais
     sur la home et le toggle déborde du viewport (surtout EN, libellés longs) */
  .billing-toggle .bt-pill {
    padding: 8px 12px;
    font-size: 14px;
  }
  .billing-toggle .save {
    font-size: 10px;
  }

  /* FAQ on pricing */
  .faq-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .faq-item {
    padding: 12px 14px;
  }
  .faq-item summary {
    font-size: 14px;
  }
}


/* ═══════════ 11) CHALLENGE /defi/ PAGE ═══════════════════════════════ */
@media (max-width: 850px) {
  /* Challenge overlay in game pages */
  .challenge-overlay {
    padding: 18px 14px;
    margin: 12px 0;
  }
  .challenge-overlay-title {
    font-size: 1rem;
  }
  .challenge-overlay-buttons {
    gap: 10px;
    flex-wrap: wrap;
  }
  .challenge-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  /* Progress card */
  .challenge-progress {
    padding: 14px 12px;
  }
  .challenge-score-num {
    font-size: 1.3rem;
  }

  /* Streak overlay */
  .streak-overlay {
    padding: 18px 14px;
  }
}


/* ═══════════ 12) FOOTER — collapsible sections on mobile ════════════ */
@media (max-width: 600px) {
  .site-footer {
    padding: 36px 16px 24px;
    margin-top: 40px;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }

  /* Make footer columns collapsible */
  .footer-col h3 {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 0;
  }
  .footer-col h3::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform 0.2s;
    flex-shrink: 0;
  }
  .footer-col.open h3::after {
    transform: rotate(-135deg);
  }
  .footer-col a,
  .footer-col .footer-social-link {
    display: none;
  }
  .footer-col.open a,
  .footer-col.open .footer-social-link {
    display: flex;
    justify-content: center;
  }
  .footer-col.open {
    gap: 10px;
  }

  /* Brand section always visible */
  .footer-brand a,
  .footer-brand p,
  .footer-brand .footer-email {
    display: flex;
    justify-content: center;
  }

  .footer-bottom {
    margin-top: 24px;
    padding-top: 16px;
  }
  .footer-bottom p {
    font-size: 12px;
  }

  /* Legal bar wrap better */
  .legalbar {
    font-size: 12px;
    padding: 10px 16px;
    line-height: 1.5;
  }
}


/* ═══════════ 13) ACCOUNT / MON COMPTE ═══════════════════════════════ */
@media (max-width: 850px) {
  /* Account page cards */
  .acct-main {
    padding: 16px 12px;
  }
  .acct-section .glass-card,
  .acct-section .glass {
    padding: 16px 14px;
    border-radius: 14px;
  }
}


/* ═══════════ 14) SPORT PAGES (listing) ══════════════════════════════ */
@media (max-width: 850px) {
  /* Match cards on sport listing pages */
  .container {
    padding: 0 12px;
  }

  /* Title sizing */
  .title {
    font-size: 22px;
  }

  /* Cards grid */
  .grid.cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Card padding compact */
  .card {
    padding: 12px;
  }

  /* Stage card */
  .stage {
    padding: 12px;
    margin: 12px auto 0;
    border-radius: 12px;
  }

  /* Classements NBA/WNBA/NFL : .conference-box a overflow:hidden (radius) dans
     les <style> inline des templates (chargés APRÈS mobile.css → ils gagnent la
     cascade) → la table (>390px) était clippée, colonnes coupées.
     !important requis pour rendre la table scrollable horizontalement. */
  .conference-box {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}


/* ═══════════ 15) EXIT INTENT MODAL ══════════════════════════════════ */
@media (max-width: 850px) {
  .exit-modal-content {
    padding: 24px 18px;
    margin: 8px;
    max-width: 95vw;
  }
  .exit-modal-header h3 {
    font-size: 18px;
  }
  .exit-option {
    padding: 12px 14px;
  }
  .exit-option-label {
    font-size: 14px;
  }
  .exit-email-field input {
    font-size: 16px;
  }
  .exit-textarea {
    font-size: 16px;
  }
  .exit-promo-code {
    font-size: 20px;
  }
  .exit-promo-box {
    flex-direction: column;
    gap: 8px;
    padding: 14px;
  }
}


/* ═══════════ 16) GENERAL MOBILE UTILITIES ═══════════════════════════ */
@media (max-width: 850px) {
  /* Scroll momentum on all overflow containers */
  .table-responsive,
  .gamesrail,
  .sport-tabs,
  .filter-options {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  /* Disable hover-only effects (prevent sticky hover on touch) */
  .card.clickable:hover {
    transform: none;
  }
  .stat-box:hover {
    transform: none;
    box-shadow: none;
  }
  .pick-card:hover {
    transform: none;
    box-shadow: none;
  }

  /* Reduce costly effects on mobile */
  .section-gradient::before {
    filter: blur(30px);
    opacity: 0.6;
  }

  /* Container padding */
  .container-narrow {
    padding-inline: 1rem;
  }
  .container-wide {
    padding-inline: 1rem;
  }

  /* Text wrapping safety */
  h1, h2, h3 {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Prevent horizontal overflow */
  body {
    overflow-x: hidden;
  }
}


/* ═══════════ 16b) COOKIE BANNER — compact on mobile ═════════════════ */
@media (max-width: 850px) {
  .cookie-banner {
    padding: 12px 14px;
  }
  .cookie-content {
    flex-direction: row !important;
    text-align: left !important;
    gap: 12px;
    align-items: center;
  }
  .cookie-text {
    flex-direction: row !important;
    gap: 8px;
    flex: 1;
  }
  .cookie-text svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  .cookie-text p {
    font-size: 12px;
    line-height: 1.3;
  }
  .cookie-buttons {
    width: auto !important;
    flex-shrink: 0;
    gap: 8px;
  }
  .cookie-btn {
    padding: 8px 14px !important;
    font-size: 12px;
    min-height: 36px;
    flex: 0 !important;
    white-space: nowrap;
  }
}


/* ═══════════ 17) SAFE AREA — iPhone notch / home indicator ══════════ */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 850px) {
    .site-footer {
      padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
    .cookie-banner {
      padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    .mobile-sticky-cta {
      padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
  }
}


/* ═══════════ 18) SIGNUP WELCOME PAGE ═════════════════════════════════ */
@media (max-width: 850px) {
  .signup-modal-content {
    padding: 28px 20px;
    border-radius: 18px;
  }
  .signup-modal-btn {
    font-size: 15px;
    padding: 14px 20px;
  }
}


/* ═══════════ 19) GUIDE / ARTICLE PAGES ══════════════════════════════ */
@media (max-width: 850px) {
  .seo-section {
    padding: 20px 14px;
  }
  .seo-section h2 {
    font-size: 18px;
  }
  .seo-content {
    font-size: 13px;
  }
}


/* ═══════════ 20) PERFORMANCE — disable heavy animations ═════════════ */
@media (max-width: 850px) and (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Reduce GPU-intensive effects on all mobile */
@media (max-width: 850px) {
  .ring-anim {
    display: none !important;
  }
  /* Reduce backdrop-filter usage for performance */
  .glass,
  .glass-strong,
  .glass-card {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
}


/* ═══════════ 21) PWA INSTALL PROMPT (2e visite mobile) ═══════════════
   Bannière custom pilotée par pwa-install.js : beforeinstallprompt sur
   Android/Chrome, instructions Partager→Écran d'accueil sur iOS.
   Positionnée au-dessus de la bottom tab bar (z-index 95). ═══════════ */
@media (max-width: 850px) {
  .pwa-install-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 16px;
    z-index: 96;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 40px 14px 14px;
    background: linear-gradient(180deg, rgba(15, 20, 28, 0.97) 0%, rgba(6, 8, 12, 0.99) 100%);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 199, 58, 0.3);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    transform: translateY(calc(120% + 96px));
    transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  }
  body.has-tab-bar .pwa-install-banner {
    bottom: 80px;   /* au-dessus de la tab bar (68px + marge) */
  }
  .pwa-install-banner.visible {
    transform: translateY(0);
  }
  .pwa-install-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .pwa-install-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
  }
  .pwa-install-text strong {
    font-size: 14px;
    color: #fff;
    line-height: 1.25;
  }
  .pwa-install-text span {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
  }
  .pwa-ios-share {
    vertical-align: -2px;
    color: #FFC73A;
  }
  .pwa-install-btn,
  .pwa-install-ok {
    flex-shrink: 0;
    min-height: 44px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
  }
  .pwa-install-btn {
    background: #FFC73A;
    color: #0B0F14;
  }
  .pwa-install-ok {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
  }
  .pwa-install-close {
    position: absolute;
    top: 4px;
    right: 6px;
    min-width: 32px;
    min-height: 32px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
  }
}
