/* --- Estilos Generales y Reset --- */
:root {
    --color-primary: #a00000; /* Rojo oscuro/principal */
    --color-secondary: #831313; /* Rojo vibrante */
    --color-text-light: #ffffff; /* Blanco para texto */
    --color-text-dark: #000000; /* Negro */
    --color-background-dark: #1a1a1a; /* Fondo muy oscuro */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--color-text-light);
    background-color: var(--color-background-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, .nav-list a, .bottom-nav-list a {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
}

a {
    text-decoration: none;
    color: var(--color-text-light);
}

ul {
    list-style: none;
}

/* ------------------------------------- */
/* --- ESTILOS DE HOME (index.html) --- */
/* ------------------------------------- */
.home-body {
    background-color: var(--color-background-dark);
    height: 100vh;
    overflow: hidden; 
}

.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    /* Fondo de Home: Imagen Full Screen con efecto Cover */
    background: url('img/Fondo.jpg') no-repeat center center;
    background-size: cover; 
    background-attachment: fixed;
    background-color: var(--color-background-dark); 
}

.hero-content-simple {
    text-align: center;
    position: relative;
    z-index: 20;
}

/* --- Animación VICTORY ROAD MEJORADA (Onda Neón con Parpadeo) --- */
.anim-text {
    font-family: 'Montserrat', sans-serif; 
    font-weight: 700;
    font-size: 7rem; 
    line-height: 1.1;
    color: var(--color-text-light); 
    text-shadow: 0 0 20px rgba(0,0,0,0.9);
    display: flex; 
    justify-content: center;
    overflow: hidden; 
    /* El parpadeo se aplica a todo el bloque después de que la onda de entrada termine */
    animation: neon-flicker-loop 5s 1.5s infinite alternate; 
}

.anim-text.anim-fade span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100px);
    animation: neon-wave-in 1.5s forwards; /* Aplica la animación de onda */
}

/* Retraso progresivo para la animación de onda */
.anim-text.anim-fade span:nth-child(1) { animation-delay: 0.1s; }
.anim-text.anim-fade span:nth-child(2) { animation-delay: 0.2s; }
.anim-text.anim-fade span:nth-child(3) { animation-delay: 0.3s; }
.anim-text.anim-fade span:nth-child(4) { animation-delay: 0.4s; }
.anim-text.anim-fade span:nth-child(5) { animation-delay: 0.5s; }
.anim-text.anim-fade span:nth-child(6) { animation-delay: 0.6s; }
.anim-text.anim-fade span:nth-child(7) { animation-delay: 0.7s; }
.anim-text.anim-fade span:nth-child(8) { animation-delay: 0.8s; } /* Espacio */
.anim-text.anim-fade span:nth-child(9) { animation-delay: 0.9s; }
.anim-text.anim-fade span:nth-child(10) { animation-delay: 1.0s; }
.anim-text.anim-fade span:nth-child(11) { animation-delay: 1.1s; }
.anim-text.anim-fade span:nth-child(12) { animation-delay: 1.2s; }

/* 1. Animación de entrada (Onda) */
@keyframes neon-wave-in {
    0% {
        opacity: 0;
        transform: translateY(100px);
        text-shadow: none;
        color: var(--color-background-dark);
    }
    50% {
        opacity: 0.5;
        transform: translateY(0);
        text-shadow: 
            0 0 5px var(--color-secondary);
        color: var(--color-secondary);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        text-shadow: 
            0 0 10px var(--color-primary),
            0 0 20px var(--color-primary);
        color: var(--color-text-light);
    }
}

/* 2. Animación de bucle (Parpadeo Neón) */
@keyframes neon-flicker-loop {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 10px var(--color-primary),
            0 0 20px var(--color-primary),
            0 0 40px rgba(255, 0, 0, 0.5); /* Sombra difusa */
        color: var(--color-text-light);
    }
    20%, 24%, 55% {
        /* Parpadeo (momentos oscuros) */
        text-shadow: 0 0 5px rgba(255, 0, 0, 0.2);
        color: var(--color-secondary);
        transform: scale(0.99); /* Ligero temblor */
    }
}


/* --- Navegación Inferior (Barra Roja) --- */
.bottom-nav {
    position: fixed; 
    bottom: 0;
    width: 100%;
    padding: 15px 0;
    z-index: 30;
    text-align: center;
    background-color: var(--color-secondary); 
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.5);
}

.bottom-nav-list {
    display: flex;
    justify-content: center;
    gap: 30px; 
}

.bottom-nav-list a {
    font-size: 1.2rem; 
    font-weight: 700;
    color: var(--color-text-light);
    padding: 5px 10px;
    transition: background-color 0.3s;
}

.bottom-nav-list a:hover,
.bottom-nav-list a.active {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 5px;
}


/* ------------------------------------- */
/* --- ESTILOS DE PÁGINAS DE SECCIÓN --- */
/* ------------------------------------- */

/* Fondo Base (Para todas las páginas de sección) */
.section-page {
    /* Fondo con Patrón de líneas Diagonales Rojas/Negras */
    background: repeating-linear-gradient(
        -45deg,
        var(--color-background-dark),
        var(--color-background-dark) 10px,
        rgba(255, 0, 0, 0.1) 10px,
        rgba(255, 0, 0, 0.1) 15px
    );
    background-attachment: fixed;
    background-color: var(--color-background-dark);
}

/* Contenedor principal con transparencia para el fondo */
.matches-section, .team-section, .gallery-section, .contact-section {
    background-color: rgba(26, 26, 26, 0.7); 
    min-height: calc(100vh - 70px);
    padding-bottom: 90px; 
    padding-top: 20px;
}

.section-page main {
    padding-top: 70px; 
}

/* --- Navegación Superior --- */
.main-header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.nav-list {
    display: flex;
    justify-content: flex-end;
    gap: 30px;
    padding-right: 20px;
}

.nav-list a:hover,
.nav-list a.active {
    color: var(--color-secondary);
    border-bottom: 2px solid var(--color-secondary);
}

.section-title-top {
    font-size: 3rem;
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
    color: var(--color-secondary);
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

/* -------------------------- */
/* --- Partidos Section (matches-section) --- */
/* -------------------------- */
.matches-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.matches-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.match-card {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    color: var(--color-text-light);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 0, 0, 0.3);
    transition: transform 0.3s;
}

.match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.5);
}

.team-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
    text-align: center;
}

.team-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 5px;
}

.score {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: 'Oswald', sans-serif;
    width: 20%;
    text-align: center;
}

.score.win { color: #00ff00; } /* Verde para Victoria */
.score.lose { color: var(--color-secondary); } /* Rojo para Derrota */
.score.draw { color: #ffff00; } /* Amarillo para Empate */

/* ------------------------------------- */
/* --- ESTILOS DE EQUIPO (equipo.html) MEJORADOS Y ORIGINALES --- */
/* ------------------------------------- */

.team-section {
    padding: 40px 0;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; 
    justify-items: center;
    padding: 20px 0;
    max-width: 1000px; 
    margin: 0 auto;
    perspective: 1200px; 
}

.player-card {
    background-color: #2c2c2c;
    border-radius: 10px 10px 20px 20px; 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    width: 100%; 
    max-width: 350px; 
    text-align: center;
    border: none;
    
    transform-style: preserve-3d; 
    transition: transform 0.5s, box-shadow 0.5s;
    position: relative; 
}

/* ANIMACIÓN 3D: Inclinación y Sombra agresiva en hover */
.player-card:hover {
    transform: rotateY(5deg) rotateX(2deg) scale(1.03); 
    box-shadow: 0 20px 40px rgba(255, 0, 0, 0.6); 
    border: 3px solid var(--color-secondary); 
}

/* Estilo para la foto del jugador - CORRECCIÓN PARA NO RECORTAR */
.player-photo {
    width: 100%; 
    height: 350px; 
    background-color: #000; 
    object-fit: contain; /* ¡CRUCIAL! Asegura que la imagen completa se vea sin recortar */
    display: block;
    border-bottom: 3px solid var(--color-primary); 
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.4)); 
    transition: filter 0.5s, opacity 0.5s;
}

/* ANIMACIÓN: Efecto de Opacidad sutil al pasar el ratón */
.player-card:hover .player-photo {
    filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8));
    opacity: 0.95; 
}

.player-info {
    padding: 20px;
    text-align: left; 
    position: relative;
    z-index: 2; 
    padding-left: 30px; 
}

/* Barra Vertical de Estilo */
.player-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px; 
    height: 100%;
    background-color: var(--color-secondary);
    transition: background-color 0.3s;
}

.player-card:hover .player-info::before {
    background-color: var(--color-primary); 
}

.player-info h3 {
    color: var(--color-text-light); 
    margin-bottom: 5px;
    font-size: 2.1rem; 
    border-bottom: none; 
    padding-bottom: 0;
    text-transform: none; 
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    line-height: 1.1;
}

/* Subtítulo de Ficha */
.player-info h3::after {
    content: " — Ficha Oficial";
    display: block;
    font-size: 0.8rem;
    color: var(--color-secondary);
    font-weight: 400;
    margin-top: 5px;
}

.player-info p {
    margin-bottom: 4px;
    font-size: 1rem;
    color: #aaa;
}

.player-info strong {
    color: var(--color-text-light);
    font-weight: 500;
    font-family: 'Oswald', sans-serif;
}

/* -------------------------- */
/* --- Galería Section (gallery-section) --- */
/* -------------------------- */

.gallery-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.gallery-row {
    margin-bottom: 30px;
    overflow: hidden; 
    border: 3px solid var(--color-primary);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.2);
}

.gallery-slider-wrapper {
    display: flex;
    gap: 10px; 
    padding: 10px;
    overflow-x: auto; 
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.gallery-slider-wrapper::-webkit-scrollbar {
    height: 8px;
}

.gallery-slider-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 10px;
}

.gallery-slider-wrapper::-webkit-scrollbar-track {
    background: var(--color-background-dark);
}

.gallery-item {
    flex-shrink: 0; 
    width: 250px; 
    height: 150px; 
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s, opacity 0.3s;
    scroll-snap-align: start;
}

.gallery-item:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

/* Lightbox Modal (si se usa) */
.modal {
    display: none; 
    position: fixed; 
    z-index: 200; 
    padding-top: 60px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgb(0,0,0); 
    background-color: rgba(0,0,0,0.9); 
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* -------------------------- */
/* --- Contacto Section (contact-section) --- */
/* -------------------------- */

.contact-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.contact-form-container {
    background-color: #2c2c2c;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* Se asegura que la clase sea .contact-form, que se usa en el HTML corregido */
.contact-form label {
    display: block;
    margin: 15px 0 5px;
    font-weight: 700;
    color: var(--color-secondary);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #333;
    color: var(--color-text-light);
    font-size: 1rem;
}

.contact-form textarea {
    resize: vertical;
}

.submit-btn {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: background-color 0.3s;
    width: 100%;
    text-transform: uppercase;
}

.submit-btn:hover {
    background-color: #cc0000;
}

.contact-info {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ------------------------------------- */
/* --- MEDIA QUERIES (Responsive) --- */
/* ------------------------------------- */

@media (max-width: 900px) {
    /* Partidos */
    .matches-grid { 
        grid-template-columns: 1fr; 
        max-width: 400px; 
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    /* General */
    .section-page main { padding-top: 55px; } 
    
    /* Home - AJUSTE PRINCIPAL: Reducir más el tamaño de texto para móviles grandes/tablets */
    .anim-text { font-size: 3.5rem; } 
    .bottom-nav-list { gap: 10px; padding: 0 10px;} 
    .bottom-nav-list a { font-size: 0.9rem; padding: 5px; }
    
    /* Navegación Superior */
    .main-header { padding: 10px 0; }
    .nav-list { gap: 15px; padding-right: 10px; }
    .nav-list a { font-size: 0.8rem; }
    
    /* Equipo: 1 tarjeta por vista en móvil */
    .team-grid {
        grid-template-columns: 1fr; 
        max-width: 400px;
        margin: 0 auto;
    }
    .player-card:hover {
        transform: scale(1.02); 
    }
    .player-photo { height: 250px; } 
    .player-info h3 { font-size: 1.7rem; }
    
    /* Galería */
    .gallery-item { width: 150px; height: 100px; }
    
    /* Contacto */
    .contact-section { padding: 20px 10px; }
}

/* --- NUEVA MEDIA QUERY: Para teléfonos pequeños (ancho menor a 450px) --- */
@media (max-width: 450px) {
    /* Home - AJUSTE CRÍTICO para pantallas muy pequeñas */
    .anim-text { 
        font-size: 2.5rem; /* Máxima reducción para evitar desbordamiento */
        line-height: 1.2;
    } 
    .hero-section {
        /* Asegura que la imagen de fondo no se corte si el 'fixed' falla en algunos móviles */
        background-attachment: scroll; 
    }
    
    /* Navegación Inferior */
    .bottom-nav-list { 
        gap: 5px; 
    }
    .bottom-nav-list a { 
        font-size: 0.8rem; 
        padding: 5px 3px; 
    }

    /* Navegación Superior */
    .nav-list a { font-size: 0.7rem; }
    
    /* Partidos */
    .score { font-size: 1.8rem; }
    
    /* Equipo */
    .player-photo { height: 200px; } 
    .player-info { padding-left: 20px; }
    .player-info h3 { font-size: 1.5rem; }
}