/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --primary: #bd0507;
    --dark: #050505;
    --dark-grey: #111111;
    --text: #ffffff;
    --font-heading: 'Teko', sans-serif;
    --font-body: 'Barlow', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: var(--dark); color: var(--text); font-family: var(--font-body); overflow-x: hidden; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
img { max-width: 100%; display: block; }

/* =========================================
   2. UTILIDADES
   ========================================= */
.container {
    max-width: 1400px; margin: 0 auto; padding: 0 20px; width: 100%; position: relative;
}
.text-red { color: var(--primary); }

.section-title {
    font-family: var(--font-heading); font-size: 4rem; text-align: center;
    margin-bottom: 50px; text-transform: uppercase; letter-spacing: 2px; line-height: 1;
}
.section-title div {
    font-size: 1.2rem; color: #888; font-family: var(--font-body); 
    letter-spacing: 1px; margin-top: 10px; display: block;
}

/* Botones */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 35px; font-family: var(--font-heading); font-size: 24px; 
    letter-spacing: 1px; text-transform: uppercase; transition: 0.3s; 
    border: 2px solid transparent; cursor: pointer; color: #fff; gap: 10px;
}
.btn-primary { background-color: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background-color: transparent; color: #fff; box-shadow: 0 0 20px rgba(189, 5, 7, 0.6); }

/* FIX VISUAL: Botón Outline legible */
.btn-outline { border: 2px solid #fff; background: transparent; color: #fff; }
.btn-outline:hover { background-color: #fff; color: #000 !important; font-weight: bold; }

/* =========================================
   3. HEADER
   ========================================= */
header { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; padding: 20px 0; transition: 0.3s; }
header.sticky { background: rgba(0, 0, 0, 0.95); padding: 10px 0; border-bottom: 1px solid var(--primary); }

.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 70px; } 
.nav-menu ul { display: flex; gap: 30px; list-style: none; }
.nav-link { font-family: var(--font-heading); font-size: 24px; text-transform: uppercase; color: #ccc; }
.nav-link:hover, .nav-link.active { color: var(--primary); }
.hamburger { display: none; font-size: 30px; cursor: pointer; color: #fff; }

/* =========================================
   4. HERO SECTION
   ========================================= */
#home { 
    height: 100vh; display: flex; align-items: center; justify-content: center; 
    background-size: cover; background-position: center; position: relative;
}
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); }
.hero-content { position: relative; z-index: 2; text-align: center; padding: 0 20px; width: 100%; }
.hero-content h1 { font-family: var(--font-heading); font-size: 6rem; line-height: 0.9; margin-bottom: 15px; text-transform: uppercase; }
.hero-content p { font-size: 1.3rem; color: #ddd; margin-bottom: 40px; }
.hero-btns { display: flex; gap: 20px; justify-content: center; width: 100%; }

/* =========================================
   5. CARRUSEL "LOS ATUNES" (FIX SCROLLBAR & CUTOFF)
   ========================================= */
#team { padding: 80px 0; background: #080808; overflow: hidden; } 
.team-slider-wrapper { position: relative; padding: 0 60px; /* Espacio para las flechas */ }

/* Contenedor Scrollable */
.team-track-container { 
    width: 100%;
    overflow-x: auto; 
    overflow-y: hidden;
    display: flex;
    gap: 20px;
    padding-bottom: 30px; /* Espacio inferior para evitar cortes de sombra */
    
    /* MAGIA: Ajuste Magnético */
    scroll-snap-type: x mandatory; 
    scroll-behavior: smooth;
    
    /* OCULTAR BARRA DE SCROLL (Código estricto) */
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}
.team-track-container::-webkit-scrollbar { 
    display: none; /* Chrome/Safari */
    width: 0;
    height: 0;
}

/* Eliminamos .team-track intermedio para simplificar */
.team-track { display: contents; } 

/* Tarjeta Miembro */
.member-card {
    position: relative; 
    flex: 0 0 auto; /* Evita que se encojan */
    width: 260px;   /* Ancho fijo óptimo */
    background: var(--dark-grey); 
    border: 1px solid #333; 
    transition: 0.3s;
    display: flex; flex-direction: column;
    
    /* ALINEACIÓN: Se detendrá siempre al inicio de la tarjeta */
    scroll-snap-align: start; 
}
.member-card:hover { border-color: var(--primary); transform: translateY(-5px); z-index: 2; }

/* Imagen */
.member-img { height: 320px; width: 100%; position: relative; background: #000; }
.member-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* Overlay Stats */
.member-stats-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); display: flex; flex-direction: column;
    justify-content: center; align-items: center; opacity: 0; transition: 0.3s;
    padding: 20px; z-index: 5; border: 1px solid var(--primary);
}
.member-card:hover .member-stats-overlay { opacity: 1; }
.ms-stat { width: 100%; border-bottom: 1px solid #333; padding: 5px 0; display: flex; justify-content: space-between; width: 100%; }
.ms-stat span { font-size: 0.9rem; color: #888; text-transform: uppercase; }
.ms-stat strong { font-size: 1.2rem; font-family: var(--font-heading); color: #fff; }

/* Textos Card */
.member-card h3 { 
    font-family: var(--font-heading); font-size: 2rem; 
    margin: 15px 0 5px 0; line-height: 1; color: #fff; text-align: center;
}
.member-card p { 
    color: var(--primary); font-size: 1rem; 
    margin-bottom: 15px; text-align: center;
}

/* FLECHAS CARRUSEL (Activas en móvil y PC) */
.atun-control {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.8); color: var(--primary); border: 1px solid var(--primary);
    width: 50px; height: 50px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 20; font-size: 24px; transition: 0.2s;
}
.atun-control:hover { background: var(--primary); color: #fff; }
.atun-control.prev { left: 0; }
.atun-control.next { right: 0; }

/* =========================================
   6. GENERADOR SQUADS
   ========================================= */
#squads { 
    padding: 80px 0; 
    /* Restauramos la imagen de fondo */
    background: url('../images/squad.webp') center/cover no-repeat fixed; 
    background-color: #111; /* Color de respaldo */
    position: relative;
}

/* Capa oscura para que el texto resalte sobre la imagen */
#squads::before {
    content: '';
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.45); /* Oscurece la foto al 85% */
    pointer-events: none; /* Permite clicks a través */
}

/* Asegurar que el contenido quede encima de la capa oscura */
#squads .container { position: relative; z-index: 2; }

/* ... resto del CSS del generador (player-grid, etc) se mantiene igual ... */
.player-grid {
    display: grid; gap: 10px; padding: 20px; background: rgba(10,10,10,0.8); border: 1px solid #222;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); 
    margin-bottom: 40px;
}

.player-checkbox {
    background: #181818; border: 1px solid #333; padding: 15px 5px;
    text-align: center; cursor: pointer; position: relative; transition: 0.2s;
}
.player-checkbox.selected { border-color: var(--primary); background: rgba(189,5,7,0.1); }
.player-checkbox img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; display: block;}
.player-checkbox span { font-family: var(--font-heading); font-size: 1.2rem; display: block; line-height: 1; color: #fff; }
.check-icon { display: none; color: var(--primary); position: absolute; top: 5px; right: 5px; }
.player-checkbox.selected .check-icon { display: block; }

/* Panel Invitados & Buscador */
.guest-panel, .search-box { margin-bottom: 30px; text-align: center; }
.guest-input-group {
    display: flex; justify-content: center; max-width: 500px; margin: 20px auto;
}
.guest-input-group input {
    background: #000; border: 1px solid #444; color: #fff;
    padding: 10px 15px; flex-grow: 1; font-size: 16px; outline: none;
}
.guest-input-group button {
    width: 50px; background: var(--primary); color: #fff; border: 1px solid var(--primary);
    cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px;
}

/* Área Acción */
.action-area { 
    text-align: center; margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.selection-counter { font-family: var(--font-heading); font-size: 2.5rem; color: #fff; }

/* Modal Oculto */
.custom-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 9999;
    display: none; align-items: center; justify-content: center;
}
.custom-modal-overlay.active { display: flex; }
.custom-modal-box {
    background: #111; border: 2px solid var(--primary); padding: 30px;
    text-align: center; max-width: 450px;
}
.modal-btns { display: flex; gap: 15px; justify-content: center; margin-top: 20px; }

/* Resultados */
.results-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 40px; }
.squad-box { background: #1a1a1a; border-left: 4px solid var(--primary); padding: 20px; }
.squad-box h4 { font-family: var(--font-heading); font-size: 1.8rem; margin-bottom: 10px; color: #fff; border-bottom: 1px solid #333; padding-bottom: 5px; }
.squad-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #282828; color: #ccc; }

/* =========================================
   7. ROSTER & TRACKER
   ========================================= */
#roster-stats, #pubg-stats { padding: 80px 0; background: #080808; }
#pubg-stats { background: #050505; }

.roster-grid {
    display: grid; gap: 20px; 
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
}
.roster-card { background: #111; border: 1px solid #333; transition: 0.3s; }
.roster-card:hover { border-color: var(--primary); }
.roster-img img { width: 100%; height: 200px; object-fit: cover; object-position: top; }
.roster-info { padding: 15px; text-align: center; }
.roster-info h4 { font-family: var(--font-heading); font-size: 1.5rem; margin-bottom: 10px; color: #fff; }
.r-stats .stat-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 3px 0; border-bottom: 1px solid #222; color: #aaa; }
.r-stats .stat-row strong { color: #fff; font-family: var(--font-heading); font-size: 1.1rem; }

/* =========================================
   8. RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Header & Menu (FIXED) */
    .nav-menu {
        position: fixed; top: 0; right: -100%; width: 100%; height: 100vh;
        background: rgba(0, 0, 0, 0.98); /* Fondo negro sólido */
        backdrop-filter: blur(10px); z-index: 2000; /* Z-Index alto */
        display: flex; flex-direction: column; justify-content: center; align-items: center;
        transition: 0.4s ease-in-out; 
    }
    .nav-menu.active { right: 0; }
    
    /* FIX: Lista Flex Vertical */
    .nav-menu ul { 
        display: flex; 
        flex-direction: column; 
        gap: 40px; 
        text-align: center; 
        padding: 0; 
        list-style: none;
    }

    /* FIX: Enlaces Grandes */
    .nav-link { font-size: 2.5rem; font-weight: bold; color: #fff; }

    .hamburger { display: block; z-index: 2001; position: relative; font-size: 28px; cursor: pointer; }

    /* 2. Hero */
    .hero-content h1 { font-size: 3.5rem; margin-bottom: 10px; }
    .hero-content p { font-size: 1rem; padding: 0 10px; }
    .hero-btns { flex-direction: column; align-items: center; gap: 15px; }
    .btn { width: 100%; max-width: 280px; }

    /* 3. Carrusel Atunes MÓVIL (1 Card + Flechas) */
    .team-slider-wrapper { padding: 0 50px; /* Espacio flechas */ }
    
    .team-track-container {
        /* Centrado estricto */
        scroll-snap-type: x mandatory; 
        padding-bottom: 20px;
    }
    
    .member-card { 
        width: 100%; /* Ocupar todo el espacio disponible */
        min-width: 100%; 
        scroll-snap-align: center; /* Centrar al soltar */
    }

    /* 4. Roster: 2 columnas */
    .roster-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
    .roster-img img { height: 150px; }
    
    /* 5. Squads */
    .player-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .section-title { font-size: 3rem; margin-bottom: 30px; }
}

/* =========================================
   10. FOOTER CLAN (CENTRADO + BOTÓN TOP)
   ========================================= */
#main-footer {
    background-color: #080808;
    border-top: 4px solid var(--primary);
    font-family: var(--font-body);
    color: #888;
    position: relative;
    padding-top: 60px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 25px;
    margin-bottom: 30px; /* Reducido para dar espacio al botón */
}

/* Logo */
.footer-logo {
    height: 80px;
    transition: 0.3s;
    filter: grayscale(100%);
    opacity: 0.7;
}
.footer-brand:hover .footer-logo {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

/* Descripción */
.footer-desc {
    max-width: 500px;
    font-size: 1.1rem;
    color: #666;
    margin: 0 auto;
    font-style: italic;
}

/* Navegación */
.footer-nav ul {
    display: flex;
    gap: 40px;
    list-style: none;
    padding: 0;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav a {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    text-transform: uppercase;
    color: #fff;
    position: relative;
    transition: 0.3s;
}

.footer-nav a:hover {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(189, 5, 7, 0.5);
}

/* BOTÓN VOLVER ARRIBA (ESTILO GAMER) */
.btn-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: #151515;
    color: var(--primary);
    border: 2px solid var(--primary);
    font-size: 1.5rem;
    transition: 0.3s;
    margin-top: 20px;
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%); /* Forma Octogonal */
    animation: bounce 2s infinite;
}

.btn-top:hover {
    background-color: var(--primary);
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(189, 5, 7, 0.6);
}

/* Pequeña animación para invitar al clic */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

/* Barra Inferior */
.footer-bottom {
    background-color: #000;
    padding: 20px 0;
    font-size: 0.9rem;
    border-top: 1px solid #151515;
    text-align: center;
}

.dev-link { color: var(--primary); font-weight: 700; text-decoration: none; }
.dev-link:hover { color: #fff; }

/* Responsive */
@media (max-width: 768px) {
    .footer-nav ul {
        flex-direction: column;
        gap: 20px;
    }
    .footer-logo { height: 60px; }
}