/* ==========================================================
   Página "ao vivo" (usa as variáveis de cores de estilo.css)
   ========================================================== */

.ao-vivo { max-width: 1440px; margin: 0 auto; padding: 24px; }

/* Três colunas: mandante | centro | visitante. No celular, empilha. */
.grade-ao-vivo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.coluna-centro { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 1100px) {
  .grade-ao-vivo { grid-template-columns: 1fr; gap: 14px; }
  .coluna-centro { order: -1; gap: 14px; }  /* placar primeiro no celular */
  .ao-vivo { padding: 14px; }
}

/* ---------- Painel do time ---------- */
.painel-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12px;
}
.painel-nome { font-size: 16px; font-weight: 800; letter-spacing: -0.2px; }
.formacao {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--linha);
  border: 1px solid var(--borda);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

/* Campo: ataque em cima, goleiro embaixo */
.campo {
  --risca: rgba(255, 255, 255, 0.22);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 6px;
  min-height: 480px;
  padding: 18px 6px 14px;
  border-radius: 14px;
  border: 2px solid var(--risca);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.2)),
    repeating-linear-gradient(180deg, #1c6b3a 0 48px, #19603a 48px 96px);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.campo::before {  /* círculo central (metade, no topo) */
  content: "";
  position: absolute;
  left: 50%;
  top: -64px;
  width: 128px;
  height: 128px;
  transform: translateX(-50%);
  border: 2px solid var(--risca);
  border-radius: 50%;
}
.campo::after {  /* grande área (embaixo) */
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 56%;
  height: 74px;
  transform: translateX(-50%);
  border: 2px solid var(--risca);
  border-bottom: none;
}
.linha-campo {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-around;
}

.jogador-campo {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 76px;
  text-align: center;
}
.jogador-campo.expulso { opacity: 0.35; filter: grayscale(1); }
.foto-jogador {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid;
  background: var(--cartao);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 6px 14px rgba(0, 0, 0, 0.45);
}
.foto-jogador img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.numero {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
}
.numero-grande {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 16px;
  font-weight: 800;
}
.nota {
  position: absolute;
  bottom: -6px;
  left: -14px;
  padding: 0 5px;
  border-radius: 6px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
}
.nota-boa { background: #16a34a; }
.nota-media { background: #ca8a04; }
.nota-ruim { background: #dc2626; }
.nome-campo {  /* nome sobre uma "etiqueta" escura: legível em qualquer cor */
  max-width: 100%;
  margin-top: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
}
.icones-campo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 16px;
  margin-top: 3px;
}
.entrou { color: #4ade80; font-size: 11px; font-weight: 700; }
.saiu { margin-left: 8px; color: #f87171; font-size: 11px; font-weight: 700; }

/* Ícones (bola, cartões, VAR...) */
.ic-bola { width: 14px; height: 14px; flex-shrink: 0; }
.gol-contra .ic-bola circle { fill: #fca5a5; }
.ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ic-cartao { width: 10px; height: 14px; border-radius: 2px; transform: rotate(8deg); }
.ic-cartao.amarelo { background: var(--amarelo); }
.ic-cartao.vermelho { background: var(--ao-vivo); }
.ic-sub { color: #4ade80; font-size: 14px; font-weight: 800; }
.ic-var {
  padding: 1px 4px;
  border-radius: 4px;
  background: #e5e7eb;
  color: #111;
  font-size: 9px;
  font-weight: 800;
}
.ic-perdido { color: #f87171; font-size: 14px; font-weight: 800; }

/* Reservas */
.titulo-bloco {
  margin: 18px 0 8px;
  color: var(--texto-suave);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.reservas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 14px; }
.reserva {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--borda);
  color: var(--texto-suave);
  font-size: 12px;
}
.reserva .nome { flex: 1; }
.reserva.entrou-jogo { color: var(--texto); font-weight: 600; }
.numero-reserva {
  min-width: 24px;
  padding: 1px 0;
  border-radius: 6px;
  background: var(--linha);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

/* ---------- Placar ---------- */
.placar-ao-vivo { background: linear-gradient(180deg, #16202b, var(--cartao)); }
.placar-linha {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.placar-lado {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}
.relogio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--linha);
  font-size: 13px;
  font-weight: 800;
}
.ao-vivo-badge { background: var(--ao-vivo); color: #fff; }
.ao-vivo-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: piscar 1.2s ease-in-out infinite;
}
@keyframes piscar { 50% { opacity: 0.2; } }

/* ---------- Lances ---------- */
.lista-lances { max-height: 440px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.lance-ao-vivo {
  display: grid;
  grid-template-columns: 46px 22px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 9px 10px;
  border-radius: var(--raio-pequeno);
  background: var(--cartao-2);
  border-left: 3px solid transparent;
  font-size: 13px;
}
.lance-ao-vivo .minuto { font-weight: 800; color: var(--texto); }
.lance-ao-vivo .texto-suave { font-size: 11px; }
.lance-mandante { border-left-color: var(--destaque); }
.lance-visitante { border-left-color: var(--azul); }
.lance-gol { background: linear-gradient(90deg, rgba(34, 197, 94, 0.14), var(--cartao-2) 70%); }
.lance-gol .lance-texto > div:first-child { font-weight: 700; }
.icone-lance { display: flex; justify-content: center; }
.icone-lance .ic-bola { width: 18px; height: 18px; }
.icone-lance .ic-cartao { width: 12px; height: 16px; }

/* ---------- Estatísticas ---------- */
.estatistica-ao-vivo { padding: 7px 0; }
.estatistica-valores {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  font-size: 13px;
  text-align: center;
}
.estatistica-valores strong { font-weight: 600; color: var(--texto-suave); }
.estatistica-valores strong.maior { font-weight: 800; color: var(--texto); }
.estatistica-valores .texto-suave { font-size: 12px; }
.barra-estatistica { display: flex; gap: 4px; height: 6px; margin-top: 6px; }
.barra-a, .barra-b { border-radius: 3px; background: var(--linha-forte); transition: width 0.4s; }
.estatistica-ao-vivo:has(strong.maior:first-child) .barra-a { background: var(--destaque); }
.estatistica-ao-vivo:has(strong.maior:last-child) .barra-b { background: var(--azul); }

/* ---------- Replay ---------- */
.botao-assistir {
  display: block;
  margin: 16px auto 0;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: var(--destaque);
  color: var(--destaque-escuro);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.3);
  transition: transform 0.12s, filter 0.12s;
}
.botao-assistir:hover { filter: brightness(1.08); transform: translateY(-1px); }

.barra-replay {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(860px, calc(100% - 24px));
  padding: 10px 16px;
  transform: translateX(-50%);
  background: rgba(18, 24, 32, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--linha-forte);
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
body.com-barra-replay { padding-bottom: 96px; }
.barra-replay input[type="range"] { flex: 1; min-width: 140px; accent-color: var(--destaque); }
.botao-replay, .botao-velocidade {
  border: none;
  background: var(--linha);
  color: var(--texto);
  font: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.botao-replay { width: 36px; height: 36px; border-radius: 50%; font-size: 15px; }
.botao-replay:hover, .botao-velocidade:hover { background: var(--linha-forte); }
.botao-replay.principal { background: var(--destaque); color: var(--destaque-escuro); }
.velocidades { display: flex; gap: 4px; }
.botao-velocidade { padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.botao-velocidade.ativa { background: var(--destaque); color: var(--destaque-escuro); }
#replay-relogio { min-width: 56px; justify-content: center; margin-top: 0; }
.barra-replay .link-rodada-atual { margin: 0; }
@media (max-width: 600px) {
  .barra-replay { border-radius: 18px; bottom: 10px; }
}

/* Destaque do lance que acabou de acontecer */
@keyframes destaque-lance {
  from { background: rgba(250, 204, 21, 0.35); }
}
.lance-ao-vivo.novo { animation: destaque-lance 2s ease-out; }
@keyframes pulso-gol {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); color: var(--destaque); }
}
.gol-agora .placar-grande { animation: pulso-gol 0.6s ease-in-out 3; }

/* ---------- O que está em jogo ---------- */
.impacto { border-color: rgba(250, 204, 21, 0.25); }
.impacto-linha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
  padding: 10px;
  margin: 0 -10px;
  border-radius: var(--raio-pequeno);
}
.impacto-linha + .impacto-linha { border-top: 1px solid var(--borda); }
.impacto-time { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.impacto-time .time { font-weight: 700; }
.impacto-rotulo { padding-left: 32px; color: var(--texto-suave); font-size: 12px; }
.impacto-valor { display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; }
.impacto-valor strong { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; min-width: 64px; text-align: right; }
.delta { font-size: 12px; font-weight: 800; white-space: nowrap; }
.delta.bom { color: #4ade80; }
.delta.ruim { color: #f87171; }
.cenarios { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding-left: 32px; }
.cenario {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cartao-2);
  border: 1px solid var(--borda);
  color: var(--texto-suave);
  font-size: 12px;
}
.cenario strong { color: var(--texto); font-weight: 700; }
.cenario.atual { border-color: var(--amarelo); background: rgba(250, 204, 21, 0.12); color: var(--texto); }
.impacto .titulo-bloco { margin-top: 14px; }
.impacto-nota { margin: 12px 0 0; color: var(--texto-fraco); font-size: 11px; }
.impacto-nota a { color: var(--destaque); text-decoration: none; font-weight: 600; }

/* Quando o número muda (gol!), a linha pisca */
@keyframes mudou-chance {
  0% { background: rgba(250, 204, 21, 0.28); }
  100% { background: transparent; }
}
.impacto-linha.mudou { animation: mudou-chance 1.8s ease-out; }
@media (prefers-reduced-motion: reduce) { .impacto-linha.mudou { animation: none; } }
@media (max-width: 600px) {
  .impacto-rotulo, .cenarios { padding-left: 0; }
  .impacto-valor strong { font-size: 22px; min-width: 52px; }
}
