/* =====================================================================
   KOTE509 — Adaptation tablettes et smartphones
   Le coupon devient un panneau glissant depuis le bas ; navigation inférieure.
   ===================================================================== */

/* Grand écran moyen : le coupon reste, la barre latérale rétrécit */
@media (max-width: 1280px) {
  :root { --side-w: 200px; --slip-w: 300px; }
  .board-head, .mrow { grid-template-columns: 84px minmax(0,1fr) 186px 40px; }
}

/* Tablette : plus de barre latérale, coupon en panneau inférieur */
@media (max-width: 1080px) {
  .shell, .shell.no-slip { grid-template-columns: minmax(0, 1fr); }
  .sidenav { display: none; }
  .sidenav.acc-nav {
    display: flex; position: static; height: auto; overflow-x: auto; padding: 0;
    border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none;
  }
  .sidenav.acc-nav::-webkit-scrollbar { display: none; }
  .sidenav.acc-nav h4 { display: none; }
  .sidenav.acc-nav a { flex: none; border-left: 0; border-bottom: 2px solid transparent; padding: 12px 14px; }
  .sidenav.acc-nav a.is-active { border-bottom-color: var(--blue); background: transparent; }
  .sidenav.acc-nav a .ico { display: none; }

  .betslip {
    position: fixed; z-index: 120; left: 0; right: 0; bottom: 0; top: auto;
    height: auto; max-height: 86vh;
    border-left: 0; border-radius: 10px 10px 0 0;
    box-shadow: 0 -10px 40px rgba(16,28,53,.25);
    transform: translateY(105%); transition: transform .22s ease-out;
  }
  .betslip.open { transform: none; }
  .slip-head { border-radius: 10px 10px 0 0; }
  .slip-head .close-sheet { display: inline-flex; color: #C5CEE0; }
  .slip-list { max-height: 40vh; }
  .sheet-backdrop { position: fixed; inset: 0; background: rgba(10,19,38,.45); z-index: 110; display: none; }
  .sheet-backdrop.show { display: block; }

  /* Barre résumé du coupon au-dessus de la navigation inférieure */
  .slip-bar {
    position: fixed; z-index: 90; left: 10px; right: 10px; bottom: 70px;
    display: none; align-items: center; gap: 12px;
    background: var(--blue); color: var(--white); border-radius: var(--r);
    padding: 0 14px; height: 48px; box-shadow: var(--shadow); border: 0; width: auto; cursor: pointer;
    font-weight: 650; font-size: 14px;
  }
  .slip-bar.show { display: flex; }
  .slip-bar .n { background: var(--white); color: var(--blue); min-width: 24px; height: 24px; border-radius: 12px; font: 700 13px/24px var(--f-num); text-align: center; padding: 0 6px; }
  .slip-bar .o { margin-left: auto; font: 700 16px var(--f-num); }

  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 100; left: 0; right: 0; bottom: 0;
    height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--night); border-top: 1px solid #0A1326;
  }
  .bottomnav a, .bottomnav button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: #8F9BB7; font-size: 10.5px; font-weight: 600; background: none; border: 0; text-decoration: none !important; cursor: pointer;
  }
  .bottomnav .is-active { color: var(--white); }
  .bottomnav .is-active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; background: var(--orange); }
  .bottomnav .count { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--orange); color: var(--night); font: 700 10px/16px var(--f-num); }
  body { padding-bottom: 62px; }

  .mainnav { display: none; }
  .content { padding: 16px 16px 120px; }
  .sport-strip { grid-template-columns: repeat(3, 1fr); }
  .promo-row { grid-template-columns: 1fr 1fr; }
  .footer-in { grid-template-columns: 1fr 1fr; }
}

/* Smartphone */
@media (max-width: 680px) {
  :root { --header-h: 54px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .brand-word { font-size: 24px; }
  .brand-tag { font-size: 13px; }
  .topsearch { display: none; }
  .topactions { margin-left: auto; gap: 6px; }
  .topactions .btn { height: 34px; padding: 0 11px; font-size: 12.5px; }
  .balance-chip { padding: 2px 8px; border-left: 0; }
  .balance-chip small { display: none; }
  .balance-chip strong { font-size: 14.5px; }
  .hide-sm { display: none !important; }
  .demo-strip .long { display: none; }
  .demo-strip .short { display: inline; }
  .toasts { bottom: 130px; left: 10px; right: 10px; width: auto; }

  .content { padding: 12px 10px 130px; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero::after { display: none; }
  .hero-copy { padding: 20px 18px 6px; }
  .hero h1 { font-size: 30px; margin: 8px 0; }
  .hero p { display: none; }
  .hero-copy .btn { display: none; }
  .hero-match { margin: 14px; }

  /* Ligne de match : temps + équipes en haut, cotes en dessous */
  .board-head { grid-template-columns: 1fr auto; padding: 8px 12px; }
  .board-head .cols, .board-head .spacer { display: none; }
  .mrow {
    grid-template-columns: minmax(0,1fr) 40px;
    grid-template-areas: "time more" "teams more" "odds odds";
    gap: 6px 10px; padding: 11px 12px 12px;
  }
  .mrow-time { grid-area: time; display: flex; gap: 8px; align-items: baseline; }
  .mrow-time strong { display: inline; font-size: 13px; }
  .mrow-teams { grid-area: teams; }
  .mrow-teams .t { font-size: 14.5px; }
  .mrow > .odds-row { grid-area: odds; }
  .mrow-more { grid-area: more; align-self: start; height: 36px; border: 1px solid var(--line); }
  .odd { height: 46px; }       /* cibles tactiles confortables */
  .odd b { font-size: 16px; }

  .sport-strip { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .sport-tile { padding: 11px; gap: 6px; }
  .sport-tile strong { font-size: 15px; }
  .promo-row { grid-template-columns: 1fr; }
  .league-grid { grid-template-columns: 1fr 1fr; }

  .scoreline .side { font-size: 16px; flex-direction: column; gap: 8px; text-align: center; }
  .scoreline .side.away { flex-direction: column-reverse; text-align: center; }
  .scoreline .score { font-size: 32px; }
  .scoreline .mid { min-width: 80px; }
  .market-body { grid-template-columns: repeat(2, 1fr); }
  .market-body.n3 { grid-template-columns: repeat(3, 1fr); }

  .stat-row { grid-template-columns: 1fr 1fr; }
  .wallet-hero { grid-template-columns: 1fr 1fr; }
  .wallet-hero .actions { grid-column: 1 / -1; }
  .wallet-hero .actions .btn { flex: 1; }
  .field-row { grid-template-columns: 1fr; }

  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form { padding: 24px 16px 100px; align-items: flex-start; }

  .footer-in { grid-template-columns: 1fr; }
  .tbl { font-size: 12.5px; }
  .ticket-sel { grid-template-columns: 1fr auto; }
  .ticket-sel .res { grid-column: 1 / -1; }
  .page-title { font-size: 24px; }
}
