/* 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;
}

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

.contenedor-central {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    flex-wrap: wrap;
}

/* Bloque del juego */
.bloque-juego {
    width: 65%;
    padding: 5px;
    box-sizing: border-box;
    text-align: center; /* Centrar todo el contenido */
}

/* Nuevo mini bloque de 2 columnas */
.mini-bloque {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.mini-bloque-izquierda {
    flex: 0 0 auto;
}

.mini-bloque-derecha {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: left;
}

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

/* Estilos para el contenedor de la imagen */
.imagen-personaje {
    width: 100px;
    height: 100px;
    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 {
    margin-bottom: 10px;
}

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

/* 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(120px, 1fr));
    gap: 5px;
    justify-items: center;
}

.opcion {
    background-color: #0073e6;
    color: #fff;
    padding: 6px 10px;
    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;
}

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

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

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

.niveles {
    margin-top: 10px;
}

.niveles h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.niveles p {
    font-size: 0.9rem;
    color: #555;
}

/* 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;
}

/* Sección de contacto */
.contacto {
    padding: 30px 20px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 20px auto;
    text-align: center;
}

.contacto h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.contacto form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contacto label {
    font-size: 1rem;
    font-weight: bold;
    text-align: left;
}

.contacto input, .contacto textarea {
    padding: 8px;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
}

.contacto textarea {
    height: 80px;
    resize: vertical;
}

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

    nav {
        position: static;
        margin-top: 10px;
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li {
        margin: 10px 0; /* Aumentado de 5px 0 */
    }

    .contenedor-central {
        flex-direction: column;
    }

    .bloque-juego, .bloque-progreso {
        width: 100%;
    }

    .mini-bloque {
        flex-direction: column;
        gap: 10px; /* Aumentado de 5px */
    }

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

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

    .opciones {
        grid-template-columns: 1fr;
        gap: 10px; /* Aumentado de 5px */
    }

    .inicio-container, .juego-container, .resultados-container, .contacto {
        margin: 10px; /* Ajustado de 5px 10px */
        padding: 15px; /* Aumentado de 10px */
    }

    .juego-container {
        max-width: 100%;
    }

    /* Aumentar tamaños de fuente para mejor legibilidad */
    .inicio-container h1 { font-size: 1.8rem; } /* Era 1.5rem */
    .inicio-container p { font-size: 1rem; } /* Era 0.9rem */
    .instrucciones h2 { font-size: 1.2rem; } /* Era 1rem */
    .instrucciones p { font-size: 0.9rem; } /* Era 0.8rem */
    .juego-container h1 { font-size: 1.8rem; } /* Era 1.5rem */
    .contador-preguntas, .temporizador { font-size: 1rem; } /* Era 0.9rem */
    .pistas p { font-size: 0.95rem; } /* Era 0.85rem */
    .seleccion-multiple p#pregunta-dato { font-size: 1.1rem; } /* Era 1rem */
    .opcion { 
        font-size: 0.9rem; /* Era 0.75rem */
        padding: 10px 15px; /* Era 6px 10px */
        min-height: 44px; /* Tamaño mínimo para toque */
    }
    .feedback { font-size: 0.95rem; } /* Era 0.85rem */

    /* Botones más grandes y táctiles */
    .boton-jugar, .boton-siguiente {
        padding: 10px 15px; /* Era 6px 12px */
        font-size: 1rem; /* Era 0.9rem */
    }
}

/* Responsividad adicional para pantallas menores a 480px */
@media (max-width: 480px) {
    .tarjetas {
        flex-direction: column;
    }
    .tarjeta {
        width: 100%; /* Una columna en pantallas muy pequeñas */
        height: 180px; /* Ajuste para mejor proporción */
    }
}