/* Ligas — extiende estilos de torneos */

.liga-estado-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.liga-estado-pill--en_curso {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.liga-estado-pill--proxima {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.liga-estado-pill--finalizada {
    background: rgba(100, 116, 139, 0.15);
    color: #475569;
}

.liga-estado-pill--cancelada {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.liga-card {
    display: grid;
    grid-template-columns: 112px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.15rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 16px;
    background: var(--surface, #fff);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.liga-card:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
    color: inherit;
}

.liga-card-thumb {
    width: 112px;
    height: 72px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.4rem;
}

.liga-card-body h3 {
    margin: 0.35rem 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 800;
}

.liga-card-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #64748b);
}

.liga-card-stats {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.55rem;
    font-size: 0.78rem;
    color: #64748b;
}

.liga-card-cta {
    font-weight: 700;
    color: #7c3aed;
    white-space: nowrap;
}

.ligas-list {
    display: grid;
    gap: 0.85rem;
}

.liga-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.liga-back-link:hover {
    color: #7c3aed;
}

.liga-detalle-hero {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 20px;
    overflow: hidden;
    background: var(--surface, #fff);
    margin-bottom: 1.25rem;
}

.liga-detalle-cover {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: #4c1d95;
}

.liga-detalle-hero-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.liga-detalle-title {
    margin: 0.5rem 0 0.35rem;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 900;
}

.liga-detalle-meta {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
}

.liga-detalle-desc {
    margin: 0.85rem 0 0;
    color: #334155;
    line-height: 1.5;
}

.liga-detalle-kpis {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.liga-detalle-kpis > div {
    min-width: 88px;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.liga-detalle-kpis strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 900;
}

.liga-detalle-kpis span {
    font-size: 0.75rem;
    color: #64748b;
}

.liga-detalle-actions {
    margin-top: 1rem;
}

.liga-detalle-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.liga-ranking-table,
.liga-fechas-list {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.liga-fecha-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.liga-fecha-pill {
    appearance: none;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    border-radius: 999px;
    padding: 0.38rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.liga-fecha-pill:hover {
    border-color: #fdba74;
    color: #c2410c;
}

.liga-fecha-pill.is-active {
    background: #f97316;
    border-color: #f97316;
    color: #fff;
}

.liga-ranking-note {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 0.55rem 0.8rem;
}

.liga-ranking-table table {
    width: 100%;
    border-collapse: collapse;
}

.liga-ranking-table th,
.liga-ranking-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: middle;
}

.liga-ranking-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    background: #fff;
    font-weight: 700;
}

.liga-ranking-table--rich .col-pos {
    width: 64px;
    text-align: center;
}

.liga-ranking-table--rich .col-num {
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.liga-ranking-table--rich .col-pts strong {
    font-size: 1.15rem;
    font-weight: 900;
    color: #0f172a;
}

.liga-ranking-table--rich .col-wl {
    font-weight: 700;
    color: #334155;
}

.liga-pos-num {
    display: inline-flex;
    min-width: 1.5rem;
    justify-content: center;
    font-weight: 800;
    color: #64748b;
}

.liga-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
    position: relative;
}

.liga-medal::after {
    content: '';
    position: absolute;
    bottom: -5px;
    width: 10px;
    height: 8px;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    opacity: 0.9;
}

.liga-medal--gold {
    background: linear-gradient(145deg, #fbbf24, #d97706);
}
.liga-medal--gold::after { background: #b45309; }

.liga-medal--silver {
    background: linear-gradient(145deg, #e2e8f0, #94a3b8);
    color: #334155;
}
.liga-medal--silver::after { background: #64748b; }

.liga-medal--bronze {
    background: linear-gradient(145deg, #fdba74, #c2410c);
}
.liga-medal--bronze::after { background: #9a3412; }

.liga-player-cell {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.liga-player-cell strong {
    font-size: 0.98rem;
    color: #0f172a;
}

.liga-player-sub {
    font-size: 0.78rem;
    color: #94a3b8;
}

.liga-stat-chip {
    display: inline-flex;
    min-width: 1.55rem;
    justify-content: center;
    padding: 0.12rem 0.4rem;
    border-radius: 6px;
    background: #ffedd5;
    color: #c2410c;
    font-weight: 800;
    font-size: 0.85rem;
}

.liga-stat-zero {
    color: #cbd5e1;
    font-weight: 600;
}

.liga-rank-row.is-top1 {
    background: linear-gradient(90deg, #fffbeb, #fff);
}

.liga-fecha-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
}

.liga-fecha-row:last-child {
    border-bottom: 0;
}

.liga-fecha-row:hover {
    background: #faf5ff;
    color: inherit;
}

.liga-fecha-row.is-current {
    background: #fff7ed;
    box-shadow: inset 3px 0 0 #f97316;
}

.liga-fecha-row.is-current .liga-fecha-num {
    color: #c2410c;
}

.liga-fecha-num {
    min-width: 64px;
    font-weight: 800;
    color: #7c3aed;
    font-size: 0.85rem;
}

.liga-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #64748b;
}

@media (max-width: 900px) {
    .liga-ranking-table--rich {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .liga-ranking-table--rich table {
        min-width: 720px;
    }
}

@media (max-width: 720px) {
    .liga-card {
        grid-template-columns: 1fr;
    }

    .liga-card-thumb {
        width: 100%;
        height: 120px;
    }

    .liga-card-cta {
        justify-self: start;
    }
}
