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

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

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

.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(57, 169, 47, 0.763);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    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.22); }

.btn-admin { background: rgba(255,255,255,0.15); color: white; }
.btn-admin:hover { background: rgba(255,255,255,0.25); }

.btn-sesion { background: white; color: #1a3d1a; font-weight: 700; border: none; }
.btn-sesion:hover { background: #e8f5e8; }

.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, #215821, #338533);
    border-radius: 16px;
    color: white;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.hero-texto { text-align: center; flex: 1; }
.hero h1 { font-size: 2rem; margin-bottom: 0.75rem; color: white; }
.hero p { opacity: 0.85; font-size: 1.05rem; }

.hero-logo {
    height: 200px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.hero-logo-placeholder {
    height: 140px;
    width: 140px;
    flex-shrink: 0;
}

.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.07);
    border: 1px solid #d4e8d4;
}

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

.hidden { display: none !important; }

/* ── MODAL PERFIL ── */
.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.2);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border: 1px solid #d4e8d4;
}

.btn-cerrar-perfil {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #e8f5e8;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    color: #1a3d1a;
    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, #1a3d1a, #2d6a2d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    overflow: hidden;
    border: 3px solid #d4e8d4;
}

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

.btn-cambiar-foto {
    background: #e8f5e8;
    color: #1a3d1a;
    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: #1a3d1a;
    text-align: center;
    margin: 0;
}

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

.perfil-info-seccion input {
    background: #f5fbf5;
    border: 1.5px solid #c0d8c0;
    color: #2d3a2d;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.perfil-info-seccion input:focus { border-color: #1a3d1a; }
.perfil-info-seccion label { font-size: 0.85rem; color: #5a7a5a; font-weight: 600; }

.btn-guardar-perfil {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.95rem;
    background: #1a3d1a;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-guardar-perfil:hover { background: #2d6a2d; }

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

.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: #e8f5e8;
    color: #1a3d1a;
    border: 1px solid #b0d4b0;
    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.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* ── TABS ── */
.inicio-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #c0d8c0;
    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: #7a9a7a;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.inicio-tab.active {
    color: #1a3d1a;
    border-bottom-color: #1a3d1a;
    background: #f0f5f0;
}

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

.cargando-inicio {
    text-align: center;
    color: #7a9a7a;
    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: #1a3d1a;
    color: white;
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #2d6a2d;
}

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

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

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

.tabla-clasificacion-real tbody tr.top-1 { background: #eeebcf; }
.tabla-clasificacion-real tbody tr.top-2 { background: #e8e7e7; }
.tabla-clasificacion-real tbody tr.top-3 { background: #f7eae0; }

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

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

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

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

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

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

.tabla-clasificacion-real .dg-pos { color: #1a7a1a !important; font-weight: 700; }
.tabla-clasificacion-real .dg-neg { color: #c0392b !important; 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: #7a9a7a;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-left: 3px solid #1a3d1a;
}

.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.06);
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid #d4e8d4;
}

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

.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;
    color: #2d3a2d;
}

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

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

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

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

.ver-stats {
    text-align: right;
    font-size: 0.72rem;
    color: #2d6a2d;
    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: #7a9a7a;
    font-weight: 600;
}

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

.btn-filtro.active {
    background: #1a3d1a;
    border-color: #1a3d1a;
    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);
    border: 1px solid #d4e8d4;
}

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

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

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

.stats-equipo-titulo {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #7a9a7a;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    border-left: 3px solid #1a3d1a;
    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 #eaf3ea;
    font-size: 0.88rem;
}

.stats-nombre { font-weight: 600; color: #2d3a2d; }
.stats-iconos { font-size: 1rem; letter-spacing: 0.1rem; }
.paradas-badge { font-size: 0.78rem; color: #7a9a7a; }

/* ── SPINNER ── */
.spinner-inicio {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(26,61,26,0.15);
    border-top-color: #1a3d1a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
    display: block;
}

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

.cargando-spinner-inicio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    color: #7a9a7a;
    font-size: 0.85rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .navbar {
        padding: 0.6rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .nav-izquierda, .nav-derecha { gap: 0.4rem; }
    .logo { font-size: 0.85rem; }
    .btn-nav { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
    #saludo-usuario span { display: none; }
    .hero {
        padding: 1.5rem 0.75rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    .hero h1 { font-size: 1.3rem; }
    .hero p  { font-size: 0.9rem; }
    .hero-logo { height: 60px; }
    .inicio-tab { font-size: 0.78rem; padding: 0.75rem 0.25rem; }
    .tabla-clasificacion-real { font-size: 0.78rem; }
    .tabla-clasificacion-real thead th,
    .tabla-clasificacion-real tbody td { padding: 0.5rem 0.4rem; }
    .partido-equipos { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
    .estadisticas-filtros { gap: 0.3rem; }
    .btn-filtro { font-size: 0.72rem; padding: 0.3rem 0.5rem; }


    
}