@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800;900&display=swap');

/* ========================================================================================== */
/* [SEC 1] CONFIGURACIÓN GLOBAL, VARIABLES Y RESET */
/* ========================================================================================== */
:root {
    --neon: #C1FF72;        /* Verde Neon Corporativo */
    --bg: #0D0D0D;          /* Fondo Negro Profundo */
    --card: #1C1C1E;        /* Fondo Tarjetas */
    --pill-bg: #2C2C2E;     /* Fondo Botones */
    --text: #fff;           /* Texto Principal */
    --text-dim: #888;       /* Texto Secundario */
    --border: #333;         /* Bordes sutiles */
    
    /* Variables Específicas Perfiles */
    --profile-bg: #121212;
}

* { box-sizing: border-box; }

body { 
    margin: 0; 
    background-color: #000; 
    color: var(--text); 
    font-family: 'Inter', sans-serif; 
    /* Layout centralizado para simular app móvil en escritorio */
    display: flex; justify-content: center; align-items: flex-start;
    min-height: 100vh; overflow-x: hidden;
}

#app-container { 
    width: 100%; max-width: 450px; /* Ancho máximo tipo móvil */
    background-color: var(--bg); 
    min-height: 100vh; position: relative; 
    box-shadow: 0 0 50px rgba(0,0,0,0.6);
    display: flex; flex-direction: column;
}

/* ========================================================================================== */
/* [SEC 0] PANTALLA DE CARGA (LOADING) */
/* ========================================================================================== */
#pantalla-carga {
    position: fixed; inset: 0; 
    background-color: #000; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}
.loader-img { width: 60px; height: auto; animation: pulse 1.5s infinite; }

@keyframes pulse { 
    0% { opacity: 0.5; transform: scale(0.95); } 
    50% { opacity: 1; transform: scale(1.05); } 
    100% { opacity: 0.5; transform: scale(0.95); } 
}

/* ========================================================================================== */
/* [SEC 2] BARRA DE NAVEGACIÓN Y MENÚ LATERAL */
/* ========================================================================================== */
.navbar { 
    background: rgba(13, 13, 13, 0.95);
    padding: 0 20px; display: flex; justify-content: space-between; 
    align-items: center; height: 60px; position: sticky; top: 0; z-index: 1000; 
    border-bottom: 1px solid var(--border); backdrop-filter: blur(10px);
}
.logo-img { height: 28px; width: auto; object-fit: contain; cursor: pointer; }
.hamburger-btn { font-size: 1.4rem; color: var(--neon); cursor: pointer; }

/* Menú Lateral (Sidebar) */
#sidebar-menu { 
    position: fixed; top: 0; right: -280px; width: 280px; height: 100vh; 
    background-color: rgba(10, 10, 10, 0.98); 
    backdrop-filter: blur(20px); border-left: 1px solid rgba(255, 255, 255, 0.1); 
    z-index: 1100; transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; flex-direction: column; padding-top: 80px; 
}
#sidebar-menu.open { right: 0; }
#sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1050; display: none; }
#sidebar-overlay.open { display: block; }

.sidebar-content button { 
    background: none; border: none; color: #fff; width: 100%; padding: 20px 30px; 
    text-align: left; font-family: 'Inter'; font-weight: 300; font-size: 1rem; 
    border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: 0.3s; 
}
.sidebar-content button:hover { color: var(--neon); padding-left: 35px; }
.close-btn { position: absolute; top: 15px; right: 20px; background: none; border: none; color: var(--neon); font-size: 2.5rem; cursor: pointer; }

/* ========================================================================================== */
/* [SEC 3] PORTADA HERO (VIDEO + MENÚ DEPORTIVO) */
/* ========================================================================================== */
.hero-video-container { 
    position: relative; width: 100%; height: 75vh; 
    overflow: hidden; border-bottom: 4px solid var(--neon);
}
.video-bg { 
    width: 100%; height: 100%; object-fit: cover; 
    position: absolute; top: 0; left: 0; z-index: 0;
}
.video-overlay {
    position: absolute; inset: 0; 
    background: linear-gradient(to right, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
}

.hero-menu-lateral {
    position: absolute; top: 50%; left: 30px; transform: translateY(-50%);
    z-index: 2; display: flex; flex-direction: column; gap: 40px;
}
.menu-item-hero { cursor: pointer; transition: transform 0.3s ease; }
.menu-item-hero:hover { transform: translateX(15px); }
.menu-item-hero:hover .menu-txt { color: var(--neon); }

.menu-num { 
    display: block; font-size: 0.8rem; font-weight: 700; color: var(--neon); 
    margin-bottom: -2px; letter-spacing: 3px; 
}
.menu-txt { 
    display: block; font-weight: 900; font-size: 3.2rem; color: #fff; 
    line-height: 0.9; text-transform: uppercase; letter-spacing: -2px; 
    font-style: italic; text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* ========================================================================================== */
/* [SEC 4] TEMPORADA ACTUAL (TABLAS Y CONTROLES) */
/* ========================================================================================== */
.header-section h1 { font-size: 1.5rem; text-align: center; margin: 25px 0; font-weight: 800; letter-spacing: -1px; }

/* Submenú Píldora */
.sub-menu-container { padding: 0 20px; margin-bottom: 20px; }
.sub-menu { background: var(--pill-bg); border-radius: 50px; display: flex; padding: 5px; gap: 5px; }
.btn-sub { 
    flex: 1; background: transparent; border: none; color: #888; padding: 10px; 
    border-radius: 50px; font-weight: 700; font-size: 0.7rem; 
    cursor: pointer; text-transform: uppercase; transition: 0.3s; 
}
.btn-sub.active { background: var(--neon); color: #000; box-shadow: 0 2px 10px rgba(193, 255, 114, 0.2); }

/* Scroll Horizontal de Rondas */
.rondas-wrapper { padding: 0 15px 15px 15px; overflow: hidden; }
.scroll-horizontal { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.scroll-horizontal::-webkit-scrollbar { display: none; }
.btn-ronda { 
    background: var(--card); color: #fff; border: 1px solid #333; 
    padding: 8px 18px; border-radius: 50px; font-size: 0.75rem; font-weight: 600; 
    white-space: nowrap; cursor: pointer; transition: 0.2s; 
}
.btn-ronda.active { background: #fff; color: #000; font-weight: 800; border-color: #fff; }

/* Estilos de Tabla de Clasificación */
.table-container { 
    background: var(--card); border-radius: 16px; padding: 10px; 
    margin: 0 15px 20px 15px; overflow-x: auto; border: 1px solid var(--border); 
}
table { width: 100%; border-collapse: collapse; font-size: 0.75rem; white-space: nowrap; }

/* Celda Equipo: Flexbox para alinear Escudo + Nombre */
.celda-equipo { display: flex; align-items: center; gap: 12px; }
.celda-equipo span { font-weight: 700; color: #eee; text-transform: uppercase; }
.escudo-tabla { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5)); }

th { color: #666; padding: 12px 10px; border-bottom: 1px solid #333; font-size: 0.65rem; font-weight: 800; text-align: center; }
th:nth-child(2) { text-align: left; } /* Alinear columna equipo a la izquierda */

td { padding: 12px 10px; border-bottom: 1px solid #222; text-align: center; font-weight: 500; }
td:nth-child(2) { text-align: left; }

/* ========================================================================================== */
/* [SEC 8] UTILIDADES TARJETAS PARTIDOS (LISTADO GENERAL) */
/* ========================================================================================== */
.partido-card-wrapper { 
    background: linear-gradient(145deg, #1e1e1e 0%, #121212 100%);
    border-radius: 20px; margin: 0 15px 15px 15px; padding: 20px; 
    border: 1px solid rgba(193, 255, 114, 0.1); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    position: relative; transition: transform 0.2s ease; cursor: pointer;
}
.partido-card-wrapper:active { transform: scale(0.98); }

.partido-info-top { display: flex; justify-content: center; gap: 12px; margin-bottom: 15px; }
.partido-info-top span {
    font-size: 0.65rem; font-weight: 800; color: var(--neon); 
    text-transform: uppercase; letter-spacing: 1.5px;
    background: rgba(193, 255, 114, 0.05); padding: 5px 12px; border-radius: 6px;
}

.partido-main-row { display: flex; justify-content: space-between; align-items: center; gap: 5px; }

.equipo-wrapper { width: 40%; display: flex; align-items: center; gap: 8px; }
.equipo-wrapper.local { justify-content: flex-end; text-align: right; }
.equipo-wrapper.visitante { justify-content: flex-start; text-align: left; }

.equipo-nombre { font-weight: 800; font-size: 0.75rem; text-transform: uppercase; color: #fff; line-height: 1.1; }
.escudo-partido { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6)); }

.marcador { 
    background: #000; color: var(--neon); padding: 8px 10px; border-radius: 12px; 
    font-weight: 900; font-size: 1.3rem; min-width: 65px; text-align: center; 
    border: 1px solid #333; 
}
.marcador.not-played { 
    background: transparent; border: 1px dashed #444; color: #666; 
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0; box-shadow: none; 
}
/* ========================================================================================== */
/* [SEC 5] EDICIONES & GRID DE CARTAS (JUGADORES/EQUIPOS) */
/* ========================================================================================== */
.editions-list-horizontal { display: flex; flex-direction: column; gap: 20px; padding: 0 15px; margin-bottom: 30px; }

.card-edicion-horizontal { 
    position: relative; width: 100%; height: 140px; border-radius: 18px; 
    overflow: hidden; background: #1c1c1e; cursor: pointer; border: 1px solid #333;
    transition: transform 0.2s ease;
}
.card-edicion-horizontal:active { transform: scale(0.98); }
.card-edicion-horizontal img { width: 100%; height: 100%; object-fit: cover; }

.overlay-edicion { 
    position: absolute; inset: 0; background: rgba(0,0,0,0.4); 
    display: flex; align-items: center; justify-content: center; 
    pointer-events: none; /* Permite clic a través del overlay */
}
.titulo-edicion-hover { 
    color: #fff; font-weight: 900; font-size: 1.6rem; 
    text-transform: uppercase; letter-spacing: 2px; 
    text-shadow: 0 4px 15px rgba(0,0,0,0.8); 
}

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 15px; }

/* --- ESTILO PREMIUM CARTA JUGADOR/EQUIPO (GRID) --- */
.card-mini { 
    background: #000; /* Fondo negro solicitado */
    border-radius: 12px; padding: 0; 
    display: flex; flex-direction: column; align-items: center; text-align: center; 
    cursor: pointer; border: 1px solid #222; overflow: hidden; position: relative;
    aspect-ratio: 3/4; /* Formato vertical tipo cromo */
    transition: transform 0.2s;
}
.card-mini:active { transform: scale(0.95); }

.card-mini img { 
    width: 100%; height: 80%; /* Deja espacio abajo para texto */
    object-fit: cover; object-position: top; z-index: 1;
}

/* Degradado inferior sobre la foto para integrar con el negro */
.card-mini::after {
    content: ''; position: absolute; bottom: 20%; left: 0; width: 100%; height: 50%;
    background: linear-gradient(to top, #000 10%, transparent 100%);
    pointer-events: none; z-index: 2;
}

/* Texto del jugador "más bonito" */
.card-mini .card-texto { 
    height: 20%; width: 100%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.55rem; font-weight: 800; text-transform: uppercase; 
    color: #fff; background: #000; z-index: 3;
    letter-spacing: 0.5px; padding: 0 2px;
}


/* ========================================================================================== */
/* [SEC 6 & 7] PERFILES (EQUIPO Y JUGADOR) */
/* ========================================================================================== */
/* Botones Volver */
.btn-volver-texto { background: none; border: none; color: var(--neon); font-weight: 700; font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.btn-volver-flotante, .btn-back-absolute { 
    position: absolute; top: 15px; left: 15px; 
    background: rgba(0,0,0,0.6); color: #fff; border: 1px solid rgba(255,255,255,0.2); 
    width: 40px; height: 40px; border-radius: 50%; z-index: 20; 
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px); font-size: 1.2rem;
}
.header-nav-inline { padding: 15px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid #222; background: var(--bg); }

/* Perfil Equipo */
.perfil-header-container { position: relative; height: 180px; overflow: hidden; border-bottom: 3px solid var(--neon); }
.img-portada-fondo { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.overlay-gradiente { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg), transparent); }

.datos-identidad { position: absolute; bottom: 15px; left: 20px; display: flex; align-items: flex-end; gap: 15px; }
.img-escudo-perfil { width: 70px; height: 70px; object-fit: contain; border-radius: 10px; background: rgba(0,0,0,0.5); padding: 5px; backdrop-filter: blur(5px); }
.texto-nombre-grande { font-size: 1.4rem; font-weight: 800; margin: 0; text-shadow: 0 2px 5px #000; line-height: 1; color: #fff; }

/* Perfil Jugador */
.perfil-jugador-fullscreen {
    background-color: var(--profile-bg);
    min-height: 100vh; padding: 0; position: relative; color: #fff; padding-bottom: 40px; 
}

/* Hero Jugador */
.jugador-hero { position: relative; height: 50vh; width: 100%; overflow: hidden; }
.img-container { width: 100%; height: 100%; position: relative; }
.img-jugador-full { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.hero-gradient {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 70%;
    background: linear-gradient(to top, #121212 25%, transparent);
}

.hero-info-overlay { position: absolute; bottom: 0; left: 20px; right: 20px; z-index: 10; padding-bottom: 15px; }
.info-row-top { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 0px; }
.dorsal-text { font-size: 1.8rem; font-weight: 700; color: #fff; text-shadow: 0 2px 10px #000; }

/* PERCENTIL DEPORTIVO GIGANTE (Sin círculo) */
.percentil-grande {
    font-family: 'Inter', sans-serif;
    font-size: 6rem; /* Tamaño muy grande */
    font-weight: 900; 
    font-style: italic;
    color: var(--neon);
    text-shadow: 0 0 25px rgba(193, 255, 114, 0.4);
    line-height: 0.8;
    transform: skewX(-5deg); /* Inclinación deportiva */
}

.alias-text {
    font-size: 3rem; font-weight: 900; margin: 0;
    text-transform: uppercase; line-height: 0.9;
    letter-spacing: -1.5px; text-shadow: 0 4px 20px #000;
}
.nac-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.flag-icon img { width: 24px; border-radius: 4px; box-shadow: 0 2px 5px #000; }
.nac-text { font-size: 0.9rem; color: #ddd; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }

.jugador-content-body { padding: 20px; background: var(--profile-bg); }
.description-text { font-size: 0.9rem; line-height: 1.5; color: #aaa; margin-bottom: 30px; font-style: italic; border-left: 3px solid var(--neon); padding-left: 15px; }

.stats-box {
    background: #1a1a1a; border-radius: 20px; padding: 25px; 
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}
.stat-col { flex: 1; text-align: center; }
.stat-val { display: block; font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: 5px; }
.stat-lbl { font-size: 0.6rem; color: #666; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; }
.stat-separator { width: 1px; height: 35px; background: #333; }

.section-block { margin-bottom: 30px; }
.section-title { font-size: 0.85rem; color: #666; text-transform: uppercase; font-weight: 800; border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 15px; letter-spacing: 1px; }

.palmares-list { display: flex; flex-direction: column; gap: 10px; }
.premio-item { background: #181818; padding: 15px; border-radius: 10px; border-left: 4px solid var(--neon); font-weight: 600; font-size: 0.9rem; color: #eee; }

.trayectoria-vertical-lista { display: flex; flex-direction: column; gap: 10px; }
.trayectoria-item-row {
    display: flex; align-items: center; gap: 15px;
    background: #151515; padding: 12px 18px; border-radius: 12px;
    border: 1px solid #222; cursor: pointer; transition: 0.2s;
}
.trayectoria-item-row:active { background: #222; }
.tray-img-small { width: 35px; height: 35px; object-fit: contain; }
.tray-nombre { font-size: 0.95rem; font-weight: 700; color: #fff; text-transform: uppercase; }


/* ========================================================================================== */
/* [SEC 9] DETALLE DE PARTIDO (TIMELINE PROFESIONAL) */
/* ========================================================================================== */
.detalle-body { padding: 0; }

/* Header del Match (Resultado Grande) */
.match-header-container {
    background: linear-gradient(to bottom, #111, #000);
    padding: 30px 20px; border-bottom: 1px solid #222;
    display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.mh-row-teams { display: flex; width: 100%; justify-content: space-between; align-items: center; }
.mh-team { display: flex; flex-direction: column; align-items: center; width: 35%; text-align: center; gap: 10px; }
.mh-logo { width: 60px; height: 60px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(255,255,255,0.1)); }
.mh-name { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; color: #fff; }

.mh-score-box { background: #222; padding: 10px 20px; border-radius: 12px; border: 1px solid #333; }
.mh-score { font-size: 2.5rem; font-weight: 900; color: var(--neon); letter-spacing: 2px; line-height: 1; }
.mh-meta { font-size: 0.7rem; color: #666; text-transform: uppercase; margin-top: 5px; }

/* Timeline Cronológica */
.timeline-container { padding: 20px; }
.timeline-title { text-align: center; color: #666; font-size: 0.75rem; letter-spacing: 2px; margin-bottom: 25px; font-weight: 700; text-transform: uppercase; }
.timeline-list { display: flex; flex-direction: column; gap: 15px; position: relative; }

/* Línea vertical central */
.timeline-list::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #222; transform: translateX(-50%); z-index: 0;
}

.timeline-row { display: flex; align-items: center; width: 100%; position: relative; z-index: 1; }

.t-col { flex: 1; font-size: 0.85rem; font-weight: 600; color: #ddd; }
.t-home { text-align: right; padding-right: 15px; } /* Texto local a la derecha */
.t-away { text-align: left; padding-left: 15px; }   /* Texto visitante a la izquierda */

/* Círculo del minuto */
.t-min-box {
    width: 30px; height: 30px; background: #1a1a1a; border: 1px solid var(--neon);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 800; color: var(--neon); box-shadow: 0 0 10px rgba(0,0,0,0.8);
}

.goal-player { display: block; color: #fff; font-weight: 700; margin-bottom: 2px; }
.goal-detail { font-size: 0.65rem; color: #666; text-transform: uppercase; }


/* ========================================================================================== */
/* [SEC 8] FOOTER Y UTILIDADES */
/* ========================================================================================== */
.main-footer { 
    background-color: #080808; padding: 40px 20px; text-align: center; 
    border-top: 1px solid #222; color: #666; font-size: 0.8rem; margin-top: 40px; 
}
.instagram-btn { 
    background: var(--neon); color: #000; padding: 12px 25px; 
    border-radius: 50px; text-decoration: none; font-weight: 800; 
    font-size: 0.75rem; display: inline-block; margin: 20px 0; 
}

/* Clases de utilidad */
.pantalla { display: none; opacity: 0; transition: opacity 0.3s ease; }
.activa { display: block !important; opacity: 1; }
.oculta { display: none !important; }