@import url('https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700&family=Baloo+2:wght@600;700;800&display=swap');

:root {
  /* Base — near-black com fundo quente (couro/ficha de aposta), não o azul-frio genérico de fintech */
  --bg: #0D0B08;
  --surface: #17130D;
  --surface-2: #201A11;
  --border: #33291A;
  --border-soft: #241D12;

  /* Texto — branco quente, como papel de ticket envelhecido */
  --text: #F6EFE0;
  --text-dim: #A69B84;
  --text-faint: #91866F;

  /* Dourado — a cor de assinatura do app, mais rica que um âmbar comum */
  --gold: #E3B54A;
  --gold-strong: #F5CB63;
  --gold-dim: #3D2F10;

  /* Resultados — calibrados, nunca neon */
  --green: #3CC17A;
  --green-dim: #12301F;
  --red: #F5525A;
  --red-dim: #3A1517;
  --amber: #F0AE45;
  --amber-dim: #3A2A10;
  --accent: #5B9CFF;
  --accent-dim: #17233D;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  /* Sombras — profundidade consistente pra cards que hoje são "chapados" */
  --shadow-sm: inset 0 1px 0 rgba(255,236,190,0.05), 0 2px 8px rgba(0,0,0,0.26);
  --shadow: 0 8px 22px rgba(0,0,0,0.32);
  --shadow-gold: 0 6px 18px rgba(227,181,74,0.16);
  /* Cartão "iluminado por cima": o topo é um tom mais claro que a base, como papel grosso sob uma luz */
  --card-bg: linear-gradient(180deg, #1D170E 0%, #15100A 100%);

  /* Títulos e nomes de jogo no estilo placar de transmissão (condensada); números continuam em mono */
  --font-display: 'Barlow Semi Condensed', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-num: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  height: 100%;
  /* Sem o "elástico" do celular ao chegar no topo, no fim ou nas laterais */
  overscroll-behavior: none;
}
/* A página nunca rola pros lados (quem precisa rolar de lado, como as abas
   de período, tem a própria rolagem). E o iPhone não aumenta o texto sozinho
   ao girar a tela. */
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* No celular, campo com letra menor que 16px faz o iPhone dar zoom ao tocar,
   e a tela fica "solta" pros lados depois. No computador nada muda. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
}

body {
  padding-bottom: env(safe-area-inset-bottom);
  background-image:
    radial-gradient(ellipse 900px 480px at 50% -8%, rgba(227,161,74,0.11), transparent 62%),
    radial-gradient(ellipse 620px 520px at 105% 108%, rgba(227,181,74,0.05), transparent 70%);
  background-attachment: fixed;
}
/* Grão fino no fundo (couro/feltro): fica atrás dos cartões, só aparece nos espaços entre eles */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .7 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

button, input, select { font-family: inherit; color: inherit; }
button { -webkit-appearance: none; appearance: none; }

button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
/* Campos de texto: borda dourada no foco em vez do contorno */
.search-input:focus, .account-value-input:focus, .sheet-body input:focus, .sheet-body select:focus, .onboarding-input:focus {
  outline: none;
  border-color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.positive { color: var(--green); }
.negative { color: var(--red); }

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 20px 8px;
  position: sticky;
  top: 0;
  /* Opaco (o que rola passa por baixo sem aparecer atrás do título), mas pintado com a mesma luz dourada do fundo,
     presa à tela (fixed): no topo da página o cabeçalho e o fundo são a mesma coisa, sem a faixa chapada de antes */
  background:
    radial-gradient(ellipse 900px 480px at 50% -8%, rgba(227,161,74,0.11), transparent 62%) fixed,
    var(--bg);
  z-index: 5;
}
.topbar-title {
  position: relative;
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.005em;
  padding-bottom: 9px;
}
/* Tracinho dourado — pequena assinatura visual da marca, sem gritar */
.topbar-title::after {
  content: "";
  position: absolute;
  left: 1px;
  bottom: 0;
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.icon-btn:active { border-color: var(--gold); color: var(--gold); }

/* A tela nunca rola nem "balança" pros lados. O que for mais largo que a tela é contido onde está
   (rolagem lateral de propósito, como nas abas de período, tem rolagem própria). No iPhone, campo de
   data/hora e texto sem espaço eram os suspeitos de alargar a página. */
main, .sheet, .flyer-overlay, .onboarding { overflow-x: hidden; }
#app { overflow-x: clip; }
input, select, textarea { max-width: 100%; min-width: 0; }
input[type="date"], input[type="time"] { width: 100%; -webkit-min-logical-width: 0; }

/* MAIN */
main {
  flex: 1;
  padding: 4px 20px 120px;
  overflow-y: auto;
}
/* Transição de view — some o corte seco ao trocar de aba */
.view {
  animation: viewIn 0.26s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* BILHETE DO SALDO — o topo do Início.
   São dois blocos com um espacinho entre eles: o saldo e os quatro números da banca. */
.slip {
  margin: 4px 0 24px;
  animation: slipPrint 0.55s cubic-bezier(.25,.8,.25,1) backwards;
}
/* O bilhete "sai da impressora": revela de cima para baixo (a margem negativa mantém a sombra visível) */
@keyframes slipPrint {
  from { clip-path: inset(-30px -30px 100% -30px); }
  to { clip-path: inset(-30px -30px -60px -30px); }
}
/* Os dois blocos são bilhetes como os das apostas: lateral dourada, dois recortes no alto e a tira pontilhada embaixo */
.slip-top, .slip-bottom {
  --perfuracao: repeating-linear-gradient(90deg, rgba(227,181,74,0.5) 0 2px, transparent 2px 5px, rgba(227,181,74,0.26) 5px 6px, transparent 6px 9px) bottom center / calc(100% - 32px) 3px no-repeat;
  position: relative;
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,236,190,0.05), 0 8px 18px rgba(0,0,0,0.3);
}
.slip-top::before, .slip-top::after, .slip-bottom::before, .slip-bottom::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
}
.slip-top::before, .slip-bottom::before { left: 10px; }
.slip-top::after, .slip-bottom::after { right: 10px; }
.hero-balance.slip-top {
  margin: 0;
  padding: 16px 18px 26px 17px; /* o saldo fica um pouco mais alto dentro do bloco */
  background:
    var(--perfuracao),
    radial-gradient(ellipse 320px 150px at 18% -10%, rgba(227,181,74,0.11), transparent 70%),
    var(--card-bg);
}
.slip-bottom {
  background: var(--perfuracao), var(--card-bg);
}
/* Saldo solto (Cassino e Cash): o mesmo número grande, sem o bilhete em volta */
.hero-balance { position: relative; padding: 22px 2px 18px; margin: 2px 0 20px; }
.hero-label {
  position: relative;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
}
.slip-top .hero-label { padding-right: 108px; } /* o seletor de período fica no canto, ao lado do rótulo */
.hero-value {
  position: relative;
  font-family: var(--font-num);
  font-size: clamp(40px, 12.4vw, 58px);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-top: 10px;
  line-height: 1;
}
/* O número brilha na cor do resultado, como um placar aceso */
.hero-value.positive { text-shadow: 0 0 26px rgba(60,193,122,0.38); }
.hero-value.negative { text-shadow: 0 0 26px rgba(245,82,90,0.34); }
.hero-sub {
  position: relative;
  color: var(--text-dim);
  font-size: 13.5px;
  margin-top: 14px;
  font-family: var(--font-num);
}
/* O seletor de período vive dentro do bilhete, no canto de cima */
.slip-top .period-btn {
  position: absolute;
  z-index: 2; /* acima do rótulo e do número (também posicionados): sem isso, parte do botão não recebia o toque */
  top: 10px;
  right: 16px;
  margin: 0;
  padding: 7px 12px;
  gap: 7px;
  font-size: 13px;
  background: rgba(13,11,8,0.5);
  border-color: rgba(227,181,74,0.28);
}

/* Período do Início: um botão que abre os atalhos e o calendário */
.period-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  padding: 10px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.period-btn svg:first-child { color: var(--gold); }
.period-btn svg:last-child { color: var(--text-dim); }
.period-btn:active { transform: scale(0.97); }
.period-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.preset {
  padding: 11px 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.preset.ativo { background: var(--gold); border-color: var(--gold); color: #1D1608; }
.cal { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.cal-nav { width: 38px; height: 38px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 50%; color: var(--text-dim); font-size: 20px; line-height: 1; cursor: pointer; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-week span { padding: 4px 0 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-faint); }
.cal-dia, .cal-vazio { height: 40px; }
.cal-dia { background: none; border: none; border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.cal-dia.hoje { color: var(--gold-strong); box-shadow: inset 0 0 0 1px var(--gold-dim); }
.cal-dia.no { background: var(--gold-dim); border-radius: 0; color: var(--gold-strong); }
.cal-dia.ponta { background: var(--gold); color: #1D1608; box-shadow: none; }
.cal-dia.ini { border-radius: 10px 0 0 10px; }
.cal-dia.fim { border-radius: 0 10px 10px 0; }
.cal-dia.ini.fim { border-radius: 10px; }
.cal-resumo { margin: 12px 2px 0; min-height: 2.6em; font-size: 13px; line-height: 1.4; color: var(--text-dim); }
.cal .btn-primary { margin-top: 12px; width: 100%; }
.cal .btn-primary:disabled { opacity: 0.45; cursor: default; }

/* PERIOD TABS */
.period-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
}
.period-tabs::-webkit-scrollbar { display: none; }
.period-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 9px 17px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.period-tab:active { transform: scale(0.96); }
.period-tab.active, .chart-range-tab.active {
  background: var(--gold);
  color: #1D1608;
  border-color: var(--gold);
}
.period-tab.active { box-shadow: var(--shadow-gold); }

/* STAT GRID — quieto de propósito: todo o "grito" visual já foi gasto no hero */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
/* Dentro do bilhete, os quatro números são células de uma mesma tabela, separadas por linhas finas */
.slip .stat-grid { gap: 0; margin: 13px 0 0; } /* o espacinho entre o saldo e os quatro números */
.slip .stat-card {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 12px 16px 13px; /* mais baixo que os 78px da v84 (ali: 15px 16px) */
}
.slip .stat-card:nth-child(odd) { border-right: 1px solid rgba(227,181,74,0.14); }
.slip .stat-card:nth-child(n+3) { border-top: 1px solid rgba(227,181,74,0.14); }
.slip .stat-card:hover { transform: none; box-shadow: none; border-color: rgba(227,181,74,0.14); }
/* O número encolhe junto com a tela em vez de quebrar em duas linhas ("R$" de um lado, o valor do outro) */
.slip .stat-value { font-size: clamp(15px, 4.9vw, 19.5px); white-space: nowrap; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
/* Só em telas com hover real (mouse) — no touch isso vira ruído */
@media (hover: hover) {
  .stat-card:hover, .group-card:hover, .account-row:hover, .monthly-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border);
  }
}
.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-num);
  font-size: 19px;
  font-weight: 700;
}

/* SECTION ROW */
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 12px;
}
.count-pill { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--amber-dim); color: var(--amber); font-family: var(--font-num); font-size: 12px; font-weight: 700; vertical-align: 1px; }
.section-row h3 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.005em;
  margin: 0;
}
.link-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

/* BET LIST — ticket de aposta: identidade do app, refinada */
.bet-list { display: flex; flex-direction: column; gap: 14px; }
.bet-card {
  --wash: transparent; /* "banho" de cor do resultado, saindo da lateral: dá pra ler verde/red/pendente de relance */
  background:
    repeating-linear-gradient(90deg, rgba(227,181,74,0.5) 0 2px, transparent 2px 5px, rgba(227,181,74,0.26) 5px 6px, transparent 6px 9px) bottom center / calc(100% - 32px) 3px no-repeat,
    linear-gradient(100deg, var(--wash) 0%, transparent 62%),
    var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-faint);
  border-radius: 18px;
  padding: 17px 18px 18px;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,236,190,0.05), 0 8px 18px rgba(0,0,0,0.3);
  transition: transform .1s ease;
}
.bet-card:active { transform: scale(0.99); }
.bet-card::before, .bet-card::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
}
.bet-card::before { left: 10px; }
.bet-card::after { right: 10px; }
.bet-card.result-green { border-left-color: var(--green); --wash: rgba(60,193,122,0.09); }
.bet-card.result-red { border-left-color: var(--red); --wash: rgba(245,82,90,0.09); }
.bet-card.result-pending { border-left-color: var(--amber); --wash: rgba(240,174,69,0.065); }
.bet-card.result-push { border-left-color: var(--text-faint); }
.bet-card.result-cashout { border-left-color: var(--accent); --wash: rgba(91,156,255,0.075); }

.bet-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.bet-card-top > :first-child { min-width: 0; overflow-wrap: anywhere; } /* palavra enorme sem espaço não alarga o cartão */
.bet-card-game {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19.5px;
  line-height: 1.15;
  letter-spacing: 0.004em;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* texto comprido não estica o cartão: o completo está na tela de edição */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mais-pill { display: inline-block; font-family: var(--font-ui); margin-left: 2px; padding: 1px 8px; border-radius: 999px; background: var(--gold-dim); color: var(--gold-strong); font-size: 11px; font-weight: 700; letter-spacing: 0; vertical-align: 1px; white-space: nowrap; }
/* Múltipla com "+N jogos": o nome usa até 2 linhas e o selo fica no alto, ao lado dele (nunca embaixo) */
.bet-card-game.com-mais { display: flex; align-items: flex-start; gap: 8px; overflow: visible; -webkit-line-clamp: unset; }
.bet-card-game.com-mais .jogo-titulo { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bet-card-game.com-mais .mais-pill { flex: none; margin-left: 0; margin-top: 1px; vertical-align: baseline; }
.ticket-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; margin-top: 6px; }
.ticket-market {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ticket-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.ticket-toggle .seta { font-size: 12px; line-height: 1; color: #FFD84A; text-shadow: 0 0 6px rgba(255, 216, 74, .55); transition: transform .15s ease; } /* amarelo vivo: mostra que o cartão desce */
.bet-card.expandida .ticket-toggle { color: var(--gold-strong); border-color: var(--gold-dim); }
.bet-card.expandida .ticket-toggle .seta { transform: rotate(180deg); }
.bet-card.expandida .ticket-market { display: none; } /* as seleções abertas já trazem o texto inteiro */
.ticket-selecoes { display: none; list-style: none; margin: 8px 0 0; padding: 0; }
.bet-card.expandida .ticket-selecoes { display: block; }
.ticket-selecoes li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-soft); }
.selecao-texto { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
/* Certinho para marcar jogo por jogo da múltipla: bolinha miúda à direita, vazia até bater e verde depois */
.selecao-ok {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1.5px solid var(--text-faint);
  border-radius: 50%;
  color: transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.selecao-ok::after { content: ""; position: absolute; inset: -10px; } /* área de toque maior que a bolinha */
.selecao-ok svg { width: 10px; height: 10px; }
.selecao-ok[aria-pressed="true"] { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.sel-batidas { color: var(--green); font-weight: 700; }
.ticket-selecoes li:first-child { border-top: none; }
.ticket-selecoes b { font-size: 13px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.ticket-selecoes span { font-size: 12.5px; line-height: 1.35; color: var(--text-dim); overflow-wrap: anywhere; }
.ticket-slip { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 8px; margin: 12px 0 0; padding-top: 11px; border-top: 1px dashed var(--border); }
.ticket-slip.dois { grid-template-columns: repeat(2, auto); justify-content: start; gap: 8px 34px; } /* red: sem a coluna de retorno */
.ticket-slip div { min-width: 0; }
.ticket-slip dt { font-size: 11.5px; font-weight: 600; color: var(--text-faint); }
.ticket-slip dd { margin: 3px 0 0; font-family: var(--font-num); font-size: 14px; font-weight: 700; white-space: nowrap; }
.bet-card-profit {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.bet-card-profit.positive { text-shadow: 0 0 16px rgba(60,193,122,0.28); }
.bet-card-profit.negative { text-shadow: 0 0 16px rgba(245,82,90,0.26); }
.bet-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  gap: 10px;
}
.ticket-ctx { min-width: 0; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; } /* casa · grupo · data, numa linha só */
.ticket-badges { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ticket-badges .badge.bonus-tag { margin-left: 0; }
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-dim); color: var(--green); }
.badge.red { background: var(--red-dim); color: var(--red); }
.badge.pending { background: var(--amber-dim); color: var(--amber); }
.badge.push { background: var(--surface-2); color: var(--text-dim); }
.badge.cashout { background: var(--accent-dim); color: var(--accent); }
.badge.bonus-tag { background: var(--gold-dim); color: var(--gold); margin-left: 6px; }

/* QUICK ACTIONS */
.quick-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.quick-btn {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 0;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-dim);
  transition: all .12s ease;
}
.quick-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.quick-btn.green { color: var(--green); border-color: rgba(60,193,122,0.34); background: linear-gradient(180deg, rgba(60,193,122,0.12), rgba(60,193,122,0.05)); }
.quick-btn.red { color: var(--red); border-color: rgba(245,82,90,0.34); background: linear-gradient(180deg, rgba(245,82,90,0.12), rgba(245,82,90,0.05)); }
.quick-btn.cashout { color: var(--accent); border-color: rgba(91,156,255,0.34); background: linear-gradient(180deg, rgba(91,156,255,0.12), rgba(91,156,255,0.05)); }
.quick-btn:active { transform: scale(0.96); }
.quick-btn.green:active, .quick-btn.green:hover { border-color: var(--green); background: var(--green-dim); }
.quick-btn.red:active, .quick-btn.red:hover { border-color: var(--red); background: var(--red-dim); }
.quick-btn.cashout:active, .quick-btn.cashout:hover { border-color: var(--accent); background: var(--accent-dim); }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-dim); }
.empty-state p { margin: 4px 0; }
.empty-sub { font-size: 13px; color: var(--text-dim); }

/* BUSCA */
.search-input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  font-size: 14.5px;
}
.search-input::placeholder { color: var(--text-faint); }

/* APOSTAS: busca + filtros recolhidos */
.history-toolbar { display: flex; gap: 10px; margin-top: 4px; }
.filters-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.filters-toggle.ativo { border-color: var(--gold); color: var(--gold-strong); }
.filters-count { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--gold); color: #1D1608; font-family: var(--font-num); font-size: 11.5px; font-weight: 700; text-align: center; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 12px;
  background: var(--gold-dim);
  border: none;
  border-radius: 999px;
  color: var(--gold-strong);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.filter-chip span { font-size: 10px; opacity: 0.8; }
.filters-panel { margin-top: 12px; padding: 4px 14px 12px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; }
.filter-row + .filter-row { border-top: 1px solid var(--border-soft); }
.filter-row label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.filters-panel .select-chip { flex: 0 0 58%; min-width: 0; border-radius: var(--radius-sm); padding: 10px 32px 10px 12px; font-size: 14px; }
.filter-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.filter-dates .date-filter-field { min-width: 0; }
.filters-clear { display: block; margin: 10px 0 0 auto; padding: 4px 0; font-size: 13px; }
.history-count { margin: 14px 2px 12px; font-size: 12.5px; color: var(--text-dim); }

/* FILTROS */
.select-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 30px 9px 13px;
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23A69B84' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.date-filter-field { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.date-filter-field label { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.date-filter-field input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 13px;
}

/* Abas pequenas (resumo por mês/ano) */
.chart-range-tabs { display: flex; gap: 6px; scroll-snap-type: x proximity; }
.chart-range-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  scroll-snap-align: start;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
/* Três números lado a lado (resumo dos Relatórios) */
.curva-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}
.curva-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.curva-stat-rotulo { font-size: 11.5px; font-weight: 600; color: var(--text-faint); }
.curva-stat-valor { font-family: var(--font-num); font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.curva-stat-sub { font-size: 11px; color: var(--text-dim); }

/* CONTAS (planilha de saldo por casa) */
.account-list { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.account-row, .monthly-row {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.account-name {
  flex: 1;
  font-weight: 600;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* CASH: uma conta por cartão, com a barra de quanto ela pesa no total */
.cash-row {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 13px 15px 12px;
  box-shadow: var(--shadow-sm);
}
.cash-row-top { display: flex; align-items: center; gap: 10px; }
.cash-value { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-num); font-size: 13px; font-weight: 700; color: var(--text-dim); }
/* O saldo é um número com sublinhado tracejado: toque e ele vira campo */
.account-value-input {
  width: 118px;
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--border);
  border-radius: 0;
  padding: 4px 0;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 17px;
  text-align: right;
  color: var(--text);
}
.account-value-input:focus { background: var(--surface-2); border-bottom: 1px solid var(--gold); outline: none; }
.share-bar { height: 4px; margin-top: 11px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.share-bar span { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.cash-row-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; font-size: 12px; color: var(--text-faint); }
.cash-age.velho { color: var(--amber); }
.edit-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  cursor: pointer;
}
.group-card .edit-btn { width: 36px; height: 36px; }
.monthly-row { flex-direction: column; align-items: stretch; gap: 0; }
.monthly-row-head { display: flex; justify-content: space-between; align-items: center; }
.monthly-row-name { font-weight: 600; font-size: 14.5px; text-transform: capitalize; }
.monthly-row-value { font-family: var(--font-num); font-weight: 700; font-size: 15.5px; white-space: nowrap; }
.monthly-breakdown {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.monthly-breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--font-num);
}
.monthly-breakdown-item span:first-child { font-family: inherit; text-transform: none; }
.monthly-breakdown-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  margin-top: 4px;
}

/* GRUPOS */
.group-list { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 17px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.group-card:active { border-top-color: var(--gold); }
.group-card-top { display: flex; justify-content: space-between; align-items: center; }
.group-name { font-weight: 700; font-size: 16.5px; }
.group-profit { font-family: var(--font-num); font-weight: 700; font-size: 16.5px; }
.group-card-top-right { display: flex; align-items: center; gap: 10px; }
.split-bar { display: flex; height: 5px; margin-top: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.split-bar .g { background: var(--green); }
.split-bar .r { flex: 1; background: var(--red); }
.group-card .stats4 { margin-top: 12px; }

/* MENU DE ESCOPO DO INÍCIO (Visão geral / Apostas / Cassino / grupos) */
.switcher-menu {
  position: absolute;
  top: 60px;
  right: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  z-index: 40;
  min-width: 160px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.switcher-option, .switcher-link {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}
.switcher-option { color: var(--text); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.switcher-link { color: var(--text-faint); padding: 8px 12px; font-size: 12px; font-weight: 600; }
.switcher-back { color: var(--text-dim); font-size: 12.5px; }
.switcher-empty { padding: 8px 12px; font-size: 12.5px; color: var(--text-faint); }
.switcher-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* FAB */
.fab-wrap {
  position: fixed;
  right: 20px;
  bottom: 96px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  width: 58px;
  height: 58px;
  z-index: 20;
}
@media (min-width: 560px) {
  .fab-wrap { right: calc(50% - 280px + 20px); }
}
/* Glow pulsante sutil atrás do FAB — chama atenção sem gritar */
.fab-wrap::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(227,181,74,0.3) 0%, transparent 70%);
  animation: fabPulse 2.6s ease-in-out infinite;
  pointer-events: none;
}
/* Um aro que se abre e some, como um sonar, chamando o olhar para o botão de nova aposta */
.fab-wrap::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid var(--gold);
  border-radius: 26px;
  opacity: 0;
  pointer-events: none;
  animation: fabPing 2.6s ease-out infinite;
}
@keyframes fabPing {
  0% { transform: scale(0.96); opacity: 0.7; }
  70%, 100% { transform: scale(1.55); opacity: 0; }
}
@keyframes fabPulse {
  0%, 100% { transform: scale(0.88); opacity: 0.55; }
  50% { transform: scale(1.12); opacity: 1; }
}
.fab {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 20px; /* quadrado arredondado: foge do botão redondo padrão e conversa com os cantos dos bilhetes */
  background: linear-gradient(160deg, var(--gold-strong), var(--gold) 55%, #C99A32);
  color: #1D1608;
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  padding: 0 0 3px;
  /* Aro claro + um anel escuro + um anel dourado por fora: o botão se destaca de qualquer cartão que passe por baixo
     e parece o "botão" da tela, em vez de mais um enfeite dourado */
  border: 2px solid rgba(255,240,200,0.92);
  box-shadow: inset 0 1px 0 rgba(255,246,214,0.55), inset 0 -3px 0 rgba(120,80,0,0.22),
    0 0 0 4px var(--bg), 0 0 0 6px rgba(227,181,74,0.6),
    0 14px 30px rgba(227,181,74,0.36), 0 4px 12px rgba(0,0,0,0.45);
  cursor: pointer;
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s ease;
}
.fab:active { transform: scale(0.94); }
@media (hover: hover) {
  .fab:hover { transform: scale(1.05); }
}

/* BOTTOM NAV */
/* Dock flutuante: solta da borda, com vidro fosco e um filete dourado; o item ativo ganha uma pastilha */
.bottom-nav {
  position: sticky;
  bottom: 10px;
  display: flex;
  margin: 0 14px 10px;
  background: rgba(26,21,13,0.82);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(227,181,74,0.18);
  border-radius: 26px;
  box-shadow: inset 0 1px 0 rgba(255,236,190,0.07), 0 16px 36px rgba(0,0,0,0.6);
  padding: 6px;
  z-index: 15;
}
.nav-btn {
  position: relative;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  padding: 8px 0 7px;
  border-radius: 20px;
  cursor: pointer;
  transition: color .15s ease, background .2s ease, box-shadow .2s ease;
}
.nav-btn svg { width: 22px; height: 22px; transition: transform .15s cubic-bezier(.2,.8,.3,1); }
.nav-btn.active {
  color: var(--gold-strong);
  background: linear-gradient(180deg, rgba(227,181,74,0.2), rgba(227,181,74,0.08));
  box-shadow: inset 0 0 0 1px rgba(227,181,74,0.26);
}
.nav-btn.active svg { transform: translateY(-1px); }

/* SHEET / MODAL */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 30;
  animation: fadeIn 0.18s ease;
  backdrop-filter: blur(2px);
}
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #211A0F 0%, #16110A 140px);
  border-radius: 30px 30px 0 0;
  border-top: 1px solid rgba(227,181,74,0.24);
  box-shadow: 0 -24px 60px rgba(0,0,0,0.6);
  z-index: 31;
  max-height: 88vh;
  overflow-y: auto;
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  animation: slideUp 0.24s cubic-bezier(.2,.8,.3,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet-handle {
  width: 44px;
  height: 5px;
  background: rgba(246,239,224,0.18);
  border-radius: 999px;
  margin: 10px auto 0;
}
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px 10px;
}
.sheet-header h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: 0.005em; margin: 0; }
.sheet-body { padding: 6px 20px 20px; display: flex; flex-direction: column; }

.sheet-body label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 16px 0 7px;
}
.sheet-body label .label-note {
  font-weight: 400;
  color: var(--text-faint);
}
.sheet-body input, .sheet-body select {
  background: #110D07; /* campo "afundado": mais escuro que a gaveta, com sombra interna */
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 15px;
  width: 100%;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.35);
  transition: box-shadow .15s ease;
}
.sheet-body input:focus, .sheet-body select:focus { box-shadow: inset 0 2px 5px rgba(0,0,0,0.35), 0 0 0 3px rgba(227,181,74,0.18); }
.row-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.row-2 > * { min-width: 0; }
/* Data e horário: o campo nativo (principalmente no iPhone) ignora a largura e a altura dos outros
   campos e cola um no outro. Tira a aparência nativa e dá o mesmo tamanho dos campos de texto. */
.sheet-body input[type="date"], .sheet-body input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  text-align: left;
  line-height: 20px;
  color-scheme: dark;
  overflow: hidden;
}
.sheet-body input[type="date"]::-webkit-date-and-time-value,
.sheet-body input[type="time"]::-webkit-date-and-time-value { text-align: left; min-width: 0; min-height: 20px; line-height: 20px; margin: 0; }
.sheet-body input[type="date"]::-webkit-calendar-picker-indicator,
.sheet-body input[type="time"]::-webkit-calendar-picker-indicator { margin: 0 0 0 4px; padding: 0; }
.row-2 { gap: 14px; }
/* Data e horário: a data é mais larga pra caber dia, mês e ano inteiros na mesma linha. */
.row-datahora { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
/* Altura vem do padding (e não de height fixo): no iPhone o texto do campo de data fica colado no topo quando a altura é fixa. */
.sheet-body input[type="date"], .sheet-body input[type="time"] { padding: 13px 10px; font-size: 14.5px; }
.sheet-body input[type="date"]::-webkit-datetime-edit,
.sheet-body input[type="time"]::-webkit-datetime-edit,
.sheet-body input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.sheet-body input[type="time"]::-webkit-datetime-edit-fields-wrapper { padding: 0; white-space: nowrap; }
.row-2 label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.profit-preview {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 15.5px;
  text-align: center;
}

.result-chips {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}
.result-chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex: 0 0 auto;
}
.chip.active.pending { background: var(--amber-dim); border-color: var(--amber); color: var(--amber); }
.chip.active.green { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.chip.active.red { background: var(--red-dim); border-color: var(--red); color: var(--red); }
.chip.active.push { background: var(--surface-2); border-color: var(--text-dim); color: var(--text); }
.chip.active.cashout { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-top: 18px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}
.checkbox-row-text { display: flex; flex-direction: column; gap: 2px; }
.checkbox-row-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.checkbox-row-sub { font-size: 11.5px; font-weight: 400; color: var(--text-dim); }
.checkbox-row input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--gold);
}

.btn-primary {
  margin-top: 24px;
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
  color: #1D1608;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,246,214,0.55), inset 0 -3px 0 rgba(120,80,0,0.2), 0 10px 22px rgba(227,181,74,0.22);
  transition: transform .1s ease;
}
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  margin-top: 12px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary.small { padding: 9px 14px; font-size: 12.5px; }
.btn-block { display: block; width: 100%; margin-top: 18px; }

.ai-scan-row { margin-top: 10px; }
.ai-scan-btn {
  margin-top: 0;
  padding: 14px 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(227, 181, 74, 0.45);
  border-radius: 12px;
  background: linear-gradient(180deg, #2A2112, #1C160C); /* fundo com um toque de dourado, em vez de cinza chapado */
  box-shadow: inset 0 1px 0 rgba(245, 203, 99, 0.14), 0 2px 8px rgba(0, 0, 0, 0.25);
  color: var(--gold-strong);
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.ai-scan-btn:hover { border-color: var(--gold); }
.ai-scan-btn:active { transform: scale(0.985); box-shadow: inset 0 1px 0 rgba(245, 203, 99, 0.08); }
.ai-scan-btn:disabled { opacity: 0.6; cursor: default; }
.ai-scan-btn.is-loading svg { animation: aiScanSpin 1.1s linear infinite; }
@keyframes aiScanSpin {
  to { transform: rotate(360deg); }
}
.ai-scan-hint {
  white-space: pre-line; /* uma mensagem por linha (o que não leu / o que leu com dúvida) */
  margin: 5px 2px 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-faint);
}
.btn-danger {
  margin-top: 10px;
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-danger.ghost { background: transparent; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn-secondary { flex: 1; }

/* CONFIG */
.config-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 10px;
}
.config-card label {
  font-size: 12.5px;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}
.config-gap { margin-top: 16px; }
.security-form { margin-top: 12px; }
.security-form input { margin-top: 8px; }
.security-form .btn-row { margin-top: 10px; }
.security-form .link-btn { display: block; margin: 10px auto 0; padding: 4px; font-size: 12.5px; }
.config-card .code-input { text-align: center; letter-spacing: 3px; font-family: var(--font-num); font-weight: 700; }
.config-card .code-input::placeholder { letter-spacing: 0; font-weight: 400; font-family: var(--font-ui); }
/* Linha de ajuste: nome à esquerda, campo à direita (em vez de um cartão por campo) */
.config-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.config-row + .config-row { border-top: 1px solid var(--border-soft); }
.config-row label { flex: 1; min-width: 0; margin: 0; line-height: 1.3; }
.config-row .input-with-icon { flex: 0 0 140px; }
.config-row .input-with-icon.wide { flex-basis: 185px; }
.config-help { margin: 4px 0 0 !important; line-height: 1.4; }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.danger-row label { margin: 0; }
.danger-row .btn-danger { margin-top: 0 !important; flex-shrink: 0; }
.config-footer { text-align: center; margin: 16px 0 0; padding: 0 8px; line-height: 1.45; }
.config-footer-link { text-align: center; margin: 4px 0 0; }
.config-card input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 14px;
  width: 100%;
}
.config-card .empty-sub { font-size: 12px; margin-top: 2px; }
/* Botões dentro de Ajustes são de ação secundária/pontual — mais
   compactos que os CTAs principais (salvar aposta, criar grupo etc.). */
.config-card .btn-primary,
.config-card .btn-secondary,
.config-card .btn-danger {
  padding: 9px 10px;
  font-size: 12.5px;
  margin-top: 10px;
}
.config-card .btn-row { gap: 8px; }
.config-card .btn-row .btn-primary,
.config-card .btn-row .btn-danger { flex: 1; margin-top: 0; }
.config-card.danger { border-color: var(--red); }

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.profile-info { min-width: 0; }
.input-with-icon {
  position: relative;
}
.input-with-icon input {
  padding-right: 42px !important;
}
.input-with-icon input[readonly] {
  color: var(--text-dim);
  cursor: default;
}
.input-with-icon .icon-btn-sm {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}
.profile-name {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon-btn-sm {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn-sm:active { background: var(--accent); color: #fff; }
.profile-email {
  font-size: 13px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.profile-meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 3px;
}
.version-tag {
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 12px;
}

.sync-card .btn-row { margin-top: 14px; }
.sync-card .btn-row .btn-secondary { margin-top: 0; }

/* TOAST */
.toast {
  --tom: var(--gold);
  --tom-dim: var(--gold-dim);
  position: fixed;
  bottom: 104px;
  bottom: calc(104px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  max-width: min(92vw, 420px);
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 3px solid var(--tom);
  padding: 11px 18px 11px 11px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  z-index: 50;
  animation: toastIn 0.24s cubic-bezier(.2,.8,.3,1);
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.toast.ok { --tom: var(--green); --tom-dim: var(--green-dim); }
.toast.erro { --tom: var(--red); --tom-dim: var(--red-dim); }
.toast.aviso { --tom: var(--amber); --tom-dim: var(--amber-dim); }
.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tom-dim);
  color: var(--tom);
  font-size: 13px;
  font-weight: 800;
}
/* "Carregando": sem ícone, um anel girando na cor do app */
.toast.info .toast-icon { border: 2.5px solid var(--gold-dim); border-top-color: var(--gold); background: none; animation: aiScanSpin 0.9s linear infinite; }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .toast.info .toast-icon { animation: none; } }

::-webkit-scrollbar { width: 0; height: 0; }

/* SPLASH SCREEN */
.splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-glow {
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(227,181,74,0.22) 0%, rgba(227,181,74,0) 65%);
  animation: splashPulse 2.2s ease-in-out infinite;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}
.splash-content {
  position: relative;
  text-align: center;
  padding: 0 32px;
}
.splash-badge {
  width: 76px;
  height: 76px;
  margin: 0 auto 24px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 36px rgba(227,181,74,0.24);
  animation: splashBadgeIn 0.7s cubic-bezier(.2,.8,.3,1) both;
}
.splash-badge img { display: block; width: 100%; height: 100%; border-radius: var(--radius); }
@keyframes splashBadgeIn {
  0% { transform: scale(0.4) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.brand-wordmark {
  font-family: 'Baloo 2', var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.01em;
  color: var(--gold-strong);
  margin: 0 0 14px;
  animation: splashTextIn 0.6s ease 0.15s both;
}
.mascot-wiggle {
  animation: mascotWiggle 2.6s ease-in-out infinite;
  transform-origin: 50% 60%;
}
@keyframes mascotWiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-8deg) scale(1.04); }
  75% { transform: rotate(8deg) scale(1.04); }
}
.splash-title {
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin: 0 0 9px;
  animation: splashTextIn 0.6s ease 0.25s both;
}
.splash-sub {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  margin: 0;
  animation: splashTextIn 0.6s ease 0.4s both;
}
@keyframes splashTextIn {
  0% { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ONBOARDING */
.onboarding {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 32px 0;
}
.onboarding-content {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 0 28px;
  text-align: center;
}
.onboarding-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.onboarding-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 18px;
}
.onboarding-input {
  display: block;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 10px;
}
.onboarding-actions { display: flex; flex-direction: column; margin-top: 6px; }
.onboarding-skip { margin-top: 16px; }
.onboarding-note {
  min-height: 16px;
  font-size: 12.5px;
  color: var(--text-dim);
  margin: 14px 0 0;
}

/* LOGIN SOCIAL (Google, Facebook, Apple) */
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  margin-top: 0;
}
.btn-social + .btn-social {
  margin-top: 10px;
}

/* =========================================================
   PLANOS, LEITURAS POR IA E RELATÓRIOS
========================================================= */

/* Contador de leituras abaixo do botão de foto */
.ai-scan-info { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; margin: 7px 2px 0; }
.ai-scan-quota {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gold);
}
.ai-scan-quota.empty { color: var(--text-dim); }

/* Selo do plano (Grátis / Pro / Pro Max) */
.plan-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.plan-chip.pro { background: var(--accent-dim); color: var(--accent); border-color: transparent; }
.plan-chip.pro_max { background: var(--gold-dim); color: var(--gold-strong); border-color: transparent; }
.plan-chip.elite { background: var(--gold); color: #1D1608; border-color: transparent; }

/* Card "Seu plano" em Ajustes */
.config-card.plan-card { border-color: var(--gold-dim); }
.plan-card-head { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.plan-card-quota { font-size: 13px; color: var(--text-dim); }
.config-card.plan-card .btn-primary,
.config-card.plan-card .btn-secondary { width: 100%; padding: 11px 10px; }

/* Atalho dos relatórios no Início */
.report-entry {
  width: 100%;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .1s ease;
}
.report-entry:active { transform: scale(0.99); }
.report-entry-icon { font-size: 20px; }
.report-entry-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.report-entry-title { font-weight: 700; font-size: 14.5px; color: var(--text); }
.report-entry-sub { font-size: 12px; color: var(--text-dim); }
.report-entry-arrow { color: var(--text-faint); font-size: 18px; }

/* Leitura de vários bilhetes (Elite): faixa "Bilhete 2 de 3" no topo do formulário e convite nos outros planos */
.lote-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 10px; padding: 9px 12px;
  background: var(--gold-dim); border: 1px solid var(--gold-dim); border-radius: 12px;
  color: var(--gold-strong); font-size: 12.5px; font-weight: 600;
}
.lote-banner .link-btn { padding: 0; font-size: 12.5px; white-space: nowrap; }
.ai-scan-line { position: relative; }
.ai-scan-line .ai-scan-btn { padding-right: 92px; } /* abre espaço para o "Elite" dentro da barra */
.ai-scan-elite {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  max-width: 82px; padding: 4px 9px; /* teste: pílula dourada dentro da barra, com brilho passando */
  overflow: hidden; isolation: isolate;
  border: 1px solid #C9CED6; border-radius: 3px;
  /* formato de bilhete: um recorte redondo no meio de cada lado */
  -webkit-mask: radial-gradient(circle 4px at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 4px at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 4px at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat,
        radial-gradient(circle 4px at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat;
  background: #23262C; color: #E8EBF0;
  font-size: 10.5px; font-weight: 700; line-height: 1.15; text-align: center;
  display: flex; align-items: center; justify-content: center;
  animation: eliteGlow 2.8s ease-in-out infinite;
}
.ai-scan-elite::after { /* faixa de brilho que atravessa a pílula e some */
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-130%) skewX(-18deg);
  animation: eliteShine 2.8s ease-in-out infinite;
}
@keyframes eliteShine {
  0%, 15% { transform: translateX(-130%) skewX(-18deg); }
  55%, 100% { transform: translateX(300%) skewX(-18deg); }
}
@keyframes eliteGlow { /* a máscara do bilhete corta sombras, então o pulso é no fundo */
  0%, 100% { background: #23262C; }
  40% { background: #343840; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-scan-elite, .ai-scan-elite::after { animation: none; }
}

/* Limite de perda do mês (Início) */
.limite-card {
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
}
.limite-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.limite-titulo { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.limite-valores { font-family: var(--font-num); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.limite-barra { height: 7px; background: var(--surface-2); border-radius: 999px; margin-top: 9px; overflow: hidden; }
.limite-preenchido { height: 100%; width: 0; background: var(--gold); border-radius: 999px; transition: width .3s ease; }
.limite-card.atencao .limite-preenchido { background: var(--amber); }
.limite-card.estourado .limite-preenchido { background: var(--red); }
.limite-msg { font-size: 12px; color: var(--text-dim); margin: 8px 0 0; }
.limite-card.atencao .limite-msg { color: var(--amber); }
.limite-card.estourado { border-color: var(--red); }
.limite-card.estourado .limite-msg { color: var(--red); font-weight: 600; }

/* Selo "Pro Max" ao lado de um título ou botão */
.label-com-selo { display: flex !important; align-items: center; gap: 8px; }
.btn-com-selo { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* Relatórios: cada coisa num bloco com título, de cima pra baixo
   (introdução, filtros, resumo, detalhamento, exportar) */
.report-intro { font-size: 13px; line-height: 1.5; color: var(--text-dim); margin: 2px 0 0; }
.report-label,
.sheet-body label.report-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dim);
  margin: 0;
}

/* Filtros: o que entra na conta (período e grupo) */
.report-filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.report-field { display: flex; flex-direction: column; gap: 8px; }
.report-period { margin: 0; gap: 8px; }
.report-period .period-tab { flex: 1; padding: 9px 8px; font-size: 12.5px; text-align: center; }
.report-period .period-tab.active { box-shadow: none; } /* o brilho seria cortado pela rolagem da linha */
.report-filters select { background: var(--surface); padding: 11px 13px; font-size: 14px; }

.report-wrap { position: relative; min-height: 260px; }
.report-body.locked { filter: blur(6px); pointer-events: none; user-select: none; }
.report-block { margin-top: 24px; }

/* Resumo do período */
.report-summary {
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
}
.report-summary-label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.report-summary-value { font-family: var(--font-num); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.1; }
.report-summary-sub { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

/* Escolha do detalhamento: 4 botões grandes, com ícone */
.report-dims { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.report-dim {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 11px 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.report-dim:active { transform: scale(0.97); }
.report-dim-icon { font-size: 19px; line-height: 1; }
.report-dim.active { background: var(--gold-dim); border-color: var(--gold); color: var(--gold-strong); }

.report-detail-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: 0.005em; margin: 22px 0 0; }
.report-detail-help { font-size: 12.5px; line-height: 1.5; color: var(--text-dim); margin: 5px 0 0; }

.report-highlights { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.report-highlight {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  min-width: 0;
}
.report-highlight-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-faint);
}
.report-highlight-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  margin-top: 7px;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* nome comprido quebra em até 2 linhas em vez de cortar na 1ª */
  -webkit-box-orient: vertical;
}
.report-highlight-value { font-family: var(--font-num); font-weight: 700; font-size: 13px; margin-top: 4px; }

/* Uma linha por casa/esporte/mercado/faixa: nome e lucro, barra, e os números com rótulo */
.report-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.report-row {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px 15px 13px;
  box-shadow: var(--shadow-sm);
}
.report-row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.report-row-id { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.report-tag { padding: 1px 8px; border-radius: 999px; background: var(--amber-dim); color: var(--amber); font-size: 10.5px; font-weight: 700; letter-spacing: 0.01em; }
.report-row-name { min-width: 0; font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-row-profit { font-family: var(--font-num); font-weight: 700; font-size: 15px; white-space: nowrap; }
.report-bar { height: 5px; margin-top: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.report-bar span { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.report-bar span.negative { background: var(--red); }
.report-row-stats, .stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.report-row-stats div, .stats4 div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.report-row-stats span, .stats4 span { font-size: 11px; font-weight: 600; color: var(--text-faint); white-space: nowrap; }
.report-row-stats b, .stats4 b { font-family: var(--font-num); font-size: 12.5px; font-weight: 700; white-space: nowrap; }

/* Risco do período: maior queda e pior sequência de reds */
.report-risk { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.report-risk[hidden] { display: none; }
.report-risk-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.report-risk-card span { font-size: 11.5px; font-weight: 600; color: var(--text-faint); }
.report-risk-card b { font-family: var(--font-num); font-size: 16px; font-weight: 700; line-height: 1.2; }
.report-risk-card small { font-size: 11px; line-height: 1.35; color: var(--text-dim); }
.report-legend { font-size: 11.5px; line-height: 1.55; color: var(--text-faint); margin: 12px 2px 0; }
.report-legend b { font-weight: 700; color: var(--text-dim); }
.report-legend b.positive { color: var(--green); }
.report-legend b.negative { color: var(--red); }

/* Exportar */
.report-export { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border-soft); }
.report-export-text { font-size: 12.5px; line-height: 1.5; color: var(--text-dim); margin: 8px 0 0; }
.report-export-btn { width: 100%; margin-top: 12px; border-color: var(--gold-dim); color: var(--gold-strong); }
.report-note { font-size: 11.5px; color: var(--text-faint); margin: 10px 2px 0; line-height: 1.45; }

.report-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 64px 20px 20px;
}
.report-lock-icon { font-size: 30px; }
.report-lock-title { font-family: var(--font-display); font-size: 21px; font-weight: 700; margin: 8px 0 4px; }
.report-lock .btn-primary { margin-top: 16px; padding: 13px 22px; }

/* Modais: ficam por cima das sheets, então abrir um não fecha o
   formulário de aposta que está embaixo. */
.modal-overlay, .flyer-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.18s ease;
}
.modal-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 28px 22px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5);
  animation: modalIn 0.26s cubic-bezier(.2,.8,.3,1);
}
@keyframes modalIn {
  from { transform: translateY(14px) scale(0.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-icon { font-size: 30px; }
.modal-title { font-family: var(--font-display); font-size: 25px; line-height: 1.1; font-weight: 700; margin: 8px 0 8px; }
.modal-text { font-size: 14.5px; line-height: 1.55; color: var(--text-dim); margin: 0; }
.modal-text strong { color: var(--text); }
.modal-card .btn-primary { margin-top: 20px; }

/* Confirmação: por cima de tudo (até do anúncio e do toast), com a cor do que está sendo confirmado */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.18s ease;
}
.confirm-card { --tom: var(--gold); --tom-dim: var(--gold-dim); border-top-color: var(--tom); }
.confirm-card[data-tom="green"] { --tom: var(--green); --tom-dim: var(--green-dim); }
.confirm-card[data-tom="red"] { --tom: var(--red); --tom-dim: var(--red-dim); }
.confirm-card[data-tom="accent"] { --tom: var(--accent); --tom-dim: var(--accent-dim); }
.confirm-card .modal-text { overflow-wrap: anywhere; white-space: pre-line; }
.confirm-impacto {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--tom-dim);
  border: 1px solid var(--tom);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dim);
  text-align: left;
}
.confirm-impacto b { color: var(--tom); font-family: var(--font-num); font-size: 14px; text-align: right; }
.confirm-botoes { display: flex; gap: 10px; margin-top: 16px; }
/* margin-top precisa vencer o ".modal-card .btn-primary" (20px): sem isso o botão principal desce e o "Voltar" estica junto. */
.confirm-card .confirm-botoes button { flex: 1; margin-top: 0; padding: 10px 8px; font-size: 14px; line-height: 1.25; }
.confirm-card[data-tom="green"] #confirmSimBtn,
.confirm-card[data-tom="red"] #confirmSimBtn,
.confirm-card[data-tom="accent"] #confirmSimBtn {
  background: var(--tom);
  color: #0D0B08;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--tom) 25%, transparent);
}
.conversao-lista { list-style: none; margin: 14px 0 0; padding: 0; max-height: 220px; overflow-y: auto; text-align: left; font-size: 13px; color: var(--text-dim); }
.conversao-lista li { padding: 8px 0; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; gap: 10px; }
.conversao-lista b { color: var(--text); white-space: nowrap; }
/* Campo com setinha: digita pra buscar ou abre a lista (Esporte e Casa de aposta) */
.combo { position: relative; }
.sheet-body .combo input { padding-right: 46px; }
.combo-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
}
.combo-btn svg { transition: transform .15s ease; }
.combo:has(.combo-list:not([hidden])) .combo-btn svg { transform: rotate(180deg); }
.combo-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.combo-item { padding: 11px 12px; border-radius: 8px; font-size: 14.5px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.combo-item.ativo { background: var(--surface); }
.combo-item.sel { color: var(--gold-strong); font-weight: 700; }
.combo-item.sel::after { content: "✓"; font-size: 13px; }
.combo-vazio { padding: 12px; font-size: 13px; color: var(--text-faint); }

/* Atalho "instalar no celular": barra fina no estilo dos "baixe o app" dos sites de aposta */
.install-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 12px;
  padding: 8px 10px 8px 2px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.install-bar-card { margin: 12px 0 0; padding-left: 12px; }
.install-bar-close { background: none; border: none; color: var(--text-faint); font-size: 12px; line-height: 1; padding: 10px 8px; cursor: pointer; }
.install-bar-icon { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.install-bar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.install-bar-text strong { font-size: 13.5px; color: var(--text); }
.install-bar-text span { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.install-bar-btn {
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
  color: #1D1608;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.install-bar-btn:active { transform: scale(0.96); }
.instalar-icone { display: block; margin: 0 auto; width: 56px; height: 56px; border-radius: 14px; }
.share-glyph { vertical-align: -3px; margin: 0 1px; color: var(--accent); }
.instalar-passos { margin: 16px 0 0; padding-left: 22px; text-align: left; font-size: 14px; line-height: 1.55; color: var(--text-dim); }
.instalar-passos li { padding: 4px 0 4px 4px; }
.instalar-passos strong { color: var(--text); }
.modal-foot { font-size: 12px; color: var(--text-faint); margin: 14px 0 0; }

/* Flyer dos planos */
.flyer-overlay { overflow-y: auto; display: flex; padding: 20px 14px; }
.flyer {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: auto;
  background:
    radial-gradient(ellipse 420px 220px at 50% -10%, rgba(227,181,74,0.16), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 18px 18px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5);
  animation: modalIn 0.3s cubic-bezier(.2,.8,.3,1);
}
.flyer-context {
  display: inline-block;
  background: var(--amber-dim);
  color: var(--amber);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 12px;
  padding: 7px 12px;
  margin: 4px 30px 14px;
}
.flyer .splash-badge { width: 60px; height: 60px; margin-bottom: 14px; animation: none; }
.flyer-title { font-family: var(--font-display); font-size: 27px; font-weight: 700; line-height: 1.1; letter-spacing: 0.005em; margin: 0 0 6px; }
.flyer-sub { font-size: 13.5px; color: var(--text-dim); margin: 0 0 16px; }
.flyer-cycle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
}
.flyer-cycle-btn {
  background: none;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.flyer-cycle-btn.active { background: var(--gold); color: #1D1608; }
.flyer-save {
  font-size: 10.5px;
  font-weight: 700;
  background: var(--green-dim);
  color: var(--green);
  padding: 2px 7px;
  border-radius: 999px;
}
.flyer-cycle-btn.active .flyer-save { background: rgba(29,22,8,0.16); color: #1D1608; }
.flyer-plans { display: flex; flex-direction: column; gap: 9px; text-align: left; }
.flyer .splash-badge { display: none; } /* a tela de planos precisa caber: o título já basta */
.flyer .flyer-title { font-size: 25px; }
.flyer .flyer-sub { margin-bottom: 12px; }
.plan-offer {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}
.plan-offer.featured {
  border: 1.5px solid var(--gold);
  box-shadow: var(--shadow-gold);
  background: linear-gradient(180deg, rgba(227,181,74,0.09), transparent 55%), var(--surface-2);
}
.plan-offer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.plan-offer-id { display: flex; flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-offer-cost { text-align: right; white-space: nowrap; flex: 0 0 auto; }
.plan-offer-name { font-family: var(--font-display); font-size: 21px; font-weight: 700; line-height: 1.1; }
.plan-offer-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--gold);
  color: #1D1608;
  padding: 2px 8px;
  border-radius: 999px;
}
.plan-offer-price { display: flex; align-items: baseline; justify-content: flex-end; gap: 3px; }
.plan-offer-price strong { font-family: var(--font-num); font-size: 21px; font-weight: 700; }
.plan-offer-price span { color: var(--text-dim); font-size: 13px; }
/* Preço antigo com um X vermelho por cima (promoção de lançamento) */
.plan-offer-price .preco-antigo {
  position: relative; text-decoration: none; align-self: center;
  margin-right: 8px; font-family: var(--font-num); font-size: 13px; color: var(--text-dim);
}
.preco-antigo::before, .preco-antigo::after {
  content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 2px;
  background: var(--red); border-radius: 2px;
}
.preco-antigo::before { transform: rotate(16deg); }
.preco-antigo::after { transform: rotate(-16deg); }
.plan-offer-equiv { font-size: 11.5px; color: var(--green); font-weight: 600; margin-top: 1px; }
.plan-offer-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 3px; }
.plan-offer-list li { font-size: 13px; line-height: 1.35; display: flex; gap: 7px; }
.plan-offer-list li::before { content: "✓"; color: var(--green); font-weight: 700; }
.plan-offer .btn-primary, .plan-offer .btn-secondary { margin-top: 10px; padding: 10px; font-size: 14px; }
.plan-offer .btn-secondary:disabled { opacity: 0.7; cursor: default; }
.flyer-later { margin-top: 16px; color: var(--text-dim); padding: 6px; }
.flyer-fine { font-size: 11.5px; color: var(--text-faint); margin: 6px 0 0; }

/* Pagamento: fica por cima do flyer (fechar volta pros planos) */
.pagamento-overlay { z-index: 46; }
.pagamento-teste {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 12px;
  padding: 7px 12px;
  margin: 4px 30px 14px;
}
.pagamento-troca { font-size: 12.5px; color: var(--amber); margin: -6px 0 12px; }
.pagamento-carregando { font-size: 13px; color: var(--text-dim); margin: 12px 0; }
.pagamento-carregando:empty { display: none; }
.pagamento-brick { text-align: left; }
.plan-cancel { display: block; margin: 12px auto 0; color: var(--red); font-size: 12.5px; }

/* Anúncio em tela cheia (por enquanto, apresentação dos próprios planos) */
.ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 46;
  background:
    radial-gradient(ellipse 700px 420px at 50% 30%, rgba(227,181,74,0.12), transparent 65%),
    var(--bg);
  display: flex;
  flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom));
  animation: fadeIn 0.2s ease;
}
.ad-top { display: flex; align-items: center; gap: 10px; max-width: 560px; width: 100%; margin: 0 auto; }
.ad-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}
.ad-timer { margin-left: auto; font-family: var(--font-num); font-weight: 700; font-size: 14px; color: var(--gold); min-width: 30px; text-align: right; }
.ad-top .modal-close { position: static; }
.ad-progress { height: 3px; background: var(--surface-2); border-radius: 999px; margin: 12px auto 0; overflow: hidden; max-width: 560px; width: 100%; }
.ad-progress-bar { height: 100%; width: 0; background: var(--gold); transition: width 1s linear; }
.ad-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}
.ad-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
  pointer-events: none;
}
.ad-slide.active { opacity: 1; transform: none; }
.ad-emoji { font-size: 54px; }
.ad-slide .plan-chip { font-size: 13px; padding: 7px 15px; }
.ad-slide h2, .ad-done h2 { font-family: var(--font-display); font-size: 31px; font-weight: 700; line-height: 1.1; letter-spacing: 0.005em; margin: 16px 0 10px; }
.ad-slide p { color: var(--text-dim); font-size: 15px; line-height: 1.5; margin: 0; }
.ad-done { display: flex; flex-direction: column; align-items: center; width: 100%; animation: modalIn 0.3s cubic-bezier(.2,.8,.3,1); }
.ad-done .btn-primary { width: 100%; max-width: 320px; }
.ad-done .link-btn { margin-top: 14px; padding: 6px; }

/* ANÚNCIOS DO GOOGLE ADSENSE (tamanho fixo, previsível; só pra quem está no plano grátis) */
.ad-slot {
  display: flex;
  justify-content: center;
  margin: 0 0 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ad-slot-small { min-height: 50px; }
.ad-slot-large { min-height: 100px; }

/* Cópias de segurança e status da sincronização (Ajustes) */
.sync-status { margin-top: 6px; font-size: 12.5px; color: var(--text-faint); }
.copia-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-soft); }
.copia-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12.5px; color: var(--text-dim); }
.copia-info b { color: var(--text); font-size: 13.5px; }
.copia-item .btn-secondary { margin-top: 0; flex-shrink: 0; }
.copias-mais { display: block; margin: 4px auto 0; padding: 8px; font-size: 12.5px; color: var(--text-dim); font-weight: 500; }

/* Campo que a IA leu com dúvida: destaque até a pessoa conferir (mexer nele). */
.sheet-body input.campo-incerto, .sheet-body select.campo-incerto {
  border-color: var(--gold);
  background: rgba(227, 181, 74, 0.12);
}

/* Comparação de dados (aparelho x nuvem) dentro da confirmação: dois cartões lado a lado, o sugerido em destaque. */
.comparar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; text-align: left; }
.comparar-lado {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 12px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.comparar-lado.sugerido { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--surface-2)); }
.comparar-lado h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 13.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim); }
.comparar-lado.sugerido h3 { color: var(--gold-strong); }
.comparar-lado b { font-family: var(--font-display); font-size: 21px; line-height: 1.2; color: var(--text); }
.comparar-lado small { font-size: 12px; line-height: 1.35; color: var(--text-dim); }
.comparar-tag {
  position: absolute;
  top: -9px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: #0D0B08;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
@media (max-width: 340px) {
  .comparar { grid-template-columns: 1fr; }
}

/* =========================================================
   PROFUNDIDADE: todo cartão do app usa a mesma luz (topo mais claro que a base) e o mesmo filete no alto,
   para que Grupos, Cash, Relatórios e Ajustes pareçam da mesma família do bilhete do Início.
========================================================= */
.group-card, .account-row, .monthly-row, .cash-row, .config-card, .report-row, .report-entry,
.limite-card, .report-summary, .install-bar, .filters-panel {
  background: var(--card-bg);
  box-shadow: inset 0 1px 0 rgba(255,236,190,0.05), 0 6px 16px rgba(0,0,0,0.26);
}
.report-entry {
  background:
    radial-gradient(ellipse 260px 90px at 0% 0%, rgba(227,181,74,0.14), transparent 70%),
    var(--card-bg);
}
.report-entry-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: 0.005em; }
.group-name, .profile-name { font-family: var(--font-display); font-size: 21px; letter-spacing: 0.005em; }
.group-card { border-radius: 20px; }
.config-card { border-radius: 18px; }
.config-card label { font-size: 13px; }
main { padding-bottom: 132px; }

/* =========================================================
   BILHETES NAS OUTRAS ABAS: Grupos, Cash e Ajustes usam o mesmo bilhete do Início e das apostas
   (lateral dourada, dois recortes no alto e a tira pontilhada embaixo).
========================================================= */
.group-card, .cash-row, .config-card {
  --perfuracao: repeating-linear-gradient(90deg, rgba(227,181,74,0.5) 0 2px, transparent 2px 5px, rgba(227,181,74,0.26) 5px 6px, transparent 6px 9px) bottom center / calc(100% - 32px) 3px no-repeat;
  position: relative;
  background: var(--perfuracao), var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,236,190,0.05), 0 8px 18px rgba(0,0,0,0.3);
}
.group-card::before, .group-card::after, .cash-row::before, .cash-row::after, .config-card::before, .config-card::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
}
.group-card::before, .cash-row::before, .config-card::before { left: 10px; }
.group-card::after, .cash-row::after, .config-card::after { right: 10px; }
.group-card { padding: 17px 17px 20px 16px; }
.cash-row { padding: 14px 15px 17px 14px; }
.config-card { padding: 14px 14px 18px 13px; margin-top: 14px; }
.config-card.plan-card { border-left-color: var(--gold); }
.config-card.danger { border-left-color: var(--red); }
.config-card.danger::before, .config-card.danger::after { border-color: var(--red); }
.group-card:active { border-top-color: var(--border); }
.group-list, .account-list { gap: 16px; }
