/* P50 (Gil, 1-nov): «Estadísticas» de la página pública. Mismos tokens que publico.css: tarjetas blancas con sombra, encabezados
   azules, el dorado solo como acento (borde) y verde/rojo para bajo/sobre par, siempre con signo o texto al lado. */
#s-estadisticas h3 { font-size: 1.15rem; margin: 0 0 .5rem; color: var(--titulo); }
#s-estadisticas h4 { font-size: 1rem; margin: 1.25rem 0 .5rem; color: var(--titulo); }
.est-bloque { margin-top: 1.75rem; scroll-margin-top: 4rem; }
.est-sub { margin: 0 0 .6rem; font-size: .88rem; }
#est-b-equipos .cabeza-seccion { margin-bottom: .5rem; }
#est-b-equipos .est-sub { margin: 0; }

/* Ir a un bloque */
.est-ir { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 .9rem; }
.chip-ir { font: inherit; font-size: .88rem; font-weight: 600; color: var(--azul); background: var(--fondo); border: 1px solid var(--linea);
  border-radius: 999px; padding: .35rem .85rem; min-height: 40px; cursor: pointer; }
.chip-ir:hover { border-color: var(--azul-boton); }
.chip-ir:focus-visible, .est-kpi:focus-visible, .ordenar:focus-visible, .est-abrir:focus-visible, .est-ver:focus-visible,
.est-ir-hoyo:focus-visible { outline: 3px solid var(--azul-boton); outline-offset: 2px; }

/* Totales: uno por resultado; al tocarlo, la lista de equipos se ordena por ese resultado */
.est-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .6rem; }
.est-kpi { font: inherit; text-align: left; display: flex; flex-direction: column; gap: .1rem; background: var(--fondo); border: 0;
  border-left: 4px solid var(--dorado); border-radius: var(--radio); box-shadow: var(--sombra); padding: .6rem .8rem; color: var(--texto); min-width: 0; }
button.est-kpi { cursor: pointer; }
button.est-kpi:hover { background: var(--azul-claro); }
.est-kpi .v { font-size: 1.6rem; font-weight: 700; color: var(--titulo); line-height: 1.15; }
.est-kpi .e { font-size: .85rem; font-weight: 600; color: var(--titulo); display: flex; align-items: center; }
.est-kpi .e .marca.mini { margin-left: 0; flex: none; }
.est-kpi .p { font-size: .76rem; }

/* Tablas. El contenedor que se desliza va con position: relative: si no, los textos para lector de pantalla (absolutos) de las
   columnas de la derecha se salen de él y la página entera se ensancha. */
#s-estadisticas .scroll-x { position: relative; }
.est-tabla td, .est-tabla th { padding: .5rem .45rem; }
.est-tabla th.num, .est-tabla th.centro, .est-tabla th.vs, .est-tabla th.mov, .est-tabla td.num { text-align: center; }
.est-tabla thead th { line-height: 1.2; vertical-align: bottom; }
/* Los nombres de renglón (hoyo, día, tipo) son <th scope="row">: sin el azul ni el sticky de los encabezados de columna */
.est-tabla tbody th { background: transparent; color: var(--titulo); position: static; z-index: auto; font-weight: 700; text-align: left; }
.est-tabla th .marca.mini { color: #fff; --fondo: var(--azul); margin: 0 .35rem 0 0; vertical-align: -1px; }
.est-tabla td.cero { color: #8a93a3; }
.est-tabla td.lider { background: var(--azul-claro); color: var(--azul); font-weight: 700; }
.ordenar { font: inherit; color: inherit; background: none; border: 0; padding: .15rem .1rem; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: .1rem; min-height: 32px; text-align: center; }
.est-tabla thead th.equipo .ordenar, .est-tabla thead th.hoyo .ordenar { justify-content: flex-start; text-align: left; }
.ordenar .flecha { display: inline-block; min-width: .9em; margin-left: .1rem; font-size: .75em; color: var(--dorado); }
/* Conteos: el símbolo arriba del nombre, para que las columnas sean angostas */
.ordenar.con-marca { flex-direction: column; gap: .2rem; }
.est-equipos thead th:first-child .txt { white-space: nowrap; }
.est-tabla th .ordenar.con-marca .marca.mini { margin: 0; }
.est-tabla mark { background: #FFE27A; color: inherit; border-radius: 3px; padding: 0 1px; }

/* Por equipo: nombre fijo a la izquierda al deslizar en el celular */
.est-equipos tbody tr { background: var(--fondo); }
.est-equipos tbody tr:nth-child(even) { background: #FAFBFD; }
.est-equipos tbody tr.fila { cursor: pointer; }
.est-equipos tbody tr.fila:hover { background: var(--azul-claro); }
.est-equipos .pos { width: 3rem; font-weight: 700; color: var(--titulo); text-align: center; }
.est-equipos .equipo { min-width: 11rem; }
.est-equipos td.num { width: 4.2rem; }
.est-equipos .equipo a { color: var(--azul-boton); font-weight: 700; text-decoration: none; }
.est-equipos .equipo .jug { display: block; font-size: .8rem; color: var(--texto); }
.est-equipos .total { text-align: center; font-size: 1.05rem; }
.est-equipos .mov { white-space: nowrap; text-align: center; font-variant-numeric: tabular-nums; }
.est-equipos .mov b { margin-left: .2rem; }
.est-equipos tr.sin-juego td { color: #8a93a3; }
.est-equipos tr.banda-patro td { padding: 0; background: var(--fondo-2); }

/* Lo más destacado */
.est-destacados { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: .75rem; }
.est-dest { background: var(--fondo); border-radius: var(--radio); box-shadow: var(--sombra); padding: .75rem .9rem; border-top: 4px solid var(--dorado); min-width: 0; }
.est-dest .t { margin: 0; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--texto); }
.est-dest .v { margin: .1rem 0 .35rem; font-size: 1.9rem; font-weight: 700; color: var(--titulo); line-height: 1.1; }
.est-dest .v small { font-size: .85rem; font-weight: 600; color: var(--texto); }
.est-quien { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.est-quien li { font-size: .9rem; overflow-wrap: anywhere; }
.est-quien a { font-weight: 700; color: var(--azul-boton); text-decoration: none; }
.est-quien .d { color: var(--titulo); font-size: .85rem; }
.est-quien .jug { display: block; font-size: .8rem; color: var(--texto); }
.est-ver, .est-ir-hoyo { font: inherit; background: none; border: 0; padding: 0; color: var(--azul-boton); font-weight: 700; cursor: pointer; text-align: left; }
.est-ver { font-size: .85rem; min-height: 32px; }
.est-ver:hover, .est-ir-hoyo:hover { text-decoration: underline; }

/* Por hoyo: barra divergente desde el par (la línea gris del centro es el par) */
.est-hoyos th.hoyo { min-width: 9rem; font-weight: 600; text-align: left; }
.est-hoyos .chips { display: flex; flex-wrap: wrap; gap: .2rem .3rem; }
.est-hoyos tbody { border-top: 2px solid var(--linea); }
.est-hoyos tbody tr:nth-child(even) { background: transparent; }
.est-hoyos tr.hoyo-detalle { background: var(--fondo-2) !important; }
.est-hoyos tr.hoyo-detalle th { font-weight: 500; font-size: .85rem; padding-left: 1.9rem; color: var(--titulo); }
.est-hoyos tr.hoyo-detalle th small { display: block; font-size: .75rem; color: var(--texto); }
.est-abrir { font: inherit; font-weight: 700; color: var(--azul-boton); background: none; border: 0; padding: .2rem 0; cursor: pointer; display: inline-flex;
  align-items: center; gap: .45rem; min-height: 36px; white-space: nowrap; }
.est-abrir .chevron { width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
  transition: transform .15s ease; margin-right: .1rem; }
.est-abrir[aria-expanded="true"] .chevron { transform: rotate(45deg); }
.est-chip { display: inline-block; margin: 0; padding: .05rem .45rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  white-space: nowrap; border: 1px solid currentColor; }
.est-chip.dificil, .est-chip.bogeys { color: var(--error); background: var(--error-fondo); }
.est-chip.facil, .est-chip.birdies { color: var(--ok); background: var(--ok-fondo); }
td.vs { white-space: nowrap; text-align: left; }
.barra-par { position: relative; display: inline-block; width: 4.5rem; height: .75rem; vertical-align: middle; margin-right: .45rem; }
.barra-par::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: #9aa3b2; }
.barra-par i { position: absolute; top: 0; bottom: 0; }
.barra-par i.pos { left: calc(50% + 1px); background: var(--error); border-radius: 0 4px 4px 0; }
.barra-par i.neg { right: calc(50% + 1px); background: var(--ok); border-radius: 4px 0 0 4px; }
td.vs .v { display: inline-block; min-width: 3.2rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Por día */
.est-dias tr.sub th { font-weight: 500; padding-left: 1.4rem; }
.est-dias tr.sub th small { display: block; font-size: .75rem; color: var(--texto); }
.est-dias td.mejor { white-space: nowrap; }
.est-dias td.mejor a { color: var(--azul-boton); font-weight: 600; text-decoration: none; }
.est-dias tbody th, .est-par tbody th { text-align: left; font-weight: 700; color: var(--titulo); }

.est-franja { margin-top: 1.5rem; border-radius: var(--radio); background: var(--fondo-2); }

.est-como { margin-top: 1.75rem; background: var(--fondo); border-radius: var(--radio); box-shadow: var(--sombra); padding: .75rem 1rem; }
.est-como summary { cursor: pointer; font-weight: 700; color: var(--azul); min-height: 32px; display: flex; align-items: center; }
.est-como ul { margin: .5rem 0 0; padding-left: 1.2rem; font-size: .88rem; display: grid; gap: .35rem; }

/* En la tarjeta del equipo */
.numeros-equipo { margin: .25rem 0 1rem; }
.numeros-equipo h3 { font-size: 1.05rem; margin: 0 0 .5rem; color: var(--titulo); }
.numeros-equipo .logros { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.numeros-equipo .logros li { display: inline-flex; align-items: center; gap: .35rem; background: var(--azul-claro); color: var(--azul); font-weight: 700;
  font-size: .85rem; border-radius: 999px; padding: .25rem .7rem .25rem .5rem; }
.numeros-equipo .logros .ico-trofeo { width: 1.05rem; height: 1.05rem; flex: none; }
.acciones-equipo { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .25rem 0 0; }
.acciones-equipo a:not(.boton) { font-weight: 600; }
.pista-tabla .ir-estadisticas { white-space: nowrap; margin-left: .35rem; }

@media (max-width: 900px) {
  .est-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.est-desliza { display: none; }
@media (max-width: 700px) {
  .est-equipos .equipo { position: sticky; left: 0; z-index: 1; background: inherit; box-shadow: 1px 0 0 var(--linea); min-width: 8.5rem; max-width: 9.5rem; }
  .est-equipos th.equipo { position: sticky; left: 0; z-index: 2; background: var(--azul); }
  .est-equipos .equipo .jug { font-size: .74rem; }
  .est-equipos .pos { width: 2.2rem; }
  .est-desliza { display: block; margin: 0 0 .4rem; font-size: .8rem; }
  .est-ir { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .est-ir::-webkit-scrollbar { display: none; }
  .chip-ir { flex: none; min-height: 36px; }
  .est-destacados { grid-template-columns: 1fr; }
  .est-kpi .v { font-size: 1.35rem; }
  .est-kpi { padding: .5rem .6rem; }
}
@media (max-width: 480px) {
  .est-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .est-kpi .e { font-size: .78rem; }
  .est-kpi .p { font-size: .72rem; }
}
@media (prefers-reduced-motion: reduce) { .est-abrir .chevron { transition: none; } }
