/* --- Estilos Globales y Contenedor Principal --- */
body {
    background-color: rgb(16, 83, 173);
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    padding: 20px;
    box-sizing: border-box;
}

.screen-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px; 
}

/* --- Estilos del Logo y Título --- */
.logo {
    width: 100px;
    margin-bottom: 15px;
}
.logoindex {
    width: 200px;
    margin-bottom: 15px;
    }
    
.title {
    color: white;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

/* --- MÓDULO DE PERSONAJE  --- */
.character-module {
    position: relative;
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 150px;
    margin: 10px 0;
}

#character {
    cursor: pointer;
    transition: all 0.3s ease;
    width: 120px;
    height: 120px;
    z-index: 10;
}

.speech-bubble {
    display: none;
    opacity: 0;
    position: relative;
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: opacity 0.3s ease;
    
    /* Móvil primero: globo debajo */
    width: 90%; 
    margin-top: 15px;
    box-sizing: border-box;
}

/* Cola del globo (apuntando ARRIBA) */
.speech-bubble::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -10px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid white;
}

/* ESTADO ACTIVO (Clickeado) */
.character-module.active #character {
    width: 50px;
    height: 50px;
}

.character-module.active .speech-bubble {
    display: block;
    opacity: 1;
}


/* --- Estilos del Personaje --- */
#character {
    cursor: pointer;
    transition: all 0.3s ease;
    width: 120px;
    height: 120px;
    z-index: 10;

    /* Hacerlo circular y añadir un halo/sombra para indicar interactividad */
    border-radius: 50%; 
    border: 2px solid rgba(255, 255, 255, 0.5); 
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.7); 
    
    /* una pequeña animación para llamar la atención */
    animation: pulse 2s infinite ease-in-out; 
}

/* Cuando el módulo está activo, quitamos el halo/animación */
.character-module.active #character {
    width: 50px;
    height: 50px;
    /* Quita el halo y la animación cuando está activo */
    border: none; 
    box-shadow: none;
    animation: none;
}

/* Definición de la animación "pulse" */
@keyframes pulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.9);
        transform: scale(1.05); /* Ligeramente más grande */
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
        transform: scale(1);
    }
}


/* --- Estilos del Formulario --- */
.recover-form {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-label {
    color: white;
    font-size: 16px;
    margin-top: 15px;
    margin-bottom: 5px;
    align-self: flex-start; /* Se alinea a la izquierda del formulario */
}

.form-input {
    background-color: white;
    border: none;
    border-radius: 10px;
    padding: 15px;
    font-size: 16px;
    color: #333;
    width: 100%;
    box-sizing: border-box; 
}

.form-input::placeholder {
    color: #888;
}

.recover-button {
    background-color: #f39c12; 
    border: none;
    border-radius: 10px;
    padding: 15px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 25px;
    width: 100%;
}

.login-link {
    color: white;
    text-decoration: underline;
    margin-top: 25px;
    font-size: 16px;
}


/* --- MEDIA QUERY RESPONSIVE (para tablets/PC) --- */
@media (min-width: 600px) {

    .character-module {
        flex-direction: row; 
    }

    .character-module.active {
        justify-content: flex-start;
    }

    .speech-bubble {
        width: 70%; 
        margin-top: 0;
        margin-left: 15px;
    }

    /* Cola del globo (apuntando a la IZQUIERDA) */
    .speech-bubble::before {
        left: -10px;
        top: 25px;
        transform: none;
        
        border-left: 0;
        border-right: 10px solid white;
        border-bottom: 10px solid transparent;
        border-top: 10px solid transparent;
    }
}

/* Fondo rosado solo para la pantalla de inicio */
body.index {
    background-color: #fcebc7; 
    
}

.container {
    width: 100%;
    max-width: 380px;
    background: transparent;
    text-align: center;
}

.btn-profesor {
  background-color: #b7d7f4;
  color: rgb(16, 83, 173);
  border-radius: 10px;
  padding: 15px;
  border: none;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 25px;
  width: 100%;
  box-sizing: border-box; 
}

.btn-alumno {
  background-color: #f9a825;
  color: white;
  border-radius: 10px;
  padding: 15px;
  border: none;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 25px;
  width: 100%;
  box-sizing: border-box; 
}

/* ============================================
--- PANTALLA PREPARATE ---
============================================
*/

/* Nuevo fondo claro */
body.body-light {
    background-color: #fcebc7; 
    padding-top: 20px; 
}

/* Contenedor específico para esta pantalla */
.preparate-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Alineado arriba */
    text-align: center;
    width: 100%;
    max-width: 450px;
    height: auto; 
    margin-top: 50px;
}

/* Título "Preparate"  */
.preparate-title {
    color:rgb(16, 83, 173); 
    font-size: 2.5rem; 
    font-weight: 900; 
    margin: 10px 0 10px 0;
}

/* Botón/Caja de Conteo 'Empezamos en 00:30' */
.preparate-countdown-box {
    background-color: rgb(16, 83, 173); 
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* Contador de Personas */
.question-counter {
    color: rgb(16, 83, 173); 
    font-size: 3rem; 
    font-weight: 900;
    margin-bottom: 10px;
}

/* Texto 'esperando jugadores...' */
.waiting-text {
    color: #f39c12;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 40px;
}

/* Personaje grande */
.preparate-character {
    width: 180px; 
    height: auto; 
    /* AÑADIDO: Sombra difusa debajo del personaje */
    filter: drop-shadow(0 15px 10px rgba(0, 0, 0, 0.2)); 
}

/* Texto inferior 'Acomodate...' */
.preparate-footer-text {
    color: #f39c12; 
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 40px;
    line-height: 1.5;
}

/* ============================================
--- PERFIL ALUMNO (Diseño general y móvil) ---
============================================ */

.profile-body {
    background-color: #4a86e8 ; 
    padding: 0; 
}

/*-----------------------------------------------header= menu-------------------------------------------------*/

header nav ul{
 display: flex;
 flex-direction: column;
 flex-wrap: wrap;
 justify-content: space-around;
 align-items: center;
 -ms-flex-direction: column;
}
header nav ul li a{
 font-size: 50px;
 width: 100%;
 height: 100%;
 background-color: orange;
 color: white;
 display: flex;
 justify-content: center;
 align-items: center;
}


/*--------------------------------- menu hamburguesa*--------------------------------*/

.menu-hamburguesa{
padding: .49rem;
width: 3rem;
aspect-ratio: 1;
cursor: pointer;
transition: all 0.3s ease-out;
position: fixed;
top: 1em;
right: 1em;
z-index: 9000;}

/*las tres lineas del menu hamburguesa*/     

.menu-hamburguesa .linea {
 width: 25px;
 height: 3px;
 background-color: orange;
 margin: 5px;
 transition: all 0.3s ease-out;
 position: relative;
 z-index: 9000;
}


nav ul {
 background-color: orange;
 display: flex;
 flex-wrap: wrap;
 justify-content: center;
 position: fixed;
 /* emplazamiento,
 estirado en toda la ventana */
 inset: 0;
 /* capa superior, arriba de casi todo */
 z-index: 8000;
 /* escondido "a la derecha" */
 translate: 100%;
 transition: all .6s ease; 
}

/*--------------------------- el menu cuando "nav" tiene la clase "menuVisible" -----------------------*/

.menuvisible ul {
 background-color:orange ;
 opacity: 80%;
 transition: all .4s ease;
 translate: 0;
 margin: 0;
}

.profile-container {
    width: 100%;
    max-width: 450px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh; 
    position: relative;
    padding-top: 50px;
}

.profile-card {
    background-color: white;
    border-radius: 25px; 
    padding: 20px;
    width: calc(100% - 40px); 
    max-width: 400px;  
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative; 
    z-index: 2; 
}

.profile-image-container {
    position: relative; 
    margin-bottom: 10px;
    width: 120px; 
    height: 120px; 
    border-radius: 50%;
    border: 4px solid white; 
    box-shadow: 0 0 0 2px #f39c12, 0 5px 10px rgba(0,0,0,0.2); 
    z-index: 4; 
}

.profile-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover; 
}

.profile-name {
    color: rgb(16, 83, 173);
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.profile-active-date {
    color: rgb(140, 159, 184);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

/* ---------------------------------
   AJUSTE DE ESTADÍSTICAS (MÓVIL)
   --------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns:auto;
    width: 100%;
    margin-bottom: 30px;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 0 0 calc(33.33% - 10px); 
    padding: 0 3px;
    box-sizing: border-box;
}

.stat-value {
    color:rgb(16, 83, 173);
    padding: 8px 15px; 
    border-radius: 20px;
    font-weight: bold;
    font-size: 1rem; 
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis; 
}

.stat-label {
    color: #f39c12; 
    font-size: 0.8rem; 
    font-weight: bold;
}
/* --------------------------------- */

.section-title {
    color: rgb(16, 83, 173);
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 15px;
    align-self: flex-start;
}

/* ---------------------------------
   AJUSTE DE ENLACES
   --------------------------------- */

.button-group .link-text {
    /* Estilo para "Ver todas las medallas" / "Ver historial completo" */
    background-color: transparent;
    border: none;
    color:rgb(140, 159, 184);
    font-size: 0.95rem;
    padding: 10px 3px;
    cursor: pointer;
    font-weight: normal; 
    text-decoration: underline; 
    white-space: nowrap;
}

.button-group .link-text:hover {
    color: #f39c12; 
}
/* --------------------------------- */


.medals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px; 
    width: 100%;
    margin-bottom: 30px;
}

.medal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.medal-icon-container {
    background-color: #f39c12; 
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.medal-icon {
    width: 75px; 
    height: 75px;
    object-fit: contain;
}

.medal-name {
    color: rgb(16, 83, 173);
    font-size: 0.9rem;
    font-weight: bold;
}

.medal-progress {
    color: #f39c12;
    font-size: 0.8rem;
}

.history-section {
    width: 100%;
    margin-bottom: 30px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.history-item:last-child {
    border-bottom: none;
}

.history-label {
    color: #f39c12;
    font-weight: bold;
}

.history-value {
    color: rgb(16, 83, 173);
    font-weight: bold;
}

.profile-buttons-bottom {
    display: flex;
    width: 100%;
    justify-content: space-between;
    margin-top: 30px;
}

.profile-button {
    background-color: #f39c12; 
    border: none;
    border-radius: 10px;
    padding: 15px 25px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    flex: 1; 
    margin: 0 5px; 
    transition: background-color 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.profile-button:hover {
    background-color: #d97706;
}


/* ============================================
--- MEDIA QUERY PARA TABLETS Y PC (Min-Width: 600px) ---
============================================ */
@media (min-width: 600px) {

    /* 1. Contenedor Principal: Dar más espacio horizontal */
    .profile-container {
        max-width: 750px; 
        min-height: 100vh;
        padding-top: 50px;
    }

    /* 2. Logo y QR: Posición para evitar colisiones */
    .logo2 {
        position: absolute;
        width: 180px;
        top: 30px;
        left: 30px;
    }

    /* 3. Tarjeta de Perfil */
    .profile-card {
        width: 100%; 
        max-width: 100%;
        padding: 40px; 
    }

    /* 5. Estadísticas Principales: Diseño centrado y más ancho */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr); 
        gap: 25px; 
    }
    .stat-item {
        flex: 1; /* Ocupa el mismo espacio */
    }
    .stat-value {
        font-size: 1.1rem; /* Restauramos el tamaño para pantallas grandes */
    }

    /* 6. Medallas: Usaremos 4 columnas */
    .medals-grid {
        grid-template-columns: repeat(4, 1fr); 
        gap: 25px; 
    }
    
    .medal-item {
        min-width: unset; 
    }

    /* 7. Historial: Mostrarlo más ancho */
    .history-section {
        max-width: 600px; 
        margin-left: auto;
        margin-right: auto;
    }


}

