/* ============================================================
   ZÉ APOSTAS · LOTERIAS / LOTECA
   CSS filho da tela de Loterias.
   Base visual vem de app.css + sportsbets-page.css.
   Aqui ficam apenas ajustes específicos da Loteca.
   ============================================================ */


/* ------------------------------------------------------------
   1) SHELL DA PÁGINA
   Mantém o respiro inferior para a bottom-nav fixa.
   ------------------------------------------------------------ */

.za-lotteries-shell{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding-bottom:calc(92px + env(safe-area-inset-bottom));
  min-width:0;
  max-width:100%;
}

.za-lotteries-shell .za-main-feed{
  min-width:0;
  max-width:100%;
}


/* ------------------------------------------------------------
   2) NAV/FILTRO DE MODALIDADE
   Hoje só há Loteca, mas mantém compatibilidade caso entre
   outra modalidade no futuro.
   ------------------------------------------------------------ */

.za-lottery-nav{
  margin-top:-2px;
}


/* ------------------------------------------------------------
   3) TÍTULOS E TEXTOS DO CARD DE LOTERIA
   Não redefine o card base: apenas tipografia específica.
   ------------------------------------------------------------ */

.za-lottery-card-title{
  display:block;
  margin:0 40px 12px 0;
  color:var(--za-text);
  font-size:20px;
  line-height:1.12;
  font-weight:850;
  letter-spacing:-.025em;
}

.za-lottery-card-title--primary{
  margin-bottom:12px;
}

.za-lottery-card-note{
  margin:10px 0 0;
  color:var(--za-text-soft);
  font-size:13px;
  line-height:1.45;
}

.za-lottery-card-note + .za-lottery-card-note{
  margin-top:4px;
}


/* ------------------------------------------------------------
   4) VARIAÇÃO VISUAL DO CARD DE LOTECA
   Usa o card global .za-tip-card e só acrescenta atmosfera.
   ------------------------------------------------------------ */

.za-tip-card.is-featured-lottery{
  border-color:rgba(255,111,97,.18);
  background:
    radial-gradient(circle at top right, rgba(255,111,97,.12), transparent 28%),
    radial-gradient(circle at top left, rgba(56,189,248,.07), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.03));
}

.za-tip-card.is-featured-lottery .za-tip-card__body{
  gap:13px;
}


/* ------------------------------------------------------------
   5) BADGES DE ESTRATÉGIA
   Mantém o padrão de pílula do app, com cor própria da Loteca.
   ------------------------------------------------------------ */

.za-lottery-strategy-main{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(56,189,248,.18);
  background:rgba(56,189,248,.10);
  color:#7dd3fc;
  font-size:12px;
  line-height:1;
  letter-spacing:.01em;
  font-weight:780;
  white-space:nowrap;
}

.za-lottery-strategy-main.is-triple{
  border-color:rgba(250,204,21,.25);
  background:rgba(250,204,21,.15);
  color:#fde68a;
  font-weight:850;
}

.za-lottery-strategy-main.is-double,
.za-lottery-strategy-main.is-simple,
.za-lottery-strategy-main.is-custom{
  border-color:rgba(56,189,248,.18);
  background:rgba(56,189,248,.10);
  color:#7dd3fc;
}


/* ------------------------------------------------------------
   6) RÉGUA DE RISCO
   A Loteca usa cor coral para dificuldade/risco.
   ------------------------------------------------------------ */

.za-lotteries-shell .za-tip-card__confidence{
  padding-top:0;
}

.za-lotteries-shell .za-tip-card__confidence-line{
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  min-width:0;
}

.za-lotteries-shell .za-tip-card__confidence-label{
  min-width:0;
  white-space:normal;
}

.za-lotteries-shell .za-difficulty-inline{
  margin-left:auto;
  color:var(--za-coral);
  font-size:16px;
  line-height:1;
  font-weight:900;
  letter-spacing:1px;
  white-space:nowrap;
}


/* ------------------------------------------------------------
   7) FAVORITO BLOQUEADO
   Mantém estrela legível quando a janela de palpite fechou.
   ------------------------------------------------------------ */

.za-lotteries-shell .za-tip-fav.is-locked,
.za-lotteries-shell .za-tip-fav:disabled.is-locked{
  opacity:.72;
  cursor:not-allowed;
  filter:none;
}

.za-lotteries-shell .za-tip-fav.is-saved.is-locked{
  opacity:.92;
  color:#fbbf24;
}


/* ------------------------------------------------------------
   8) TABELA DA LOTECA
   Mantém estrutura compacta e legível em mobile.
   ------------------------------------------------------------ */

.za-loteca-table-wrap{
  margin-top:14px;
  border:1px solid rgba(148,163,184,.10);
  border-radius:18px;
  overflow:hidden;
  background:rgba(2,6,23,.20);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}

.za-loteca-table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  font-size:13px;
}

.za-loteca-table th,
.za-loteca-table td{
  padding:10px 10px;
  border-bottom:1px solid rgba(148,163,184,.08);
  color:var(--za-text-soft);
  text-align:left;
  vertical-align:middle;
}

.za-loteca-table tr:last-child td{
  border-bottom:0;
}

.za-loteca-table th{
  background:rgba(255,255,255,.025);
  color:var(--za-muted);
  font-size:10px;
  line-height:1.1;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-weight:900;
}

.za-loteca-table td{
  font-size:12px;
  line-height:1.25;
}

.za-loteca-table td.is-marked{
  color:var(--za-coral);
  font-weight:1000;
}

/* Colunas pequenas: Jogo, 1, X, 2 */
.za-loteca-table th:nth-child(1),
.za-loteca-table td:nth-child(1){
  width:42px;
  text-align:center;
}

.za-loteca-table th:nth-child(3),
.za-loteca-table td:nth-child(3),
.za-loteca-table th:nth-child(4),
.za-loteca-table td:nth-child(4),
.za-loteca-table th:nth-child(5),
.za-loteca-table td:nth-child(5){
  width:32px;
  text-align:center;
}

/* Mandante e visitante podem quebrar linha sem estourar o card */
.za-loteca-table td:nth-child(2),
.za-loteca-table td:nth-child(6){
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}


/* ------------------------------------------------------------
   9) ESTADOS E AJUSTES HERDADOS
   Protege textos e estados renderizados pelo PHP/JS.
   ------------------------------------------------------------ */

.za-lotteries-shell .za-empty-card,
.za-lotteries-shell .za-page-state,
.za-lotteries-shell .za-list-premium{
  min-width:0;
  max-width:100%;
}

.za-lotteries-shell .za-tip-card__label-row{
  gap:7px;
}


/* ------------------------------------------------------------
   10) RESPONSIVO
   Ajustes finos para Telegram Mini App/mobile.
   ------------------------------------------------------------ */

@media (max-width:640px){
  .za-lottery-card-title{
    margin-right:36px;
    font-size:19px;
  }

  .za-loteca-table{
    font-size:12px;
  }

  .za-loteca-table th,
  .za-loteca-table td{
    padding:9px 7px;
  }

  .za-loteca-table th:nth-child(1),
  .za-loteca-table td:nth-child(1){
    width:38px;
  }

  .za-loteca-table th:nth-child(3),
  .za-loteca-table td:nth-child(3),
  .za-loteca-table th:nth-child(4),
  .za-loteca-table td:nth-child(4),
  .za-loteca-table th:nth-child(5),
  .za-loteca-table td:nth-child(5){
    width:30px;
  }

  .za-loteca-table td:nth-child(2),
  .za-loteca-table td:nth-child(6){
    font-size:11px;
    line-height:1.22;
  }
}

@media (max-width:380px){
  .za-lottery-card-title{
    font-size:18px;
  }

  .za-loteca-table th,
  .za-loteca-table td{
    padding-left:6px;
    padding-right:6px;
  }

  .za-loteca-table th:nth-child(1),
  .za-loteca-table td:nth-child(1){
    width:34px;
  }

  .za-loteca-table th:nth-child(3),
  .za-loteca-table td:nth-child(3),
  .za-loteca-table th:nth-child(4),
  .za-loteca-table td:nth-child(4),
  .za-loteca-table th:nth-child(5),
  .za-loteca-table td:nth-child(5){
    width:28px;
  }
}

/* ------------------------------------------------------------
   11) LOTECA · MODO JOGO A JOGO
   Mantém o card de marcação limpo e leva a análise detalhada
   para o submenu próprio.
   ------------------------------------------------------------ */
.za-lot-games-mode{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  min-width:0;
}

.za-lot-games-summary{
  gap:10px;
}

.za-lot-games-card .za-tip-card__reason{
  color:var(--za-text-soft);
  font-size:14px;
  line-height:1.42;
}

.za-lot-games-list{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  min-width:0;
}

.za-lot-game{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  padding:12px;
  border:1px solid rgba(148,163,184,.12);
  border-radius:18px;
  background:rgba(255,255,255,.035);
}

.za-lot-game__top,
.za-lot-game__bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}

.za-lot-game__number{
  color:var(--za-blue);
  font-size:11px;
  line-height:1;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  white-space:nowrap;
}

.za-lot-game__confidence{
  color:var(--za-text-soft);
  font-size:12px;
  line-height:1.1;
  font-weight:800;
  text-align:right;
  white-space:nowrap;
}

.za-lot-game__teams{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  gap:8px;
  color:var(--za-text);
  font-size:13px;
  line-height:1.25;
  font-weight:800;
}

.za-lot-game__teams span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.za-lot-game__teams span:last-child{
  text-align:right;
}

.za-lot-game__teams strong{
  color:var(--za-muted);
  font-size:11px;
  line-height:1;
  font-weight:900;
  text-transform:lowercase;
}

.za-lot-game__pick{
  min-width:0;
  color:#fde68a;
  font-size:12px;
  line-height:1.15;
  font-weight:850;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.za-lot-game__balls{
  display:inline-flex;
  align-items:center;
  gap:5px;
  flex:0 0 auto;
}

.za-lot-game-ball{
  display:inline-grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.18);
  background:rgba(255,255,255,.035);
  color:var(--za-muted);
  font-size:11px;
  line-height:1;
  font-weight:950;
}

.za-lot-game-ball.is-marked{
  border-color:rgba(255,111,97,.32);
  background:rgba(255,111,97,.16);
  color:#fecaca;
}

@media (max-width:420px){
  .za-lot-game{
    padding:11px;
  }

  .za-lot-game__confidence{
    font-size:11px;
  }

  .za-lot-game__teams{
    font-size:12px;
  }
}

/* ------------------------------------------------------------
   12) LOTECA · HISTÓRICO INTELIGENTE
   Transforma o histórico em ferramenta de aprendizado:
   verde = acerto seco, azul = cobertura correta,
   amarelo = atenção/apuração/proteção insuficiente,
   vermelho = erro.
   ------------------------------------------------------------ */
.za-lot-history-card{
  gap:13px;
}

.za-lot-history-summary{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
  margin-top:2px;
}

.za-lot-history-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:30px;
  padding:7px 9px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.12);
  background:rgba(255,255,255,.035);
  color:var(--za-text-soft);
  font-size:11px;
  line-height:1;
  font-weight:850;
  white-space:nowrap;
}

.za-lot-history-pill.is-perfect{
  border-color:rgba(34,197,94,.24);
  background:rgba(34,197,94,.10);
  color:#86efac;
}

.za-lot-history-pill.is-covered{
  border-color:rgba(56,189,248,.24);
  background:rgba(56,189,248,.10);
  color:#7dd3fc;
}

.za-lot-history-pill.is-partial{
  border-color:rgba(250,204,21,.24);
  background:rgba(250,204,21,.10);
  color:#fde68a;
}

.za-lot-history-pill.is-miss{
  border-color:rgba(239,68,68,.24);
  background:rgba(239,68,68,.10);
  color:#fca5a5;
}

.za-lot-history-games{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  min-width:0;
}

.za-lot-history-game{
  display:grid;
  grid-template-columns:34px 1fr;
  gap:10px;
  align-items:start;
  padding:12px;
  border-radius:18px;
  border:1px solid rgba(148,163,184,.12);
  background:rgba(255,255,255,.032);
}

.za-lot-history-game__status{
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  border-radius:999px;
  background:rgba(255,255,255,.045);
  border:1px solid rgba(148,163,184,.12);
  font-size:15px;
  line-height:1;
}

.za-lot-history-game__body{
  display:grid;
  grid-template-columns:1fr;
  gap:7px;
  min-width:0;
}

.za-lot-history-game__top,
.za-lot-history-game__meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-width:0;
}

.za-lot-history-game__number{
  color:var(--za-muted);
  font-size:11px;
  line-height:1;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.za-lot-history-game__badge{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:5px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.04);
  color:var(--za-text-soft);
  font-size:10px;
  line-height:1;
  font-weight:900;
  white-space:nowrap;
}

.za-lot-history-game__teams{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  gap:8px;
  align-items:center;
  color:var(--za-text);
  font-size:13px;
  line-height:1.2;
  font-weight:800;
}

.za-lot-history-game__teams span:first-child{
  text-align:left;
}

.za-lot-history-game__teams span:last-child{
  text-align:right;
}

.za-lot-history-game__teams strong{
  color:var(--za-muted);
  font-size:11px;
  line-height:1;
  font-weight:900;
  text-transform:lowercase;
}

.za-lot-history-game__meta{
  color:var(--za-muted);
  font-size:11px;
  line-height:1.2;
  font-weight:700;
  flex-wrap:wrap;
}

.za-lot-history-game__meta strong{
  color:var(--za-text-soft);
  font-weight:900;
}

.za-lot-history-game.is-perfect{
  border-color:rgba(34,197,94,.22);
  background:rgba(34,197,94,.055);
}

.za-lot-history-game.is-perfect .za-lot-history-game__badge,
.za-lot-history-game.is-perfect .za-lot-history-game__meta strong{
  color:#86efac;
}

.za-lot-history-game.is-covered{
  border-color:rgba(56,189,248,.22);
  background:rgba(56,189,248,.055);
}

.za-lot-history-game.is-covered .za-lot-history-game__badge,
.za-lot-history-game.is-covered .za-lot-history-game__meta strong{
  color:#7dd3fc;
}

.za-lot-history-game.is-partial,
.za-lot-history-game.is-pending{
  border-color:rgba(250,204,21,.22);
  background:rgba(250,204,21,.055);
}

.za-lot-history-game.is-partial .za-lot-history-game__badge,
.za-lot-history-game.is-partial .za-lot-history-game__meta strong,
.za-lot-history-game.is-pending .za-lot-history-game__badge,
.za-lot-history-game.is-pending .za-lot-history-game__meta strong{
  color:#fde68a;
}

.za-lot-history-game.is-miss{
  border-color:rgba(239,68,68,.22);
  background:rgba(239,68,68,.055);
}

.za-lot-history-game.is-miss .za-lot-history-game__badge,
.za-lot-history-game.is-miss .za-lot-history-game__meta strong{
  color:#fca5a5;
}

@media (max-width:420px){
  .za-lot-history-summary{
    grid-template-columns:1fr;
  }

  .za-lot-history-game{
    grid-template-columns:30px 1fr;
    padding:11px;
  }

  .za-lot-history-game__status{
    width:28px;
    height:28px;
    font-size:14px;
  }

  .za-lot-history-game__teams{
    font-size:12px;
  }
}

/* ------------------------------------------------------------
   12) HISTÓRICO INTELIGENTE · MESMO LAYOUT DO JOGO A JOGO
   ------------------------------------------------------------ */
.za-lot-history-games{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  min-width:0;
}

.za-lot-history-game.za-lot-game{
  grid-template-columns:1fr;
  gap:8px;
}

.za-lot-history-game.is-perfect{
  border-color:rgba(34,197,94,.28);
  background:rgba(34,197,94,.055);
}

.za-lot-history-game.is-covered{
  border-color:rgba(56,189,248,.28);
  background:rgba(56,189,248,.055);
}

.za-lot-history-game.is-partial,
.za-lot-history-game.is-pending{
  border-color:rgba(250,204,21,.24);
  background:rgba(250,204,21,.052);
}

.za-lot-history-game.is-miss{
  border-color:rgba(239,68,68,.30);
  background:rgba(239,68,68,.055);
}

.za-lot-history-result-line{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  padding-top:2px;
  color:var(--za-muted);
  font-size:11px;
  line-height:1.2;
  font-weight:760;
}

.za-lot-history-result-line strong{
  color:var(--za-text-soft);
  font-weight:950;
}

.za-lot-history-status{
  font-weight:900;
}

.za-lot-history-game.is-perfect .za-lot-history-status,
.za-lot-history-game.is-perfect .za-lot-history-result-line strong{
  color:#86efac;
}

.za-lot-history-game.is-covered .za-lot-history-status,
.za-lot-history-game.is-covered .za-lot-history-result-line strong{
  color:#7dd3fc;
}

.za-lot-history-game.is-partial .za-lot-history-status,
.za-lot-history-game.is-partial .za-lot-history-result-line strong,
.za-lot-history-game.is-pending .za-lot-history-status,
.za-lot-history-game.is-pending .za-lot-history-result-line strong{
  color:#fde68a;
}

.za-lot-history-game.is-miss .za-lot-history-status,
.za-lot-history-game.is-miss .za-lot-history-result-line strong{
  color:#fca5a5;
}

/* ------------------------------------------------------------
   13) AJUSTE FINO · BOLINHAS DO HISTÓRICO
   ------------------------------------------------------------
   Regra de semântica visual:
   - opção não assinalada fica neutra;
   - verde/azul/vermelho só aparecem onde há leitura de resultado;
   - vermelho não vaza para opções adjacentes.
   ------------------------------------------------------------ */
.za-lot-history-balls .za-lot-game-ball{
  border-color:rgba(148,163,184,.18);
  background:rgba(148,163,184,.12);
  color:#94a3b8;
  box-shadow:none;
}

.za-lot-history-balls .za-lot-game-ball.is-marked{
  border-color:rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  color:#ffffff;
}

.za-lot-history-balls .za-lot-game-ball.is-result{
  border-color:rgba(255,255,255,.28);
  box-shadow:0 0 0 1px rgba(255,255,255,.06) inset;
}

.za-lot-history-game.is-perfect .za-lot-history-balls .za-lot-game-ball.is-hit{
  border-color:rgba(34,197,94,.48);
  background:rgba(34,197,94,.22);
  color:#bbf7d0;
}

.za-lot-history-game.is-covered .za-lot-history-balls .za-lot-game-ball.is-hit{
  border-color:rgba(56,189,248,.48);
  background:rgba(56,189,248,.20);
  color:#bae6fd;
}

.za-lot-history-balls .za-lot-game-ball.is-extra{
  opacity:.72;
}

.za-lot-history-balls .za-lot-game-ball.is-missed-result{
  border-color:rgba(239,68,68,.46);
  background:rgba(239,68,68,.18);
  color:#fecaca;
}

.za-lot-history-balls .za-lot-game-ball:not(.is-marked):not(.is-missed-result):not(.is-hit){
  border-color:rgba(148,163,184,.18);
  background:rgba(148,163,184,.12);
  color:#94a3b8;
}

@media (max-width:420px){
  .za-lot-history-game.za-lot-game{
    grid-template-columns:1fr;
    padding:11px;
  }

  .za-lot-history-summary{
    grid-template-columns:1fr;
  }
}
