/* CoreScore styles - Analysis components (cards, tabs, badges).
   Extraido de css/styles.css em 22/05/2026 (FASE E).
   Carregar APOS styles.css (vars) pra que cascade funcione. */


/* ─── Mensagem central ───────────────────────────────────────────────────── */
.cmsg {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 14px;
  color: var(--text3); text-align: center; padding: 20px;
}
.cmsg h2 { font-size: 16px; font-weight: 700; color: var(--text); }

/* ─── Spinner ────────────────────────────────────────────────────────────── */
.spin {
  width: 30px; height: 30px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .75s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Cards de análise ───────────────────────────────────────────────────── */
.mh {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 18px; margin-bottom: 16px;
}
.mh-top { display: flex; align-items: center; gap: 12px; width: 100%; }
.mh-t   { flex: 1; }
.mh-t h2 { font-size: 17px; font-weight: 800; color: var(--text); }
.mh-t p  { font-size: 11px; color: var(--text2); margin-top: 3px; }
.mh-c    { text-align: center; min-width: 70px; }
.mh-vs   { font-size: 20px; font-weight: 800; color: var(--accent); }
.mh-sc   { font-size: 24px; font-weight: 900; color: var(--text); }
.mh-sub  { font-size: 11px; color: var(--text3); margin-top: 3px; }
.mh-c .score   { font-size: 22px; font-weight: 900; color: var(--text); line-height: 1.1; }
.live-chip { display: inline-block; font-size: 12px; font-weight: 800; color: #fff; background: #ef4444; padding: 2px 8px; border-radius: 6px; animation: pulse 1.4s infinite; margin-top: 3px; }
.time-chip { display: inline-block; font-size: 12px; font-weight: 700; color: var(--text2); background: var(--bg3); border: 1.5px solid var(--border); padding: 2px 8px; border-radius: 6px; margin-top: 3px; }
.ft-chip   { display: inline-block; font-size: 12px; font-weight: 800; color: var(--text2); background: var(--bg3); border: 1.5px solid var(--border); padding: 2px 8px; border-radius: 6px; margin-top: 3px; }

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tabs {
  display: flex; border-bottom: 1.5px solid var(--border);
  margin-bottom: 16px; flex-wrap: wrap;
}
.tbtn {
  padding: 9px 16px; font-size: 12px; cursor: pointer; color: var(--text2);
  background: transparent; border: none; border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px; font-weight: 600; transition: all .18s;
}
.tbtn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tp          { display: none; }
.tp.active   { display: block; }

/* ─── Seção e card genérico ──────────────────────────────────────────────── */
.sec {
  font-size: 11px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: .5px; margin: 0 0 10px;
}
.card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 13px; margin-bottom: 10px;
}
.cl  { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; font-weight: 700; }
.cv  { font-size: 20px; font-weight: 800; color: var(--text); }
.cs  { font-size: 11px; color: var(--text2); margin-top: 3px; line-height: 1.5; }
.pb  { height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; margin-top: 7px; }
.pf  { height: 100%; border-radius: 3px; transition: width .8s; }

/* ─── Grids ──────────────────────────────────────────────────────────────── */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 12px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; margin-bottom: 12px; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 12px; }

/* ─── Barra de resultado ─────────────────────────────────────────────────── */
.rbar {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 14px; margin-bottom: 12px; display: flex; gap: 12px;
}
.ri     { flex: 1; text-align: center; }
.ri p   { font-size: 10px; color: var(--text2); margin-bottom: 6px; font-weight: 600; }
.ri .big { font-size: 24px; font-weight: 800; }

/* ─── Badges de forma ────────────────────────────────────────────────────── */
.fb { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; margin: 0 2px; }
.fw { background: #d1fae5; color: #065f46; } [data-theme="dark"] .fw { background: #065f46; color: #6ee7b7; }
.fd { background: #f3f4f6; color: #374151; } [data-theme="dark"] .fd { background: #374151; color: #9ca3af; }
.fl { background: #fee2e2; color: #991b1b; } [data-theme="dark"] .fl { background: #7f1d1d; color: #fca5a5; }

/* ─── Linha de jogo recente ──────────────────────────────────────────────── */
.gr { display: flex; align-items: center; gap: 7px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.gr:last-child { border-bottom: none; }
.gd { color: var(--text3); min-width: 46px; font-weight: 600; }
.go { flex: 1; color: var(--text); }
.gs { font-weight: 700; color: var(--text); min-width: 40px; text-align: center; }
.gb { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.gw  { background: #d1fae5; color: #065f46; } [data-theme="dark"] .gw  { background: #065f46; color: #6ee7b7; }
.gdr { background: #f3f4f6; color: #374151; } [data-theme="dark"] .gdr { background: #374151; color: #9ca3af; }
.gl  { background: #fee2e2; color: #991b1b; } [data-theme="dark"] .gl  { background: #7f1d1d; color: #fca5a5; }

/* ─── Card de placar ─────────────────────────────────────────────────────── */
.scc      { background: var(--card); border: 1.5px solid var(--border); border-radius: 8px; padding: 12px 8px; text-align: center; }
.scc.top  { border-color: var(--accent); background: #eff6ff; }
[data-theme="dark"] .scc.top { background: #1e2a45; }

/* ─── Notice ─────────────────────────────────────────────────────────────── */
.notice {
  background: #eff6ff; border: 1.5px solid #bfdbfe; border-radius: 8px;
  padding: 10px 14px; font-size: 11px; color: #1d4ed8;
  margin-bottom: 12px; line-height: 1.6;
}
[data-theme="dark"] .notice { background: #1e2a45; border-color: #2d4a7a; color: #93c5fd; }

.lineup-badge-wrap {
  margin-bottom: 14px;
}

.lineup-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
}

.lineup-badge--ok {
  background: #d1fae5;
  color: #065f46;
}

.lineup-badge--pending {
  background: #fef3c7;
  color: #92400e;
}

/* Sprint 12 - Notice de escalacao provavel com ajustes */
.lineup-probable-notice {
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 12px;
}
.lineup-probable-title {
  color: #fcc847;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lineup-probable-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.lineup-probable-side {
  font-weight: 700;
  font-size: 11px;
  color: var(--text);
  margin-bottom: 4px;
}
.lineup-changes {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 11px;
  color: var(--text2);
}
.lineup-changes li {
  padding: 3px 0;
  border-bottom: 1px dashed var(--border);
}
.lineup-changes li:last-child { border-bottom: 0; }
.lineup-changes .lineup-promoted { color: var(--success, #34d399); }
@media (max-width: 640px) {
  .lineup-probable-grid { grid-template-columns: 1fr; }
}

/* Sprint 12 (Etapa 2 fix) - Loading state da escalacao */
.lineup-loading {
  text-align: center;
  padding: 40px 20px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.lineup-loading-spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 14px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: lineup-spin 0.8s linear infinite;
}
@keyframes lineup-spin {
  to { transform: rotate(360deg); }
}
.lineup-loading-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.lineup-loading-hint {
  font-size: 11px;
  color: var(--text3);
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Pre-match: escalacao ainda nao publicada (ambos os lados vazios) */
.lineup-empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.lineup-empty-icon { font-size: 32px; margin-bottom: 14px; opacity: 0.7; }
.lineup-empty-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.lineup-empty-hint {
  font-size: 12px;
  color: var(--text2);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Sprint 12 (Etapa 2) - Campo SVG unificado: home esquerda + away direita */
.rb-field-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  /* Sprint 12 fix: limita largura total do bloco pra header + canvas + bench
     ficarem alinhados (canvas tem max-width 1000px; sem isso, header e bench
     se esticavam pra largura do painel pai). */
  max-width: 1028px;  /* 1000px do canvas + 2*14px de padding */
}
.rb-field-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.rb-field-side-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rb-field-side-name--away {
  color: #34d399;
  text-align: right;
}
.rb-field-formations {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.rb-field-formation {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.rb-field-formation--home { color: var(--accent); border-color: rgba(79, 142, 247, 0.4); }
.rb-field-formation--away { color: #34d399; border-color: rgba(52, 211, 153, 0.4); }
.rb-field-vs { color: var(--text3); font-size: 11px; }

.rb-field-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: #0d4f23;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.4);
}
.rb-field-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.rb-field-players {
  position: absolute;
  inset: 0;
}
.rb-field-player {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  cursor: help;
  width: 50px;
  transition: transform 0.15s;
}
.rb-field-player:hover { transform: translate(-50%, -50%) scale(1.1); z-index: 5; }
.rb-field-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  overflow: hidden;
}
.rb-field-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}
.rb-field-initials {
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  z-index: 1;
  pointer-events: none;
}
.rb-field-number {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: #fff;
  color: #0d4f23;
  font-size: 8px;
  font-weight: 800;
  border-radius: 50%;
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  border: 1px solid #0d4f23;
  font-variant-numeric: tabular-nums;
}
.rb-field-pname {
  margin-top: 3px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58px;
}

/* Sprint 12 (Etapa 3) - Badge de titularidade nos ultimos 6 jogos */
/* Lote 6.2b (Collector SofaScore): rating (pill no avatar) + valor de mercado */
.rb-field-rating {
  position: absolute; top: -4px; left: -4px;
  background: #059669; color: #fff;
  font-size: 8px; font-weight: 800; line-height: 1;
  padding: 2px 4px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.5);
  font-variant-numeric: tabular-nums;
}
.rb-field-mv {
  margin-top: 1px; font-size: 7.5px; font-weight: 700;
  color: #93c5fd; line-height: 1.1; text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.rb-field-titularity {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 5px;
  font-size: 8px;
  font-weight: 800;
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-shadow: none;
  line-height: 1.2;
  border: 1px solid rgba(255,255,255,0.35);
}
.rb-field-titularity.tit-hot {
  background: rgba(34, 197, 94, 0.95);
  color: #fff;
  border-color: rgba(34, 197, 94, 0.8);
}
.rb-field-titularity.tit-warm {
  background: rgba(245, 158, 11, 0.95);
  color: #1a1a1a;
  border-color: rgba(245, 158, 11, 0.8);
}
.rb-field-titularity.tit-cold {
  background: rgba(148, 163, 184, 0.9);
  color: #1a1a1a;
  border-color: rgba(148, 163, 184, 0.75);
}

/* Chip de % medio do time titular (header) */
.rb-field-team-tit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 3px 11px;
  border-radius: 14px;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  border: 1.5px solid transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.rb-field-side-name--away .rb-field-team-tit,
.rb-field-team-tit.rb-field-team-tit--away {
  margin-left: 0;
  margin-right: 8px;
}
.rb-field-team-tit-label {
  font-size: 9px;
  font-weight: 700;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* 31/05/2026: % do time titular bem DESTACADO (numero grande e forte). */
.rb-field-team-tit strong { font-size: 16px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.rb-field-team-tit.tit-hot {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.4);
}
.rb-field-team-tit.tit-warm {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
}
.rb-field-team-tit.tit-cold {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text2);
  border-color: rgba(148, 163, 184, 0.35);
}

/* Sprint 12 (Etapa 4) - Chip "GA X.X" (gols sofridos / jogos) no header */
.rb-field-team-conceded {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.rb-field-side-name--away .rb-field-team-conceded {
  margin-left: 0;
  margin-right: 6px;
}
.rb-field-team-conceded-label {
  font-size: 9px;
  font-weight: 700;
  opacity: 0.8;
  letter-spacing: 0.04em;
}
.rb-field-team-conceded strong { font-size: 11px; font-weight: 900; }

/* Sprint 12 (Etapa 4) - Linha de stats (gols, assists, amarelos) sob o badge titularidade */
.rb-field-stats {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
  max-width: 76px;
  margin-left: auto;
  margin-right: auto;
}
.rb-stat {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 800;
  text-shadow: none;
  white-space: nowrap;
}
.rb-stat b { font-weight: 900; font-size: 11px; font-variant-numeric: tabular-nums; }

/* Gols: destaque com glow verde + bola de futebol SVG */
.rb-stat-goals {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  border: 1.5px solid #fff;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.75), inset 0 0 0 1px rgba(255,255,255,0.3);
  padding: 3px 6px;
  font-size: 11px;
  gap: 3px;
}
.rb-stat-goals b { font-size: 13px; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,0.5); }
.rb-ball-svg {
  width: 13px;
  height: 13px;
  vertical-align: middle;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}

.rb-stat-assists {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: rgba(59, 130, 246, 0.6);
}
.rb-stat-yellow { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); border-color: rgba(245, 158, 11, 0.6); color: #1a1a1a; }
.rb-stat-yellow-risk {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.5), 0 0 6px rgba(239, 68, 68, 0.4);
}
.rb-stat-red {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: rgba(239, 68, 68, 0.7);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

/* Bolinhas vermelhas: gols sofridos pelo time nos jogos do defensor/GK */
.rb-stat-conceded {
  background: rgba(120, 30, 30, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.7);
  padding: 2px 4px;
  gap: 1px;
}
.rb-ball-conceded {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fca5a5 0%, #ef4444 50%, #991b1b 100%);
  border: 1px solid #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.7), inset 0 0 2px rgba(255,255,255,0.3);
  margin-right: 0;
  vertical-align: middle;
}
.rb-ball-conceded + .rb-ball-conceded { margin-left: -1px; }

/* Placeholder para lado do campo sem dados (sem lineup nem historico) */
.rb-field-empty-side {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 38%;
  color: #e5e7eb;
  padding: 12px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.rb-field-empty-icon { font-size: 22px; opacity: 0.6; margin-bottom: 6px; }
.rb-field-empty-title { font-size: 13px; font-weight: 800; margin-bottom: 4px; }
.rb-field-empty-hint { font-size: 11px; color: #d1d5db; opacity: 0.9; line-height: 1.4; }

/* Banco - lista lateral abaixo do campo */
.rb-bench-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.rb-bench-group { min-width: 0; }
.rb-bench-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.rb-bench-item {
  display: grid;
  grid-template-columns: 24px 1fr 26px;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  font-size: 11px;
  border-bottom: 1px dashed var(--border);
  cursor: help;
}
.rb-bench-item:last-child { border-bottom: 0; }
.rb-bench-num {
  background: var(--bg3);
  color: var(--text2);
  font-weight: 700;
  text-align: center;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}
.rb-bench-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.rb-bench-pos {
  font-size: 9px;
  color: var(--text3);
  text-align: right;
  font-weight: 700;
}

@media (max-width: 760px) {
  .rb-bench-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .rb-field-player { width: 44px; }
  .rb-field-avatar { width: 26px; height: 26px; }
  .rb-field-pname { font-size: 8px; max-width: 50px; }
}