/* Rànquing de jugadors i fitxa individual. Comparteix el xassís de pantalla amb
   el panell d'administració (training.css): capçalera fixa i scroll vertical.
   El que aporta ací és la taula: en un mòbil no caben deu columnes, així que la
   taula rodola en horitzontal i la foto es queda enganxada a l'esquerra. */

.players-screen,
.player-card-screen {
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 0, rgba(23, 107, 95, .5), transparent 34%),
    radial-gradient(circle at 90% 20%, rgba(23, 92, 167, .25), transparent 31%),
    linear-gradient(#041c1b, #020d0d);
}

#players-refresh,
#player-card-refresh { color: var(--gold); font-size: 21px; }

.players-button svg { fill: #ffe19a; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.players-note { margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.players-footnote {
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

/* El contenidor rodola, no la pàgina: la resta de la pantalla es queda quieta. */
.players-table-wrap {
  margin: 0 -15px -15px;
  padding: 0 0 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 190, 76, .35) transparent;
}
.players-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  white-space: nowrap;
}
.players-table th,
.players-table td {
  padding: 8px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  text-align: left;
  vertical-align: middle;
}
.players-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 9px;
  background: #0a2725;
  color: var(--gold);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1.25;
}
.players-table tbody tr:last-child th,
.players-table tbody tr:last-child td { border-bottom: 0; }

/* Primera columna fixa: la foto identifica la fila mentre es rodola. */
.players-table .is-face {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 56px;
  padding-left: 15px;
  background: #0a2725;
}
.players-table thead .is-face { z-index: 4; }

.players-table .is-name strong,
.players-table .is-name small { display: block; }
.players-table .is-name strong { font-size: 12px; font-weight: 800; }
.players-table .is-name small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.players-table .is-number { text-align: right; font-variant-numeric: tabular-nums; }
.players-table td.is-number { color: #eaf3f0; font-weight: 800; }
.players-table td.is-number small { color: var(--muted); font-weight: 700; }

.players-winrate {
  display: inline-block;
  min-width: 46px;
  padding: 4px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .07);
  font-size: 9px;
  font-weight: 950;
  text-align: center;
}
.players-winrate.is-good { background: rgba(82, 188, 138, .13); color: #72d6a8; }
.players-winrate.is-bad { background: rgba(226, 88, 64, .12); color: #ff8b72; }

.player-face-button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.player-face-button:active { transform: scale(.94); }

.player-face {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(245, 190, 76, .35);
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  color: #ffe19a;
  font: 800 15px/1 Georgia, serif;
}
.player-face img { width: 100%; height: 100%; object-fit: cover; }
.player-face.is-large { width: 68px; height: 68px; font-size: 26px; }

.player-card-head { display: flex; align-items: center; gap: 14px; }
.player-card-head > div { min-width: 0; }
.player-card-head h3 { margin: 2px 0 0; font: 700 22px/1.05 Georgia, serif; }
.player-card-head small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }

/* Como .trained-stats, pero sin fijar tres columnas: aquí hay filas de cuatro. */
.players-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 7px;
  margin: 12px 0 0;
}
.players-stats span {
  padding: 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  font-size: 9px;
  line-height: 1.3;
  text-align: center;
}
.players-stats b { display: block; color: #f7c766; font-size: 17px; }

@media (max-width: 380px) {
  .players-table { font-size: 10px; }
  .players-table th, .players-table td { padding: 7px; }
  .player-face { width: 34px; height: 34px; }
}
