/* =========================================
   VARIABLES Y RESET
   ========================================= */
   :root {
    --bg-dark: #02081f;
    --board-blue: #091442;
    --card-blue: #0b227a;
    --card-hover: #1234b3;
    --gold: #ffcc00;
    --gold-glow: rgba(255, 204, 0, 0.4);
    --text-light: #ffffff;
    --disabled: #1a1f33;
    --team-1: #e91e63;
    --team-2: #2196f3;
    --team-3: #4caf50;
    --team-4: #ff9800;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Evita el scroll, es una pantalla fija de TV */
}

/* =========================================
   FONDO ANIMADO
   ========================================= */
.bg-animation {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, #0a194f 0%, #02081f 100%);
    z-index: -1;
}
.bg-animation::after {
    content: '';
    position: absolute;
    width: 200%; height: 200%;
    top: -50%; left: -50%;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: rotateBg 100s linear infinite;
}
@keyframes rotateBg { 100% { transform: rotate(360deg); } }

/* =========================================
   CABECERA
   ========================================= */
.game-header {
    text-align: center;
    padding: 1.5rem 0;
    background: rgba(0,0,0,0.3);
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 10;
}
.logo { font-size: 0.9rem; color: #aaa; text-transform: uppercase; letter-spacing: 2px; }
.game-header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 2.5rem;
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
    margin: 5px 0;
    letter-spacing: 1px;
}
.subtitle { font-size: 1rem; color: #ddd; }

/* =========================================
   TABLERO DE JUEGO
   ========================================= */
.board-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.game-board {
    display: grid;
    /* 5 columnas fijas, se adapta según las categorías en JS */
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 1400px;
    height: 100%;
    background: var(--board-blue);
    padding: 10px;
    border: 3px solid var(--gold);
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

/* Categorías (Fila superior) */
.category-header {
    background: var(--card-blue);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    font-size: 1.2rem;
    padding: 10px;
    border: 2px solid #1a3c9e;
    text-transform: uppercase;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* Tarjetas de Puntos */
.card-item {
    background: var(--card-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #1a3c9e;
    border-radius: 4px;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.card-item:hover {
    background: var(--card-hover);
    transform: scale(1.02);
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold-glow), inset 0 0 20px rgba(0,0,0,0.2);
}
.card-points {
    font-family: 'Oswald', sans-serif;
    font-size: 3.5rem;
    color: var(--gold);
    text-shadow: 3px 3px 0 #000, 0 0 15px var(--gold-glow);
}

/* Tarjeta deshabilitada (ya clickeada) */
.card-item.disabled {
    background: var(--disabled);
    border-color: #111;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.card-item.disabled .card-points {
    color: #333;
    text-shadow: none;
}

/* =========================================
   MARCADOR (SCOREBOARD)
   ========================================= */
.scoreboard {
    display: flex;
    height: 100px;
    background: #000;
    border-top: 2px solid #333;
}
.team-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #222;
    padding: 10px;
}
.team-card:last-child { border-right: none; }
.team-card h2 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    outline: none;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.2s;
}
.team-card h2:focus { border-bottom: 1px dashed #fff; }

.team-1 h2 { color: var(--team-1); }
.team-2 h2 { color: var(--team-2); }
.team-3 h2 { color: var(--team-3); }
.team-4 h2 { color: var(--team-4); }

.score-display {
    display: flex;
    align-items: center;
    gap: 15px;
}
.score-display span {
    font-family: 'Oswald', sans-serif;
    font-size: 2.5rem;
    min-width: 80px;
    text-align: center;
}
.score-btn {
    width: 35px; height: 35px;
    border-radius: 50%;
    border: none;
    background: #222;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}
.score-btn:hover { background: #444; }
.score-btn.minus:hover { background: #e53935; }
.score-btn.plus:hover { background: #4caf50; }

/* =========================================
   MODAL DE PREGUNTAS (POPUP)
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content {
    background: var(--card-blue);
    width: 90%; max-width: 1000px; min-height: 60vh;
    border: 4px solid var(--gold);
    border-radius: 12px;
    display: flex; flex-direction: column;
    box-shadow: 0 0 50px rgba(0,0,0,1);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .modal-content { transform: scale(1); }

.modal-header {
    background: var(--board-blue);
    padding: 15px 30px;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid var(--gold);
}
.gold-text { color: var(--gold); font-family: 'Oswald', sans-serif; font-size: 2rem;}
.close-btn { background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; }
.close-btn:hover { color: #f44336; }

.modal-body {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px;
    text-align: center;
}
.question-text { font-size: 3rem; font-weight: 600; text-shadow: 2px 2px 4px #000; margin-bottom: 20px;}
.answer-text { font-size: 2.5rem; color: var(--gold); padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.2); }
.hidden { display: none !important; }

.modal-footer {
    padding: 20px;
    display: flex; justify-content: center;
    background: rgba(0,0,0,0.3);
}

.btn-primary, .btn-secondary {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    border: none; border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    transition: all 0.2s;
}
.btn-primary { background: var(--gold); color: #000; }
.btn-primary:hover { background: #ffd700; transform: translateY(-2px); box-shadow: 0 5px 15px var(--gold-glow); }
.btn-secondary { background: #4caf50; color: white; }
.btn-secondary:hover { background: #45a049; transform: translateY(-2px); }