/* --- bingo.css | THE LIIGA GAMES (NORDIC ICE) --- */

:root {
    --neon-blue: #00A3E0; 
    --neon-blue-glow: rgba(0, 163, 224, 0.4);
    --fin-bg-main: #020813;
    --fin-surface: rgba(10, 20, 35, 0.85);
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.1);
    
    --correct-bg: linear-gradient(145deg, rgba(0, 51, 160, 0.4), rgba(0, 10, 25, 0.9));
    --wrong-red: #e63946;
}

.bingo-play-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 40px;
}

@media (min-width: 850px) {
    .bingo-play-area {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* =========================================
   PANEL DEL JUGADOR (IZQUIERDA)
   ========================================= */
.current-player-panel {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--fin-surface);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    
    /* Panel Pegajoso para que no desaparezca al hacer scroll */
    position: sticky;
    top: 90px; 
    align-self: flex-start;
    z-index: 20; 
}

.deck-status {
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 20px;
    background: rgba(0,0,0,0.5);
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid rgba(0, 163, 224, 0.3);
}

.player-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.cp-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--neon-blue);
    box-shadow: 0 0 20px var(--neon-blue-glow);
    margin-bottom: 15px;
    background-color: #000;
}

.cp-name {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    text-align: center;
    margin: 0 0 15px 0;
    line-height: 1.1;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}

.panel-actions {
    width: 100%;
    position: relative;
}

.outline-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--text-secondary);
    color: #fff;
    padding: 12px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.outline-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

.error-msg {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--wrong-red);
    color: #fff;
    padding: 6px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(230, 57, 70, 0.5);
    opacity: 1;
    transition: opacity 0.3s;
}
.error-msg.hidden { opacity: 0; pointer-events: none; }

/* =========================================
   TABLERO BINGO (DERECHA)
   ========================================= */
.bingo-board-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.bingo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 650px;
    aspect-ratio: 1 / 1;
}

.bingo-cell {
    background: #07101e; /* Fondo oscuro sólido, más rápido para el navegador */
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    cursor: pointer;
    /* Transiciones más rápidas y baratas en recursos */
    transition: transform 0.1s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.bingo-cell:hover:not(.filled) {
    background: #0a182b;
    border-color: var(--neon-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

/* --- CONTENIDO DE LAS CELDAS --- */

/* 1. Contenedor: Fuerza que el texto vaya siempre debajo de la imagen */
.cat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Espacio exacto entre el escudo y el texto */
    width: 100%;
}

/* 2. Escudos de los equipos (Más grandes) */
.cat-img {
    width: 50px;  /* Subimos de 35px a 50px */
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* 3. Banderas de nacionalidad (Más grandes y rectangulares) */
.cat-flag {
    width: 48px;  
    height: 34px; 
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* 4. Iconos o Emojis (Por si acaso, también un pelín más grandes) */
.cat-emoji {
    font-size: 2.2rem; 
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* 5. El texto de la categoría */
.cat-content span {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-secondary);
    line-height: 1.1;
    text-align: center;
}

.cell-text {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-secondary);
    line-height: 1.1;
    z-index: 2;
}

/* Celda Completada */
.bingo-cell.filled {
    background: var(--correct-bg);
    border: 1px solid var(--neon-blue);
    cursor: default;
    box-shadow: inset 0 0 20px rgba(0, 163, 224, 0.2);
}

.bingo-cell.filled .cell-icon { display: none; }
.bingo-cell.filled .cell-text { display: none; }

.filled-player-img {
    width: 100%;
    height: 70%;
    object-fit: cover;
    object-position: top;
    position: absolute;
    top: 0; left: 0;
    background-color: #000;
}

.filled-player-name {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    height: 30%;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    line-height: 1;
    border-top: 1px solid var(--neon-blue);
}

/* =========================================
   MODALES Y FAQ
   ========================================= */
.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; }
.glass-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; }

.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); }

.faq-section { margin-top: 2rem; 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; }

/* =========================================
   MÓVILES
   ========================================= */
@media (max-width: 850px) {
    .current-player-panel {
        position: relative;
        top: 0;
        flex: none;
        width: 100%;
        padding: 15px;
        margin-bottom: 10px;
    }

    .cp-photo { width: 100px; height: 100px; margin-bottom: 10px; }
    .cp-name { font-size: 1.3rem; }

    .bingo-grid { gap: 6px; }
    .bingo-cell { border-radius: 8px; padding: 4px; }
    .cell-icon { width: 30px; height: 30px; margin-bottom: 4px; }
    .cell-text { font-size: 0.55rem; }
    
    .filled-player-name { font-size: 0.5rem; }
}

/* --- NAVEGACIÓN DIARIA (Centrado y Estilo) --- */
.daily-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 2rem;
}

.btn-nav {
    padding: 6px 15px !important;
    font-size: 1rem !important;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.day-text {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* --- ANIMACIONES DE JUEGO --- */

/* Animación de Acierto (Pulso verde) */
@keyframes success-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 163, 224, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px 10px rgba(0, 255, 127, 0.4); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 163, 224, 0); }
}

.bingo-cell.filled {
    animation: success-pulse 0.5s ease-out;
    background: var(--correct-bg);
    border: 1px solid var(--neon-blue);
}

/* Animación de Fallo (Sacudida y Flash Rojo) */
@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.error-shake {
    animation: error-shake 0.4s ease-in-out;
    background: rgba(230, 57, 70, 0.3) !important; /* Flash rojo */
    border-color: #ff4d4d !important;
    box-shadow: 0 0 15px rgba(230, 57, 70, 0.5);
    z-index: 10;
}

/* --- ESTILO DEL MODAL (Inspirado en Grid) --- */

.modal-content.glass-modal {
    background: #051021;
    border: 2px solid rgba(0, 163, 224, 0.3);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 163, 224, 0.1);
    padding: 30px;
    border-radius: 24px;
}

#endMessage {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 163, 224, 0.4);
}

#endSubMessage {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 30px;
}

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

/* Botón de compartir con el color neón */
#shareBtn {
    border-color: var(--neon-blue);
    color: var(--neon-blue);
}

#shareBtn:hover {
    background: var(--neon-blue);
    color: #000;
}