*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', sans-serif;
    background: #f4f6f9;
    min-height: 100vh;
}

.navbar {
    background: #0f3460;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.nav-izquierda, .nav-derecha {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.btn-nav {
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-nav:hover { background: rgba(255,255,255,0.25); }

.btn-admin { background: #e8a020; }
.btn-admin:hover { background: #f0b030; }

.btn-sesion { background: white; color: #0f3460; font-weight: 600; }
.btn-sesion:hover { background: #e8f0fe; }

.saludo { color: rgba(255,255,255,0.85); font-size: 0.9rem; }

.contenido { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; }

.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #0f3460, #1a4a80);
    border-radius: 16px;
    color: white;
    margin-bottom: 2rem;
}

.hero h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.hero p { opacity: 0.85; font-size: 1.05rem; }

.cards-placeholder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card-info {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.card-info h3 { margin-bottom: 0.75rem; color: #1a1a2e; }
.proximamente { color: #999; font-style: italic; font-size: 0.9rem; }

.hidden { display: none !important; }

.modal-perfil-contenido {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.btn-cerrar-perfil {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f0f0f0;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.perfil-avatar-seccion {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.avatar-perfil-grande {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f3460, #1a4a80);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    overflow: hidden;
    border: 3px solid #e8f0fe;
}

.avatar-perfil-grande img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-cambiar-foto {
    background: #e8f0fe;
    color: #0f3460;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
}

.perfil-nombre-display {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1a1a2e;
    text-align: center;
    margin: 0;
}

.perfil-info-seccion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-guardar-perfil {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.95rem;
}

.perfil-separador {
    height: 1px;
    background: #eee;
}

.btn-cerrar-sesion-perfil {
    background: #fff0f0;
    color: #c0392b;
    border: 1.5px solid #f5c6c6;
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-cerrar-sesion-perfil:hover { background: #ffe0e0; }

.mensaje-exito {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}


/* ── TABS ── */
.inicio-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.inicio-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.inicio-tab.active {
    color: #0f3460;
    border-bottom-color: #0f3460;
    background: #f8f9ff;
}

.inicio-seccion { padding: 0 0 2rem 0; }

.cargando-inicio {
    text-align: center;
    color: #aaa;
    padding: 2rem;
    font-size: 0.9rem;
}

/* ── TABLA CLASIFICACIÓN ── */
.tabla-clasificacion-wrap {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.tabla-clasificacion-real {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
}

.tabla-clasificacion-real thead th {
    background: #0f3460;
    color: white;
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tabla-clasificacion-real thead th:nth-child(2) { text-align: left; }

.tabla-clasificacion-real tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.tabla-clasificacion-real tbody tr:hover { background: #f8f9ff; }

.tabla-clasificacion-real tbody tr.top-1 { background: #fff9e6; }
.tabla-clasificacion-real tbody tr.top-2 { background: #f5f5f5; }
.tabla-clasificacion-real tbody tr.top-3 { background: #fff4ee; }

.tabla-clasificacion-real tbody td {
    padding: 0.75rem 1rem;
    text-align: center;
}

.tabla-clasificacion-real tbody td:nth-child(2) { text-align: left; }

.pos-num {
    font-weight: 800;
    font-size: 1rem;
    color: #0f3460;
}

.equipo-nombre {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.equipo-icono { font-size: 1.1rem; }

.puntos-td {
    font-weight: 800;
    font-size: 1rem;
    color: #0f3460;
}

.dg-pos { color: #27ae60; font-weight: 700; }
.dg-neg { color: #e74c3c; font-weight: 700; }

/* ── PARTIDOS ── */
.jornada-grupo { margin-bottom: 1.5rem; }

.jornada-titulo {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-left: 3px solid #0f3460;
}

.partido-card {
    background: white;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    transition: transform 0.15s, box-shadow 0.15s;
}

.partido-card.jugado { cursor: pointer; }
.partido-card.jugado:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.partido-equipos {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.equipo-local, .equipo-visitante {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
}

.equipo-local  { text-align: right; }
.equipo-visitante { text-align: left; }

.partido-centro { flex-shrink: 0; padding: 0 0.75rem; }

.resultado-badge {
    background: #0f3460;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.95rem;
}

.fecha-badge {
    background: #eee;
    color: #666;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.78rem;
}

.ver-stats {
    text-align: right;
    font-size: 0.72rem;
    color: #0f3460;
    margin-top: 0.3rem;
    font-weight: 600;
}

/* ── FILTROS ESTADÍSTICAS ── */
.estadisticas-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.filtro-label {
    font-size: 0.8rem;
    color: #888;
    font-weight: 600;
}

.btn-filtro {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    border: 1.5px solid #dee2e6;
    background: white;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filtro.active {
    background: #0f3460;
    border-color: #0f3460;
    color: white;
}

/* ── MODAL PARTIDO ── */
.modal-partido-contenido {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-partido-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.75rem;
}

.modal-partido-header h3 { font-size: 1rem; color: #0f3460; }

.stats-equipo-grupo { margin-bottom: 1rem; }

.stats-equipo-titulo {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    border-left: 3px solid #0f3460;
    padding-left: 0.5rem;
}

.stats-jugador-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.88rem;
}

.stats-nombre { font-weight: 600; color: #333; }
.stats-iconos { font-size: 1rem; letter-spacing: 0.1rem; }
.paradas-badge { font-size: 0.78rem; color: #555; }