/* =========================================================
   FRZ - Torneios
   CSS público para tabelas, jogos, artilharia, cards e mata-mata
========================================================= */

:root {
  --frz-primary: #06aa48;
  --frz-primary-dark: #04883a;
  --frz-bg: #f5f7f8;
  --frz-card: #ffffff;
  --frz-border: #e5e7eb;
  --frz-text: #1f2937;
  --frz-muted: #6b7280;
  --frz-soft-green: #e8f8ef;
  --frz-red: #dc2626;
  --frz-blue: #2563eb;
  --frz-cyan: #06b6d4;
  --frz-yellow: #f59e0b;
  --frz-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --frz-radius: 14px;
}

.frz-torneio-tabela-wrap,
.frz-torneio-jogos,
.frz-torneio-artilheiros,
.frz-torneio-card,
.frz-torneio-bracket {
  font-family: inherit;
  color: var(--frz-text);
  box-sizing: border-box;
}

.frz-torneio-tabela-wrap *,
.frz-torneio-jogos *,
.frz-torneio-artilheiros *,
.frz-torneio-card *,
.frz-torneio-bracket * {
  box-sizing: border-box;
}

/* Tabela de classificação */
.frz-torneio-tabela-wrap {
  width: 100%;
  background: var(--frz-card);
  border: 1px solid var(--frz-border);
  border-radius: var(--frz-radius);
  box-shadow: var(--frz-shadow);
  overflow: hidden;
  margin: 24px 0;
}

.frz-torneio-tabela {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: transparent;
}

.frz-torneio-tabela thead {
  background: linear-gradient(135deg, var(--frz-primary), var(--frz-primary-dark));
  color: #fff;
}

.frz-torneio-tabela th {
  padding: 14px 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: center;
  white-space: nowrap;
  border: none;
}

.frz-torneio-tabela th:nth-child(2),
.frz-torneio-tabela td.frz-torneio-team {
  text-align: left;
}

.frz-torneio-tabela td {
  padding: 13px 10px;
  font-size: 14px;
  text-align: center;
  border-bottom: 1px solid var(--frz-border);
  vertical-align: middle;
}

.frz-torneio-tabela tbody tr {
  transition: background .18s ease;
}

.frz-torneio-tabela tbody tr:hover {
  background: #f9fafb;
}

.frz-torneio-tabela tbody tr:last-child td {
  border-bottom: none;
}

.frz-torneio-tabela-row td:first-child {
  border-left: 5px solid var(--frz-row-zone-color, transparent);
}

.frz-torneio-tabela tbody tr:nth-child(-n+4) td:first-child {
  border-left-color: var(--frz-row-zone-color, var(--frz-blue));
}

.frz-torneio-tabela tbody tr:nth-child(n+5):nth-child(-n+6) td:first-child {
  border-left-color: var(--frz-row-zone-color, var(--frz-cyan));
}

.frz-torneio-tabela tbody tr:nth-child(n+7):nth-child(-n+12) td:first-child {
  border-left-color: var(--frz-row-zone-color, var(--frz-primary));
}

.frz-torneio-tabela tbody tr:nth-last-child(-n+4) td:first-child {
  border-left-color: var(--frz-row-zone-color, var(--frz-red));
}

.frz-torneio-team {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--frz-text);
}

.frz-torneio-team small {
  color: var(--frz-muted);
  font-size: 11px;
  font-weight: 800;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 2px 7px;
}

.frz-torneio-team-logo,
.frz-torneio-tabela img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: 0 0 28px;
}

.frz-torneio-points {
  font-weight: 900;
  color: var(--frz-primary-dark);
}

.frz-form-sequence {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.frz-form-sequence span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
}

.frz-form-v { background: var(--frz-primary); }
.frz-form-e { background: var(--frz-yellow); }
.frz-form-d { background: var(--frz-red); }

/* Lista de jogos */
.frz-torneio-jogos {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.frz-torneio-jogo {
  background: var(--frz-card);
  border: 1px solid var(--frz-border);
  border-radius: var(--frz-radius);
  box-shadow: var(--frz-shadow);
  padding: 18px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.frz-torneio-jogo:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
}

.frz-torneio-jogo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--frz-muted);
}

.frz-torneio-jogo-meta span {
  background: #f3f4f6;
  border-radius: 999px;
  padding: 5px 10px;
}

.frz-torneio-jogo-times {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.frz-torneio-jogo-time {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  min-width: 0;
}

.frz-home-team,
.frz-torneio-jogo-time:first-child {
  justify-content: flex-end;
  text-align: right;
}

.frz-away-team,
.frz-torneio-jogo-time:last-child {
  justify-content: flex-start;
  text-align: left;
}

.frz-torneio-jogo-time img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 34px;
}

.frz-torneio-jogo-placar {
  min-width: 86px;
  background: #111827;
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.frz-torneio-gols {
  margin: 14px 0 0;
  padding: 14px 0 0 20px;
  border-top: 1px dashed var(--frz-border);
  font-size: 13px;
  color: var(--frz-muted);
}

/* Artilharia */
.frz-torneio-artilheiros {
  background: var(--frz-card);
  border: 1px solid var(--frz-border);
  border-radius: var(--frz-radius);
  box-shadow: var(--frz-shadow);
  overflow: hidden;
  margin: 24px 0;
}

.frz-torneio-artilheiro {
  display: grid;
  grid-template-columns: 44px 48px 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--frz-border);
}

.frz-torneio-artilheiro:last-child {
  border-bottom: none;
}

.frz-torneio-artilheiro:hover {
  background: #f9fafb;
}

.frz-torneio-artilheiro-posicao {
  width: 34px;
  height: 34px;
  background: var(--frz-soft-green);
  color: var(--frz-primary-dark);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.frz-torneio-artilheiro-foto {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  object-fit: cover;
  background: #f3f4f6;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--frz-border);
}

.frz-torneio-artilheiro-nome {
  font-weight: 900;
  color: var(--frz-text);
  line-height: 1.2;
}

.frz-torneio-artilheiro-time {
  display: block;
  margin-top: 3px;
  color: var(--frz-muted);
  font-size: 13px;
  font-weight: 500;
}

.frz-torneio-artilheiro-gols {
  background: linear-gradient(135deg, var(--frz-primary), var(--frz-primary-dark));
  color: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 58px;
  text-align: center;
  font-weight: 900;
}

.frz-torneio-artilheiro-gols small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  opacity: .85;
  text-transform: uppercase;
}

.frz-torneio-artilheiro-extra {
  color: var(--frz-muted);
  font-size: 12px;
  font-weight: 800;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 5px 8px;
}

.frz-torneio-empty,
.frz-torneio-sem-dados {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: var(--frz-radius);
  padding: 18px;
  font-weight: 700;
  margin: 18px 0;
}

/* Card */
.frz-torneio-card {
  background: linear-gradient(135deg, #fff, #f9fafb);
  border: 1px solid var(--frz-border);
  border-radius: var(--frz-radius);
  box-shadow: var(--frz-shadow);
  padding: 22px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.frz-torneio-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--frz-border);
  padding: 10px;
}

.frz-torneio-nome {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  color: var(--frz-text);
}

.frz-torneio-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--frz-muted);
  font-size: 13px;
}

.frz-torneio-meta span {
  background: var(--frz-soft-green);
  color: var(--frz-primary-dark);
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 800;
}

.frz-torneio-stage-list {
  margin: 12px 0 0;
}

/* Mata-mata */
.frz-torneio-bracket {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 8px 4px 18px;
  margin: 24px 0;
}

.frz-torneio-bracket-round {
  min-width: 240px;
  background: var(--frz-card);
  border: 1px solid var(--frz-border);
  border-radius: var(--frz-radius);
  box-shadow: var(--frz-shadow);
  padding: 14px;
}

.frz-torneio-bracket-round-title {
  font-weight: 900;
  color: var(--frz-primary-dark);
  margin-bottom: 12px;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: .04em;
}

.frz-torneio-bracket-match {
  border: 1px solid var(--frz-border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #fff;
}

.frz-torneio-bracket-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  font-weight: 800;
  border-bottom: 1px solid var(--frz-border);
}

.frz-torneio-bracket-team:last-child { border-bottom: none; }
.frz-torneio-bracket-team.is-winner { background: var(--frz-soft-green); color: var(--frz-primary-dark); }
.frz-torneio-bracket-score { font-weight: 900; color: var(--frz-text); }

@media (max-width: 768px) {
  .frz-torneio-tabela-wrap { overflow-x: auto; }
  .frz-torneio-tabela { min-width: 860px; }
  .frz-torneio-jogo-times { grid-template-columns: 1fr; text-align: center; }
  .frz-torneio-jogo-time,
  .frz-home-team,
  .frz-away-team,
  .frz-torneio-jogo-time:first-child,
  .frz-torneio-jogo-time:last-child { justify-content: center; text-align: center; }
  .frz-torneio-jogo-placar { margin: 0 auto; }
  .frz-torneio-card { flex-direction: column; align-items: flex-start; }
  .frz-torneio-nome { font-size: 21px; }
  .frz-torneio-artilheiro { grid-template-columns: 34px 44px 1fr auto; }
  .frz-torneio-artilheiro-extra { display: none; }
}

@media (max-width: 480px) {
  .frz-torneio-jogo { padding: 14px; }
  .frz-torneio-jogo-meta { font-size: 12px; }
  .frz-torneio-artilheiro { grid-template-columns: 34px 1fr auto; padding: 12px; }
  .frz-torneio-artilheiro-foto { display: none; }
}
