/* ── BJ Réservation — CSS commun à toutes les pages ── */
:root {
  --bg:      #0d1117; --surface: #161b22; --surface2: #1c2333;
  --border:  #30363d; --border2: #21262d;
  --text:    #e6edf3; --muted:   #7d8590;
  --green:   #3fb950; --red:     #f85149; --blue: #58a6ff;
  --yellow:  #e3b341; --orange:  #ffa657;
  --radius:  8px;
}
*{box-sizing:border-box;margin:0;padding:0}
body{background:var(--bg);color:var(--text);font-family:system-ui,sans-serif;
     font-size:14px;min-height:100dvh;display:flex;flex-direction:column}

/* ── Header ── */
header{background:var(--surface);border-bottom:1px solid var(--border);
       padding:12px 16px;display:flex;align-items:center;gap:10px;flex-shrink:0}
.user-avatar{width:36px;height:36px;border-radius:50%;background:var(--blue);
             display:flex;align-items:center;justify-content:center;
             font-weight:700;font-size:15px;color:#fff;flex-shrink:0}
.user-info{flex:1;min-width:0}
.user-name{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-meta{font-size:11px;color:var(--muted);display:flex;gap:8px;align-items:center;margin-top:2px}
.badge{padding:1px 7px;border-radius:20px;font-size:10px;font-weight:600;letter-spacing:.5px}
.badge.free{background:#1f3d2a;color:var(--green)}
.badge.credits{background:#2d2000;color:var(--yellow)}
.badge.monthly{background:#001d3d;color:var(--blue)}
.credits-count{font-size:11px;color:var(--yellow)}
.btn-logout{background:none;border:1px solid var(--border);color:var(--muted);
            padding:6px 12px;border-radius:6px;cursor:pointer;font-size:12px;white-space:nowrap}
.btn-logout:hover{border-color:var(--red);color:var(--red)}
.maint-banner{background:rgba(248,81,73,.12);border:1px solid rgba(248,81,73,.4);
              color:var(--red);padding:4px 12px;border-radius:6px;font-size:11px;font-weight:600}

/* ── Bottom nav ── */
nav.bottom-nav{background:var(--surface);border-top:1px solid var(--border);
               display:flex;flex-shrink:0;position:sticky;bottom:0;z-index:10}
nav.bottom-nav button{flex:1;padding:10px 4px 8px;background:none;border:none;
                       color:var(--muted);cursor:pointer;display:flex;flex-direction:column;
                       align-items:center;gap:3px;font-size:10px;transition:color .15s}
nav.bottom-nav button.active{color:var(--blue)}
nav.bottom-nav button .nav-icon{font-size:20px;line-height:1}

/* ── Ad banners ── */
.bj-ad{flex-shrink:0;display:flex;align-items:center;justify-content:center;
       background:var(--surface2);border:1px solid var(--border);overflow:hidden;
       width:100%;z-index:5;min-height:50px}
.bj-ad-top{border-top:none}
.bj-ad-bottom{border-bottom:none}
.bj-ad-placeholder{color:var(--muted);font-size:11px;letter-spacing:.5px;opacity:.5;
                    text-transform:uppercase;user-select:none}
.bj-ad ins,.bj-ad iframe,.bj-ad img{max-width:100%;display:block;margin:0 auto}
/* Masquer si vide ou pas encore chargé */
.bj-ad:empty{display:none}

/* ── Main content ── */
main{flex:1;overflow-y:auto;padding:16px;max-width:600px;width:100%;margin:0 auto}

/* ── Cards ── */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
      padding:16px;margin-bottom:12px}
.card-title{font-weight:600;font-size:13px;color:var(--muted);text-transform:uppercase;
            letter-spacing:.6px;margin-bottom:12px;display:flex;align-items:center;
            justify-content:space-between}

/* ── Inputs ── */
input,select,textarea{background:var(--bg);border:1px solid var(--border);
  border-radius:6px;color:var(--text);padding:8px 10px;font-size:13px;width:100%;
  outline:none;transition:border-color .15s}
input:focus,select:focus{border-color:var(--blue)}
input[type="date"]::-webkit-calendar-picker-indicator{filter:invert(1);opacity:.5}

/* ── Buttons ── */
.btn{display:inline-flex;align-items:center;gap:6px;padding:9px 16px;border-radius:6px;
     border:none;cursor:pointer;font-size:13px;font-weight:500;transition:opacity .15s;
     width:auto;min-width:0;justify-content:center;box-sizing:border-box}
.btn:disabled{opacity:.4;cursor:not-allowed}
.btn-primary{background:#238636;color:#fff}.btn-primary:hover:not(:disabled){background:#2ea043}
.btn-ghost{background:none;border:1px solid var(--border);color:var(--text)}
.btn-ghost:hover:not(:disabled){border-color:var(--blue);color:var(--blue)}
.btn-red{background:none;border:1px solid var(--border);color:var(--muted)}
.btn-red:hover:not(:disabled){border-color:var(--red);color:var(--red)}
.btn-green{background:#238636;color:#fff;border:none;border-radius:6px;cursor:pointer;font-size:13px;font-weight:500;padding:9px 16px}
.btn-green:hover{background:#2ea043}
.btn-sm{padding:5px 10px;font-size:12px;width:auto}

/* ── Grid ── */
.g2{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:start}
.g2-eq{display:grid;grid-template-columns:1fr 1fr;gap:8px}

/* ── Player list ── */
.player-list{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.player-item{display:flex;align-items:center;gap:10px;padding:9px 12px;
             background:var(--bg);border:1px solid var(--border2);border-radius:6px;
             cursor:pointer;transition:border-color .15s,background .15s}
.player-item:hover{border-color:var(--border);background:var(--surface2)}
.player-item.selected{background:#001d3d;border-color:rgba(88,166,255,.3)}
.player-item.selected .player-name{color:var(--blue)}
.player-check{width:18px;height:18px;border-radius:4px;border:2px solid var(--border);
              display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:11px}
.player-item.selected .player-check{background:var(--blue);border-color:var(--blue);color:#fff}
.player-name{flex:1;font-size:13px;font-weight:500}
.player-del{background:none;border:none;color:var(--muted);cursor:pointer;font-size:14px;
            padding:4px;border-radius:4px}
.player-item.bj-busy{border-color:rgba(210,153,34,.35);background:rgba(210,153,34,.04)}
.player-busy-warn{margin-left:6px;font-size:12px;cursor:default}
.player-del:hover{color:var(--red)}
.player-empty{text-align:center;color:var(--muted);font-size:12px;padding:20px 0}

/* ── Selection counter ── */
.sel-counter{font-size:12px;padding:3px 10px;border-radius:20px;border:1px solid var(--border);
             color:var(--muted)}
.sel-counter.ok{border-color:var(--green);color:var(--green)}
.sel-counter.warn{border-color:var(--yellow);color:var(--yellow)}

/* ── Job list ── */
.job-item{background:var(--bg);border:1px solid var(--border2);border-radius:6px;
          padding:10px 12px;margin-bottom:8px}
.job-header{display:flex;align-items:center;gap:8px;margin-bottom:4px}
.job-label{font-weight:600;font-size:13px;flex:1}
.job-status{font-size:10px;padding:2px 8px;border-radius:20px;font-weight:600;letter-spacing:.4px}
.job-status.pending{background:#2d2000;color:var(--yellow)}
.job-status.running{background:#001d3d;color:var(--blue)}
.job-status.done{background:#1f3d2a;color:var(--green)}
.job-status.error{background:#3d1f1f;color:var(--red)}
.job-status.cancelled{background:#2a2a2a;color:var(--muted)}
.job-meta{font-size:11px;color:var(--muted);display:flex;flex-wrap:wrap;gap:8px}

/* ── Logs modal ── */
.logs-modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.75);z-index:1000;
  align-items:flex-end;justify-content:center}
.logs-modal-overlay.open{display:flex}
.logs-modal{background:var(--surface);border-top:1px solid var(--border);border-radius:12px 12px 0 0;
  width:100%;max-width:600px;max-height:80dvh;display:flex;flex-direction:column;padding:16px}
.logs-modal-header{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.logs-modal-title{font-weight:600;font-size:14px;flex:1}
.logs-modal-close{background:none;border:none;color:var(--muted);cursor:pointer;font-size:18px;line-height:1;padding:4px}
.logs-modal-box{flex:1;overflow-y:auto;background:#000;border:1px solid var(--border2);border-radius:6px;
  padding:10px;font-family:"Courier New",monospace;font-size:11px;line-height:1.6;color:#4ade80;
  white-space:pre-wrap;word-break:break-all;min-height:200px}

/* ── Alerts ── */
.alert{padding:10px 12px;border-radius:6px;font-size:13px;margin-bottom:10px;display:none}
.alert.show{display:block}
.alert.error{background:#3d1f1f;color:var(--red);border:1px solid rgba(248,81,73,.2)}
.alert.ok{background:#1f3d2a;color:var(--green);border:1px solid rgba(63,185,80,.2)}
.alert.warn{background:#2d2000;color:var(--yellow);border:1px solid rgba(227,179,65,.2)}
.alert.info{background:#001d3d;color:var(--blue);border:1px solid rgba(88,166,255,.2)}

/* ── Booking summary box ── */
.booking-summary{background:var(--bg);border:1px solid rgba(88,166,255,.2);border-radius:6px;
                 padding:12px;margin-bottom:12px;font-size:12px;line-height:1.8}
.booking-summary strong{color:var(--blue)}

/* ── Divider ── */
.divider{border:none;border-top:1px solid var(--border2);margin:12px 0}

/* ── Sport selector ── */
.sport-btns{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.sport-btn{padding:10px 6px;background:var(--bg);border:1px solid var(--border2);border-radius:8px;color:var(--muted);font-size:12px;font-weight:600;cursor:pointer;text-align:center;transition:all .15s;line-height:1.4}
.sport-btn:hover{border-color:var(--border);color:var(--text);background:var(--surface2)}
.sport-btn.selected{background:rgba(88,166,255,.12);border-color:var(--blue);color:var(--blue)}

/* ── Mode selector ── */
.mode-selector{display:flex;gap:0;margin-bottom:12px;border-radius:8px;overflow:hidden;border:1px solid var(--border)}
.mode-btn{flex:1;padding:11px 8px;background:var(--surface);border:none;border-right:1px solid var(--border);color:var(--muted);font-size:13px;font-weight:600;cursor:pointer;transition:all .15s}
.mode-btn:last-child{border-right:none}
.mode-btn.active{background:var(--blue);color:#fff}

/* ── Calendrier ── */
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:3px}
.cal-hdr{text-align:center;font-size:10px;color:var(--muted);font-weight:600;padding:4px 2px}
.cal-day{aspect-ratio:1;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:6px;border:1px solid transparent;transition:all .15s;background:var(--bg);position:relative;user-select:none}
.cal-day.future{border-color:rgba(63,185,80,.3);background:rgba(63,185,80,.07);cursor:pointer}
.cal-day.future:hover{background:rgba(63,185,80,.2);border-color:var(--green)}
.cal-day.past{opacity:.25}
.cal-day.window-open{opacity:.3;cursor:not-allowed!important;background:var(--bg)!important;border-color:transparent!important}
.cal-day.is-today{border-color:var(--yellow)!important}
.cal-day.selected{background:var(--blue)!important;border-color:var(--blue)!important;color:#fff}
.cal-day .cdn{font-weight:700;font-size:13px;line-height:1}
.cal-day .cdm{font-size:9px;color:var(--muted);line-height:1;margin-top:2px}
.cal-day.selected .cdm{color:rgba(255,255,255,.7)}
.cal-day.reserved::after{content:'';position:absolute;bottom:3px;left:50%;transform:translateX(-50%);width:5px;height:5px;border-radius:50%;background:var(--yellow)}

/* ── Court grid ── */
.court-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:6px}
.court-btn{padding:9px 4px;background:var(--bg);border:1px solid var(--border2);border-radius:6px;color:var(--text);font-size:11px;font-weight:600;cursor:pointer;text-align:center;transition:all .15s}
.court-btn:hover{border-color:var(--blue);color:var(--blue);background:var(--surface2)}
.court-btn.selected{background:var(--blue);border-color:var(--blue);color:#fff}

/* ── Time grid ── */
.time-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:5px}
.time-btn{padding:7px 2px;background:var(--bg);border:1px solid var(--border2);border-radius:6px;color:var(--text);font-size:11px;font-weight:600;cursor:pointer;text-align:center;transition:all .15s}
.time-btn:hover{border-color:var(--blue);color:var(--blue);background:var(--surface2)}
.time-btn.selected{background:var(--blue);border-color:var(--blue);color:#fff}
.time-btn.taken{opacity:.35;cursor:not-allowed;text-decoration:line-through;pointer-events:none}
.time-btn.app-taken{opacity:.45;cursor:not-allowed;pointer-events:none;background:rgba(248,81,73,.08);border-color:rgba(248,81,73,.3);color:var(--red)}
.court-btn.app-taken{opacity:.45;cursor:not-allowed;pointer-events:none;background:rgba(248,81,73,.08);border-color:rgba(248,81,73,.3);color:var(--red)}
.time-btn .tc{font-size:9px;display:block;margin-top:1px;opacity:.75}
.time-btn.partial,.court-btn.partial{background:rgba(240,136,62,.1);border-color:rgba(240,136,62,.5);color:#f0883e}
.time-btn.partial:hover,.court-btn.partial:hover{background:rgba(240,136,62,.2);border-color:#f0883e}
.time-btn.partial.selected,.court-btn.partial.selected{background:#f0883e;border-color:#f0883e;color:#fff}

/* ── Sections résas ── */
.section-sep{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;
             letter-spacing:.7px;margin:16px 0 8px;display:flex;align-items:center;gap:8px}
.section-sep::after{content:'';flex:1;border-top:1px solid var(--border2)}
.user-badge{font-size:10px;padding:2px 7px;border-radius:20px;background:var(--surface2);
            color:var(--muted);border:1px solid var(--border2);margin-left:4px}
div:hover > .del-msg-btn { opacity: 1 !important; }

/* ── Météo ── */
.weather-card-title{font-size:11px;font-weight:600;color:var(--muted);margin-bottom:8px;display:flex;align-items:center;gap:5px}
.weather-strip{display:flex;gap:6px;overflow-x:auto;padding:2px 0;scrollbar-width:none}
.weather-strip::-webkit-scrollbar{display:none}
.weather-day{display:flex;flex-direction:column;align-items:center;gap:2px;padding:9px 7px;border-radius:8px;background:var(--bg);border:1px solid var(--border2);min-width:62px;flex-shrink:0;text-align:center;transition:border-color .15s;cursor:pointer}
.weather-day:hover{border-color:var(--blue)}
.weather-day.wday-active{border-color:var(--blue);background:rgba(88,166,255,.1)}
.weather-day.rain-ext{border-color:rgba(248,81,73,.5);background:rgba(248,81,73,.05)}
.weather-day .wd-label{font-size:9px;color:var(--muted);font-weight:600;text-transform:capitalize;line-height:1.2}
.weather-day .wd-icon{font-size:26px;line-height:1;margin:2px 0}
.weather-day .wd-tmax{font-size:12px;font-weight:700}
.weather-day .wd-tmin{font-size:10px;color:var(--muted)}
.weather-day .wd-danger{font-size:9px;color:var(--red);margin-top:2px;font-weight:600}
.weather-day .wd-expand{font-size:9px;color:var(--muted);margin-top:1px;transition:transform .2s}
.weather-day.wday-active .wd-expand{transform:rotate(180deg)}
.weather-loading{font-size:12px;color:var(--muted);padding:6px 0}
.weather-detail-wrap{margin-top:8px;background:var(--surface);border:1px solid var(--border2);border-radius:10px;padding:10px 12px;animation:fadeIn .15s}
.weather-unavail{margin-top:8px;padding:18px 12px;border-radius:10px;background:var(--surface);border:1px solid var(--border2);text-align:center;font-size:14px;font-weight:600;color:var(--muted);animation:fadeIn .15s}
.weather-hours{display:flex;gap:6px}
.weather-hour{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 6px;border-radius:8px;background:var(--bg);border:1px solid var(--border2);flex:1;text-align:center}
.weather-hour.rain-ext{border-color:rgba(248,81,73,.5);background:rgba(248,81,73,.05)}
.wh-time{font-size:11px;font-weight:700;color:var(--blue)}
.wh-icon svg{width:28px!important;height:28px!important}
.wh-temp{font-size:13px;font-weight:700}
.wh-precip{font-size:10px;color:#4A90D9}
.wh-wind{font-size:10px;color:var(--muted)}
.weather-live{display:flex;gap:8px;flex-wrap:wrap}
.wl-now{flex:2;padding:12px 10px;border-radius:10px;background:var(--surface);border:1px solid var(--border2);text-align:center;display:flex;flex-direction:column;align-items:center;gap:4px}
.wl-now.rain-ext{border-color:rgba(248,81,73,.5);background:rgba(248,81,73,.05)}
.wl-forecast{flex:1;padding:10px 8px;border-radius:10px;background:var(--surface);border:1px solid var(--border2);text-align:center;display:flex;flex-direction:column;align-items:center;gap:3px;opacity:.9}
.wl-badge{font-size:9px;font-weight:700;color:var(--blue);text-transform:uppercase;letter-spacing:.5px;background:rgba(88,166,255,.12);padding:2px 6px;border-radius:4px}
.wl-temp-big{font-size:24px;font-weight:700;line-height:1.1}
.wl-temp-sm{font-size:16px;font-weight:700;line-height:1.1}
.wl-sub{font-size:11px;color:var(--muted);display:flex;align-items:center;gap:4px}

/* ── Loading spinner ── */
.spinner{display:inline-block;width:14px;height:14px;border:2px solid var(--border);
         border-top-color:var(--blue);border-radius:50%;animation:spin .6s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── Empty state ── */
.empty{text-align:center;padding:32px 0;color:var(--muted);font-size:13px}
.empty-icon{font-size:32px;margin-bottom:8px}

@keyframes fadeIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}


/* ── Mode Pro/Advantage/Lite — géré par data-mode sur <html>, sans JS ── */
/* Par défaut (lite) : boutons réservation cachés */
#navReserver, #navResas { display: none; }
/* Mode pro : tout visible */
html[data-mode="pro"] #navReserver,
html[data-mode="pro"] #navResas { display: inline-flex; }
/* Mode advantage : Réserver + Résas (comme Pro, mais immédiat seulement) */
html[data-mode="advantage"] #navReserver,
html[data-mode="advantage"] #navResas { display: inline-flex; }


/* ══════════════════════════════════════════════════════════
   RESPONSIVE — auto-adapte selon l'appareil
   Mobile  (<768px)    : layout actuel + safe-area iPhone
   Tablette (768-1023) : contenu large, nav bas
   Desktop (>=1024px)  : sidebar gauche + mise en page large
   ══════════════════════════════════════════════════════════ */

/* ── Safe-area iPhone (encoche + barre d'accueil) ── */
header {
  padding-top: max(50px, calc(env(safe-area-inset-top, 0px) + 8px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
nav.bottom-nav {
  padding-bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 8px));
}

/* ── Tablette 768px-1023px ── */
@media (min-width: 768px) and (max-width: 1023px) {
  main { max-width: 740px; padding: 20px 24px; }
  .g2-eq { gap: 12px; }
  .court-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .time-grid { grid-template-columns: repeat(6, 1fr); }
  .cal-grid { max-width: 380px; margin: 0 auto; }
  .card { padding: 18px; }
  nav.bottom-nav button { padding: 12px 8px 10px; font-size: 11px; }
}

/* ── Desktop >=1024px : sidebar gauche ── */
@media (min-width: 1024px) {
  body {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "sidenav header"
      "sidenav adtop"
      "sidenav main"
      "sidenav adbottom";
    height: 100dvh;
    height: 100vh;
    overflow: hidden;
  }
  .bj-ad-top{grid-area:adtop;border-left:1px solid var(--border)}
  .bj-ad-bottom{grid-area:adbottom;border-left:1px solid var(--border)}
  header {
    grid-area: header;
    border-left: 1px solid var(--border);
    padding: 14px 24px;
  }
  main {
    grid-area: main;
    max-width: none;
    width: 100%;
    overflow-y: auto;
    padding: 24px 32px;
    height: 100%;
  }
  nav.bottom-nav {
    grid-area: sidenav;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    position: static;
    height: 100%;
    border-top: none;
    border-right: 1px solid var(--border);
    background: var(--surface);
    padding: 0 0 24px;
    overflow-y: auto;
  }
  nav.bottom-nav::before {
    content: '🎾 BJ';
    display: block;
    padding: 18px 16px 16px;
    font-size: 16px;
    font-weight: 800;
    color: var(--blue);
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    letter-spacing: .04em;
  }
  nav.bottom-nav button {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    font-size: 13px;
    border-left: 3px solid transparent;
    border-radius: 0;
    text-align: left;
    width: 100%;
  }
  nav.bottom-nav button:hover {
    background: var(--border2);
    color: var(--text);
  }
  nav.bottom-nav button.active {
    color: var(--blue);
    border-left-color: var(--blue);
    background: rgba(88,166,255,.06);
  }
  nav.bottom-nav button .nav-icon {
    font-size: 17px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
  }
  .card { padding: 20px; }
  .g2-eq { gap: 16px; }
  .court-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .time-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .logs-modal-overlay { align-items: center; }
  .logs-modal { border-radius: 12px; max-height: 85dvh; }
}

/* ── Grand desktop >=1440px : contenu centre ── */
@media (min-width: 1440px) {
  body { grid-template-columns: 240px 1fr; }
  main { max-width: 960px; margin: 0 auto; padding: 28px 40px; }
}

/* ── PWA standalone mode : masquer l'admin quand l'app tourne en mode standalone ── */
/* Affecte uniquement les installations 'Ajouter a l ecran d accueil' et Capacitor */
/* Le site web classique (Safari, Chrome, etc.) continue d afficher admin normalement */
@media (display-mode: standalone) {
  .admin-only,
  a[href^="/admin-"] {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════════════
   iPhone FIXES — overflow, tap targets, zoom, safe areas
   Appliqué uniquement sur mobile (<768px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* Empêche tout scroll horizontal accidentel */
  html, body { overflow-x: hidden; width: 100%; }

  /* iOS zoom auto au focus quand font-size < 16px : fix avec 16px */
  input, select, textarea {
    font-size: 16px !important;
    -webkit-appearance: none;
  }
  /* Mais garde la lisibilité des petits boutons/labels */
  input[type='checkbox'], input[type='radio'] { font-size: inherit !important; }

  /* Tap targets Apple HIG : minimum 44x44 sur éléments interactifs principaux */
  .btn, .btn-primary, .btn-ghost, .btn-red, .btn-green {
    min-height: 44px;
  }
  .btn-logout { min-height: 36px; padding: 8px 14px; }

  /* Bottom nav : safe area + tap target */
  nav.bottom-nav button { min-height: 48px; }

  /* Sport buttons plus grands au tap */
  .sport-btn { min-height: 48px; padding: 12px 6px; }
  .mode-btn { min-height: 44px; }

  /* Time grid : boutons plus grands, 4 colonnes au lieu de 5 sur petits écrans */
  .time-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .time-btn { min-height: 44px; padding: 8px 2px; font-size: 12px; }
  .time-btn .tc { font-size: 9px; margin-top: 2px; }
  .court-btn { min-height: 44px; padding: 10px 4px; font-size: 12px; }

  /* Calendrier : chiffres un peu plus grands */
  .cal-day .cdn { font-size: 14px; }
  .cal-day .cdm { font-size: 9px; }

  /* Weather strip : jours plus espacés */
  .weather-day { min-width: 66px; }

  /* Player list items tap-friendly */
  .player-item { min-height: 48px; }
  .player-del { min-width: 32px; min-height: 32px; padding: 8px; }

  /* Alerts et cards : un peu plus d'air pour lecture mobile */
  .card { padding: 14px; }
  .alert { font-size: 14px; }

  /* Prévient le tap highlight bleu iOS (peut être perturbant) */
  * { -webkit-tap-highlight-color: rgba(88, 166, 255, 0.12); }

  /* Inputs ne doivent jamais déborder du conteneur */
  input, select, textarea { max-width: 100%; }

  /* Safe area bottom sur main pour éviter masquage par home indicator */
  main { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  nav.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; }
}

/* Déconnexion: cacher le bouton du header sur mobile (on garde uniquement celui de la page Compte) */
@media (max-width: 767px) {
  header .btn-logout { display: none !important; }
  body.page-compte .btn-logout-inline { display: flex !important; }
}

/* ── Reserve row : badge ⚡ + bouton submit (ultra-fast booking) ── */
.reserve-row{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.uf-status{display:flex;align-items:center;gap:10px;padding:9px 12px;
           border:1px solid rgba(35,134,54,.3);background:rgba(35,134,54,.08);
           border-radius:6px;font-size:13px;max-width:100%;flex-wrap:wrap}
.uf-status-badge{font-weight:600;color:#238636;white-space:nowrap}
.uf-status .uf-hint{color:var(--muted);font-weight:400;font-size:12px;line-height:1.4;flex:1;min-width:180px}

/* ════════════════════════════════════════════════════════════════════════════
   POLISH v2 (2026-05-02) — design plus arrondi, pro, technique.
   Override progressif : ne casse pas la structure, juste affine les détails.
   ──────────────────────────────────────────────────────────────────────────── */
:root {
  --radius:    12px;   /* était 8px → plus arrondi global */
  --radius-sm: 8px;    /* boutons compacts, badges */
  --radius-lg: 18px;   /* cards, modals */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.20);
  --shadow-md: 0 4px 12px rgba(0,0,0,.25);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.32);
  --easing-pop: cubic-bezier(.22,.94,.42,1);
}

/* Cards plus arrondies + subtle elevation au hover */
.card { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: box-shadow .18s var(--easing-pop), transform .18s var(--easing-pop) }
.card:hover { box-shadow: var(--shadow-md) }

/* Boutons : transitions douces, micro lift au hover, press feedback */
.btn {
  border-radius: 10px;
  transition: transform .12s var(--easing-pop), box-shadow .12s, background .15s, opacity .15s, border-color .15s;
  letter-spacing: .15px;
}
.btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: var(--shadow-sm) }
.btn:not(:disabled):active { transform: translateY(0); transition-duration: .05s }
.btn-primary { box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, var(--shadow-sm) }
.btn-logout { border-radius: 8px; transition: transform .12s, border-color .15s, color .15s }
.btn-logout:hover { transform: translateY(-1px) }

/* Inputs/selects : focus ring colorée + arrondi */
input, select, textarea {
  border-radius: 10px;
  transition: border-color .15s, box-shadow .18s, background .15s;
}
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(88,166,255,.18);
}

/* Header & nav : ombre subtile pour profondeur */
header { box-shadow: 0 1px 4px rgba(0,0,0,.18) }
nav.bottom-nav { box-shadow: 0 -2px 14px rgba(0,0,0,.22) }
nav.bottom-nav button { transition: color .12s, transform .15s var(--easing-pop) }
nav.bottom-nav button:active { transform: scale(.90) }
nav.bottom-nav button.active .nav-icon { transform: translateY(-1px) }

/* Avatars + chips : ombre et arrondi */
.user-avatar { box-shadow: 0 2px 6px rgba(0,0,0,.30) }
.badge { border-radius: 999px; padding: 2px 9px }

/* Modals : arrondi plus marqué */
.modal-box, .modal-content, [class*="modal-overlay"] > div, [class*="modal"][class*="open"] > * {
  border-radius: var(--radius-lg) !important;
}

/* Conv items / cards de chat : micro-animation au hover */
.conv-item, .pcard, .job-item, .member-chip {
  border-radius: var(--radius);
  transition: transform .15s var(--easing-pop), background .15s, border-color .15s, box-shadow .15s;
}
.conv-item:hover { transform: translateX(2px) }
.pcard:hover, .job-item:hover { box-shadow: var(--shadow-sm) }

/* Spinner + skeleton pulse animation */
@keyframes bj-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .55 } }
@keyframes bj-shimmer {
  0%   { background-position: -200% 0 }
  100% { background-position:  200% 0 }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: bj-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius);
  display: block;
  min-height: 16px;
}

/* État offline : opacity légère sur les éléments interactifs */
html.bj-offline .btn:not(.btn-ghost):not(:disabled) { opacity: .85 }
html.bj-offline .conv-item, html.bj-offline .job-item { opacity: .92 }

/* Touch targets iPhone : min-height plus haut sur mobile */
@media (max-width: 768px) {
  .btn { min-height: 38px }
  nav.bottom-nav button { padding-top: 12px; padding-bottom: 10px }
}

/* Reduce motion accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .05s !important;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   POLISH v3.7 (2026-05-03) — App Shell flex column scope à body.is-capacitor
   La classe `is-capacitor` est ajoutée par shared.js QUAND on détecte qu'on
   est dans l'app native Capacitor (iPhone/Android). Le site web (browser PC,
   mobile web) garde son layout d'origine. Aucun impact sur reservation-bj.website
   en navigation classique.
   ──────────────────────────────────────────────────────────────────────────── */

body.is-capacitor,
html:has(body.is-capacitor) { height: 100% }
@supports (height: 100dvh) {
  body.is-capacitor,
  html:has(body.is-capacitor) { height: 100dvh }
}

body.is-capacitor {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: -webkit-fill-available;
  background: var(--bg);
}

/* Header : reste en haut dans l'app Capacitor */
body.is-capacitor header {
  flex-shrink: 0;
  z-index: 10;
}

/* Main : seul scrollable dans l'app Capacitor */
body.is-capacitor main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  min-height: 0;
}

/* Bottom nav : reste en bas dans l'app Capacitor */
body.is-capacitor nav.bottom-nav {
  flex-shrink: 0;
  z-index: 10;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Compaction bottom nav uniquement mobile, mais on la garde aussi pour browser
   mobile (≤ 768px) — pas de scope is-capacitor ici, c'est cosmétique global. */
@media (max-width: 768px) {
  nav.bottom-nav button {
    padding: 6px 4px 4px;
    font-size: 9px;
    gap: 2px;
  }
  nav.bottom-nav button .nav-icon { font-size: 18px }
}


/* ════════════════════════════════════════════════════════════════════════════
 * THÈME FUTURISTE PADEL / TENNIS (injecté 11/05)
 * Disponible sur toutes les pages via shared.css
 * Variables custom + classes bj-tile/bj-chat-tile + court vibe sur .card existant
 * ════════════════════════════════════════════════════════════════════════════ */
:root {
  --bj-ball:        #e0f547;
  --bj-ball-soft:   rgba(224,245,71,.15);
  --bj-court:       #1a7c3d;
  --bj-court-blue:  #1e6fb8;
  --bj-padel:       #4fc3f7;
  --bj-glow:        rgba(224,245,71,.35);
  --bj-glow-soft:   rgba(224,245,71,.18);
}

/* Halo court tennis en haut-droite (global, sous le contenu) */
body::before {
  content:'';position:fixed;top:-120px;right:-120px;width:340px;height:340px;
  background:radial-gradient(circle,var(--bj-ball-soft) 0%,transparent 70%);
  pointer-events:none;z-index:0;filter:blur(40px)
}
body > * { position: relative; z-index: 1; }

/* ═══ TUILE FUTURISTE ═══ */
.bj-tile {
  position:relative;overflow:hidden;cursor:pointer;
  background:linear-gradient(135deg,#161b22 0%,#0d1117 100%);
  border:1px solid rgba(255,255,255,.06);
  border-radius:18px;padding:30px 18px;text-align:center;
  display:flex;flex-direction:column;align-items:center;gap:8px;
  transition:transform .35s cubic-bezier(.2,.85,.3,1),border-color .25s,box-shadow .35s;
  will-change:transform
}
.bj-tile::before {
  content:'';position:absolute;inset:0;pointer-events:none;opacity:.5;
  background-image:
    linear-gradient(0deg,transparent 49.5%,rgba(255,255,255,.025) 50%,transparent 50.5%),
    linear-gradient(90deg,transparent 49.5%,rgba(255,255,255,.025) 50%,transparent 50.5%);
  background-size:28px 28px
}
.bj-tile::after {
  content:'';position:absolute;inset:-1px;border-radius:inherit;pointer-events:none;
  background:conic-gradient(from 180deg at 50% 50%,
    transparent 0deg,var(--bj-glow) 90deg,transparent 180deg,
    var(--bj-padel) 270deg,transparent 360deg);
  opacity:0;transition:opacity .4s;z-index:-1;filter:blur(14px)
}
.bj-tile:hover {
  transform:translateY(-4px);
  border-color:rgba(224,245,71,.35);
  box-shadow:0 12px 30px rgba(0,0,0,.5),0 0 0 1px var(--bj-ball-soft) inset
}
.bj-tile:hover::after { opacity:.7 }
.bj-tile:active { transform:translateY(-2px) scale(.98);transition:transform .1s }

.bj-tile-sm { padding:22px 12px;border-radius:14px;gap:5px }
.bj-tile-sm .bj-tile-icon { font-size:34px }
.bj-tile-sm .bj-tile-title { font-size:13px }
.bj-tile-sm .bj-tile-sub { font-size:10.5px }

.bj-tile-icon {
  font-size:46px;line-height:1;display:inline-block;
  filter:drop-shadow(0 4px 12px rgba(0,0,0,.4));
  animation:bj-ball-bounce 3s ease-in-out infinite
}
@keyframes bj-ball-bounce {
  0%,100% { transform:translateY(0) rotate(0) }
  50%     { transform:translateY(-5px) rotate(6deg) }
}
.bj-tile-title { font-weight:800;font-size:16px;letter-spacing:.3px;color:#e6edf3;z-index:1 }
.bj-tile-sub { font-size:11px;color:#8b949e;line-height:1.4;z-index:1 }

/* ═══ TUILE CHAT (variation accent vert + pulse online) ═══ */
.bj-chat-tile {
  position:relative;overflow:hidden;cursor:pointer;
  background:linear-gradient(135deg,#0f2010 0%,#1a3a1a 60%,#0f2010 100%);
  border:1px solid rgba(63,185,80,.35);border-radius:18px;
  padding:24px 22px;display:flex;align-items:center;gap:18px;
  transition:transform .3s cubic-bezier(.2,.85,.3,1),box-shadow .35s,border-color .25s;
  box-shadow:0 6px 18px rgba(63,185,80,.18)
}
.bj-chat-tile::before {
  content:'';position:absolute;inset:0;pointer-events:none;opacity:.6;
  background-image:
    radial-gradient(circle at 90% 50%,rgba(63,185,80,.12) 0%,transparent 50%),
    linear-gradient(0deg,transparent 49.5%,rgba(255,255,255,.02) 50%,transparent 50.5%);
  background-size:auto,32px 32px
}
.bj-chat-tile:hover {
  transform:translateY(-3px);border-color:#3fb950;
  box-shadow:0 12px 30px rgba(63,185,80,.30),0 0 0 1px rgba(63,185,80,.2) inset
}
.bj-chat-icon {
  font-size:42px;line-height:1;flex-shrink:0;position:relative;z-index:1;
  filter:drop-shadow(0 2px 6px rgba(0,0,0,.5))
}
.bj-chat-icon::after {
  content:'';position:absolute;top:-2px;right:-4px;width:10px;height:10px;border-radius:50%;
  background:#3fb950;box-shadow:0 0 0 0 rgba(63,185,80,.6);
  animation:bj-pulse 2s ease-out infinite
}
@keyframes bj-pulse {
  0%   { box-shadow:0 0 0 0 rgba(63,185,80,.6) }
  70%  { box-shadow:0 0 0 12px rgba(63,185,80,0) }
  100% { box-shadow:0 0 0 0 rgba(63,185,80,0) }
}
.bj-chat-title { font-weight:800;font-size:18px;color:#fff;display:flex;align-items:center;gap:10px;letter-spacing:.2px }
.bj-chat-sub { font-size:13px;color:#a8d4ad;line-height:1.4;margin-top:4px }
.bj-chat-arrow { font-size:26px;color:#3fb950;flex-shrink:0;font-weight:700;transition:transform .25s }
.bj-chat-tile:hover .bj-chat-arrow { transform:translateX(4px) }

/* ═══ HEADERS DE SECTION ═══ */
.bj-section-header {
  font-size:11px;font-weight:800;color:#8b949e;
  text-transform:uppercase;letter-spacing:1px;
  margin:22px 2px 12px;display:flex;align-items:center;gap:10px
}
.bj-section-header-icon { font-size:14px;filter:drop-shadow(0 0 6px var(--bj-glow)) }
.bj-section-header-line {
  flex:1;height:1px;
  background:linear-gradient(90deg,rgba(224,245,71,.4),rgba(255,255,255,.05) 50%,transparent);
  margin-left:6px
}

/* ═══ CONTEXT HEADER (sous-vues) ═══ */
.bj-ctx-header {
  position:relative;overflow:hidden;
  background:linear-gradient(135deg,#161b22,#0d1117);
  border:1px solid rgba(255,255,255,.06);border-radius:12px;
  padding:14px 16px;margin-bottom:14px;display:flex;align-items:center;gap:14px
}
.bj-ctx-header::before {
  content:'';position:absolute;left:0;top:0;bottom:0;width:3px;
  background:linear-gradient(180deg,var(--bj-ball),var(--bj-padel))
}
.bj-ctx-header-icon { font-size:28px;flex-shrink:0;z-index:1 }
.bj-ctx-header-title { font-weight:800;font-size:15px;color:#e6edf3 }
.bj-ctx-header-sub { font-size:11.5px;color:#8b949e;margin-top:3px }

/* ═══ BACK BUTTON ═══ */
.bj-back-btn {
  background:none;border:none;color:#8b949e;font-size:13px;cursor:pointer;
  padding:4px 8px 12px 0;display:inline-flex;align-items:center;gap:6px;
  transition:color .2s,transform .2s
}
.bj-back-btn:hover { color:var(--bj-ball) }
.bj-back-btn:hover .bj-back-arrow { transform:translateX(-3px) }
.bj-back-arrow { font-size:18px;transition:transform .2s;display:inline-block }

/* ═══ TRANSITIONS ENTRE VUES ═══ */
.bj-view { animation:bj-view-in .4s cubic-bezier(.2,.85,.3,1) both }
@keyframes bj-view-in {
  0%   { opacity:0;transform:translateX(24px) scale(.98) }
  100% { opacity:1;transform:translateX(0) scale(1) }
}
.bj-view-back { animation:bj-view-back-in .4s cubic-bezier(.2,.85,.3,1) both }
@keyframes bj-view-back-in {
  0%   { opacity:0;transform:translateX(-24px) scale(.98) }
  100% { opacity:1;transform:translateX(0) scale(1) }
}

/* ═══ BONUS : appliquer une touche futur aux .card existantes ═══
   Subtilité : on rajoute juste un border accent neon + glow au hover sur les cartes
   classiques pour donner une cohérence visuelle sans casser le contenu. */
.card {
  transition:border-color .25s,box-shadow .3s,transform .2s
}
.card:hover {
  border-color:rgba(224,245,71,.18);
  box-shadow:0 4px 16px rgba(0,0,0,.3),0 0 0 1px var(--bj-glow-soft) inset
}
.hub-card {
  transition:transform .3s cubic-bezier(.2,.85,.3,1),border-color .25s,box-shadow .3s
}
.hub-card:hover {
  transform:translateY(-3px);
  border-color:rgba(224,245,71,.35);
  box-shadow:0 8px 24px rgba(0,0,0,.4),0 0 0 1px var(--bj-glow-soft) inset
}

/* ═══ Polish bottom nav ═══ */
nav.bottom-nav button.active {
  position:relative;color:var(--bj-ball)
}
nav.bottom-nav button.active::before {
  content:'';position:absolute;top:0;left:20%;right:20%;height:2px;
  background:linear-gradient(90deg,transparent,var(--bj-ball),transparent);
  box-shadow:0 0 8px var(--bj-glow)
}

/* Reduce motion : respecte les prefs accessibilité */
@media (prefers-reduced-motion: reduce) {
  .bj-tile-icon, .bj-chat-icon::after { animation:none }
  .bj-tile:hover, .bj-chat-tile:hover, .hub-card:hover { transform:none }
  .bj-view, .bj-view-back { animation:none }
}
/* Fin thème futur */


/* ═══ Grille des créneaux à surveiller (boutons plus larges à cause du texte) ═══ */
.time-grid-watch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
}
.time-grid-watch button {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Sur très petits écrans (iPhone SE, foldables), forcer 2 colonnes */
@media (max-width: 380px) {
  .time-grid-watch { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}

/* ════════════════════════════════════════════════════════════════════════════
 * THÈME V2 — TECH / HOLOGRAPHIC / COURT VIBE (11/05 soir)
 * Glassmorphism, holo borders, 3D tilt, custom font, animated court SVG
 * ════════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  /* Palette signature */
  --bj-ball:        #d4ff00;
  --bj-ball-glow:   rgba(212,255,0,.45);
  --bj-ball-soft:   rgba(212,255,0,.10);
  --bj-violet:      #b794ff;
  --bj-cyan:        #00e5ff;
  --bj-magenta:     #ff4d8d;
  --bj-court:       #1a7c3d;
  --bj-deep:        #06070d;
  --bj-glass-bg:    rgba(20,24,33,.62);
  --bj-glass-bg-hi: rgba(28,32,42,.78);
  --bj-glass-bd:    rgba(255,255,255,.08);
  --bj-glow:        rgba(212,255,0,.35);
}

/* Body : court SVG animé en fond + font Space Grotesk */
body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -.005em;
  background:
    radial-gradient(ellipse at top right, rgba(183,148,255,.06) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(0,229,255,.04) 0%, transparent 50%),
    var(--bg, #0d1117);
}
/* SVG court lines en bas du body */
body::before {
  content: '';
  position: fixed;
  bottom: -40px;
  left: -10%;
  width: 120%;
  height: 280px;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(180deg, transparent 0%, rgba(212,255,0,.05) 100%),
    /* Lignes horizontales court */
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 40px,
      rgba(255,255,255,.02) 40px,
      rgba(255,255,255,.02) 41px
    );
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
  filter: blur(.5px);
  animation: bj-court-drift 30s linear infinite;
}
@keyframes bj-court-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 0 80px; }
}
/* Halo violet en haut-droite */
body::after {
  content: '';
  position: fixed; top: -150px; right: -100px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, var(--bj-ball-soft) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(50px);
  animation: bj-halo-pulse 8s ease-in-out infinite;
}
@keyframes bj-halo-pulse {
  0%, 100% { opacity: .7; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.15); }
}
body > * { position: relative; z-index: 1; }

/* ═══ TUILE GLASS HOLOGRAPHIC ═══ */
.bj-tile {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--bj-glass-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--bj-glass-bd);
  border-radius: 20px;
  padding: 32px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform .4s cubic-bezier(.2,.85,.3,1),
              border-color .25s,
              box-shadow .4s,
              background .25s;
  transform-style: preserve-3d;
  will-change: transform;
  isolation: isolate;
}

/* Bordure holographique animée — gradient conique qui tourne */
.bj-tile::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from 0deg,
    var(--bj-violet),
    var(--bj-cyan),
    var(--bj-ball),
    var(--bj-magenta),
    var(--bj-violet)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
  animation: bj-holo-rotate 6s linear infinite;
}
@keyframes bj-holo-rotate {
  to { transform: rotate(1turn); }
}

/* Court line pattern à l'intérieur de la tuile */
.bj-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  z-index: -1;
  background-image:
    linear-gradient(0deg,  transparent 49.5%, rgba(255,255,255,.04) 50%, transparent 50.5%),
    linear-gradient(90deg, transparent 49.5%, rgba(255,255,255,.04) 50%, transparent 50.5%);
  background-size: 32px 32px;
}

.bj-tile:hover {
  transform: translateY(-6px) perspective(800px) rotateX(2deg);
  background: var(--bj-glass-bg-hi);
  border-color: transparent;
  box-shadow:
    0 20px 50px -10px rgba(0,0,0,.6),
    0 0 0 1px var(--bj-glow-soft, rgba(212,255,0,.2)) inset,
    0 0 40px -10px var(--bj-glow);
}
.bj-tile:hover::before { opacity: 1; }

.bj-tile:active {
  transform: translateY(-3px) perspective(800px) rotateX(1deg) scale(.98);
  transition: transform .12s;
}

/* Variante compacte */
.bj-tile-sm {
  padding: 22px 12px;
  border-radius: 16px;
  gap: 6px;
}
.bj-tile-sm .bj-tile-icon { font-size: 36px; }
.bj-tile-sm .bj-tile-title { font-size: 13px; }
.bj-tile-sm .bj-tile-sub { font-size: 10.5px; }

/* Icône avec bounce + drop-shadow néon */
.bj-tile-icon {
  font-size: 50px;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.5))
          drop-shadow(0 0 12px rgba(212,255,0,.15));
  animation: bj-ball-bounce 3.5s ease-in-out infinite;
  position: relative;
  z-index: 1;
}
@keyframes bj-ball-bounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-6px) rotate(8deg); }
}

.bj-tile-title {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.01em;
  color: #f0f4f8;
  z-index: 1;
  position: relative;
}
.bj-tile-sub {
  font-size: 11.5px;
  color: #8b949e;
  line-height: 1.4;
  z-index: 1;
  position: relative;
  font-weight: 400;
}

/* ═══ TUILE CHAT (variante verte + pulse online) ═══ */
.bj-chat-tile {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background:
    radial-gradient(circle at 80% 50%, rgba(63,185,80,.15) 0%, transparent 50%),
    linear-gradient(135deg, rgba(15,32,16,.85) 0%, rgba(26,58,26,.75) 100%);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(63,185,80,.35);
  border-radius: 20px;
  padding: 26px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform .3s cubic-bezier(.2,.85,.3,1),
              box-shadow .35s,
              border-color .25s;
  box-shadow: 0 10px 30px rgba(63,185,80,.15);
}
.bj-chat-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image:
    linear-gradient(0deg, transparent 49.5%, rgba(255,255,255,.025) 50%, transparent 50.5%),
    linear-gradient(90deg, transparent 49.5%, rgba(255,255,255,.025) 50%, transparent 50.5%);
  background-size: 36px 36px;
}
.bj-chat-tile:hover {
  transform: translateY(-4px);
  border-color: #3fb950;
  box-shadow:
    0 18px 40px rgba(63,185,80,.30),
    0 0 0 1px rgba(63,185,80,.25) inset,
    0 0 60px -20px rgba(63,185,80,.5);
}
.bj-chat-icon {
  font-size: 44px;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.5))
          drop-shadow(0 0 14px rgba(63,185,80,.4));
}
.bj-chat-icon::after {
  content: '';
  position: absolute;
  top: -2px; right: -4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3fb950, #56d364);
  box-shadow: 0 0 0 0 rgba(63,185,80,.7);
  animation: bj-pulse 2s ease-out infinite;
}
@keyframes bj-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(63,185,80,.7); }
  70%  { box-shadow: 0 0 0 14px rgba(63,185,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(63,185,80,0); }
}
.bj-chat-title {
  font-weight: 700;
  font-size: 19px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -.01em;
}
.bj-chat-sub {
  font-size: 13px;
  color: #a8d4ad;
  line-height: 1.4;
  margin-top: 5px;
  font-weight: 400;
}
.bj-chat-arrow {
  font-size: 28px;
  color: #3fb950;
  flex-shrink: 0;
  font-weight: 600;
  transition: transform .25s;
  filter: drop-shadow(0 0 10px rgba(63,185,80,.5));
}
.bj-chat-tile:hover .bj-chat-arrow { transform: translateX(6px); }

/* ═══ HEADERS DE SECTION (avec gradient line + glow icon) ═══ */
.bj-section-header {
  font-size: 10.5px;
  font-weight: 700;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 24px 2px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bj-section-header-icon {
  font-size: 16px;
  filter: drop-shadow(0 0 8px var(--bj-glow));
}
.bj-section-header-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--bj-glow) 0%,
    rgba(183,148,255,.3) 30%,
    rgba(255,255,255,.05) 70%,
    transparent 100%
  );
  margin-left: 8px;
}

/* ═══ CONTEXT HEADER ═══ */
.bj-ctx-header {
  position: relative;
  overflow: hidden;
  background: var(--bj-glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bj-glass-bd);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.bj-ctx-header::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--bj-ball), var(--bj-violet), var(--bj-cyan));
  box-shadow: 0 0 12px var(--bj-glow);
}
.bj-ctx-header-icon {
  font-size: 30px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px var(--bj-glow));
}
.bj-ctx-header-title {
  font-weight: 700;
  font-size: 16px;
  color: #f0f4f8;
  letter-spacing: -.01em;
}
.bj-ctx-header-sub {
  font-size: 12px;
  color: #8b949e;
  margin-top: 3px;
  font-weight: 400;
}

/* ═══ BACK BUTTON ═══ */
.bj-back-btn {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px 14px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .2s, transform .2s;
  font-family: inherit;
  font-weight: 500;
}
.bj-back-btn:hover { color: var(--bj-ball); }
.bj-back-btn:hover .bj-back-arrow { transform: translateX(-4px); }
.bj-back-arrow { font-size: 18px; transition: transform .2s; display: inline-block; }

/* ═══ TRANSITIONS ENTRE VUES (stagger children) ═══ */
.bj-view {
  animation: bj-view-in .5s cubic-bezier(.2,.85,.3,1) both;
}
@keyframes bj-view-in {
  0%   { opacity: 0; transform: translateX(28px) scale(.97); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
.bj-view-back {
  animation: bj-view-back-in .5s cubic-bezier(.2,.85,.3,1) both;
}
@keyframes bj-view-back-in {
  0%   { opacity: 0; transform: translateX(-28px) scale(.97); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
/* Stagger : enfants animés en cascade */
.bj-view > .bj-tile,
.bj-view-back > .bj-tile,
.bj-view > div > .bj-tile,
.bj-view-back > div > .bj-tile {
  animation: bj-tile-in .5s cubic-bezier(.2,.85,.3,1) both;
}
.bj-view > .bj-tile:nth-child(1),
.bj-view > div > .bj-tile:nth-child(1) { animation-delay: .05s; }
.bj-view > .bj-tile:nth-child(2),
.bj-view > div > .bj-tile:nth-child(2) { animation-delay: .12s; }
.bj-view > .bj-tile:nth-child(3),
.bj-view > div > .bj-tile:nth-child(3) { animation-delay: .19s; }
.bj-view > .bj-tile:nth-child(4),
.bj-view > div > .bj-tile:nth-child(4) { animation-delay: .26s; }
@keyframes bj-tile-in {
  0%   { opacity: 0; transform: translateY(20px) scale(.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══ Polish .card / .hub-card existants ═══ */
.card {
  background: var(--bj-glass-bg);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid var(--bj-glass-bd);
  transition: border-color .25s, box-shadow .3s, transform .2s;
}
.card:hover {
  border-color: rgba(212,255,0,.18);
  box-shadow: 0 8px 24px rgba(0,0,0,.3),
              0 0 0 1px var(--bj-ball-soft) inset;
}
.hub-card {
  background: var(--bj-glass-bg);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid var(--bj-glass-bd);
  transition: transform .3s cubic-bezier(.2,.85,.3,1),
              border-color .25s,
              box-shadow .3s;
}
.hub-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212,255,0,.35);
  box-shadow: 0 12px 30px rgba(0,0,0,.4),
              0 0 0 1px var(--bj-ball-soft) inset;
}

/* ═══ Bottom nav : tab active avec barre néon + glow ═══ */
nav.bottom-nav {
  background: var(--bj-glass-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
nav.bottom-nav button.active {
  position: relative;
  color: var(--bj-ball);
}
nav.bottom-nav button.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--bj-ball), transparent);
  box-shadow: 0 0 12px var(--bj-glow), 0 0 24px var(--bj-glow);
  border-radius: 0 0 4px 4px;
}

/* ═══ Headers de page (h1/h2/h3) ═══ */
h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -.02em;
}

/* ═══ Spinner remplacé par tennis ball bouncing ═══ */
.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: none !important;
  background: radial-gradient(circle at 30% 30%, var(--bj-ball), #a8c800 70%);
  border-radius: 50%;
  position: relative;
  animation: bj-spinner-bounce 1s cubic-bezier(.5,.05,.5,.95) infinite;
  box-shadow: 0 4px 8px rgba(0,0,0,.3),
              inset 0 -2px 4px rgba(0,0,0,.2),
              0 0 16px var(--bj-glow);
}
.spinner::before, .spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(45deg, transparent 47%, rgba(255,255,255,.4) 50%, transparent 53%);
}
.spinner::after {
  transform: rotate(90deg);
}
@keyframes bj-spinner-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-12px) scale(.95); }
}

/* ═══ Boutons globaux : touche tech au hover ═══ */
.btn.btn-primary {
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .3s;
}
.btn.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(212,255,0,.2);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .bj-tile-icon, .bj-chat-icon::after, body::after, body::before, .spinner { animation: none; }
  .bj-tile:hover, .bj-chat-tile:hover, .hub-card:hover { transform: none; }
  .bj-tile::before { animation: none; }
  .bj-view, .bj-view-back, .bj-view > .bj-tile, .bj-view > div > .bj-tile { animation: none; }
}
/* Fin thème v2 */


/* ═══ Inner tabs v2 — segmented glass control (Parties / Chat) ═══ */
.inner-tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  margin: 8px 0 14px;
  background: var(--bj-glass-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--bj-glass-bd);
  border-radius: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.inner-tab {
  flex: 1;
  padding: 11px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #8b949e;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all .25s cubic-bezier(.2,.85,.3,1);
  font-family: inherit;
  letter-spacing: -.005em;
  position: relative;
  overflow: hidden;
}
.inner-tab:hover {
  color: #e6edf3;
  background: rgba(255,255,255,.04);
}
.inner-tab.active {
  color: var(--bj-deep, #06070d);
  background: linear-gradient(135deg, var(--bj-ball) 0%, #b4dd00 100%);
  font-weight: 700;
  box-shadow:
    0 4px 14px var(--bj-glow),
    0 0 0 1px rgba(255,255,255,.15) inset;
}
/* Petit shimmer subtil sur l'onglet actif */
.inner-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  animation: bj-shimmer 3s ease-in-out infinite;
}
@keyframes bj-shimmer {
  0%   { left: -100%; }
  50%  { left: 100%; }
  100% { left: 100%; }
}
/* Override responsive padding */
@media (max-width: 599px) {
  .inner-tabs { margin: 6px 0 12px; padding: 5px; gap: 5px; }
  .inner-tab { padding: 10px 8px; font-size: 12.5px; }
}


/* ════════════════════════════════════════════════════════════════════
   PERF SCROLL iOS WebView — 12/05/2026
   backdrop-filter blur tue le FPS sur iPhone. On retire sur mobile
   et on compense avec un background plus opaque.
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Garde blur leger sur elements 1x (header/modals/stiles) — retire sur listes scrollables */
  .msg-bbl, .msg-bubble, .bubble, .conv-item, .pcard, .partner-row {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  /* Header/modals : blur reduit 10px au lieu de 18-20px pour FPS iOS */
  .topbar, header, .bj-header, .modal-box, .smodal-box, .stile, .bj-tile {
    backdrop-filter: blur(10px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(130%) !important;
  }
  /* Compense visuel : background plus opaques sur les cards glassy */
  .card,
  .pcard,
  .stile,
  .bj-tile,
  .bj-ctx-tile,
  .conv-item,
  .msg-bbl,
  .msg-bubble,
  .bubble,
  .modal-box,
  .smodal-box,
  .pf-card,
  .partner-row,
  .stat-card,
  .pyr-card {
    background-color: rgba(20, 26, 38, .92) !important;
  }
  /* Hardware acceleration sur scrollables principaux */
  main, .content, .chat-msgs, .chat-main, #pgMsgs, #dmMsgs, #chatMsgs, #lgMsgs {
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    will-change: scroll-position;
  }
  /* Containment des cards pour eviter reflow global */
  .card, .pcard, .stile, .msg-row, .conv-item {
    contain: layout style;
  }
  /* Disable animations infinies non-essentielles */
  .bj-live-dot { animation: none !important }
  .bj-streak-icon { animation: none !important }
  .bj-react-pill { transition: none !important }
}



/* ════════════════════════════════════════════════════════════
   WELCOME CARD METEO v3 — compact, icone SVG, layout horizontal
   ════════════════════════════════════════════════════════════ */
#welcomeCard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px !important;
  min-height: auto;
  background: linear-gradient(135deg, rgba(20,30,55,.94), rgba(10,15,28,.98));
  border: 1px solid rgba(212,255,0,.20);
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,.32), inset 0 0 0 1px rgba(255,255,255,.04);
}
#welcomeCard .welcome-left { flex: 1; min-width: 0 }
#welcomeCard .welcome-hello {
  font-size: 18px; font-weight: 800; color: #fff;
  line-height: 1.15; letter-spacing: -.01em;
  margin-bottom: 3px;
}
#welcomeCard .welcome-sub {
  font-size: 12px; color: rgba(255,255,255,.65);
  line-height: 1.35;
}
#welcomeCard .welcome-meteo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,.10);
}
#welcomeCard .wx-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
  animation: wxIconFloat 4s ease-in-out infinite;
}
@keyframes wxIconFloat {
  0%, 100% { transform: translateY(0) }
  50% { transform: translateY(-3px) }
}
#welcomeCard .wx-info {
  display: flex; flex-direction: column; align-items: flex-start;
  line-height: 1; gap: 2px;
}
#welcomeCard .wx-temp {
  font-size: 22px; font-weight: 800; color: #fff;
  letter-spacing: -.5px;
}
#welcomeCard .wx-label {
  font-size: 10px; color: rgba(255,255,255,.75);
  font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  white-space: nowrap;
}

/* Mobile : meteo cache sur ecrans < 380px sinon trop serre */
@media (max-width: 360px) {
  #welcomeCard .welcome-meteo { padding-left: 8px; gap: 6px }
  #welcomeCard .wx-icon { width: 36px; height: 36px }
  #welcomeCard .wx-icon svg { width: 36px; height: 36px }
  #welcomeCard .wx-temp { font-size: 18px }
  #welcomeCard .wx-label { font-size: 9px }
}
