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

:root {
    --correct-glass: rgba(0, 255, 136, 0.15);
    --correct-border: #00ff88;
    --wrong-glass: rgba(255, 255, 255, 0.05);
    --border-neon: var(--border-dark);
}

.hidden { display: none !important; }

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

/* --- CABECERA Y FOTO --- */
.main-title { 
    font-weight: 900; 
    font-size: 3.5rem; 
    text-transform: uppercase;
    background: linear-gradient(to bottom, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.mystery-player {
    width: 180px; 
    height: 180px;
    border-radius: 15px;
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 20px var(--neon-blue-glow);
    object-fit: cover;
    transition: filter 0.5s ease;
    background: #fff;
}

/* --- BUSCADOR (ESTILO GRID PRO) --- */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 30px 0;
}

.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-img { width: 60px; height: 60px; border-radius: 50%; border: 2px solid #fff; background: #fff; }

.sugg-name { font-weight: 900; font-size: 1.2rem; color: #fff; display: block; }

.sugg-pos { color: var(--neon-blue); font-weight: 900; text-transform: uppercase; }

.sugg-logo { height: 50px; width: auto; margin-left: auto; }

/* --- EL TABLERO (ESTILO GRID DE ATRIBUTOS) --- */
.grid-table {
    width: 100%;
    min-width: 1000px;
    margin-top: 20px;
}

.grid-header {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1fr 1.2fr 1fr 1fr 1fr;
    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 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.grid-box {
    height: 110px; /* Celdas mucho más grandes */
    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: 2.2rem; /* Números y letras GIGANTES */
    font-weight: 900;
    position: relative;
    transition: transform 0.3s ease;
}

/* Variantes de Acierto */
.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);
}

/* Jugador (Foto + Nombre) */
.player-box {
    flex-direction: row;
    justify-content: flex-start;
    padding-left: 20px;
}

.box-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
    margin-right: 20px;
    background: #fff;
    object-fit: cover;
}

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

/* Banderas y Logos (MAXIMIZADOS) */
.box-flag {
    width: 85%;
    max-width: 80px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.box-logo {
    width: 85%;
    height: 85%;
    object-fit: contain;
}

/* Indicadores de flechas */
.arrow-indicator {
    position: absolute;
    bottom: 2px;
    right: 12px;
    font-size: 2.5rem;
    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);
}

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

.revealed-player-info img {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    border: 4px solid #fff;
    margin-bottom: 20px;
}

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

.mystery-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.mystery-player {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    border: 3px solid var(--neon-blue);
    filter: blur(20px);
    transition: filter 0.5s;
    background: white;
}

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

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

/* Tabla Gigante */
.grid-table { min-width: 1000px; }
.grid-header, .grid-attempt-row {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1fr 1.2fr 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.grid-box {
    height: 110px;
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem; /* Números muy grandes */
    font-weight: 900;
    position: relative;
}

.player-box { flex-direction: row; justify-content: flex-start; padding-left: 15px; }
.box-photo { width: 85px; height: 85px; border-radius: 50%; border: 2px solid white; margin-right: 15px; background: white; }
.box-name { font-size: 1.3rem; font-weight: 900; line-height: 1.1; }

.box-flag { width: 80%; border-radius: 8px; }
.box-logo { width: 85%; height: 85%; object-fit: contain; }

.correct {
    background: rgba(0, 255, 136, 0.2) !important;
    border: 2px solid #00ff88 !important;
    color: #00ff88 !important;
}

.arrow-indicator {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 2.2rem;
    color: var(--neon-blue);
}

/* Modal Estilo Grid */
.final-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.9);
    display: none; justify-content: center; align-items: center; z-index: 2000;
}
.final-modal.show { display: flex; }
.modal-content {
    background: var(--card-bg); padding: 40px; border-radius: 20px;
    border: 2px solid var(--neon-blue); text-align: center; max-width: 500px;
}
.modal-actions { display: flex; gap: 15px; justify-content: center; margin-top: 25px; }
.b2b-btn { padding: 12px 25px; border-radius: 8px; font-weight: 900; border: none; cursor: pointer; }
.btn-share { background: #5c4dff; color: white; }
.btn-finish { background: #ccff00; color: black; }

/* --- BARRA SUPERIOR Y CONTADOR --- */
.stats-top-bar {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-bottom: -15px; /* Evita que empuje la imagen hacia abajo */
    z-index: 10;
}

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

/* =========================================
   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;
}

/* Ocultar textos de móvil en pantallas grandes por defecto */
.hide-desktop {
    display: none;
}

/* =========================================
   AJUSTES PARA MÓVILES (Who Are You)
   ========================================= */
@media (max-width: 768px) {
    /* Quitamos el ancho mínimo que forzaba el scroll */
    .grid-table {
        min-width: 0 !important;
        width: 100%;
    }

    /* Reducimos las 7 columnas y el espacio (gap) entre ellas */
    .grid-header, .grid-attempt-row {
        grid-template-columns: 1.6fr 0.7fr 0.7fr 1fr 0.7fr 0.6fr 0.6fr;
        gap: 3px;
    }

    /* Textos de la cabecera diminutos */
    .grid-header div {
        font-size: 0.45rem;
        letter-spacing: 0;
        word-wrap: break-word;
    }

    /* Reducimos el tamaño general de las cajas */
    .grid-box {
        height: 60px; /* Mitad de altura */
        font-size: 0.8rem; /* Tamaño para números y posición */
        border-radius: 6px;
        padding: 2px;
    }

    /* Primera columna (Jugador): apilamos la foto arriba y el nombre abajo */
    .player-box {
        padding-left: 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .box-photo {
        width: 30px;
        height: 30px;
        margin-right: 0;
        margin-bottom: 2px;
        border-width: 1px;
    }

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

    /* Ajustar tamaños de bandera y logos */
    .box-flag {
        max-width: 25px;
        border-radius: 3px;
    }

    .box-logo {
        width: 90%;
        height: 90%;
    }

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

    /* Intercambio de palabras: ocultar largas, mostrar cortas */
    .hide-mobile {
        display: none;
    }
    
    .hide-desktop {
        display: inline;
    }
}