/* =========================================================================
   stats-sidebar :: mod_js_players polish — goleadores + asistencias
   Capturado del DOM real round 6 Bloque B paso 1. Sin vendoring de templates.
   ========================================================================= */

/* Card wrapper por módulo */
.stats-sidebar .moduletable {
  background: #fff;
  border: 1px solid rgba(31, 61, 142, 0.10);
  border-radius: 0;                   /* flat corners — preferencia cliente */
  padding: 22px 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.stats-sidebar .moduletable:last-child { margin-bottom: 0; }

/* Heading */
.stats-sidebar .moduletable > h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.05;
  color: var(--brand-blue, #1F3D8E);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--brand-orange, #ED5A1F);
}

/* Container + counter para rank */
.stats-sidebar .jsm_playerstat {
  counter-reset: rank;
}

/* Outer row wrapper (inline-styled div de JoomSport — override overflow para
   evitar clipping de hover shadows). El inline style="overflow:hidden" requiere
   !important para overrride. */
.stats-sidebar .jsm_playerstat > div {
  overflow: visible !important;
  border-bottom: 1px solid rgba(31, 61, 142, 0.06);
}
.stats-sidebar .jsm_playerstat > div:last-child { border-bottom: none; }

/* Row content — .jsblc-team-info */
.stats-sidebar .jsm_playerstat .jsblc-team-info {
  counter-increment: rank;
  display: block;
  position: relative;
  padding: 11px 0 11px 36px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1a1a1a;
}

/* Rank number absolute izquierda */
.stats-sidebar .jsm_playerstat .jsblc-team-info::before {
  content: counter(rank);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: rgba(31, 61, 142, 0.5);
}

/* Hide ball.png stock — reemplazamos con emoji vía ::after sobre <strong> */
.stats-sidebar .jsm_playerstat .jsblc-team-info img {
  display: none;
}

/* Count pill naranja */
.stats-sidebar .jsm_playerstat .jsblc-team-info strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  font-weight: 800;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--brand-orange, #ED5A1F);
  color: #fff;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

/* Icon emoji default ⚽ via ::after del <strong> */
.stats-sidebar .jsm_playerstat .jsblc-team-info strong::after {
  content: '⚽';
  font-size: 10px;
  margin-left: 1px;
}

/* Discriminator goleo vs asistencias — :has() detecta el title attr del img
   stock. El img está hidden por display:none arriba pero sigue existiendo en
   DOM, así que el selector matchea. Compat: Chrome 105+, FF 121+, Safari 15.4+.
   Plain 'A' (no emoji 🅰) para evitar el bug de monochrome rendering donde el
   negative-squared-A colapsa a un white box con la A "punched out" invisible. */
.stats-sidebar .moduletable:has(img[title="Asistencia"]) .jsblc-team-info strong::after {
  content: 'A';
  font-weight: 800;
}

/* Player name link — el primero de los <a> dentro del row */
.stats-sidebar .jsm_playerstat .jsblc-team-info > a:first-of-type {
  font-weight: 700;
  color: var(--brand-blue, #1F3D8E);
  text-decoration: none;
  transition: color 0.15s;
}
.stats-sidebar .jsm_playerstat .jsblc-team-info > a:first-of-type:hover {
  color: var(--brand-orange, #ED5A1F);
  text-decoration: underline;
}

/* Team links (uno o varios — caso multi-team player) */
.stats-sidebar .jsm_playerstat .jsblc-team-info a:not(:first-of-type) {
  color: rgba(26, 26, 26, 0.55);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}
.stats-sidebar .jsm_playerstat .jsblc-team-info a:not(:first-of-type):hover {
  color: var(--brand-blue, #1F3D8E);
}

/* Top scorer #1 — subtle orange-tint highlight */
.stats-sidebar .jsm_playerstat > div:first-child .jsblc-team-info {
  background: linear-gradient(90deg, rgba(237, 90, 31, 0.06), transparent 60%);
  margin: 0 -8px;
  padding-left: 44px;
  padding-right: 8px;
  border-radius: 0;                   /* flat — alineado con .moduletable card */
}
.stats-sidebar .jsm_playerstat > div:first-child .jsblc-team-info::before {
  color: var(--brand-orange, #ED5A1F);
  font-size: 14px;
  font-weight: 800;
  left: 4px;
}
.stats-sidebar .jsm_playerstat > div:first-child .jsblc-team-info > a:first-of-type {
  font-weight: 800;
}

/* Mobile — más compacto cuando sidebar stack abajo del componente */
@media (max-width: 1024px) {
  .stats-sidebar .moduletable { padding: 18px 16px; }
  .stats-sidebar .moduletable > h3 { font-size: 22px; }
  .stats-sidebar .jsm_playerstat .jsblc-team-info { font-size: 13px; }
}
