/* =========================================
   grid.css | THE PUCK GAMES - PUCK GRID
   ========================================= */

/* --- 1. CONTENEDORES BASE Y UTILIDADES --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Ocultar elementos vitales (Temporizador, listas, etc) */
#game-timer.hidden, 
.suggestions-list.hidden {
    display: none !important;
}

/* Ocultar el modal con transición suave */
.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* --- 2. NAVEGACIÓN DIARIA --- */
.daily-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 2rem;
    position: relative;
    z-index: 50;
}

.btn-nav {
    padding: 10px 20px;
    font-size: 1.2rem;
    border-radius: 8px;
}

.btn-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.btn-nav:disabled:hover {
    background: transparent;
    box-shadow: none;
}

.day-info {
    text-align: center;
    min-width: 150px;
}

.day-text {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--neon-blue);
    letter-spacing: 2px;
    text-shadow: 0 0 15px var(--neon-blue-glow);
}

/* --- 3. BUSCADOR Y AUTOCOMPLETADO --- */
.search-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 3rem;
    position: relative;
    z-index: 50;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-container {
    position: relative;
    flex-grow: 1;
}

.neon-input {
    width: 100%;
    padding: 18px 25px;
    background: #111827; 
    border: 2px solid var(--neon-blue);
    color: #fff;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
    transition: all 0.3s;
    box-sizing: border-box;
}

.neon-input::placeholder { color: rgba(255, 255, 255, 0.5); }
.neon-input:focus { 
    outline: none; 
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px var(--neon-blue); 
}

.neon-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.suggestions-list {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: #0f1722; 
    border: 1px solid var(--neon-blue);
    border-radius: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 350px;
    overflow-y: auto;
    box-shadow: 0 15px 30px rgba(0,0,0,0.9);
}

.suggestions-list::-webkit-scrollbar { width: 8px; }
.suggestions-list::-webkit-scrollbar-thumb { background: var(--neon-blue); border-radius: 4px; }

.suggestions-list li {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.suggestions-list li:hover { 
    background: rgba(0, 242, 255, 0.2); 
    padding-left: 25px; 
}

/* --- 4. EL TABLERO 3x3 --- */
.grid-wrapper {
    display: flex;
    justify-content: center;
    padding-bottom: 4rem;
    position: relative;
}

.grid-board {
    display: grid;
    grid-template-columns: 140px repeat(3, 150px);
    grid-template-rows: 140px repeat(3, 150px);
    gap: 8px;
}

.grid-cell {
    background-color: rgba(20, 28, 40, 0.95); 
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    transition: all 0.3s ease;
}

.empty-corner {
    background: transparent;
    border: none;
}

.logo-box {
    background: radial-gradient(circle, rgba(0,242,255,0.2) 0%, rgba(10,13,20,1) 100%);
    color: var(--neon-blue);
    font-weight: 900;
    font-size: 1.4rem;
    border: 2px solid rgba(0, 242, 255, 0.3);
    text-shadow: 0 0 10px var(--neon-blue);
}

.header-cell {
    background-color: rgba(15, 23, 34, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.header-cell img {
    height: 70px; 
    max-width: 100px;
    margin-bottom: 10px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}

.header-name {
    font-size: 0.85rem;
    font-weight: 900;
    line-height: 1.2;
}

/* Celdas jugables */
.play-cell {
    background-color: rgba(10, 15, 25, 0.6);
    border: 2px dashed rgba(0, 242, 255, 0.2);
    cursor: pointer;
}

.play-cell:hover {
    background-color: rgba(0, 242, 255, 0.05);
    border-color: rgba(0, 242, 255, 0.5);
    transform: scale(1.02);
}

.placeholder-text {
    color: rgba(0, 242, 255, 0.4);
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Celdas completadas */
.filled-cell {
    background: radial-gradient(circle, rgba(0,242,255,0.1) 0%, rgba(0,0,0,0.8) 100%);
    border: 2px solid var(--neon-blue);
    box-shadow: inset 0 0 20px rgba(0, 242, 255, 0.2), 0 0 15px rgba(0, 242, 255, 0.3);
}

.filled-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 3px solid var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.5);
}

.filled-name {
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* --- 5. BOTONES GLOBALES --- */
.btn-neon-outline {
    background: transparent;
    color: var(--neon-blue);
    border: 2px solid var(--neon-blue);
    padding: 0.5rem 1.5rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px transparent, inset 0 0 10px transparent;
}

.btn-neon-outline:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 15px var(--neon-blue), inset 0 0 10px var(--neon-blue);
}

.b2b-btn {
    transition: filter 0.2s;
}
.b2b-btn:hover {
    filter: brightness(1.2);
}

.play-btn {
    background: var(--neon-blue);
    color: #000;
    border: none;
    font-weight: 900;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
}
.play-btn:hover { box-shadow: 0 0 15px var(--neon-blue); }

/* --- 6. MODAL DE RESULTADOS NEÓN --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; overflow-y: auto; padding: 15px; box-sizing: border-box;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1; visibility: visible;
}

.neon-modal {
    background: var(--bg-color, #080a0f); border: 1px solid var(--neon-blue);
    box-shadow: 0 0 40px rgba(0, 242, 255, 0.15); border-radius: 12px;
    padding: 1.5rem 1.2rem; text-align: center; position: relative;
    width: 100%; max-width: 380px; margin: auto;
    background-image: radial-gradient(circle at top, #111827 0%, var(--bg-color) 70%);
}

.close-btn {
    position: absolute; top: 15px; right: 20px;
    background: none; border: none; color: var(--text-secondary);
    font-size: 2rem; cursor: pointer; transition: color 0.2s;
}

.close-btn:hover { color: var(--neon-pink); }

.modal-header-title { font-size: 1.4rem; font-weight: 900; color: #fff; margin-bottom: 10px; letter-spacing: 2px; }
.modal-top-stats { display: flex; justify-content: center; gap: 30px; margin-bottom: 10px; }
.stat-big-box { display: flex; flex-direction: column; align-items: center; }
.big-number { font-size: 2.5rem; font-weight: 900; line-height: 1; }
.highlight { color: var(--neon-blue); text-shadow: 0 0 15px var(--neon-blue-glow); }
.pink-glow { color: var(--neon-pink); text-shadow: 0 0 15px var(--neon-pink-glow); }
.big-label { font-size: 0.75rem; color: var(--text-secondary); font-weight: 700; letter-spacing: 1.5px; margin-top: 5px; text-transform: uppercase; }

/* Mini Grid en el Modal */
.mini-grid { display: grid; gap: 4px; justify-content: center; margin-bottom: 15px; }
.mini-cell { border-radius: 4px; background-color: rgba(20, 24, 34, 0.8); border: 1px solid var(--border-dark); transition: all 0.3s ease; }
.mini-cell.correct { background-color: rgba(0, 242, 255, 0.2); border-color: var(--neon-blue); box-shadow: inset 0 0 10px rgba(0, 242, 255, 0.3), 0 0 5px var(--neon-blue-glow); }

/* Cronómetro y Stats en el Modal */
.modal-countdown { margin-bottom: 15px; padding: 10px; background: rgba(20, 24, 34, 0.6); border-radius: 8px; border: 1px dashed rgba(255, 255, 255, 0.1); }
.countdown-label { display: block; font-size: 0.7rem; color: var(--text-secondary); font-weight: 700; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 1px; }
.countdown-time { font-size: 1.8rem; font-weight: 900; color: #fff; letter-spacing: 2px; }

.modal-buttons { display: flex; gap: 10px; margin-bottom: 15px; }

.modal-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; border-top: 1px solid var(--border-dark); padding-top: 15px; }
.stat-box { background: rgba(20, 24, 34, 0.6); padding: 10px 5px; border-radius: 8px; border: 1px solid var(--border-dark); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: all 0.3s ease; }
.stat-box:hover { background: rgba(0, 242, 255, 0.05); border-color: var(--neon-blue); }
.stat-num { display: block; font-size: 1.3rem; font-weight: 900; color: #fff; margin-bottom: 2px; text-align: center; text-shadow: 0 0 10px rgba(255, 255, 255, 0.1); }
.stat-text { font-size: 0.65rem; color: var(--text-secondary); font-weight: 800; letter-spacing: 1px; text-align: center; text-transform: uppercase; }

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

.faq-section {
    width: 100%;
    margin: 4rem 0 0 0; /* Margen superior para separarlo del tablero */
    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;
}

/* El texto que queremos resaltar dentro del título (Ej: "Puck Grid" o "FAQ") */
.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, #8b949e);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Para que las palabras en negrita dentro de la respuesta resalten en blanco */
.faq-answer strong {
    color: #ffffff;
    font-weight: 700;
}

/* =========================================
   AJUSTES PARA MÓVILES (Puck Grid)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Arreglar transparencia del autocompletado */
    .suggestions-list {
        background-color: #0f1722 !important; 
        box-shadow: 0 15px 35px rgba(0,0,0,0.95) !important;
        z-index: 9999;
    }
    
    .suggestions-list li {
        background-color: #0f1722;
    }

    /* Reducir los márgenes generales del contenedor principal en móvil */
    .container {
        padding: 1.5rem 0.5rem;
    }

    /* 2. Encoger el tablero (Grid) para que quepa sin hacer scroll */
    .grid-board {
        /* Cabecera izq de 70px, y 3 columnas que se reparten el resto del espacio */
        grid-template-columns: 70px repeat(3, 1fr);
        /* Cabecera superior de 75px, y 3 filas de 90px para los jugadores */
        grid-template-rows: 75px repeat(3, 90px);
        gap: 5px;
    }

    /* 3. Ajustar textos e imágenes dentro de las celdas para que no se desborden */
    .logo-box {
        font-size: 0.7rem;
        padding: 4px;
    }

    .header-cell img {
        height: 35px;
        max-width: 50px;
        margin-bottom: 2px;
    }

    .header-name {
        font-size: 0.5rem;
    }

    .placeholder-text {
        font-size: 0.55rem;
    }

    /* Reducimos la foto del jugador adivinado */
    .filled-img {
        width: 40px;
        height: 40px;
        margin-bottom: 4px;
        border-width: 2px;
    }

    /* Reducimos el nombre del jugador adivinado */
    .filled-name {
        font-size: 0.5rem;
    }

    /* Reducimos la cajita del porcentaje (%) de acierto */
    .filled-cell div {
        font-size: 0.55rem !important;
        padding: 2px 4px !important;
        margin-top: 3px !important;
    }

    /* 4. Ajustar la caja central de "Select Mode" para que no se salga de la pantalla */
    #start-mode-box, #already-played-box {
        width: 90% !important;
        max-width: 280px;
        padding: 15px;
    }
}