/* =========================================
   grid.css | THE LIIGA GAMES - NORDIC ICE THEME
   ========================================= */

:root {
    /* Mapeo de colores "Neón" del HTML a tonos elegantes Finlandeses */
    --neon-blue: #00A3E0; /* Azul Hielo (Acentos, bordes, brillos) */
    --neon-blue-glow: rgba(0, 163, 224, 0.3);
    
    --neon-pink: #0033A0; /* Azul Bandera Finlandia (Sustituye al rosa estridente) */
    --neon-pink-glow: rgba(0, 51, 160, 0.4);
    
    /* Paleta Premium Oscura */
    --fin-bg-main: #020813;
    --fin-surface: rgba(10, 20, 35, 0.7);
    --fin-surface-hover: rgba(15, 30, 50, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.08);
}

body {
    background-color: var(--fin-bg-main);
    background-image: radial-gradient(circle at 50% 0%, #05142b 0%, var(--fin-bg-main) 70%);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
    min-height: 100vh;
}

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

.hidden { display: none !important; }
.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: 25px;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 50;
}

.btn-nav {
    padding: 8px 18px;
    font-size: 1.1rem;
    border-radius: 8px;
    background: var(--fin-surface);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.btn-nav:disabled { opacity: 0.2; cursor: not-allowed; border-color: transparent; }
.btn-nav:not(:disabled):hover { border-color: var(--neon-blue); transform: translateY(-2px); }

.day-info { text-align: center; min-width: 160px; }
.day-text {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* --- 3. BUSCADOR Y AUTOCOMPLETADO --- */
.search-section {
    display: flex; justify-content: center; gap: 12px;
    margin-bottom: 3.5rem; position: relative; z-index: 999; 
    max-width: 650px; margin-left: auto; margin-right: auto;
}
.search-container { position: relative; flex-grow: 1; }

.neon-input {
    width: 100%; padding: 16px 24px;
    background: rgba(0, 0, 0, 0.4); 
    border: 1px solid rgba(0, 163, 224, 0.4);
    color: #fff; border-radius: 12px;
    font-size: 1.1rem; font-weight: 600;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease; box-sizing: border-box;
}

.neon-input::placeholder { color: var(--text-secondary); font-weight: 400; }
.neon-input:focus { 
    outline: none; 
    background: rgba(0, 163, 224, 0.05);
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 4px rgba(0, 163, 224, 0.1); 
}
.neon-input:disabled { opacity: 0.5; cursor: not-allowed; }

/* Lista de Autocompletado (Glassmorphism) */
.suggestions-list {
    position: absolute; top: calc(100% + 8px); left: 0; width: 100%;
    background: rgba(5, 12, 22, 0.95) !important; 
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    border-radius: 12px; padding: 5px 0; margin: 0;
    max-height: 320px; overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8) !important;
    z-index: 1000; list-style: none;
}

.suggestions-list li {
    padding: 12px 20px; cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex; align-items: center; gap: 15px;
    font-weight: 600; font-size: 1rem; color: var(--text-primary) !important;
    transition: all 0.2s ease; background: transparent !important;
}

.suggestions-list li:hover { background: rgba(0, 163, 224, 0.15) !important; padding-left: 25px; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(0, 163, 224, 0.4); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-blue); }

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

.grid-board {
    display: grid;
    /* Ajuste de proporciones más elegantes */
    grid-template-columns: 120px repeat(3, 140px);
    grid-template-rows: 120px repeat(3, 140px);
    gap: 12px;
}

.grid-cell {
    background: var(--fin-surface);
    border: 1px solid var(--border-glass);
    border-radius: 14px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    padding: 8px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

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

.logo-box {
    background: transparent; color: var(--text-secondary);
    font-weight: 900; font-size: 1.1rem; line-height: 1.2;
    border: none; letter-spacing: 1px; opacity: 0.5;
}

/* Cabeceras (Equipos/Ligas) */
.header-cell {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.header-cell img {
    height: 65px; max-width: 90px; object-fit: contain; margin-bottom: 8px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
}
.header-name { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); }

/* Celdas Jugables */
.play-cell {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    cursor: pointer;
}
.play-cell:hover {
    background: rgba(0, 163, 224, 0.05);
    border-color: rgba(0, 163, 224, 0.5);
    transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.placeholder-text { color: rgba(255, 255, 255, 0.3); font-weight: 800; font-size: 0.8rem; letter-spacing: 1px; }

/* Celdas Completadas */
.filled-cell {
    background: linear-gradient(145deg, rgba(0, 51, 160, 0.4), rgba(0, 10, 25, 0.9));
    border: 1px solid var(--neon-blue);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(0, 163, 224, 0.1);
}
.filled-img {
    width: 75px; height: 75px; object-fit: cover; border-radius: 50%;
    margin-bottom: 6px; border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}
.filled-name { font-size: 0.75rem; font-weight: 800; color: #fff; line-height: 1.2; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }

/* Etiquetas de Porcentaje */
.filled-cell div {
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #fff !important; text-shadow: none !important;
    border-radius: 20px !important; padding: 3px 8px !important;
}

/* --- 5. BOTONES GLOBALES --- */
.btn-neon-outline {
    background: rgba(0, 163, 224, 0.1); color: var(--neon-blue);
    border: 1px solid var(--neon-blue); padding: 0.6rem 1.8rem;
    font-weight: 800; border-radius: 8px; cursor: pointer;
    text-transform: uppercase; letter-spacing: 1px; transition: all 0.2s ease;
}
.btn-neon-outline:hover { background: var(--neon-blue); color: #000; transform: translateY(-2px); }

.play-btn {
    background: var(--text-primary); color: #000; border: none; font-weight: 900;
    border-radius: 8px; cursor: pointer; text-transform: uppercase; transition: all 0.2s ease;
}
.play-btn:hover { background: var(--text-secondary); }

/* --- 6. MODAL DE RESULTADOS --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 5, 12, 0.85); backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000; padding: 15px; transition: all 0.3s ease;
}

.neon-modal {
    background: #051021; border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8); border-radius: 20px;
    padding: 2rem; text-align: center; width: 100%; max-width: 400px; position: relative;
}

.close-btn { position: absolute; top: 15px; right: 20px; color: var(--text-secondary); font-size: 2rem; cursor: pointer; }
.close-btn:hover { color: #fff; }

.modal-header-title { font-size: 1.2rem; font-weight: 900; color: var(--text-secondary); margin-bottom: 15px; letter-spacing: 2px; }
.modal-top-stats { display: flex; justify-content: center; gap: 40px; margin-bottom: 20px; }
.big-number { font-size: 3rem; font-weight: 900; line-height: 1; color: #fff; }
.highlight { color: var(--neon-blue); }
.pink-glow { color: #fff; }
.big-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 700; margin-top: 5px; text-transform: uppercase; }

/* Mini Grid Modal */
.mini-grid { display: grid; gap: 5px; justify-content: center; margin-bottom: 25px; }
.mini-cell { border-radius: 6px; background: rgba(255, 255, 255, 0.05); transition: all 0.3s ease; }
.mini-cell.correct { background: var(--neon-blue); box-shadow: 0 0 10px rgba(0, 163, 224, 0.4); }

.modal-countdown { margin-bottom: 20px; padding: 15px; background: rgba(0,0,0,0.3); border-radius: 12px; }
.countdown-time { font-size: 1.6rem; font-weight: 900; color: #fff; letter-spacing: 2px; }

.modal-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; border-top: 1px solid var(--border-glass); padding-top: 20px; }
.stat-box { background: rgba(255, 255, 255, 0.03); padding: 12px; border-radius: 10px; border: 1px solid transparent; }
.stat-num { font-size: 1.4rem; font-weight: 900; color: #fff; margin-bottom: 4px; }
.stat-text { font-size: 0.7rem; color: var(--text-secondary); font-weight: 700; }

/* =========================================
   FAQ SECTION
   ========================================= */
.faq-section { margin-top: 4rem; padding: 4rem 2rem; background: rgba(255,255,255,0.02); border-top: 1px solid var(--border-glass); }
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-title { font-size: 1.8rem; font-weight: 900; margin-bottom: 2rem; }
.faq-title .accent { color: var(--neon-blue); }
.faq-question { font-size: 1.2rem; color: #fff; margin-top: 2rem; margin-bottom: 0.8rem; }
.faq-answer { color: var(--text-secondary); line-height: 1.7; }
.faq-answer strong { color: #fff; }

/* =========================================
   AJUSTES PARA MÓVILES
   ========================================= */
@media (max-width: 768px) {
    .container { padding: 1rem 0.5rem; }
    .search-section { padding: 0 10px; }
    
    .grid-board {
        grid-template-columns: 65px repeat(3, 1fr);
        grid-template-rows: 70px repeat(3, 95px);
        gap: 6px;
    }
    .grid-cell { padding: 4px; border-radius: 8px; }
    .header-cell img { height: 35px; max-width: 45px; margin-bottom: 4px; }
    .header-name { font-size: 0.55rem; }
    
    .placeholder-text { font-size: 0.55rem; }
    .filled-img { width: 45px; height: 45px; border-width: 1px; margin-bottom: 4px; }
    .filled-name { font-size: 0.55rem; }
    .filled-cell div { font-size: 0.55rem !important; padding: 2px 6px !important; margin-top: 4px !important; }

    #start-mode-box, #already-played-box { width: 90% !important; max-width: 300px; padding: 20px; }
    .suggestions-list { width: calc(100% - 20px); left: 10px; }
}