/* --- guesstheclub.css | THE PUCK GAMES STYLE --- */

:root {
    --bg-dark: #0a0e17;
    --card-bg: #131a26;
    --border-dark: #2a3441;
    --neon-blue: #00f2ff;
    --neon-blue-glow: rgba(0, 242, 255, 0.5);
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
    
    /* Colores de estado */
    --correct-glass: rgba(0, 255, 136, 0.15);
    --correct-border: #00ff88;
    --wrong-glass: rgba(255, 255, 255, 0.05);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Inter', sans-serif; 
}

body { 
    background: var(--bg-dark); 
    color: var(--text-primary); 
}

.hidden { display: none !important; }

/* --- NAVEGACIÓN --- */
.navbar { 
    padding: 20px; 
    text-align: center; 
    border-bottom: 1px solid var(--border-dark); 
    background: var(--card-bg); 
}

.logo { 
    font-size: 2rem; 
    font-weight: 900; 
    letter-spacing: 1px;
}

.highlight { color: var(--neon-blue); }

/* --- CONTENEDOR PRINCIPAL --- */
.game-wrapper { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

/* --- BARRA SUPERIOR (CONTADOR) --- */
.stats-top-bar { 
    width: 100%; 
    display: flex; 
    justify-content: flex-end; 
    margin-bottom: 20px; 
    z-index: 10;
}

.attempts-counter { 
    font-size: 1.1rem; 
    font-weight: 900; 
    color: var(--neon-blue); 
    background: var(--card-bg); 
    padding: 10px 20px; 
    border: 1px solid var(--border-dark); 
    border-radius: 8px; 
    text-transform: uppercase; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* --- CAJA MISTERIOSA --- */
.mystery-container { 
    margin-bottom: 40px; 
    display: flex; 
    justify-content: center; 
}

.mystery-box { 
    width: 200px; 
    height: 200px; 
    background: var(--card-bg); 
    border-radius: 15px; 
    border: 3px solid var(--neon-blue); 
    box-shadow: 0 0 25px var(--neon-blue-glow); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

.question-overlay { 
    font-size: 7rem; 
    font-weight: 900; 
    color: var(--neon-blue); 
    text-shadow: 0 0 20px var(--neon-blue-glow); 
}

/* --- BUSCADOR / AUTOCOMPLETADO --- */
.search-section { 
    width: 100%; 
    display: flex; 
    justify-content: center; 
    margin-bottom: 40px; 
}

.autocomplete-wrapper { 
    position: relative; 
    width: 100%; 
    max-width: 600px; 
}

.custom-input { 
    width: 100%; 
    padding: 20px 25px; 
    border-radius: 12px; 
    background: var(--card-bg); 
    border: 1px solid var(--border-dark); 
    color: #fff; 
    font-size: 1.3rem; 
    font-weight: 700; 
    outline: none; 
    transition: 0.3s; 
}

.custom-input:focus { 
    border-color: var(--neon-blue); 
    box-shadow: 0 0 15px var(--neon-blue-glow); 
}

.suggestions-list { 
    position: absolute; 
    top: 105%; 
    width: 100%; 
    background: #0d1117; 
    border: 1px solid var(--border-dark); 
    border-radius: 12px; 
    z-index: 1000; 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
}

.sugg-item { 
    display: flex; 
    align-items: center; 
    padding: 15px; 
    gap: 20px; 
    border-bottom: 1px solid #222; 
    cursor: pointer; 
    transition: 0.2s; 
}

.sugg-item:hover { background: rgba(0, 242, 255, 0.1); }
.sugg-logo { width: 50px; height: 50px; object-fit: contain; }
.sugg-name { font-weight: 900; font-size: 1.2rem; color: #fff; }

/* --- TABLERO GRID GIGANTE --- */
.guesses-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.grid-table { 
    min-width: 1100px; 
}

.grid-header { 
    display: grid; 
    grid-template-columns: 2.5fr 1fr 1fr 1.2fr 1.5fr 1fr 1.2fr; 
    gap: 15px; 
    margin-bottom: 15px; 
    text-align: center; 
}

.grid-header div {
    font-weight: 900;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.grid-attempt-row { 
    display: grid; 
    grid-template-columns: 2.5fr 1fr 1fr 1.2fr 1.5fr 1fr 1.2fr; 
    gap: 15px; 
    margin-bottom: 15px; 
}

.grid-box { 
    height: 110px; /* Celdas grandes y premium */
    background: var(--wrong-glass); 
    border: 1px solid var(--border-dark); 
    border-radius: 15px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    font-size: 1.4rem; /* Tamaño de texto generoso */
    font-weight: 900; 
    position: relative; 
}

.correct { 
    background: var(--correct-glass) !important; 
    border: 2px solid var(--correct-border) !important; 
    color: var(--correct-border) !important; 
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

/* Caja específica para el Club (Logo + Nombre) */
.club-box { 
    flex-direction: row; 
    justify-content: flex-start; 
    padding-left: 20px; 
}

.box-logo { 
    width: 65px; 
    height: 65px; 
    margin-right: 15px; 
    object-fit: contain; 
}

.box-name { 
    font-size: 1.2rem; 
    text-align: left; 
    line-height: 1.2; 
}

/* Indicadores de flechas (Establecimiento y Capacidad) */
.arrow-indicator { 
    position: absolute; 
    bottom: 5px; 
    right: 12px; 
    font-size: 2rem; 
    color: var(--neon-blue); 
    text-shadow: 0 0 10px var(--neon-blue-glow);
}

/* --- MODAL DE FINAL --- */
.final-modal { 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.9); 
    backdrop-filter: blur(10px); 
    display: none; 
    justify-content: center; 
    align-items: center; 
    z-index: 2000; 
}

.final-modal.show { display: flex; }

.modal-content { 
    background: var(--card-bg); 
    border: 2px solid var(--neon-blue); 
    padding: 50px; 
    border-radius: 20px; 
    text-align: center; 
    box-shadow: 0 0 40px var(--neon-blue-glow);
    max-width: 500px;
    width: 90%;
}

#endMessage { 
    font-size: 2.5rem; 
    font-weight: 900; 
    margin-bottom: 25px; 
    text-shadow: 0 0 10px currentColor; 
}

.revealed-player-info { margin-bottom: 30px; }

.revealed-player-info img { 
    width: 180px; 
    height: 180px; 
    object-fit: contain; 
    margin-bottom: 20px; 
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    border: 4px solid var(--neon-blue);
}

#revealed-name {
    font-size: 1.8rem;
    font-weight: 900;
}

.b2b-stats-grid { margin-bottom: 25px; }

.stat-box {
    background: var(--wrong-glass);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-dark);
    display: inline-block;
    min-width: 120px;
}

.stat-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--neon-blue);
}

.stat-text {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 700;
}

.modal-actions { 
    display: flex; 
    gap: 15px; 
    justify-content: center; 
}

.b2b-btn { 
    padding: 15px 25px; 
    border-radius: 8px; 
    font-weight: 900; 
    border: none; 
    cursor: pointer; 
    font-size: 1.1rem; 
    transition: 0.2s;
}

.b2b-btn:hover { transform: scale(1.05); }

.btn-share { background: #5c4dff; color: white; }
.btn-finish { background: #ccff00; color: black; }

/* =========================================
   ANIMACIONES DEL JUEGO
   ========================================= */

/* 1. Animación en cascada para las celdas del intento */
.grid-attempt-row .grid-box {
    opacity: 0;
    /* Usamos forwards para que se queden visibles al terminar */
    animation: flipIn 0.5s ease forwards;
}

/* Retrasos escalonados para cada columna (efecto Wordle) */
.grid-attempt-row .grid-box:nth-child(1) { animation-delay: 0.1s; }
.grid-attempt-row .grid-box:nth-child(2) { animation-delay: 0.25s; }
.grid-attempt-row .grid-box:nth-child(3) { animation-delay: 0.4s; }
.grid-attempt-row .grid-box:nth-child(4) { animation-delay: 0.55s; }
.grid-attempt-row .grid-box:nth-child(5) { animation-delay: 0.7s; }
.grid-attempt-row .grid-box:nth-child(6) { animation-delay: 0.85s; }
.grid-attempt-row .grid-box:nth-child(7) { animation-delay: 1.0s; }

@keyframes flipIn {
    0% { 
        opacity: 0; 
        transform: rotateX(90deg); /* Empieza girado hacia atrás */
    }
    100% { 
        opacity: 1; 
        transform: rotateX(0); /* Termina de frente */
    }
}

/* 2. Animación de entrada para el Modal Final */
.final-modal.show { 
    display: flex; 
    animation: fadeInBg 0.4s ease forwards;
}

.final-modal.show .modal-content {
    /* cubic-bezier crea ese efecto de "rebote" elástico */
    animation: popInModal 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes fadeInBg {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popInModal {
    0% { 
        opacity: 0; 
        transform: scale(0.5) translateY(50px); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* =========================================
   HOW TO PLAY / FAQ SECTION (Minimalist)
   ========================================= */

.faq-section {
    width: 100%;
    margin: 2rem 0 0 0;
    padding: 4rem 2rem;
    border-top: 1px solid rgba(0, 242, 255, 0.2); 
    border-bottom: 1px solid rgba(0, 242, 255, 0.2);
    background: rgba(13, 17, 26, 0.4); 
    box-sizing: border-box; 
}

.faq-container {
    max-width: 800px; 
    margin: 0 auto;
    text-align: left;
}

.faq-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
}

.faq-title .accent {
    color: var(--neon-blue, #00f2ff); 
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--neon-blue, #00f2ff);
    margin-top: 1.8rem;
    margin-bottom: 0.6rem;
    letter-spacing: -0.3px;
}

.faq-answer {
    font-size: 0.95rem;
    color: var(--text-secondary, #8892b0);
    line-height: 1.6;
    margin-bottom: 0;
}

.faq-answer strong {
    color: #fff;
    font-weight: 700;
}

/* =========================================
   AJUSTES PARA MÓVILES (Evitar scroll horizontal)
   ========================================= */
   /* Ocultar textos de móvil en pantallas grandes por defecto */
.hide-desktop {
    display: none;
}
@media (max-width: 768px) {
    /* Quitamos el ancho mínimo que forzaba el scroll */
    /* Quitamos el ancho mínimo que forzaba el scroll de forma obligatoria */
    .grid-table {
        min-width: 0 !important;
        width: 100%;
    }

    /* Reducimos las columnas y el espacio (gap) entre ellas */
    .grid-header, .grid-attempt-row {
        grid-template-columns: 1.5fr 0.8fr 0.8fr 1fr 1.3fr 0.8fr 1.1fr;
        gap: 3px;
    }

    /* Hacemos el texto de las cabeceras muy pequeñito */
    .grid-header div {
        font-size: 0.5rem;
        letter-spacing: 0;
        word-wrap: break-word;
    }

    /* Reducimos el tamaño general de las cajas */
    .grid-box {
        height: 55px; /* Mitad de altura */
        font-size: 0.65rem; /* Texto de los datos más pequeño */
        border-radius: 6px;
        padding: 2px;
    }

    /* Adaptamos la primera columna (Club) para que el logo y el nombre se apilen */
    .club-box {
        padding-left: 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .box-logo {
        width: 24px;
        height: 24px;
        margin-right: 0;
        margin-bottom: 2px;
    }

    .box-name {
        font-size: 0.45rem;
        text-align: center;
        line-height: 1;
    }

    /* Hacemos las flechas de indicador (↑ ↓) más pequeñas */
    .arrow-indicator {
        font-size: 0.7rem;
        bottom: 2px;
        right: 2px;
    }

    /* Ocultar textos largos y mostrar los resumidos en móvil */
    .hide-mobile {
        display: none;
    }
    
    .hide-desktop {
        display: inline;
    }
}