/* ============ Mobile & tablette (chargé en dernier) ============ */
html, body { overflow-x: hidden; max-width: 100%; }
button, .btn, a, select, input[type=range] { touch-action: manipulation; }
img, svg, canvas { max-width: 100%; }

@media (max-width: 1100px) {
  .page { padding: 18px 14px 50px; }
  .game-layout { grid-template-columns: 1fr; gap: 14px; }
  .panel { position: static; }
  .hero { grid-template-columns: 1fr; padding: 30px 24px; }
  .rw-grid, .team-grid, .profile-grid, .two-col { grid-template-columns: 1fr; }
  .hstats { grid-template-columns: repeat(2, 1fr); }
  .auth { grid-template-columns: 1fr; } .auth-art { padding: 36px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .craft-row { flex-direction: column; align-items: center; } .ladder { flex-direction: row; max-height: none; overflow-x: auto; width: 100%; } .ladder .lr { min-width: 92px; flex-direction: column; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); font-size: 15px; }
  /* en-tête compact + barre d'onglets en bas */
  #announce { font-size: 11px; padding: 5px 8px; letter-spacing: .06em; }
  #header { height: auto; padding: 8px 12px; gap: 8px; flex-wrap: nowrap; justify-content: space-between; position: sticky; top: 0; }
  .logo .wm small { display: none; } .logo .wm b { font-size: 20px; } .logo-svg { width: 26px; height: 26px; }
  .hdr-right { gap: 6px; margin-left: auto; } .jp-mini { display: none; } .icon-btn { width: 34px; height: 34px; }
  .wallet { padding: 5px 9px; gap: 5px; } .wallet b { font-size: 13px; } .wallet .ic { width: 16px !important; height: 16px !important; }
  .user-chip { padding: 3px 6px 7px 3px; } .user-chip .un { display: none; }
  #nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 430; display: flex; gap: 0; background: rgba(10, 8, 7, .97); border-top: 1px solid var(--brass-lo); padding: 0 0 env(safe-area-inset-bottom); overflow-x: auto; width: 100%; box-shadow: 0 -10px 30px rgba(0, 0, 0, .6); }
  #nav a { flex: 1 0 auto; min-width: 70px; padding: 14px 10px 13px; text-align: center; font-size: 11px; letter-spacing: .08em; white-space: nowrap; }
  #nav a::after { left: 20%; right: 20%; bottom: auto; top: 0; height: 3px; }
  .nbadge { margin-left: 4px; padding: 0 4px; }
  #ticker { height: 26px; font-size: 11px; }
  #footer { padding: 18px 14px; font-size: 11px; }
  .chat-dock { right: 8px; left: 8px; width: auto; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 425; } .chat-toggle { padding: 8px 12px; } .chat-list { height: 190px; }
  #toasts { right: 8px; left: 8px; bottom: calc(118px + env(safe-area-inset-bottom)); align-items: stretch; } .toast { max-width: none; font-size: 14px; }
  .rain { top: 78px; width: calc(100% - 24px); }
  .float-text { font-size: 22px; }

  /* titres & cartes */
  .page-title { font-size: 30px; margin-bottom: 14px; } h3 { font-size: 18px; }
  .card-box { padding: 16px 14px; overflow-x: auto; } .card-box::before, .panel::before { display: none; }
  .tbl { font-size: 12px; } .tbl th, .tbl td { padding: 7px 8px; white-space: nowrap; }
  .modal { padding: 20px 16px; max-height: 92dvh; } .overlay { padding: 8px; place-items: center; } .modal.wide { max-width: 100%; }
  .btn { min-height: 44px; padding: 10px 14px; } .btn.big { padding: 13px 16px; font-size: 16px; } .btn.mini { min-height: 34px; }
  input, select, textarea { font-size: 16px; min-height: 44px; } input[type=range] { min-height: 0; } input[type=checkbox] { min-height: 0; }

  /* connexion */
  .auth-art h1 { font-size: 64px; } .auth-art p { letter-spacing: .12em; font-size: 12px; } .auth-card { padding: 22px 16px; max-width: none; }

  /* lobby */
  .hero { padding: 24px 16px; } .hero h1 { font-size: 40px; } .hero p { font-size: 14px; } .hero-cta { flex-direction: column; } .hero-cta .btn { width: 100%; }
  .streak-days { gap: 5px; } .sd { width: 38px; height: 50px; flex: 1; } .jackpot { padding: 28px 10px 18px; } .odo { font-size: 34px; }
  .hstat { padding: 12px 14px; } .hstat b { font-size: 18px; } .hstats { margin-bottom: 20px; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; } .search { width: 100%; min-width: 0; }
  .pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; } .pill { flex: 0 0 auto; padding: 10px 14px; }
  .poster-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .p-no { font-size: 32px; left: 12px; top: 40px; } .p-info { padding: 40px 12px 12px; } .p-info h3 { font-size: 16px; } .p-info p { display: none; } .p-foot { font-size: 10px; } .p-foot b { font-size: 12px; } .p-tag { font-size: 10px; padding: 3px 10px 3px 14px; top: 18px; }
  .poster:hover { transform: none; }
  .band { padding: 24px 18px; } .band h2 { font-size: 28px; }

  /* page de jeu */
  .game-head { flex-wrap: wrap; gap: 10px; padding: 12px; } .gh-title { flex: 1 1 100%; order: 2; } .gh-title h1 { font-size: 24px; } .gh-title p { display: none; } .gicon { width: 36px; height: 36px; }
  .back { order: 1; padding: 8px 12px; } .gh-actions { order: 1; margin-left: auto; gap: 6px; } .gh-actions .btn { padding: 8px 10px; font-size: 12px; min-height: 40px; }
  .panel { padding: 14px 12px; gap: 12px; } .stage { padding: 10px; min-height: 0; gap: 12px; }
  .bet-row { grid-template-columns: 1fr auto auto auto; } .bet-chips .chip { max-width: 56px; } .win-amt { font-size: 22px; }
  .game-layout:has(.pusher-cv), .game-layout:has(.claw-cv), .game-layout:has(.craft-cv), .game-layout:has(.trade-cv), .game-layout:has(.crash-cv) { display: flex; flex-direction: column; } .game-layout:has(.pusher-cv) > .stage, .game-layout:has(.claw-cv) > .stage, .game-layout:has(.craft-cv) > .stage, .game-layout:has(.trade-cv) > .stage, .game-layout:has(.crash-cv) > .stage { order: -1; }
  .pusher-stage, .claw-stage { padding: 4px; }

  /* mode auto */
  .auto-toggle { padding: 14px; } .auto-stats { grid-template-columns: repeat(3, 1fr); } .rule { grid-template-columns: auto 1fr; } .rule .btn { grid-column: 2; }

  /* jeux */
  .slot-machine { padding: 10px 8px 16px; --cell: clamp(48px, 14.5vw, 80px); } .marquee { font-size: 18px; } .lights i { width: 8px; height: 8px; } .spin-btn { width: 100%; }
  .r-stage { overflow-x: hidden; } .r-top { flex-direction: column; gap: 10px; } .wheel-box { width: 100%; max-width: 340px; } .r-side { min-width: 0; width: 100%; } .r-result { width: 84px; height: 84px; font-size: 34px; } .r-hist { max-width: none; }
  .rtable { overflow-x: auto; padding: 6px; -webkit-overflow-scrolling: touch; } .rtable > * { min-width: 520px; } .rcell { min-height: 38px; font-size: 12px; } .r-row { gap: 3px; }
  .live-bar { flex-wrap: wrap; gap: 8px; } .live-timer { width: 46px; height: 46px; font-size: 17px; } .live-players { max-height: 190px; }
  .card { width: 58px; height: 84px; } .card.big { width: 112px; height: 158px; } .hand .card + .card { margin-left: -34px; } .cr { font-size: 14px; } .cs { font-size: 28px; }
  .bj-actions, .hl-actions { grid-template-columns: 1fr 1fr; } .bacc-hands { grid-template-columns: 1fr; gap: 14px; } .bspots { gap: 6px; } .bspot { padding: 14px 4px; font-size: 13px; }
  .keno-grid, .mines-grid { gap: 5px; } .ktile { font-size: 13px; } .kp { min-width: 48px; padding: 4px 6px; }
  .mines-mult { font-size: 40px; } .dice-num { font-size: 64px; } .dstats { gap: 8px; } .dstat b { font-size: 16px; }
  .coin-wrap { width: 170px; height: 220px; } .coin { width: 150px; height: 150px; } .scratch-wrap { width: min(320px, 86vw); }
  .craft-cv { width: 100%; } .modes { grid-template-columns: 1fr 1fr; } .mode { padding: 8px; } .mode small { display: none; }
  .ptabs { grid-template-columns: repeat(3, 1fr); } .ptab { padding: 8px 6px; } .ptab small { display: none; } .pts { font-size: 30px; } .dpad { max-width: 210px; } .dpad button { height: 52px; font-size: 20px; }
  .collect .ck { grid-template-columns: repeat(4, 1fr); }
  .cr-hist { gap: 4px; } .ch { padding: 3px 8px; font-size: 11px; }

  /* trading */
  .trade-stage { padding: 10px; } .sym-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; } .chip-sym { flex: 0 0 auto; min-width: 124px; } .tr-head { gap: 8px 12px; } .tr-head h2 { font-size: 18px; flex: 1 1 100%; } .tr-price { font-size: 28px; } .tr-tick { display: none; }
  .ttabs { grid-template-columns: repeat(3, 1fr); } .ttab { font-size: 11px; padding: 10px 2px; } .digit-freq { height: 70px; } .digit-strip i { width: 24px; height: 24px; font-size: 11px; } .pos-box { padding: 10px; }

  /* récompenses, profil, classement, équité */
  .chests { grid-template-columns: repeat(2, 1fr); } .tier { flex: 0 0 104px; } .mission { grid-template-columns: 1fr; } .mission .btn { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); } .avatars { gap: 6px; } .avatars button { width: 48px; height: 48px; } .p-head { gap: 12px; } .p-avatar { width: 72px; height: 72px; }
  .lb-row { grid-template-columns: 34px 36px 1fr auto; gap: 8px; padding: 10px; } .lb-row .rk { font-size: 22px; }
  .ach-grid { grid-template-columns: 1fr; } .kv code { font-size: 11px; } code.cut { max-width: 110px; }
  .kpis { grid-template-columns: repeat(2, 1fr); } .kpi b { font-size: 17px; }
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; } .admin-tabs button { flex: 0 0 auto; } .admin-games { grid-template-columns: 1fr; } .ga-luck { grid-template-columns: 1fr auto; } .ga-luck .ends { display: none; } .edit-user .row { flex-wrap: wrap; }

  /* gacha */
  .gstatus { grid-template-columns: repeat(2, 1fr); gap: 6px; } .gst { padding: 8px 10px; gap: 8px; } .gst b { font-size: 15px; }
  .gtabs { flex-wrap: nowrap; overflow-x: auto; } .gtab { flex: 0 0 auto; padding: 12px 14px; font-size: 12px; }
  .g-hero { padding: 18px 14px; gap: 14px; } .g-info h1 { font-size: 28px; } .g-btns { flex-direction: column; } .g-btns .btn { min-width: 0; width: 100%; } .g-art { min-height: 0; order: -1; } .ccard.xl { width: 190px; } .g-glow { width: 220px; height: 220px; }
  .banner-tabs { overflow-x: auto; flex-wrap: nowrap; } .btab { flex: 0 0 auto; padding: 10px 14px; }
  .cgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .book-prog { grid-template-columns: repeat(3, 1fr); } .col-head { flex-direction: column; align-items: stretch; }
  .slots { grid-template-columns: repeat(3, 1fr); gap: 6px; } .slot { min-height: 150px; } .power-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .detail { flex-direction: column; } .stats-grid.sm { grid-template-columns: repeat(2, 1fr); }
  .pull-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 4px; } .pull-grid.c1 { grid-template-columns: 200px; } .pull-out { padding: 16px 4px 90px; } .pcard.single .ccard { transform: scale(1.1); } .skip { right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .ccard .cc-name { font-size: 12px; min-height: 28px; } .cc-art { aspect-ratio: 1 / 1.1; }
  .battle { padding: 6px; gap: 12px; } .battle .side { gap: 6px; } .bu { width: 17vw; max-width: 86px; } .bu.foe.boss { width: 28vw; max-width: 130px; } .bu small { font-size: 10px; } .vs { font-size: 22px; } .dmg { font-size: 16px; } .dmg.crit { font-size: 22px; } .battle-res h1 { font-size: 52px; } .rw-line { font-size: 17px; gap: 12px; }
  .foes { gap: 8px; } .foe { min-width: 96px; padding: 8px; } .tower-head { flex-wrap: wrap; gap: 10px; } .hist { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); } .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .spot-art { width: min(240px, 62vw); } .spot-in h1 { font-size: 34px; }
  .bigwin .bw-title { letter-spacing: 2px; }
}

@media (max-width: 400px) {
  .poster-grid { gap: 8px; } .hero h1 { font-size: 34px; } .wallet b { font-size: 12px; } .logo .wm b { font-size: 17px; }
  .slots { grid-template-columns: repeat(2, 1fr); } .shop-grid { grid-template-columns: 1fr; }
}

/* écrans tactiles : pas de survol, cibles plus grandes */
@media (hover: none) {
  .poster .p-info p { display: none; } .poster:hover svg.poster { transform: none; } .btn:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--brass-lo); color: inherit; }
  .ccard:hover { transform: none; }
}
@media (max-height: 520px) and (orientation: landscape) { #nav { position: static; } body { padding-bottom: 0; } .chat-dock { bottom: 0; } }
