/* ============================================================
   Responsive - source breakpoints: 1536 / 1280 / 1024 / 768 / 640 / 400 / 360
   ============================================================ */

@media (max-width: 1280px) {
  .row, .prov-row { --per: 6; }
  .game-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand { gap: 28px; }
}

/* Below md (source "mobile"): sidebar becomes a drawer, bottom nav appears */
@media (max-width: 767px) {
  .content { margin-left: 0; padding-bottom: calc(var(--safe-bottom) + 4rem); }
}
@media (max-width: 1024px) {
  .hero { --per: 2; }
  .promo-row { --per: 2; }
  .row, .prov-row { --per: 5; }
  .game-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .promos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__brand { grid-template-columns: 1fr; }
  .footer__ver { margin-top: 20px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-aside, .layout-main-aside { grid-template-columns: minmax(0, 1fr); }
  .betslip { position: static; }
}

@media (max-width: 768px) {
  .hero { --per: 1.1; }
  .hero__dots { bottom: 8px; }
  .promo-row { --per: 1.15; }
  .row { --per: 3.3; }
  .prov-row { --per: 3.5; }
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .promos-grid { grid-template-columns: 1fr; }
  .lobbybar { flex-direction: column; align-items: stretch; gap: 12px; }
  .lobbybar > * { width: 100%; }
  .search { flex: 0 0 auto; min-width: 0; height: 48px; }
  .bets__tabs { width: 100%; }
  .bets__table th:nth-child(2), .bets__table td:nth-child(2) { display: none; }
  .footer-box { padding: 20px 16px; }
  .responsible { padding-bottom: 20px; }
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 24px 0; }
  .footer__col h4 { margin-bottom: 12px; }
  .gm { grid-template-columns: 1fr; }
  .modal--wide { max-width: 480px; }
  .grid-2, .steps { grid-template-columns: 1fr; }
  .match { grid-template-columns: 1fr; }
  .match__odds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-title { font-size: 20px; }
}

@media (max-width: 640px) {
  .brand { font-size: 24px; }
  .brand__p { width: 20px; height: 26px; }
  .section__title { font-size: 16px; }
  .chip-all { padding: 0 10px; }
  .arrow-btn { width: 32px; height: 32px; }
  .section__head { height: 32px; }
  .grid-3 { grid-template-columns: 1fr; }
  .toasts { left: 12px; right: 12px; top: 72px; max-width: none; }
}

@media (max-width: 400px) {
  .row { --per: 3.15; }
  .footer__cols { grid-template-columns: 1fr 1fr; gap: 16px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}

/* ---------- Bottom nav (mobile) ---------- */
.mobile-nav { display: none; }
@media (max-width: 767px) {
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 55;
    background: var(--background-400); border-top: 1px solid var(--grey-24);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--text-secondary); }
  .mobile-nav a img { width: 22px; height: 22px; object-fit: contain; filter: grayscale(1) brightness(1.3); opacity: .75; transition: filter var(--fast), opacity var(--fast); }
  .mobile-nav a svg { width: 22px; height: 22px; }
  .mobile-nav a.is-active { color: #fff; }
  .mobile-nav a.is-active img { filter: none; opacity: 1; }
}

/* narrow phones, logged in: header carries logo + balance + 4 buttons - keep every piece visible */
@media (max-width: 400px) {
  .header .brand { font-size: 20px; letter-spacing: -0.6px; }
  .header .brand__p { width: 17px; height: 22px; }
}
