/* ============================================================
   estadistica.css — Estadísticas del sitio público
   /sitio/estadistica.php  (Capa 1)

   Clases de tabla copiadas de
   assets/css/directivos/secretario/dashboardBase.css
   para que Posiciones y Goleo se vean IDÉNTICAS al dashboard
   del secretario. Mobile-first. Solo lectura.

   Único cambio respecto al original: var(--color-primary) del
   spinner se fija aquí al teal #0f766e (acento del módulo), y se
   agregan .alert* (que el JS usa para estados de error/vacío).
   ============================================================ */

/* ---- Layout de la página ---- */
.est-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
}

.est-titulo-pagina {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f766e;
    margin: 0.5rem 0 1rem;
    text-align: center;
}

.est-seccion {
    margin-bottom: 2.5rem;
}

.est-seccion > h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid #0f766e;
    padding-bottom: 0.4rem;
}

.est-seccion > h2 i {
    color: #0f766e;
}

/* El texto del título va en un <span> (para cambiarlo entre "Liguilla" y "Tabla general");
   fold.css pinta todo <span> de azul, así que hereda el color del h2. */
.est-seccion > h2 span {
    color: inherit;
}

/* Trofeo del título "Liguilla": blanco, dentro de un círculo verde para que se vea sobre el fondo blanco */
.est-seccion > h2 i.fa-trophy {
    color: #fff;
    background: #0f766e;
    width: 1.55em;
    height: 1.55em;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
}

/* ---- Spinner de carga ---- */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #0f766e;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Mensajes (vacío / error) ---- */
.alert {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    font-size: 0.85rem;
    text-align: center;
}

.alert-info {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ============================================================
   TABLA DE POSICIONES
   ============================================================ */
.posiciones-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
}

.tabla-posiciones {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    min-width: 800px;
}

.tabla-posiciones th,
.tabla-posiciones td {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.tabla-posiciones th {
    background: #f1f5f9;
    font-weight: 700;
    color: #0f766e;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
}

.tabla-posiciones tbody tr:hover {
    background: #f8fafc;
}

.tabla-posiciones .posicion {
    font-weight: 700;
    color: #0f766e;
}

.tabla-posiciones .equipo {
    text-align: left;
    font-weight: 600;
    color: #1f2937;
}

.tabla-posiciones .puntos {
    font-weight: 800;
    color: #0f766e;
    background: #f0fdf4;
    border-radius: 20px;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    min-width: 40px;
}

/* Rankings de equipo (valla menos vencida / ofensivo): derivados de la tabla de
   posiciones. 5 columnas, caben en móvil sin ocultar nada. */
.tabla-ranking {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.tabla-ranking th,
.tabla-ranking td {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.tabla-ranking th {
    background: #f1f5f9;
    font-weight: 700;
    color: #0f766e;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}

.tabla-ranking tbody tr:hover {
    background: #f8fafc;
}

.tabla-ranking .posicion {
    font-weight: 700;
    color: #0f766e;
}

.tabla-ranking .equipo {
    text-align: left;
    font-weight: 600;
    color: #1f2937;
}

.tabla-ranking .destacado {
    font-weight: 800;
    color: #0f766e;
    background: #f0fdf4;
    border-radius: 20px;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    min-width: 44px;
}

/* Racha de resultados */
.racha {
    display: flex;
    gap: 0.2rem;
    justify-content: center;
}

.racha-icono {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
}

.racha-g { background: #10b981; color: white; }
.racha-e { background: #f59e0b; color: white; }
.racha-epe { background: #8b5cf6; color: white; }
.racha-p { background: #ef4444; color: white; }
.racha-pendiente { background: #cbd5e1; color: #475569; }

/* Móvil: columnas esenciales */
@media (max-width: 768px) {
    .tabla-posiciones {
        min-width: 100%;
        font-size: 0.7rem;
    }

    /* Ocultar columnas menos importantes en móvil (PJ G E EPE P GF GC) */
    .tabla-posiciones th:nth-child(3),
    .tabla-posiciones td:nth-child(3),
    .tabla-posiciones th:nth-child(4),
    .tabla-posiciones td:nth-child(4),
    .tabla-posiciones th:nth-child(5),
    .tabla-posiciones td:nth-child(5),
    .tabla-posiciones th:nth-child(6),
    .tabla-posiciones td:nth-child(6),
    .tabla-posiciones th:nth-child(7),
    .tabla-posiciones td:nth-child(7),
    .tabla-posiciones th:nth-child(8),
    .tabla-posiciones td:nth-child(8),
    .tabla-posiciones th:nth-child(9),
    .tabla-posiciones td:nth-child(9) {
        display: none;
    }

    .tabla-posiciones th,
    .tabla-posiciones td {
        padding: 0.5rem 0.25rem;
    }

    .tabla-posiciones td:first-child {
        font-size: 0.65rem;
        font-weight: 700;
        min-width: 35px;
    }

    .tabla-posiciones td:nth-child(2) {
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tabla-posiciones td:nth-child(10) .puntos {
        font-size: 0.9rem;
        padding: 0.15rem 0.4rem;
    }

    .racha-icono {
        width: 18px;
        height: 18px;
        font-size: 0.55rem;
    }
}

/* ============================================================
   TABLA DE GOLEADORES
   ============================================================ */
.goleadores-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
}

.tabla-goleadores {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    min-width: 450px;
}

.tabla-goleadores th,
.tabla-goleadores td {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.tabla-goleadores th {
    background: #f1f5f9;
    font-weight: 700;
    color: #0f766e;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}

.tabla-goleadores .posicion {
    font-weight: 700;
    color: #0f766e;
    font-size: 0.85rem;
}

.tabla-goleadores .jugador {
    text-align: left;
    font-weight: 600;
    color: #1f2937;
}

.tabla-goleadores .equipo {
    text-align: left;
    color: #6b7280;
    font-size: 0.7rem;
}

.tabla-goleadores .goles {
    font-weight: 800;
    color: #0f766e;
    background: #f0fdf4;
    border-radius: 20px;
    display: inline-block;
    padding: 0.2rem 0.6rem;
    min-width: 35px;
}

/* Top 3 destacados */
.tabla-goleadores tr:nth-child(1) .posicion { color: #f59e0b; font-size: 1rem; }
.tabla-goleadores tr:nth-child(2) .posicion { color: #94a3b8; }
.tabla-goleadores tr:nth-child(3) .posicion { color: #cd7f32; }

/* Escritorio: todas las columnas de jornada visibles */
@media (min-width: 769px) {
    .tabla-goleadores {
        min-width: auto;
    }

    .tabla-goleadores th.jornada-col,
    .tabla-goleadores td.jornada-col {
        display: table-cell;
        font-size: 0.7rem;
        min-width: 40px;
    }
}

/* Móvil: ocultar columnas de jornada, mostrar solo básico */
@media (max-width: 768px) {
    .tabla-goleadores th.jornada-col,
    .tabla-goleadores td.jornada-col {
        display: none;
    }

    .tabla-goleadores {
        min-width: 350px;
        font-size: 0.65rem;
    }

    .tabla-goleadores .equipo {
        max-width: 90px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tabla-goleadores .jugador {
        max-width: 110px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tabla-goleadores th,
    .tabla-goleadores td {
        padding: 0.5rem 0.25rem;
    }
}

@media (max-width: 480px) {
    .tabla-goleadores {
        min-width: 300px;
    }

    .tabla-goleadores .jugador { max-width: 90px; }
    .tabla-goleadores .equipo { max-width: 70px; }
}

/* ============================================================
   AJUSTES PROPIOS DEL SITIO PÚBLICO
   ============================================================ */

/* Contador de visitas: al final de la página, en el flujo normal.
   ruta.css lo fija con position:absolute;bottom:0 (relativo a la primera
   pantalla), y en una página larga queda flotando encima del contenido.
   Aquí solo para esta página; ruta.css no se toca (lo usan las demás).
   El body es flex en columna: margin-top:auto lo baja al fondo cuando el
   contenido es corto, y lo deja después del contenido cuando es largo. */
body .ruta {
    position: static;
    display: block;
    width: 100%;
    margin-top: auto;
    padding: 1.25rem 0 1rem;
    text-align: center;
    box-sizing: border-box;
}

/* Móvil: tabla de posiciones un poco más angosta para que quepa la Racha
   completa (antes la 5.ª casilla quedaba cortada en el borde derecho). */
@media (max-width: 768px) {
    .est-wrap {
        padding: 0.75rem 0.5rem;
    }

    .tabla-posiciones th,
    .tabla-posiciones td {
        padding: 0.5rem 0.15rem;
    }

    /* El logo lleva width/height en línea desde el JS; !important para ganarle. */
    .tabla-posiciones .logo-equipo-mini {
        width: 18px !important;
        height: 18px !important;
        margin-right: 3px !important;
    }

    /* Burbuja de puntos más compacta (en el escritorio mide min-width:40px). */
    .tabla-posiciones .puntos {
        min-width: 30px;
        padding: 0.15rem 0.3rem;
    }

    .racha {
        gap: 0.08rem;
    }

    .racha-icono {
        width: 15px;
        height: 15px;
        font-size: 0.5rem;
    }
}

/* ============================================================
   DETALLE AL TOCAR (racha y goleo) + DIÁLOGOS SweetAlert2
   ============================================================ */

/* Casillas de la racha tocables */
.racha-icono[role="button"] {
    cursor: pointer;
    transition: transform 0.12s ease;
}

.racha-icono[role="button"]:hover {
    transform: scale(1.15);
}

.racha-icono[role="button"]:focus-visible {
    outline: 2px solid #0f766e;
    outline-offset: 2px;
}

/* Goles por jornada tocables (escritorio) */
.tabla-goleadores td.gol-click {
    cursor: pointer;
    color: #0f766e;
    font-weight: 700;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.tabla-goleadores td.gol-click:hover {
    background: #f0fdf4;
}

/* Fila tocable (móvil: abre la lista de jornadas con goles y su rival) */
@media (max-width: 768px) {
    .tabla-goleadores tbody tr.gol-fila {
        cursor: pointer;
    }

    .tabla-goleadores tbody tr.gol-fila:hover {
        background: #f1f5f9;
    }
}

/* Diálogo */
.est-swal {
    border-radius: 16px !important;
    padding: 0.75rem 1rem 1.25rem !important;
    max-width: 92vw;
}

.est-swal .swal2-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f766e;
    /* margen a ambos lados: deja sitio a la X de cerrar (nombres largos) */
    padding: 0.5rem 2.5rem 0.4rem;
}

.est-swal .swal2-close:focus {
    box-shadow: none;
}

/* fold.css fija `* { color: #007bff }` en todo el sitio y eso pisa el color heredado;
   se fija el color de texto del diálogo (:where = especificidad 0, así los colores
   específicos de abajo siguen ganando). */
:where(.est-dlg, .est-dlg *, .est-dlg-lista, .est-dlg-lista *) {
    color: #1f2937;
}

.est-swal .swal2-html-container {
    margin: 0.25rem 0 0;
    padding: 0;
}

.est-dlg {
    font-size: 0.85rem;
    color: #1f2937;
}

.est-dlg-logo {
    object-fit: contain;
}

/* Racha: [equipo]  5 – 3  [rival]  + etiqueta del resultado */
.est-dlg-marcador {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.est-dlg-equipo {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
}

.est-dlg-score {
    font-size: 1.9rem;
    font-weight: 800;
    color: #0f766e;
    white-space: nowrap;
}

.est-dlg-chip {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* Goleo (escritorio): contra quién */
.est-dlg-rival {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 800;
}

/* Goleo (móvil): lista de jornadas con goles */
.est-dlg-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
}

.est-dlg-lista li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.82rem;
}

.est-dlg-lista li:last-child {
    border-bottom: 0;
}

.est-dlg-j {
    font-weight: 800;
    color: #0f766e;
    min-width: 2rem;
}

.est-dlg-nombre {
    flex: 1;
    min-width: 0;
    font-weight: 600;
}

.est-dlg-goles {
    font-weight: 800;
    color: #0f766e;
    white-space: nowrap;
}

/* ============================================================
   TABLA DE TARJETAS (Capa 2)
   Misma estructura visual que la de goleadores; casillas de color
   por tarjeta (.tj) y totales por tipo.
   ============================================================ */

/* Casilla de tarjeta */
.tj {
    display: inline-block;
    width: 11px;
    height: 15px;
    border-radius: 2px;
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.tj + .tj {
    margin-left: 3px;
}

.tj-A { background: #facc15; }
.tj-E { background: #dc2626; }
/* Doble amarilla: la segunda amarilla es roja */
.tj-AA { background: linear-gradient(135deg, #facc15 50%, #dc2626 50%); }

.tar-leyenda {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.72rem;
    color: #475569;
}

.tar-leyenda > span {
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.tarjetas-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.75rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
}

.tabla-tarjetas {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    min-width: 450px;
}

.tabla-tarjetas th,
.tabla-tarjetas td {
    padding: 0.6rem 0.4rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    color: #1f2937;
}

.tabla-tarjetas th {
    background: #f1f5f9;
    font-weight: 700;
    color: #0f766e;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}

.tabla-tarjetas .posicion {
    font-weight: 700;
    color: #0f766e;
    font-size: 0.85rem;
}

.tabla-tarjetas .jugador {
    text-align: left;
    font-weight: 600;
}

.tabla-tarjetas .equipo {
    text-align: left;
    color: #6b7280;
    font-size: 0.7rem;
    white-space: nowrap;
}

.tabla-tarjetas .tar-cero {
    color: #cbd5e1;
}

/* fold.css fija `* { color: #007bff }`: el nombre va en <span>, así que se fija aquí */
.tabla-tarjetas .eq-nombre {
    color: #6b7280;
}

.tabla-tarjetas .tar-total {
    font-weight: 800;
    color: #0f766e;
    background: #f0fdf4;
    border-radius: 20px;
    display: inline-block;
    padding: 0.2rem 0.6rem;
    min-width: 35px;
}

/* Casillas tocables (escritorio) */
.tabla-tarjetas td.tar-click {
    cursor: pointer;
}

.tabla-tarjetas td.tar-click:hover {
    background: #f0fdf4;
}

/* Pie: contador y "Ver más" */
.tar-pie {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.6rem;
    font-size: 0.75rem;
}

.tar-pie > span {
    color: #64748b;
}

.tar-ver-mas {
    background: #0f766e;
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.tar-ver-mas:hover {
    background: #115e59;
}

/* Móvil: sin columnas de jornada; el equipo se reduce al logo */
@media (max-width: 768px) {
    .tabla-tarjetas th.jornada-col,
    .tabla-tarjetas td.jornada-col {
        display: none;
    }

    .tabla-tarjetas {
        min-width: 100%;
        font-size: 0.68rem;
    }

    .tabla-tarjetas th,
    .tabla-tarjetas td {
        padding: 0.5rem 0.2rem;
    }

    .tabla-tarjetas .eq-nombre {
        display: none;
    }

    .tabla-tarjetas .equipo img {
        margin-right: 0 !important;
    }

    .tabla-tarjetas .jugador {
        max-width: 110px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tabla-tarjetas tbody tr.tar-fila {
        cursor: pointer;
    }

    .tabla-tarjetas tbody tr.tar-fila:hover {
        background: #f1f5f9;
    }
}

/* Diálogo de tarjeta (escritorio) */
.tar-dlg-chips {
    margin-bottom: 0.6rem;
}

.tar-dlg-chips .tj {
    width: 16px;
    height: 22px;
}

.tar-dlg-rival {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: left;
    margin-bottom: 0.9rem;
}

.tar-dlg-rival small {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
}

.tar-dlg-rival strong {
    font-size: 1rem;
    font-weight: 800;
}

.tar-dlg-fila {
    text-align: left;
    padding: 0.5rem 0.25rem;
    border-top: 1px solid #e2e8f0;
}

.tar-dlg-et {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: #0f766e;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.15rem;
}

.tar-causas {
    margin: 0;
    padding-left: 1.1rem;
}

/* Diálogo de tarjetas del jugador (móvil) */
/* `li.tar-item` (y no solo `.tar-item`): .est-dlg-lista li pone display:flex y
   le ganaría en especificidad, apretando el rival en una columna estrecha. */
.est-dlg-lista li.tar-item {
    display: block;
    padding: 0.55rem 0.25rem;
}

.tar-item-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tar-item-chips {
    display: inline-flex;
    min-width: 2.2rem;
}

.tar-item-info {
    margin-top: 0.3rem;
    padding-left: 2.5rem;
    font-size: 0.74rem;
    line-height: 1.3;
}

/* Cada dato en su línea: etiqueta a la izquierda, valor a la derecha */
.tar-item-linea {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.15rem 0;
}

.tar-item-et {
    flex: 0 0 3.5rem;
    padding-top: 0.12rem;
    font-size: 0.62rem;
    font-weight: 700;
    color: #0f766e;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tar-item-valor {
    flex: 1;
    min-width: 0;
    color: #334155;
    word-break: break-word;
}

.tar-item-causas {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding-left: 0.9rem;
    list-style: disc;
    color: #334155;
    word-break: break-word;
}

/* Las viñetas de la lista anidada no deben heredar el diseño de .est-dlg-lista li */
.est-dlg-lista .tar-item-causas li {
    display: list-item;
    padding: 0.05rem 0;
    border: 0;
    font-size: inherit;
    color: #334155;
}

/* ============================================================
   LIGUILLA (pestañas Liguilla | Tabla general) — vista general por fases
   Sirve para cualquier formato: tabla (Mini-Liga), tablas por grupo, o cruces.
   fold.css fija `* { color: #007bff }`: los colores se fijan explícitamente.
   ============================================================ */

/* El atributo hidden debe ganar aunque la clase defina display */
.est-tabs[hidden],
#est-liguilla[hidden],
#est-posiciones[hidden] {
    display: none !important;
}

.est-tabs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.est-tab {
    flex: 1;
    border: 1px solid #b3b3b3;
    background: #b3b3b3;
    color: #1f2937;
    border-radius: 999px;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.est-tab.activa {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.lig-resumen {
    margin-top: 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    text-align: center;
}

/* Podio de campeones */
.lig-podio {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.lig-podio-item {
    flex: 1 1 100px;
    text-align: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.6rem 0.4rem;
}

.lig-podio-medalla { font-size: 1.4rem; }
.lig-podio-nombre { margin-top: 0.3rem; font-size: 0.8rem; font-weight: 800; color: #1f2937; }
.lig-podio-et { font-size: 0.65rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.4px; }

.lig-logo { object-fit: contain; }

.lig-cuadro {
    margin-top: 1.4rem;
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f766e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tarjeta de fase */
.lig-fase {
    margin-top: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.lig-fase-en_curso { border-color: #0f766e; box-shadow: 0 0 0 1px #0f766e; }

.lig-fase-cab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: #f1f5f9;
}

.lig-fase-titulo { font-size: 0.9rem; font-weight: 800; color: #0f766e; }

.lig-chips { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; justify-content: flex-end; }

.lig-chip {
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    background: #e2e8f0;
    color: #475569;
    white-space: nowrap;
}

.lig-chip-en_curso   { background: #fef3c7; color: #92400e; }
.lig-chip-finalizada { background: #dcfce7; color: #166534; }
.lig-chip-fmt        { background: #e0f2fe; color: #075985; }

/* Cruces */
.lig-cruce {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.6rem;
    border-top: 1px solid #e2e8f0;
}

.lig-eq {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1f2937;
}

.lig-eq-izq { justify-content: flex-end; text-align: right; }
.lig-eq-der { justify-content: flex-start; text-align: left; }

.lig-nombre { color: #1f2937; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lig-eq .lig-nombre { overflow-wrap: anywhere; }

.lig-gana, .lig-gana .lig-nombre { font-weight: 800; color: #0f766e; }

.lig-marcador {
    min-width: 54px;
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    color: #0f766e;
    white-space: nowrap;
}

.lig-marcador.lig-vs { font-size: 0.78rem; font-weight: 700; color: #94a3b8; }

.lig-pordefinir { font-size: 0.74rem; font-style: italic; color: #94a3b8; }

.lig-nota {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: #b45309;
}

/* Tabla de Mini-Liga / grupos */
.lig-grupo {
    padding: 0.5rem 0.75rem 0.1rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: #0f766e;
}

.lig-leyenda-tabla {
    padding: 0.4rem 0.75rem 0.6rem;
    font-size: 0.65rem;
    color: #94a3b8;
}

.liguilla-container {
    width: 100%;
    overflow-x: auto;
}

.tabla-liguilla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    min-width: 520px;
}

.tabla-liguilla th,
.tabla-liguilla td {
    padding: 0.6rem 0.4rem;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    color: #1f2937;
}

.tabla-liguilla th {
    background: #fff;
    font-weight: 700;
    color: #0f766e;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}

.tabla-liguilla .posicion { font-weight: 700; color: #0f766e; }

.tabla-liguilla .equipo {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.tabla-liguilla .equipo .lig-logo { margin-right: 6px; vertical-align: middle; }
.tabla-liguilla .equipo .lig-nombre { vertical-align: middle; }

.tabla-liguilla .puntos {
    font-weight: 800;
    color: #0f766e;
    background: #f0fdf4;
    border-radius: 20px;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    min-width: 36px;
}

/* Móvil: #, Equipo, PJ, DIF, PTS (se ocultan G, EPE, P, GF, GC) */
@media (max-width: 768px) {
    .tabla-liguilla {
        min-width: 100%;
        font-size: 0.7rem;
    }

    .tabla-liguilla th:nth-child(4), .tabla-liguilla td:nth-child(4),
    .tabla-liguilla th:nth-child(5), .tabla-liguilla td:nth-child(5),
    .tabla-liguilla th:nth-child(6), .tabla-liguilla td:nth-child(6),
    .tabla-liguilla th:nth-child(7), .tabla-liguilla td:nth-child(7),
    .tabla-liguilla th:nth-child(8), .tabla-liguilla td:nth-child(8) {
        display: none;
    }

    .tabla-liguilla th,
    .tabla-liguilla td {
        padding: 0.5rem 0.25rem;
    }

    .tabla-liguilla .equipo .lig-nombre {
        display: inline-block;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .lig-eq { font-size: 0.72rem; }
}

/* ============================================================
   Partidos del día (en vivo / resultados / próxima jornada)
   Mobile-first: tarjeta con equipo | marcador u hora | equipo.
   fold.css pinta todo de azul: cada texto fija su color.
   ============================================================ */
.est-partidos-fecha {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0.4rem 0 0.6rem;
}

.est-partidos-fecha:empty {
    display: none;
}

.est-partidos-lista {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.est-partido {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 0.4rem;
    row-gap: 0.3rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.6rem 0.5rem;
    box-sizing: border-box;
}

.est-partido.en-juego {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px #ef4444 inset;
}

.est-p-eq {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    text-align: center;
}

.est-p-nombre {
    color: #1f2937;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.est-p-centro {
    text-align: center;
    min-width: 3.4rem;
}

.est-p-goles {
    color: #0f766e;
    font-size: 1.4rem;
    font-weight: 800;
    white-space: nowrap;
}

.est-p-hora {
    color: #0f766e;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
}

.est-p-info {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.72rem;
    color: #6b7280;
}

.est-p-estado,
.est-p-campo {
    color: #6b7280;
}

.est-p-estado.vivo {
    color: #ef4444;
    font-weight: 700;
}

.est-punto-vivo {
    color: #ef4444 !important;
    font-size: 0.6em;
    animation: est-parpadeo 1.2s ease-in-out infinite;
}

@keyframes est-parpadeo {
    50% { opacity: 0.25; }
}

@media (min-width: 640px) {
    .est-partidos-lista {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Detalle por partido (Fase 3): clic en el finalizado + modal ===== */

/* Solo el partido finalizado es clicable; se nota al pasar/enfocar. */
.est-partido.clicable {
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.est-partido.clicable:hover,
.est-partido.clicable:focus-visible {
    border-color: #0f766e;
    box-shadow: 0 0 0 1px #0f766e inset;
}

.est-partido.clicable:focus {
    outline: none;
}

/* Chevron "ver detalle" al final de la línea de info */
.est-p-ver {
    color: #0f766e;
    font-size: 0.78rem;
    margin-left: 0.3rem;
}

/* --- Modal de detalle (SweetAlert2, dentro de .est-dlg) --- */
.part-dlg {
    text-align: left;
}

.part-dlg-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #e2e8f0;
}

.part-dlg-eq {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

.part-dlg-nom {
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    overflow-wrap: anywhere;
}

.part-dlg-marcador {
    font-size: 1.7rem;
    font-weight: 800;
    color: #0f766e;
    white-space: nowrap;
}

.part-dlg-meta {
    font-size: 0.76rem;
    color: #6b7280;
    margin-top: 0.4rem;
    text-align: center;
}

.part-dlg-meta i {
    color: #0f766e;
}

.part-dlg-sec {
    margin-top: 0.9rem;
}

.part-dlg-sec h3 {
    margin: 0 0 0.4rem;
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f766e;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.25rem;
}

.part-dlg-sec h3 i {
    margin-right: 0.3rem;
}

/* Goleadores: dos columnas (equipo1 | equipo2), como el marcador */
.part-dlg-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.part-dlg-col {
    min-width: 0;
}

.part-dlg-lista {
    list-style: none;
    margin: 0;
    padding: 0;
}

.part-dlg-lista li {
    font-size: 0.8rem;
    line-height: 1.35;
    padding: 0.15rem 0;
    overflow-wrap: anywhere;
}

.part-dlg-x {
    font-weight: 800;
    color: #0f766e;
}

.part-dlg-ag {
    color: #b45309;
    font-size: 0.72rem;
}

.part-dlg-tar {
    margin-bottom: 0.5rem;
}

.part-dlg-tar strong {
    display: block;
    font-size: 0.76rem;
    color: #374151;
    margin-bottom: 0.15rem;
}

.part-dlg-tar small {
    color: #6b7280;
}

.part-dlg-min {
    color: #6b7280;
    font-size: 0.72rem;
    white-space: nowrap;
}

.part-dlg-inc {
    margin: 0;
    padding-left: 1.1rem;
}

.part-dlg-inc li {
    font-size: 0.8rem;
    line-height: 1.35;
    margin-bottom: 0.2rem;
    overflow-wrap: anywhere;
}

.part-dlg-vacio {
    margin: 0;
    font-size: 0.78rem;
    color: #9ca3af;
    font-style: italic;
}

/* ===== Aviso "en construcción" (D-152): estadistica.php cuando está oculta ===== */
.est-en-construccion {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

/* color explícito con !important: fold.css pinta TODO texto de azul (* { color }). */
.est-en-construccion i {
    font-size: 2.6rem;
    color: #0f766e !important;
}

.est-en-construccion p {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151 !important;
}
