/* Estilos generales */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    line-height: 1.6;
    color: #333;
    margin-top: 0;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 15px;
    background-color: #333;
    color: #fff;
    position: relative;
}

header .logo img {
    height: 40px;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 15px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

/* Pantalla de inicio */
.inicio-container {
    text-align: center;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 5px auto;
}

.inicio-container h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.inicio-container p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 10px;
}

.instrucciones {
    margin-bottom: 10px;
    padding: 5px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.instrucciones h2 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.instrucciones p {
    font-size: 0.8rem;
    color: #666;
}

/* Contenedor del juego */
.juego-container {
    padding: 5px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 5px auto;
    max-height: 90vh;
    overflow-y: auto;
}

.juego-container h1 {
    font-size: 1.5rem;
    text-align: center;
    margin: 5px 0;
}

/* Bloque de progreso */
.bloque-progreso {
    padding: 5px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 5px;
}

.medidor-container {
    width: 100%;
    height: 15px;
    background-color: #ddd;
    border-radius: 10px;
    overflow: hidden;
}

.medidor-barra {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s ease;
}

.progreso-indicadores {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 5px;
}

.progreso-indicadores p {
    font-size: 0.9rem;
    margin: 0;
}

#puntuacion { color: #0073e6; }
#nivel-actual { color: #28a745; }
#puntos-proximo-nivel { color: #ff0000; }

/* Contenedor central */
.contenedor-central {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Bloque del juego */
.bloque-juego {
    padding: 5px;
    box-sizing: border-box;
    text-align: center;
}

/* Mini bloque en 2 columnas */

.mini-bloque {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Proporción ajustada al contenido */
    gap: 5px;
    margin-bottom: 5px;
    position: relative; /* Para la línea divisoria */
    max-width: 600px; /* Ancho máximo para centrar */
    margin-left: auto; /* Centrar horizontalmente */
    margin-right: auto; /* Centrar horizontalmente */
}

/* Línea divisoria entre columnas */
.mini-bloque::after {
    content: '';
    position: absolute;
    top: 0;
    left: calc(33.33% + 2.5px); /* Posición entre las columnas (1fr de 3fr total + mitad del gap) */
    width: 1px;
    height: 100%;
    background-color: #ccc; /* Color de la línea */
}

/* Ajustes para las columnas */
.columna-izquierda {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.columna-derecha {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    margin-left: 10px; /* Añadido para alejar el texto de la línea divisoria */
}

/* Contador de preguntas y temporizador */
.contador-preguntas, .temporizador {
    font-size: 0.9rem;
    color: #333;
    margin: 0;
    text-align: left;
}

/* Estilos para el contenedor de la imagen */
.imagen-personaje {
    width: 15vw;
    max-width: 80px;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.imagen-personaje img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Estilos para las pistas */
.pistas {
    text-align: left;
}

.pistas p {
    font-size: 0.85rem;
    color: #444;
    margin: 2px 0;
    font-weight: bold;
    overflow-wrap: break-word;
}

/* Estilos para la selección múltiple */
.seleccion-multiple {
    margin-bottom: 5px;
    padding: 5px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.seleccion-multiple p#pregunta-dato {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}

/* Estilos para las opciones (botones) */
.opciones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 5px;
    justify-items: center;
}

.opcion {
    background-color: #0073e6;
    color: #fff;
    padding: 5px 8px;
    border: none;
    border-radius: 5px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    text-align: center;
}

.opcion:hover {
    background-color: #005bb5;
    transform: scale(1.05);
}

.opcion:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Estilos para los botones de acción */
.boton-jugar, .boton-siguiente {
    background-color: #28a745;
    color: #fff;
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.boton-jugar:hover, .boton-siguiente:hover {
    background-color: #218838;
    transform: scale(1.05);
}

.boton-siguiente {
    background-color: #0073e6;
}

.boton-siguiente:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Estilos para el feedback */
.feedback {
    margin-top: 5px;
    font-size: 0.85rem;
    font-weight: bold;
    padding: 5px;
    border-radius: 5px;
}

/* Pantalla de resultados */
.resultados-container {
    text-align: center;
    padding: 20px 15px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 10px auto;
}

.resultados-container h1 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.resultados-container p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 20px;
}

#insignia-final {
    font-size: 1.2rem;
    font-weight: bold;
    color: #28a745;
}

/* Tarjetas */
.tarjetas {
    display: flex;
    justify-content: center;
    padding: 10px;
    max-width: 76.5%;
    margin: 0 auto;
    gap: 10px;
}

.tarjeta {
    width: 25%;
    height: 200px;
    text-align: center;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    position: relative;
}

.tarjeta:hover {
    transform: scale(1.05);
}

.tarjeta img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tarjeta-texto {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(51, 51, 51, 0.65);
    color: #fff;
    padding: 5px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    line-height: 1.4;
    box-sizing: border-box;
}

/* Responsividad para pantallas de hasta 768px */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        margin-top: 10px;
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li {
        margin: 10px 0;
    }

    .juego-container {
        margin: 5px;
        padding: 5px;
        max-height: 85vh;
    }

    .contenedor-central {
        max-height: 65vh;
    }

    .mini-bloque {
        grid-template-columns: 1fr 2fr;
        gap: 3px;
    }

    .tarjetas {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .tarjeta {
        width: 45%;
        height: 150px;
    }

    .opciones {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .inicio-container, .resultados-container {
        margin: 5px;
        padding: 10px;
    }

    .juego-container h1 { font-size: 1.3rem; }
    .contador-preguntas, .temporizador { font-size: 0.85rem; }
    .pistas p { font-size: 0.8rem; }
    .seleccion-multiple p#pregunta-dato { font-size: 0.9rem; }
    .opcion { 
        font-size: 0.8rem;
        padding: 4px 6px;
    }
    .feedback { font-size: 0.8rem; }
    .boton-jugar, .boton-siguiente {
        padding: 5px 10px;
        font-size: 0.85rem;
    }
}
 
/* Responsividad adicional para pantallas menores a 480px */
@media (max-width: 480px) {
    .tarjetas {
        flex-direction: column;
    }
    .tarjeta {
        width: 100%;
        height: 180px;
    }
    .opciones {
        gap: 2px;
    }
    .juego-container {
        padding: 3px;
        max-height: 80vh; /* Reducido para móviles */
    }
    .contenedor-central {
        max-height: 60vh; /* Reducido para dejar espacio a opciones */
    }
    .bloque-juego, .bloque-progreso {
        padding: 3px;
    }
    .mini-bloque {
        grid-template-columns: 1fr 2fr; /* Mantener 2 columnas en móviles */
        gap: 3px;
        margin-bottom: 3px;
    }
    .mini-bloque::after {
        left: calc(33.33% + 1.5px); /* Ajuste por gap reducido */
    }
    .columna-derecha {
        margin-left: 5px; /* Reducir margen en móviles */
    }
    .progreso-indicadores {
        gap: 10px; /* Reducir espacio entre indicadores */
    }
    .progreso-indicadores p {
        font-size: 0.8rem; /* Reducir fuente ligeramente */
    }
    .seleccion-multiple {
        margin-bottom: 3px;
        padding: 3px;
    }
    .opcion {
        padding: 4px 6px;
        font-size: 0.7rem; /* Ajustar tamaño de opciones */
    }
}