/* =================================================================
   COMPONENTS.CSS  Cards, tabelas, bot�es, badges, seletores
   Edite aqui: estilo visual dos blocos, mercados, match rows
   ================================================================= */

/* ---------- CARD GEN�RICO ---------- */
.card {
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: 12px;
  overflow: hidden;
  height: fit-content;
}
.card-hd {
  background: var(--bg3);
  padding: 15px 20px;
  border-bottom: 1px solid var(--bdr);
  display: flex;
  justify-content: space-between;
}
.card-ttl {
  font-family: 'Oswald', sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--y);
}

/* ---------- TABELA DE CLASSIFICA��O ---------- */
/* FASE 42.10: width:auto permite o conte�do se expandir e o overflow-x:auto
   do .table-container pai gerar scroll horizontal. Sem isso, width:100%
   for�ava a tabela a caber no container, esmagando a coluna Retrospecto. */
.st {
  width: auto !important;
  min-width: 100%;
  border-collapse: collapse;
  display: table;
}
/* FASE 42.10: MODO DETALHADO  for�a largura m�nima pra TODAS as 11 colunas
   ficarem vis�veis, gerando scroll horizontal nativo quando o container for
   menor que 900px. O usu�rio arrasta a tabela lateralmente sem quebrar layout. */
#st-table.st-mode-detalhada {
  width: max-content !important;
  min-width: 900px !important;
  display: table !important;
}
/* FASE 42.10: MODO RESUMIDO  a tabela se ajusta sem scroll porque as
   colunas escondidas (GM, GS, Retrospecto) deixam a tabela estreita. */
#st-table.st-mode-resumida {
  width: 100% !important;
  min-width: 0 !important;
}
.st th {
  background: var(--bg4);
  padding: 12px 8px;
  font-size: 9px; color: var(--t3);
  text-transform: uppercase;
  border-bottom: 1px solid var(--bdr);
  text-align: center;
}
.st td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--bdr);
  font-size: 12px;
  text-align: center;
}
.st tr:hover { background: var(--bg3); cursor: pointer; }
.td-tm { display: flex; align-items: center; gap: 8px; text-align: left; }

/* FASE 42.4: ESCUDO (sigla) FIXO e COMPACTO  45x30px, sem ellipsis.
   A coluna do escudo (`.sh`) N�O pode ter min-width largo. */
.st .sh,
.sel-block .sh,
.td-tm > .sh {
  width: 45px !important;
  min-width: 45px !important;
  max-width: 45px !important;
  height: 30px !important;
  flex: 0 0 45px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
}

/* FASE 42.4: NOME DO TIME (span) com elipse  anti-esmagamento
   quando a sidebar abre. min-width garante legibilidade; max-width +
   ellipsis impede overflow horizontal. */
.team-name-text {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  display: block;
}
/* Container flex .td-tm: escudo + nome lado a lado, com gap m�nimo */
.td-tm {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  min-width: 0;
}

/* ---------- SHIELD (escudo placeholder) ---------- */
/* FASE 45.1: Sofascore  escudos 100% transparentes na tabela.
   overflow:hidden garante que o border-radius circular funcione no <img>.
   O TM CDN badge � retangular com fundo escuro  overflow:hidden + border-radius
   cria um c�rculo que CLIP a imagem, mas o fundo escuro DO PNG BATEADO continua.
   A solu��o completa requer badges SVG sem fundo (Sofascore-style).       */
.sh {
  background: transparent !important;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50% !important;  /* circular  clip da img */
  width: 28px; height: 28px;
  overflow: hidden !important;   /* FASE 45.1: clipe o img */
  box-shadow: none !important;
  flex-shrink: 0;
}
.sh img {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
  font-size: 10px; font-weight: bold; color: var(--y);
}

/* ---------- FORMA (V/E/D) ---------- */
.forma-letra {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  color: #fff; font-size: 10px; font-weight: bold;
  margin: 0 2px;
}

/* ---------- BLOCO SELETOR / SEL-BLOCK ---------- */
.sel-block {
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: 12px;
  padding: 15px;
}
.sel-hd {
  font-family: 'Oswald', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--y);
  margin-bottom: 15px;
  text-transform: uppercase;
}

/* ---------- COMPARADOR R�PIDO ---------- */
.sel-row {
  display: grid;
  grid-template-columns: 1fr 30px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 15px;
}
.sslot {
  text-align: center;
  padding: 10px;
  border: 2px dashed var(--bdr);
  border-radius: 8px;
  transition: all .3s;
}
.sslot.sh-s { border-color: var(--g); background: rgba(34,197,94,.1); }
.sslot.sa-s { border-color: var(--r); background: rgba(239,68,68,.1); }
.vs-lbl { text-align: center; font-size: 10px; font-weight: bold; color: var(--y); }
.ssn { font-size: 10px; font-weight: 600; color: var(--t); margin-top: 5px; }

/* ---------- BOT�O COMPARAR ---------- */
.cmp-btn {
  width: 100%; padding: 12px;
  background: var(--y); color: #000;
  border: none; border-radius: 8px;
  font-size: 11px; font-weight: 700;
  cursor: pointer; transition: all .2s;
}
.cmp-btn:disabled { background: var(--bg3); color: var(--t3); cursor: not-allowed; }
.cmp-btn:hover:not(:disabled) { background: #ffd93d; }

/* ---------- TEAM HERO ---------- */
/* FASE 60.8: gap:20px, padding:24px, overflow:visible no th-logo */
.team-hero {
  background-size: cover !important;
  background-position: center !important;
  background-blend-mode: overlay;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 20px; justify-content: flex-start;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  max-height: 200px;
}
/* FASE 45.1: Sofascore style  escudos SEM fundo, 100% transparente.
   overflow:hidden garante clip circular no <img> do TM CDN. */
.th-logo {
  background: transparent !important;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: bold; color: #fff;
  overflow: visible !important;
  box-shadow: none !important;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
}
.th-logo img {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------- ABAS DE TIME ---------- */
/* FASE 47.1: defesa em profundidade - tabs SEMPRE horizontais */
.team-tabs,
.team-tabs.team-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px 18px !important;
  border-bottom: 1px solid var(--bdr);
  margin-bottom: 20px;
  list-style: none;
  padding: 0;
}
.team-tabs .t-tab,
.t-tab {
  display: inline-flex !important;
  align-items: center !important;
  padding: 10px 14px;
  font-size: 12px; font-weight: 600;
  color: var(--t3); cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.team-tabs .t-tab:hover,
.t-tab:hover { color: var(--y); }
.team-tabs .t-tab.active,
.t-tab.active { color: var(--y); border-color: var(--y); }

/* ---------- MATCH ROW (jogos passados / pr�ximos) ---------- */
.match-list { display: flex; flex-direction: column; }
.match-row {
  display: flex; align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--bdr);
  gap: 10px;
  background: var(--bg3);
  transition: background 0.2s;
  border-radius: 6px;
  margin-bottom: 5px;
}
.match-row:hover { background: var(--bg4); cursor: pointer; }
.m-date { display: flex; flex-direction: column; width: 45px; font-size: 11px; color: var(--t2); text-align: center; }
.m-teams { flex: 1; display: flex; flex-direction: column; padding-left: 10px; border-left: 1px solid var(--bdr); }
.m-comp { font-size: 10px; font-weight: bold; color: var(--y); margin-bottom: 6px; }
.m-team-line { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--t2); margin-bottom: 4px; }
.m-score { font-family: 'Oswald', sans-serif; font-weight: 700; color: #fff; }
.m-badge { width: 22px; height: 22px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; color: #fff; margin-left: 10px; }
.win-badge  { background: var(--g); }
.draw-badge { background: #6b7280; }
.loss-badge { background: var(--r); }

/* ---------- BET CARD (cart�o clic�vel de mercado) ---------- */
.bet-card {
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  user-select: none;
}
.bet-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.bet-card.selected { border-color: var(--y) !important; background: rgba(245,200,0,0.08); }
.bet-card.selected::after { content: ''; position: absolute; top: 10px; right: 10px; color: var(--y); font-weight: bold; font-size: 16px; }

/* ---------- CONFIAN�A DO MERCADO ---------- */
.high-conf   { border: 1px solid var(--g); background: linear-gradient(135deg, rgba(34,197,94,0.1) 0%, rgba(0,0,0,0) 100%); }
.normal-conf { border: 1px solid var(--bdr); opacity: 0.8; }

/* ---------- COMPACT GRID (cards compactos) ---------- */
.compact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 10px; margin-bottom: 12px; }
.compact-card { background: #0f172a; border: 1px solid #1e293b; border-radius: 6px; overflow: hidden; }
.compact-hd { padding: 8px 10px; background: #1e293b; font-size: 10px; font-weight: 700; text-transform: uppercase; display: flex; justify-content: space-between; align-items: center; }
.compact-body { padding: 6px; }
.compact-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 11px; }
.compact-row:last-child { border: 0; }

/* ============================================================
   FASE 42.9: TOGGLE BUTTONS (Resumida / Detalhada) + MODO COMPACTO
   ============================================================ */

/* Bot�es do toggle (estado normal) */
.st-toggle-btn {
  background: var(--bg3);
  color: var(--t2);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.st-toggle-btn:hover {
  background: var(--bg4);
  color: var(--t);
  border-color: var(--y);
}
/* Bot�o ativo (selecionado) */
.st-toggle-btn.active {
  background: var(--y);
  color: #000;
  border-color: var(--y);
  box-shadow: 0 0 8px rgba(245, 200, 0, 0.3);
}

/* FASE 42.9: MODO RESUMIDO  esconde colunas GM, GS e Retrospecto */
#st-table.st-mode-resumida .st-col-detail,
#st-table.st-mode-resumida .st-col-retrospecto,
#st-table.st-mode-resumida td.st-col-detail,
#st-table.st-mode-resumida td.st-col-retrospecto {
  display: none !important;
}
/* FASE 42.9: MODO DETALHADO  todas as 11 colunas vis�veis (default) */
#st-table.st-mode-detalhada .st-col-detail,
#st-table.st-mode-detalhada .st-col-retrospecto,
#st-table.st-mode-detalhada td.st-col-detail,
#st-table.st-mode-detalhada td.st-col-retrospecto {
  display: table-cell;
}
/* Quando modo resumido, o body da tabela se ajusta melhor */
#st-table.st-mode-resumida {
  min-width: 480px;
}

/* ---------- FASE 42.17: TABELA DE M�TRICAS DETALHADAS (CASA/FORA/GERAL) ---------- */
/* Vers�o COMPACTA mas COM RESPIRO entre colunas  corrigido FASE 42.16
   (que ficou colado). Usa separador visual entre zonas (CASA/FORA/GERAL). */
.st-metricas {
  width: 100% !important;
  min-width: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  table-layout: auto;
}
.st-metricas th {
  background: var(--bg4);
  padding: 7px 10px;
  font-size: 9px;
  color: var(--t3);
  text-transform: uppercase;
  border-bottom: 1px solid var(--bdr);
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
/* Separador visual entre zonas (CASA | FORA | GERAL) */
.st-metricas th.zona-casa  { border-right: 2px solid var(--y); }
.st-metricas th.zona-fora  { border-right: 2px solid var(--y); }
.st-metricas th.metricas-th-grupo {
  background: var(--bg3);
  color: var(--y);
  font-size: 10px;
  padding: 8px 10px;
  border-bottom: 2px solid var(--y);
}
/* FASE 42.18: linha amarela CONT�NUA sob a �ltima linha do thead
   (FAV/CON) e tamb�m sob o "M�trica" (rowspan=2). Sem isso, a linha
   amarela fica quebrada  M�TRICA tem borda curta, FAV/CON t�m borda
   1px normal. */
.st-metricas thead tr:last-child th {
  border-bottom: 2px solid var(--y);
}
.st-metricas thead tr:first-child th.metricas-metric {
  /* "M�trica" tem rowspan=2  borda amarela j� vem de .metricas-th-grupo,
     mas garantimos tamb�m aqui pra evitar 1px gap visual */
  border-bottom: 2px solid var(--y);
}
.st-metricas td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--bdr);
  font-size: 13px;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  white-space: nowrap;
}
.st-metricas td.zona-casa { border-right: 2px solid var(--y); }
.st-metricas td.zona-fora { border-right: 2px solid var(--y); }
.st-metricas td.metricas-metric {
  text-align: left;
  font-family: inherit;
  font-weight: 600;
  color: var(--t);
  background: rgba(255,255,255,0.02);
  min-width: 140px;
  font-size: 12px;
}
.st-metricas td.metricas-fav { color: var(--g); }
.st-metricas td.metricas-con { color: var(--r); }
.st-metricas tr:hover td { background: rgba(245,200,0,0.06); }
.st-metricas tr:last-child td { border-bottom: none; }
/* Container com scroll horizontal s� se for�ar tamanho menor que 700px */
.st-metricas-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}

/* ---------- FASE 42.19: LINHAS DO CALEND�RIO (Hist�rico + Pr�ximos) ---------- */
/* Grid 6 colunas: COMPETI��O (120px) | DATA (60px) | TIME1 (flex) | PLACAR (60px) | TIME2 (flex) | BADGE (30px) */
.cal-row {
  display: grid;
  grid-template-columns: 120px 60px 1fr 60px 1fr 30px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--bdr);
  font-size: 12px;
  transition: background 0.15s;
}
.cal-row:hover {
  background: rgba(245,200,0,0.04);
}
.cal-row .cal-comp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-content: center;
}
.cal-row .cal-date {
  color: var(--t2);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.cal-row .cal-team {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-row .cal-team-left  { text-align: right; }
.cal-row .cal-team-right { text-align: left; }
.cal-row .cal-placar {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  text-align: center;
  background: var(--bg3);
  border-radius: 3px;
  padding: 3px 0;
  min-width: 50px;
}
.cal-row .cal-placar-prox {
  font-weight: 700;
  color: var(--t3);
  font-size: 11px;
  text-align: center;
}
.cal-row .cal-badge { text-align: center; }
.cal-row .cal-venue {
  font-size: 9px;
  color: var(--t3);
  text-align: center;
  font-weight: 700;
}

/* === CORREÇÃO FORÇADA DE ESCUDOS E SIDEBAR === */
.th-logo, .club-badge, .team-logo, .th-logo-container {
    background: transparent !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
}
.th-logo img, .club-badge img, .team-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.4)) !important;
}
#left-sidebar, .sidebar {
    top: 60px !important;
    height: calc(100vh - 60px) !important;
    width: 220px !important;
}

/* === FIX TOPSIDE & BANNER ESCUDOS === */
.th-logo, .club-badge, .team-logo, .th-logo-container {
    background: transparent !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
}
.th-logo img, .club-badge img, .team-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.4)) !important;
}
#left-sidebar, .sidebar {
    top: 60px !important;
    height: calc(100vh - 60px) !important;
    width: 220px !important;
}
.retrospective-circle, .rank-circle {
    border-radius: 50% !important;
}