/* ============================================================
   Lobinho.Bet — RESPONSIVE MOBILE OVERRIDES
   Carregue SEMPRE depois de style.css + lobby.css
   ============================================================ */

/* ── VIEWPORT E SAFE AREA ────────────────────────────────── */
html { height: 100%; -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: hidden; }
body {
  min-height: 100vh;
  min-height: 100dvh;
}
@supports (padding: env(safe-area-inset-top)) {
  .navbar {
    padding-left:  max(var(--space-6), env(safe-area-inset-left));
    padding-right: max(var(--space-6), env(safe-area-inset-right));
  }
}

/* ── AUTH PAGES (login/register): 100dvh centralizado ─── */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top:    max(var(--space-6), env(safe-area-inset-top));
  padding-bottom: max(var(--space-6), env(safe-area-inset-bottom));
}

/* ── GAME PAGE: FULLSCREEN TRAVADO (sem rolagem) ─────── */
body.game-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
}
.game-page .game-frame-container { flex: 1; min-height: 0; position: relative; }
.game-page iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; display: block;
}

/* ── INPUTS: anti-zoom iOS (requer 16px em mobile) ───── */
@media (max-width: 768px) {
  .form-input,
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="tel"], input[type="search"],
  textarea, select { font-size: 16px !important; }
}

/* ── TOUCH TARGETS (acessibilidade mobile) ───────────── */
@media (max-width: 768px) {
  .btn { min-height: 38px; padding: 8px 16px; font-size: 13px; }
  .btn-xs { min-height: 30px; padding: 5px 10px; font-size: 11px; }
  .btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12px; }
  .chip, .filter-chip { min-height: 38px; }
  .dropdown-item { min-height: 44px; }
  .modal-close { min-width: 40px; min-height: 40px; }
}

/* ── HERO FLUIDO (mobile-friendly typography) ────────── */
.hero-title { font-size: clamp(26px, 7.5vw, 60px); line-height: 1.15; }
.hero-description { font-size: clamp(14px, 3.8vw, 18px); }
@media (max-width: 480px) {
  .hero { padding: 36px var(--space-3) 30px !important; min-height: auto !important; }
  .hero-eyebrow { font-size: 11px; padding: 6px 12px; }
  .hero-cta { flex-direction: column; width: 100%; gap: 10px; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .hero-badges { justify-content: center; }
  .hero-badge { font-size: 12px; padding: 6px 10px; }
}

/* ── NAVBAR MOBILE compactada ────────────────────────── */
@media (max-width: 480px) {
  .navbar { height: 56px !important; padding: 0 var(--space-3) !important; }
  .navbar-right { gap: 8px !important; }
  .balance-badge { padding: 6px 10px !important; }
  .bal-amount { font-size: 12px !important; }
  .avatar { width: 34px !important; height: 34px !important; font-size: 13px !important; }
  .brand-logo-nav { height: 22px !important; width: auto !important; max-width: 130px !important; object-fit: contain !important; }
}

/* ── FILTER CHIPS: scroll horizontal suave ───────────── */
.filter-chips {
  flex-wrap: nowrap !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip { flex-shrink: 0; scroll-snap-align: start; }

/* ── STATS BAR mobile ────────────────────────────────── */
@media (max-width: 640px) {
  .stats-inner { flex-wrap: wrap; gap: var(--space-3) !important; justify-content: center; }
  .stat-separator { display: none; }
  .stat-item { flex: 1 1 calc(50% - 12px); min-width: 140px; justify-content: center; }
}

/* ── GAMES GRID: 2 colunas firmes em mobile ──────────── */
@media (max-width: 480px) {
  .games-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .games-grid-featured { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
}

/* ── PROMO BANNER ────────────────────────────────────── */
@media (max-width: 640px) {
  .promo-banner { padding: var(--space-5) var(--space-4) !important; margin: 0 var(--space-3) var(--space-5) !important; }
  .promo-title { font-size: clamp(18px, 4.8vw, 24px); line-height: 1.25; }
  .promo-desc { font-size: 13px; }
}

/* ── TESTIMONIALS / TRUST / FOOTER ───────────────────── */
@media (max-width: 640px) {
  .testimonials-grid { grid-template-columns: 1fr !important; gap: var(--space-3) !important; }
  .trust-bar { flex-wrap: wrap; gap: var(--space-2) !important; padding: var(--space-4) var(--space-3) !important; }
  .trust-item { font-size: 12px; }
  .footer-main { grid-template-columns: 1fr 1fr !important; gap: var(--space-5) !important; }
  .footer-bottom { flex-direction: column; gap: var(--space-3); text-align: center; }
}
@media (max-width: 440px) {
  .footer-main { grid-template-columns: 1fr !important; }
  .footer-brand { text-align: center; }
  .footer-socials { justify-content: center; }
}

/* ── MODAL: BOTTOM SHEET em mobile ───────────────────── */
@media (max-width: 640px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%; width: 100%;
    max-height: 94vh; max-height: 94dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-6) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom));
    animation: sheetUp 0.28s var(--ease-out);
  }
  @keyframes sheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .modal-title { font-size: var(--text-lg); }
  .modal::after {
    content: ""; position: absolute;
    top: 8px; left: 50%; transform: translateX(-50%);
    width: 42px; height: 4px; border-radius: 999px;
    background: rgba(255,255,255,0.18);
  }
}

/* ── BONUS POPUP mobile ──────────────────────────────── */
@media (max-width: 640px) {
  .bonus-popup-overlay { padding: 0; align-items: flex-end; }
  .bonus-popup {
    max-width: 100% !important; width: 100% !important;
    max-height: 94dvh; overflow-y: auto;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    padding: var(--space-6) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom)) !important;
  }
  .bonus-popup-title { font-size: clamp(20px, 5.5vw, 30px) !important; }
  .bonus-popup-amount { font-size: clamp(28px, 8vw, 44px) !important; }
}

/* ── WALLET MOBILE ───────────────────────────────────── */
@media (max-width: 640px) {
  .wallet-page { padding: 72px var(--space-3) var(--space-8) !important; }
  .balance-hero-card { padding: var(--space-6) var(--space-4) !important; border-radius: var(--radius-lg); }
  .balance-actions-row { gap: var(--space-2); }
  .balance-actions-row .btn { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 12px 10px; font-size: 13px; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { flex: 0 0 auto; white-space: nowrap; }
}

/* ── GAME TOPBAR MOBILE ──────────────────────────────── */
@media (max-width: 640px) {
  .game-topbar {
    padding: 0 var(--space-3) !important; height: 48px !important;
    gap: 6px;
    padding-left: max(var(--space-3), env(safe-area-inset-left)) !important;
    padding-right: max(var(--space-3), env(safe-area-inset-right)) !important;
  }
  .game-topbar-left { gap: 8px !important; min-width: 0; flex: 1; }
  .game-back-btn { padding: 6px 10px !important; font-size: 12px !important; }
  .game-title-tag { font-size: 12px !important; min-width: 0; overflow: hidden; }
  .game-title-tag img { height: 20px !important; }
  .game-title-sep { display: none; }
  #game-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .game-topbar-right { gap: 6px !important; flex-shrink: 0; }
  .game-balance-display { padding: 5px 10px !important; font-size: 12px !important; }
  .game-fullscreen-btn { width: 32px !important; height: 32px !important; }
}

/* ── ADMIN: TABELAS SCROLL HORIZONTAL ────────────────── */
@media (max-width: 900px) {
  .table-wrap, .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 640px; }
}

/* ── QUEBRA DE TEXTO ─────────────────────────────────── */
h1, h2, h3, h4, p, a { overflow-wrap: break-word; word-break: break-word; }

/* ── TOAST mobile ────────────────────────────────────── */
@media (max-width: 640px) {
  #toast {
    left: var(--space-3); right: var(--space-3);
    bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
    max-width: none; width: auto;
  }
}

/* ── IMPEDIR ZOOM DUPLO-TOQUE em botões ─────────────── */
button, a, .btn, .chip, .filter-chip { touch-action: manipulation; }

/* ── LOGOS PADRONIZADOS (mesmo tamanho do cabeçalho) ── */
.brand-logo-auth,
.brand-logo-footer,
.game-loading-logo img,
.game-title-tag img {
  height: 16px !important;
  width: auto !important;
  margin: 0 auto !important;
}
@media (max-width: 768px) {
  .brand-logo-auth,
  .brand-logo-footer,
  .game-loading-logo img,
  .game-title-tag img { height: 13px !important; }
}
@media (max-width: 480px) {
  .brand-logo-nav,
  .brand-logo-auth,
  .brand-logo-footer,
  .game-loading-logo img,
  .game-title-tag img { height: 28px !important; }
}

/* ── ANIMAÇÕES REDUZIDAS se usuário preferir ─────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── AJUSTE 2026-05-17: logo e botões menores em mobile pequeno ── */
@media (max-width: 768px) {
  .brand-logo-nav { height: 26px !important; }
  .btn-lg { padding: 10px 20px !important; font-size: 14px !important; min-height: 42px !important; }
  .btn-xl { padding: 12px 24px !important; font-size: 15px !important; min-height: 46px !important; }
  .btn-md { padding: 8px 16px !important; font-size: 13px !important; min-height: 38px !important; }
}
@media (max-width: 380px) {
  .brand-logo-nav { height: 20px !important; }
  .navbar { height: 50px !important; }
  .navbar-logo .logo-icon { width: 28px !important; height: 28px !important; }
  .balance-badge { padding: 4px 8px !important; }
  .bal-amount { font-size: 11px !important; }
  .avatar { width: 30px !important; height: 30px !important; font-size: 12px !important; }
  .btn { padding: 7px 13px !important; font-size: 12px !important; min-height: 36px !important; }
  .btn-lg { padding: 9px 16px !important; font-size: 13px !important; min-height: 38px !important; }
  .btn-xl { padding: 11px 20px !important; font-size: 14px !important; min-height: 42px !important; }
}

/* ── AJUSTE 2026-05-17 v2: limitar logo por largura pra evitar overflow ── */
.brand-logo-nav {
  width: auto !important;
  object-fit: contain !important;
}
@media (max-width: 768px) {
  .brand-logo-nav { height: 24px !important; max-width: 140px !important; }
}
@media (max-width: 480px) {
  .brand-logo-nav { height: 20px !important; max-width: 120px !important; }
}
@media (max-width: 380px) {
  .brand-logo-nav { height: 18px !important; max-width: 100px !important; }
}

/* ── AJUSTE 2026-05-17 v3: footer mobile 100% centralizado ── */
@media (max-width: 768px) {
  .footer-col { text-align: center !important; }
  .footer-col-title { text-align: center !important; }
  .footer-links { align-items: center !important; }
  .footer-link { text-align: center !important; }
  .footer-desc { text-align: center !important; }
  .footer-socials { justify-content: center !important; }
  .footer-bottom { flex-direction: column !important; align-items: center !important; text-align: center !important; gap: var(--space-3) !important; }
  .footer-copyright { text-align: center !important; }
  .footer-certs { justify-content: center !important; }
  .footer-responsible { text-align: center !important; }
}
