/* ── LotoDez — Custom Styles ────────────────────────────────────────────── */

:root {
  --navy:       #0B1E3D;
  --navy-mid:   #132952;
  --navy-light: #1E3A5F;
  --green:      #00C896;
  --green-dark: #00A878;
  --gold:       #F5A623;
  --red:        #FF4757;
  --text:       #1A2B4A;
  --muted:      #6B7A90;
  --bg:         #F8FAFC;
  --border:     #E2E8F0;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(11,30,61,0.10);
  --shadow-lg:  0 8px 48px rgba(11,30,61,0.18);
}

html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--text); }

/* ── Typography ──────────────────────────────────────────────────────────── */
.text-green { color: var(--green) !important; }
.text-gold  { color: var(--gold)  !important; }
.text-navy  { color: var(--navy)  !important; }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.ld-navbar {
  background: var(--navy) !important;
  border-bottom: none;
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.22);
}
.ld-navbar .navbar-toggler { border-color: rgba(255,255,255,0.3); }
.ld-navbar .navbar-toggler-icon { filter: invert(1); }
.ld-navbar .nav-link { color: rgba(255,255,255,0.75) !important; font-weight: 500; }
.ld-navbar .nav-link:hover { color: #fff !important; }
.brand-loto { color: #fff; font-weight: 700; font-size: 1.45rem; letter-spacing: -0.03em; line-height: 1; }
.brand-dez  { color: var(--green); font-weight: 800; font-size: 1.45rem; letter-spacing: -0.03em; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge-pro  { background: var(--gold); color: #fff; font-weight: 700; font-size: 0.65rem; padding: 3px 7px; border-radius: 6px; letter-spacing: 0.05em; }
.badge-free { background: var(--navy-light); color: rgba(255,255,255,0.6); font-weight: 600; font-size: 0.65rem; padding: 3px 7px; border-radius: 6px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-ld-primary {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0,200,150,0.35);
}
.btn-ld-primary:hover { background: var(--green-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(0,200,150,0.45); }
.btn-ld-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: var(--radius);
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  transition: all 0.2s;
}
.btn-ld-outline:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.7); }
.btn-ld-gold {
  background: linear-gradient(135deg, #F5A623 0%, #e09420 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  transition: all 0.22s;
  box-shadow: 0 4px 18px rgba(245,166,35,0.4);
  letter-spacing: 0.02em;
}
.btn-ld-gold:hover {
  background: linear-gradient(135deg, #e09420 0%, #c8841a 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 7px 22px rgba(245,166,35,0.5);
}

/* Botão secundário leve — para ações de navegação dentro do app
 * (ex.: "Analisar estes 15", "Testar no backtest", "Copiar"). */
.btn-ld-soft {
  background: rgba(0, 200, 150, 0.08);
  color: var(--green-dark, #00875A);
  border: 1.5px solid rgba(0, 200, 150, 0.28);
  border-radius: 10px;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  font-size: 0.83rem;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-ld-soft:hover {
  background: rgba(0, 200, 150, 0.16);
  color: var(--green-dark, #00875A);
  border-color: var(--green, #00C896);
  transform: translateY(-1px);
}
.btn-ld-soft.is-copied,
.btn-ld-soft.is-copied:hover {
  background: var(--green, #00C896);
  color: #fff;
  border-color: var(--green, #00C896);
  transform: none;
}
.btn-ld-soft:disabled,
.btn-ld-soft[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
/* Quando btn-ld-primary é usado em ação secundária (ex.: Nova variação),
 * usa o mesmo tamanho compacto dos soft para manter o ritmo. */
.btn-ld-primary.btn-soft-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.95rem;
  font-size: 0.83rem;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,200,150,0.32);
  white-space: nowrap;
}
.btn-ld-primary.btn-soft-size:disabled,
.btn-ld-primary.btn-soft-size[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero-section {
  background: var(--navy);
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 5rem 0;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 700px 500px at 75% 50%, rgba(0,200,150,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 15% 80%, rgba(245,166,35,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,200,150,0.12);
  border: 1px solid rgba(0,200,150,0.3);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.hero-title .accent { color: var(--green); }
.hero-lead {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.65);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}
.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 1.6rem; font-weight: 800; color: var(--green); }
.hero-stat .lbl { font-size: 0.75rem; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Hero Number Grid ────────────────────────────────────────────────────── */
.hero-grid-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 28px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  backdrop-filter: blur(4px);
}
.hero-ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.5s cubic-bezier(0.34,1.56,0.64,1);
  opacity: 0;
}
.hero-ball.show { opacity: 1; }
.hero-ball.included { background: var(--green); color: #fff; box-shadow: 0 0 18px rgba(0,200,150,0.45); }
.hero-ball.excluded { background: rgba(255,71,87,0.15); color: #FF6B7A; border: 1.5px solid rgba(255,71,87,0.35); }
.hero-grid-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}
.legend-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
}
.legend-dot::before {
  content: '';
  width: 12px; height: 12px;
  border-radius: 50%;
}
.legend-dot.incl::before { background: var(--green); }
.legend-dot.excl::before { background: rgba(255,71,87,0.5); border: 1px solid #FF4757; }

/* ── Trust Bar ───────────────────────────────────────────────────────────── */
.trust-bar {
  background: var(--navy-mid);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 1.5rem 0;
}
.trust-item { text-align: center; }
.trust-item .val { font-size: 1.5rem; font-weight: 800; color: var(--green); }
.trust-item .lbl { font-size: 0.72rem; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.06em; display: block; }

/* ── Sections ────────────────────────────────────────────────────────────── */
.section-dark    { background: var(--navy); color: #fff; padding: 5rem 0; }
.section-light   { background: #fff; padding: 5rem 0; }
.section-gray    { background: var(--bg); padding: 5rem 0; }
.section-title   { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1rem; }
.section-sub     { font-size: 1.1rem; color: var(--muted); max-width: 600px; margin: 0 auto 3rem; }

/* ── Problem/Solution block ──────────────────────────────────────────────── */
.method-card {
  border-radius: 16px;
  padding: 2rem;
  height: 100%;
}
.method-card.wrong  { background: rgba(255,71,87,0.05); border: 1.5px solid rgba(255,71,87,0.2); }
.method-card.right  { background: rgba(0,200,150,0.05); border: 1.5px solid rgba(0,200,150,0.2); }
.method-card .icon  { font-size: 2rem; margin-bottom: 1rem; }
.method-card h4     { font-weight: 700; margin-bottom: 0.5rem; }
.method-card p      { color: var(--muted); line-height: 1.7; }

/* ── How it works steps ──────────────────────────────────────────────────── */
.step-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  transition: transform 0.2s;
}
.step-card:hover { transform: translateY(-2px); }
.step-num {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-card h5 { font-weight: 700; margin-bottom: 0.25rem; font-size: 1rem; }
.step-card p  { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ── Last Results ────────────────────────────────────────────────────────── */
.result-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.result-card .concurso-info { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.75rem; }
.result-card .concurso-num  { font-weight: 700; color: var(--navy); font-size: 0.95rem; }
.balls-row { display: flex; flex-wrap: wrap; gap: 6px; }
.num-ball {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.82rem;
  transition: all 0.2s;
  flex-shrink: 0;
}
.num-ball.default  { background: var(--navy); color: #fff; }
.num-ball.hot      { background: var(--green); color: #fff; box-shadow: 0 0 10px rgba(0,200,150,0.3); }
.num-ball.cold     { background: rgba(255,71,87,0.12); color: #FF4757; }
.num-ball.excluded { background: #FF4757; color: #fff; }
.num-ball.included { background: var(--green); color: #fff; }
.num-ball.neutral  { background: rgba(30,58,95,0.12); color: var(--navy-light); }
.num-ball.selected { background: var(--green); color: #fff; box-shadow: 0 0 12px rgba(0,200,150,0.4); transform: scale(1.1); }
.num-ball.fixed    { background: linear-gradient(135deg, var(--gold), #D97706); color: #fff; box-shadow: 0 0 10px rgba(245,166,35,0.4); }
.num-ball.clickable { cursor: pointer; }
.num-ball.clickable:hover:not(.selected):not(.fixed) { background: rgba(0,200,150,0.15); border: 1.5px solid var(--green); transform: scale(1.05); }

/* ── Feature Cards ───────────────────────────────────────────────────────── */
.feat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.75rem;
  height: 100%;
  transition: all 0.25s;
}
.feat-card:hover { background: rgba(255,255,255,0.07); border-color: rgba(0,200,150,0.25); transform: translateY(-2px); }
.feat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(0,200,150,0.15);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.feat-icon.gold { background: rgba(245,166,35,0.15); color: var(--gold); }
.feat-card h5 { color: #fff; font-weight: 700; margin-bottom: 0.4rem; }
.feat-card p  { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin: 0; line-height: 1.6; }

/* ── Pricing Cards ───────────────────────────────────────────────────────── */
.price-card {
  border-radius: 20px;
  padding: 2.5rem;
  height: 100%;
  border: 1.5px solid var(--border);
  background: #fff;
  position: relative;
  transition: all 0.25s;
}
.price-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.price-card.featured {
  border-color: var(--green);
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 40px rgba(0,200,150,0.2);
}
.price-card .popular-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 5px 14px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.price-amount { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.price-amount sup { font-size: 1.2rem; vertical-align: super; margin-right: 2px; }
.price-amount .period { font-size: 0.9rem; font-weight: 400; opacity: 0.6; }
.price-features { list-style: none; padding: 0; margin: 1.5rem 0; }
.price-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 0.9rem;
}
.price-card.featured .price-features li { border-color: rgba(255,255,255,0.08); }
.price-features li i { margin-top: 2px; flex-shrink: 0; }

/* ── Auth Pages ──────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  backdrop-filter: blur(10px);
}
.auth-card .brand { text-align: center; margin-bottom: 2rem; }
.auth-card h2 { color: #fff; font-weight: 800; text-align: center; font-size: 1.6rem; margin-bottom: 0.5rem; }
.auth-card .sub { color: rgba(255,255,255,0.5); text-align: center; font-size: 0.9rem; margin-bottom: 2rem; }
.auth-field { margin-bottom: 1.25rem; }
.auth-field label { color: rgba(255,255,255,0.7); font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; display: block; }
.auth-field .form-control {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.auth-field .form-control::placeholder { color: rgba(255,255,255,0.25); }
.auth-field .form-control:focus {
  background: rgba(255,255,255,0.09);
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,200,150,0.15);
  color: #fff;
  outline: none;
}
.auth-error { background: rgba(255,71,87,0.12); border: 1px solid rgba(255,71,87,0.3); color: #FF6B7A; border-radius: 10px; padding: 0.75rem 1rem; font-size: 0.85rem; margin-bottom: 1rem; display: none; }
.auth-error.show { display: block; }
.auth-link { color: rgba(255,255,255,0.5); font-size: 0.88rem; text-align: center; margin-top: 1.5rem; }
.auth-link a { color: var(--green); text-decoration: none; font-weight: 600; }
.auth-link a:hover { text-decoration: underline; }

/* reCAPTCHA v3: esconde o badge flutuante do Google (a divulgação fica no texto abaixo) */
.grecaptcha-badge { visibility: hidden; }
.recaptcha-notice {
  color: rgba(255,255,255,0.38);
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: center;
  margin-top: 1.25rem;
}
.recaptcha-notice a { color: rgba(255,255,255,0.6); text-decoration: none; }
.recaptcha-notice a:hover { text-decoration: underline; }

/* ── App Layout (dashboard/tools) ────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: calc(100vh - 62px);
}
.app-sidebar {
  width: 240px;
  background: var(--navy);
  border-right: none;
  padding: 1.25rem 0;
  flex-shrink: 0;
  position: sticky;
  top: 62px;
  height: calc(100vh - 62px);
  min-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 6px 0 32px rgba(0,0,0,0.18), inset -1px 0 0 rgba(255,255,255,0.05);
  z-index: 10;
}
.sidebar-section { padding: 0.25rem 1rem 0.5rem; font-size: 0.65rem; color: rgba(255,255,255,0.25); text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 1rem;
  margin: 1px 10px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.18s;
  position: relative;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.92); }
.sidebar-nav a.active {
  background: rgba(0,200,150,0.15);
  color: var(--green);
  box-shadow: 0 2px 12px rgba(0,200,150,0.15);
}
.sidebar-nav a.active::before { display: none; }
.sidebar-nav a i { width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-nav .pro-lock { margin-left: auto; font-size: 0.6rem; opacity: 0.45; }
.app-main {
  flex: 1;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}
.app-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.app-topbar h1 { font-size: 1.15rem; font-weight: 700; color: var(--text); margin: 0; }
.app-content { padding: 1.75rem; }

/* ── Dashboard cards ─────────────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(11,30,61,0.09), 0 1px 4px rgba(11,30,61,0.05);
  height: 100%;
}
.stat-card .lbl  { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin-bottom: 0.4rem; }
.stat-card .val  { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-card .sub  { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }
.stat-card .icon { font-size: 1.5rem; color: var(--green); float: right; margin-top: -2.2rem; }

.dash-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(11,30,61,0.08), 0 1px 4px rgba(11,30,61,0.04);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.dash-card h5 { font-weight: 700; color: var(--text); margin-bottom: 1rem; font-size: 1rem; }

/* ── Tool sections ───────────────────────────────────────────────────────── */
.tool-header { margin-bottom: 1.25rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.tool-header h2 { display: none; }
.tool-body { }
.tool-section { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Number selector grid ────────────────────────────────────────────────── */
.num-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 280px;
}
.num-grid .num-ball { width: 100%; height: auto; aspect-ratio: 1; font-size: 0.9rem; }

/* Grade de números fixos do Gerador: mais colunas em telas maiores */
@media (min-width: 576px) {
  .gen-fixed-grid { grid-template-columns: repeat(9, 1fr); max-width: 420px; }
  .gen-fixed-grid .num-ball { font-size: 0.8rem; }
}

/* ── Verificar Jogo — grade e controles ──────────────────────────────────── */
.check-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-width: 240px;
}
.check-grid .num-ball { width: 100%; height: auto; aspect-ratio: 1; font-size: 0.82rem; }

.check-progress-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.check-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ── Absence grid ────────────────────────────────────────────────────────── */
.absence-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.absence-ball {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 60px;
}
.absence-ball .num-ball { width: 44px; height: 44px; font-size: .85rem; }
.absence-ball .cnt { font-size: 0.65rem; font-weight: 700; color: var(--muted); }
.absence-ball .abs-rec { font-size: .55rem; font-weight: 800; color: #FF4757; text-transform: uppercase; letter-spacing: .03em; }
.absence-mini-bar { width: 100%; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.absence-mini-fill { height: 100%; border-radius: 2px; transition: width 0.45s ease; }
.absence-mini-fill.safe   { background: var(--green); }
.absence-mini-fill.warn   { background: #F5A623; }
.absence-mini-fill.danger { background: #FF4757; }

/* ── Absence detail list (alerta + frescos) ──────────────────────────────── */
.absence-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.absence-detail-row:last-child { border-bottom: none; }
.absence-detail-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.absence-detail-fill { height: 100%; border-radius: 3px; transition: width 0.45s ease; }
.absence-detail-fill.warn   { background: linear-gradient(90deg, #F5A623, #e09420); }
.absence-detail-fill.danger { background: linear-gradient(90deg, #FF6B6B, #FF4757); }
.absence-pct { font-size: .72rem; font-weight: 800; min-width: 34px; text-align: right; }
.absence-pct.warn   { color: #e09420; }
.absence-pct.danger { color: #FF4757; }

/* ── Score display ───────────────────────────────────────────────────────── */
.score-wrap { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.score-circle {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--sc-color, var(--green)) var(--sc-pct, 0deg), rgba(30,58,95,0.2) 0);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.score-circle .inner {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-circle .sc-val { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--text); }
.score-circle .sc-lbl { font-size: 0.65rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.breakdown-row { display: flex; align-items: center; gap: 10px; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.breakdown-row:last-child { border: none; }
.breakdown-row .br-label { flex: 1; font-size: 0.85rem; color: var(--text); font-weight: 600; }
.breakdown-row .br-note { flex: 2; font-size: 0.78rem; color: var(--muted); }
.breakdown-row .br-score { font-weight: 700; font-size: 0.9rem; min-width: 40px; text-align: right; }
.score-bar { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; flex: 1; }
.score-bar-fill { height: 100%; background: var(--green); border-radius: 2px; transition: width 0.8s ease; }

/* ── Suggestion display ──────────────────────────────────────────────────── */
.suggest-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 0.5rem 0 1rem; }
.suggest-grid .num-ball { width: 34px; height: 34px; font-size: 0.78rem; }
.suggest-grid-lg .num-ball { width: 44px; height: 44px; font-size: 0.9rem; font-weight: 800; }

/* ── Upgrade prompt ──────────────────────────────────────────────────────── */
.upgrade-prompt {
  background: linear-gradient(160deg, rgba(245,166,35,0.07) 0%, rgba(255,255,255,0) 100%);
  border: 1px solid rgba(245,166,35,0.22);
  border-top: 3px solid var(--gold);
  border-radius: 16px;
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(245,166,35,0.07);
}
.up-icon {
  width: 52px; height: 52px;
  background: rgba(245,166,35,0.12);
  border: 1.5px solid rgba(245,166,35,0.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .875rem;
}
.up-icon i { font-size: 1.35rem; color: var(--gold); }
.up-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(90deg, #F5A623, #e09420);
  color: #fff;
  font-size: 0.67rem; font-weight: 800;
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 3px 11px; border-radius: 20px;
  margin-bottom: .875rem;
}
.upgrade-prompt h4 { font-weight: 700; color: var(--text); margin-bottom: .4rem; font-size: 1rem; }
.upgrade-prompt p  { color: var(--muted); font-size: 0.875rem; margin-bottom: 1.5rem; line-height: 1.65; }

/* ── Perfil ──────────────────────────────────────────────────────────────── */
.ld-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.ld-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}
.ld-input:focus {
  background: #fff;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,200,150,0.12);
  color: var(--text);
}
.ld-input:disabled { opacity: 0.6; cursor: not-allowed; }
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--navy-mid));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; color: #fff;
}
.password-strength { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.strength-bar { height: 100%; width: 0; border-radius: 2px; transition: width .3s, background .3s; }
.strength-weak   { background: var(--red); }
.strength-medium { background: var(--gold); }
.strength-good   { background: #5bc0de; }
.strength-strong { background: var(--green); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.ld-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 3rem 0 2rem;
  border-top: 3px solid rgba(0,200,150,0.25);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
}
.footer-brand { margin-bottom: 0.75rem; }
.footer-link { color: rgba(255,255,255,0.45); text-decoration: none; font-size: 0.88rem; display: block; padding: 0.2rem 0; transition: color 0.2s; }
.footer-link:hover { color: rgba(255,255,255,0.85); }
.ld-footer h6 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.35); margin-bottom: 0.75rem; font-weight: 700; }

/* ── Toast messages ──────────────────────────────────────────────────────── */
.toast-msg {
  position: fixed;
  bottom: 24px; right: 24px;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.toast-msg.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--green); color: #fff; }
.toast-error   { background: var(--red); color: #fff; }
.toast-info    { background: var(--navy); color: #fff; border: 1px solid rgba(255,255,255,0.15); }

/* ── Loaders ─────────────────────────────────────────────────────────────── */
.spinner-ld {
  width: 40px; height: 40px;
  border: 3px solid rgba(0,200,150,0.2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.9rem; padding: 2rem; }

/* ── UX polish: cursor + entrada suave (mata a sensação de "piscar") ───────── */
/* 1) Mãozinha em tudo que é clicável — cobre os <a> sem href (ex.: os submenus
   .tool-nav-item) e elementos controlados por JS (atributos data-, onclick, role). */
[role="button"], [onclick], .tool-nav-item, [data-tool], [data-action],
[data-tab], [data-target], .clickable, label[for], summary {
  cursor: pointer;
}
/* desabilitados continuam com cursor de bloqueio */
[aria-disabled="true"], .is-disabled, button:disabled, button[disabled] {
  cursor: not-allowed;
}

/* 2) Entrada suave do conteúdo criado por JS — reaproveita o keyframe fadeIn.
   Antes os cards/resultados apareciam "secos" (pop), o que somado à ação rápida
   dava a sensação de piscar. Agora cada bloco entra com fade + leve subida. */
.result-card, .gen-game-card, .freq-stat-card, .absence-ball,
.absence-detail-row, .score-wrap, .pair-detail-bar, .loading-block, .fx-in {
  animation: fadeIn 0.28s ease both;
}
/* stagger opcional: filhos de um container .fx-stagger entram em cascata leve */
.fx-stagger > *          { animation: fadeIn 0.3s ease both; }
.fx-stagger > *:nth-child(2) { animation-delay: .04s; }
.fx-stagger > *:nth-child(3) { animation-delay: .08s; }
.fx-stagger > *:nth-child(4) { animation-delay: .12s; }
.fx-stagger > *:nth-child(5) { animation-delay: .16s; }
.fx-stagger > *:nth-child(n+6) { animation-delay: .2s; }

/* 3) Feedback tátil de clique: o botão "afunda" de leve ao pressionar — dá
   resposta imediata mesmo quando a ação é instantânea. */
.btn-ld-primary:active, .btn-ld-gold:active, .btn-ld-soft:active,
.btn-ld-outline:active, .btn:active { transform: translateY(1px); }

/* 4) Acessibilidade: quem prefere menos movimento não vê as animações. */
@media (prefers-reduced-motion: reduce) {
  .result-card, .gen-game-card, .freq-stat-card, .absence-ball,
  .absence-detail-row, .score-wrap, .pair-detail-bar, .loading-block,
  .fx-in, .fx-stagger > * { animation: none; }
}

/* ── Bottom nav (mobile — páginas autenticadas) ───────────────────────────── */
.app-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.1);
  z-index: 1100;
  padding: 0;
}
.app-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.app-bottom-nav a i { font-size: 1.1rem; }
.app-bottom-nav a.active,
.app-bottom-nav a:hover { color: var(--green); }
.app-bottom-nav a.logout-btn { color: rgba(255,255,255,0.35); }
.app-bottom-nav a.logout-btn:hover { color: var(--red); }


/* ── Frequência ──────────────────────────────────────────────────────────── */
.freq-stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem .75rem; text-align: center;
}
.freq-stat-card.hot  { border-top: 3px solid var(--green); }
.freq-stat-card.cold { border-top: 3px solid #3B82F6; }
.freq-stat-icon { font-size: 1rem; color: var(--muted); margin-bottom: 6px; }
.freq-stat-card.hot  .freq-stat-icon { color: var(--green); }
.freq-stat-card.cold .freq-stat-icon { color: #3B82F6; }
.freq-stat-val   { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.freq-stat-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.freq-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.freq-section-title.hot  { color: var(--green-dark); }
.freq-section-title.cold { color: #1D4ED8; }

/* ── Frequência — quick filter pills ────────────────────────────────────── */
.freq-quick-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 4px 13px;
  transition: all 0.15s;
  white-space: nowrap;
}
.freq-quick-btn:hover {
  background: rgba(30,58,95,0.06);
  border-color: var(--navy-light, #3B6D9A);
  color: var(--navy);
}
.freq-quick-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30,58,95,0.2);
}

.freq-custom-input {
  width: 60px !important;
  border-radius: 20px !important;
  font-size: 0.73rem !important;
  font-weight: 600 !important;
  padding: 4px 8px !important;
  border-color: var(--border) !important;
  text-align: center;
  -moz-appearance: textfield;
}
.freq-custom-input::-webkit-outer-spin-button,
.freq-custom-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.freq-custom-input:focus { border-color: var(--navy) !important; box-shadow: 0 0 0 2px rgba(30,58,95,0.12) !important; }

.freq-rank-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.freq-rank-row:last-child { border-bottom: none; }
.freq-rank-pos   { font-size: 0.72rem; color: var(--muted); min-width: 16px; text-align: center; }
.freq-rank-bar   { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.freq-rank-fill  { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.freq-rank-fill.hot  { background: linear-gradient(90deg, #00C896, #00A878); }
.freq-rank-fill.cold { background: linear-gradient(90deg, #74B9FF, #3B82F6); }
.freq-rank-count { font-size: 0.72rem; font-weight: 700; color: var(--text); min-width: 32px; text-align: right; }

.freq-parity-bar { display: flex; height: 28px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.freq-parity-seg { display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; color: #fff; transition: width 0.5s ease; overflow: hidden; }
.freq-parity-seg.even { background: linear-gradient(90deg, #FF6B6B, #EF4444); }
.freq-parity-seg.odd  { background: linear-gradient(90deg, #60A5FA, #3B82F6); }
.freq-parity-kpi { flex: 1; text-align: center; padding: .6rem .5rem; border-radius: 8px; border: 1px solid var(--border); }
.freq-parity-kpi.even { background: rgba(239,68,68,.06);  border-color: rgba(239,68,68,.2); }
.freq-parity-kpi.odd  { background: rgba(59,130,246,.06); border-color: rgba(59,130,246,.2); }
.freq-parity-kpi-val  { font-size: 1.3rem; font-weight: 800; }
.freq-parity-kpi.even .freq-parity-kpi-val { color: #C0392B; }
.freq-parity-kpi.odd  .freq-parity-kpi-val { color: #1D4ED8; }
.freq-parity-kpi-label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ── Co-ocorrência de pares ──────────────────────────────────────────────── */
/* Bolas menores em todos os pontos da tela de pares */
#pairsGrid { max-width: 240px; gap: 6px; }
#pairsGrid .num-ball { font-size: 0.82rem; }
#pairsTopPro .num-ball,
#pairsBottomPro .num-ball { width: 26px; height: 26px; font-size: 0.7rem; }
.pair-balls .num-ball { width: 32px; height: 32px; font-size: 0.75rem; }
/* Painel "Parceiros do número X" dentro do card unificado */
#pairsDetail .num-ball { width: 28px; height: 28px; font-size: 0.72rem; }
#pairsDetail h5, #pairsDetail h6 { font-size: 1rem; }
/* Top parceiros em 3 colunas — altura compacta, alinhado ao grid 5×5 do seletor */
.pairs-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 10px;
  row-gap: 2px;
}
/* Duplas Campeãs / Raras em 2 colunas — reduz altura à metade */
.pairs-list-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 14px;
  row-gap: 2px;
}
.pairs-list-grid > div {
  border-bottom: 1px solid var(--border);
  padding-right: 4px;
}
.pair-row:hover { background: rgba(0,200,150,0.04); }
@media (max-width: 540px) {
  /* Em mobile estreito as duplas voltam para 1 coluna pra não apertar */
  .pairs-list-grid { grid-template-columns: 1fr; }
}
/* Card explorer unificado: separador visual entre seletor e detail em desktop */
.pairs-explorer { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.pairs-explorer-selector { display: flex; flex-direction: column; }
.pairs-explorer-detail { min-height: 200px; }
@media (min-width: 768px) {
  .pairs-explorer-detail {
    border-left: 1px solid var(--border);
    padding-left: 1.5rem !important;
  }
}
@media (max-width: 767px) {
  /* Em mobile o card vira vertical — separador horizontal sutil */
  .pairs-explorer-detail {
    border-top: 1px solid var(--border);
    padding-top: 1rem !important;
    margin-top: .25rem;
  }
}

.pair-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: box-shadow 0.18s;
}
.pair-card:hover { box-shadow: var(--shadow); }

.pair-rank {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--muted);
  min-width: 28px;
  text-align: center;
}
.pair-rank.gold   { color: #F5A623; }
.pair-rank.silver { color: #9FB3C8; }
.pair-rank.bronze { color: #C6855A; }

.pair-balls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pair-plus {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 700;
}

.pair-stat {
  margin-left: auto;
  text-align: right;
  line-height: 1.2;
}
.pair-pct {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--green);
}
.pair-cnt {
  font-size: 0.72rem;
  color: var(--muted);
  display: block;
}

/* grade de números para seleção (PRO) */
.pairs-num-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.pairs-num-btn {
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.pairs-num-btn:hover   { border-color: var(--green); color: var(--green); }
.pairs-num-btn.active  { background: var(--green); border-color: var(--green); color: #fff; }

/* painel de detalhe de parceiros */
.pair-detail-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.pair-detail-bar .bar-fill {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.pair-detail-bar .bar-fill span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.pair-detail-bar .bar-num  { font-weight: 700; font-size: 0.85rem; min-width: 28px; text-align: center; }
.pair-detail-bar .bar-pct  { font-size: 0.75rem; color: var(--muted); min-width: 40px; text-align: right; }

/* ── Gerador estratégico ─────────────────────────────────────────────────── */
.gen-game-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.18s;
}
.gen-game-card:hover { box-shadow: var(--shadow); }

.gen-game-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.75rem;
}
.gen-game-index {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gen-game-badge {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}

.gen-game-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.85rem;
}

.gen-game-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--muted);
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.gen-game-meta span strong { color: var(--text); }

.gen-game-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* estratégia label chips */
.strategy-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.strategy-hot       { background: rgba(255,71,87,0.12);  color: var(--red); }
.strategy-due       { background: rgba(245,166,35,0.15); color: var(--gold); }
.strategy-balanced  { background: rgba(0,200,150,0.12);  color: var(--green-dark); }
.strategy-contrarian{ background: rgba(30,58,95,0.12);   color: var(--navy-light); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .app-sidebar { display: none; }
  .app-layout { flex-direction: column; }
  .app-main { width: 100%; padding-bottom: 68px; }
  .hero-grid-wrap { display: none; }
  .app-bottom-nav { display: flex; }
}
@media (max-width: 576px) {
  .hero-stats { gap: 1rem; }
  .hero-stat .num { font-size: 1.2rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
}

/* ── Tabs mobile (substituem a sidebar em <992px) ─────────────────────────── */
.app-tabs-mobile-wrap {
  display: none;
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
  width: 100%;
  min-width: 0;     /* impede flexbox de estourar o container */
  max-width: 100vw;
}
/* Fade lateral à direita indicando que há mais conteúdo para scrollar */
.app-tabs-mobile-wrap::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(to left, #fff, transparent);
  opacity: 1;
  transition: opacity .2s;
}
.app-tabs-mobile-wrap.is-end::after { opacity: 0; }

.app-tabs-mobile {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;       /* Firefox */
  white-space: nowrap;
  padding: 0 4px;
  width: 100%;
  min-width: 0;
}
.app-tabs-mobile::-webkit-scrollbar { display: none; }  /* WebKit */
.app-tabs-mobile .tab-mobile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 3px;
  padding: 9px 10px 7px;
  min-width: 56px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
  cursor: pointer;
}
.app-tabs-mobile .tab-mobile i { font-size: 1.05rem; }
.app-tabs-mobile .tab-mobile:hover { color: var(--green-dark, #00875A); }
.app-tabs-mobile .tab-mobile.active {
  color: var(--green-dark, #00875A);
  border-bottom-color: var(--green, #00C896);
}
.app-tabs-mobile .pro-lock { font-size: .55rem; color: var(--gold); }
@media (max-width: 991px) {
  .app-tabs-mobile-wrap { display: block; }
}
/* Phones pequenos: esconde texto, só ícones (cabe os 9 tabs sem scroll) */
@media (max-width: 420px) {
  .app-tabs-mobile .tab-mobile {
    min-width: 0;
    flex: 1 1 0;
    padding: 9px 4px 7px;
  }
  .app-tabs-mobile .tab-mobile span { display: none; }
  .app-tabs-mobile .tab-mobile i { font-size: 1.1rem; }
  .app-tabs-mobile-wrap::after { display: none; }  /* sem scroll, sem fade */
}

/* ── Mobile fine-tuning (Fase 1: polimento sem PWA) ───────────────────────── */
@media (max-width: 768px) {
  /* Cards lado-a-lado em Pares empilham com gap visível, sem max-width grudado */
  #pairsGrid,
  #pairsDetail { max-width: 100%; }
  /* Top/Bottom pares: tabelas internas ganham fonte um pouco menor */
  #pairsTopPro, #pairsBottomPro { font-size: .82rem; }
  /* Topbar das ferramentas: título e meta empilham */
  .app-topbar { flex-wrap: wrap; gap: .25rem .75rem; }
  /* Cards "stat" da Frequência/Ausência ficam mais finos */
  .freq-stat-card { padding: .65rem .35rem; }
  .freq-stat-val  { font-size: 1.15rem; }
  /* Hero da LP — título mais compacto em tablet */
  .hero-title { font-size: 2.2rem; line-height: 1.1; }
}

@media (max-width: 540px) {
  /* ─── Stat cards (Frequência/Ausência): empilhar bola + valor ─── */
  #freqStatHot, #freqStatCold,
  #absStatMost, #absStatAlert, #absStatFresh {
    flex-direction: column !important;
    gap: 4px !important;
    min-height: 56px;
  }
  #freqStatHot > div[style*="font-size"],
  #freqStatCold > div[style*="font-size"] {
    font-size: .9rem !important;
    line-height: 1.1;
  }
  .freq-stat-card { padding: .6rem .25rem !important; }
  .freq-stat-icon { font-size: .85rem; margin-bottom: 3px; }
  .freq-stat-label { font-size: .62rem; }

  /* ─── Gerador: cards empilham verticalmente em mobile ─── */
  .gen-game-card > .d-flex:first-child {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: .65rem !important;
  }
  /* Score + rating ficam em linha horizontal compacta */
  .gen-game-card > .d-flex:first-child > div:nth-child(1) {
    display: flex !important;
    align-items: baseline;
    justify-content: center;
    gap: .5rem;
    min-width: 0 !important;
    text-align: center !important;
  }
  /* Linha das 15 bolas — full width, fonte menor */
  .gen-game-card .balls-row {
    justify-content: center;
    gap: 4px !important;
  }
  .gen-game-card .balls-row .num-ball {
    width: 28px; height: 28px; font-size: .7rem;
  }
  /* Botões: viram linha horizontal de largura igual */
  .gen-game-card > .d-flex:first-child > div:last-child {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: stretch;
    gap: .3rem !important;
    text-align: center !important;
    width: 100%;
  }
  .gen-game-card .btn-ld-soft {
    flex: 1 1 0;
    min-width: 0;
    font-size: .68rem;
    padding: .35rem .2rem;
    gap: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    justify-content: center;
  }
  .gen-game-card .btn-ld-soft i { font-size: .68rem; }
  /* Breakdown de score: barra mais fina, espaço otimizado */
  .gen-game-card .score-bar { height: 5px; }

  /* Pills de janela mais compactas — cabem mais por linha */
  .freq-quick-btn {
    padding: .25rem .55rem;
    font-size: .72rem;
  }
  #freqQuickBtns,
  #trendQuickBtns,
  #pairsQuickBtns,
  #sugQuickBtns,
  #backtestQuickBtns,
  #genQuickBtns {
    gap: 4px !important;
    row-gap: 6px !important;
  }
  /* Input custom mais estreito */
  .freq-custom-input { width: 56px !important; font-size: .72rem; }
  /* Bolas globalmente menores */
  .num-ball { width: 32px; height: 32px; font-size: .75rem; }
  .suggest-grid .num-ball { width: 30px; height: 30px; }
  .suggest-grid-lg .num-ball { width: 38px; height: 38px; font-size: .82rem; }
  #pairsGrid .num-ball { font-size: .78rem; }
  #pairsTopPro .num-ball,
  #pairsBottomPro .num-ball { width: 22px; height: 22px; font-size: .62rem; }
  .pair-balls .num-ball { width: 28px; height: 28px; font-size: .7rem; }
  /* Cards de score do Gerador respiram menos */
  .gen-game-card { padding: .75rem !important; }
  /* Tool header: título menor */
  .tool-header h2 { font-size: 1.2rem; }
  /* Hero da LP em phone pequeno */
  .hero-title { font-size: 1.8rem; }
  .hero-lead  { font-size: .95rem; }
  .section-title { font-size: 1.5rem; }
  .section-sub   { font-size: .92rem; }
  /* Onboarding card menos invasivo */
  #toolsOnboarding h5 { font-size: 1rem; }
  /* Tabelas — fonte enxuta para caber mais coluna */
  .table-sm { font-size: .78rem; }
  /* Painel admin: cards de métrica mais compactos */
  .metric-card { padding: .85rem !important; }
  .metric-card .value { font-size: 1.6rem; }
  /* Sugestão IA — botões empilham 2x2 (cada botão fica com largura mínima) */
  #suggestResult .btn-ld-soft,
  #suggestResult .btn-ld-primary.btn-soft-size {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }
  /* Garantir bottom nav não cobre conteúdo final */
  .app-main { padding-bottom: 76px !important; }
}

@media (max-width: 400px) {
  /* Última camada — phones bem pequenos (iPhone SE / Galaxy Mini) */
  .num-ball { width: 30px; height: 30px; font-size: .7rem; }
  .suggest-grid { gap: 6px; }
  .suggest-grid .num-ball { width: 28px; height: 28px; font-size: .68rem; }
  .suggest-grid-lg .num-ball { width: 34px; height: 34px; font-size: .76rem; }
  #pairsGrid { max-width: 220px; }
  /* Botões em 1 linha cheia (4 botões = 1 por linha não vale) → 2x2 já cuida */
  /* Hero title cabe sem quebrar */
  .hero-title { font-size: 1.55rem; }
  /* Pills de janela: símbolo "?" do input fica menor */
  .freq-custom-input { width: 48px !important; }
  /* Reduz padding lateral global de containers */
  .container { padding-left: 12px; padding-right: 12px; }
  /* Pricing cards: títulos e features menores */
  .price-amount { font-size: 2.4rem; }
  .price-features li { font-size: .85rem; }
}

/* ── Touch targets — mínimo 40px de altura útil para tap em mobile ──────── */
@media (hover: none) and (pointer: coarse) {
  .freq-quick-btn,
  .btn-ld-soft,
  .btn-ld-primary.btn-soft-size {
    min-height: 36px;
  }
  .num-ball.clickable { min-width: 30px; min-height: 30px; }
  /* iOS notch (safe area) no bottom nav */
  .app-bottom-nav { padding-bottom: env(safe-area-inset-bottom, 0); }
}
