/* =====================================================================
   ZONA DEL ALUMNO - lúdica, botones enormes y poco texto
   ===================================================================== */

body.alumno {
    background: var(--azul-claro);
    font-size: 1.25rem;
    touch-action: manipulation;   /* evita el zoom por doble toque */
}

/* ---------- Fondo tipo cielo con nubes ---------- */
.fondo-decorado {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 85% 90%, rgba(242, 192, 193, .55) 0 120px, transparent 121px),
        radial-gradient(circle at 8% 80%, rgba(209, 184, 224, .55) 0 90px, transparent 91px),
        linear-gradient(180deg, var(--azul) 0%, #c9def0 45%, var(--crema) 100%);
}

.nube {
    position: absolute;
    width: 140px;
    height: 44px;
    background: #fff;
    border-radius: 999px;
    opacity: .85;
    animation: flotar 14s ease-in-out infinite alternate;
}
.nube::before, .nube::after {
    content: "";
    position: absolute;
    background: #fff;
    border-radius: 50%;
}
.nube::before { width: 60px; height: 60px; left: 20px; top: -30px; }
.nube::after  { width: 46px; height: 46px; left: 66px; top: -20px; }
.n1 { top: 8%;  left: 4%; }
.n2 { top: 22%; right: 6%; transform: scale(.75); animation-duration: 18s; }
.n3 { top: 62%; left: 55%; transform: scale(.6); animation-duration: 22s; opacity: .6; }

@keyframes flotar {
    from { translate: -20px 0; }
    to   { translate: 30px 0; }
}

.estrellita {
    position: absolute;
    color: #fff;
    animation: titilar 3s ease-in-out infinite;
}
.estrellita .icono { width: 34px; height: 34px; }
.s1 { top: 14%; left: 70%; color: var(--crema); }
.s2 { top: 48%; left: 6%;  color: var(--rosa); animation-delay: 1s; }
.s3 { top: 80%; left: 82%; color: var(--lila); animation-delay: 2s; }

@keyframes titilar {
    0%, 100% { transform: scale(1) rotate(0); opacity: .9; }
    50%      { transform: scale(1.3) rotate(20deg); opacity: .5; }
}

/* ---------- Pantalla de acceso ---------- */
.acceso {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 16px 96px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.acceso-caras {
    display: flex;
    gap: 12px;
}
.acceso-caras .cara {
    width: clamp(56px, 16vw, 88px);
    animation: botar 2.4s ease-in-out infinite;
}
.acceso-caras .cara:nth-child(2) { animation-delay: .25s; }
.acceso-caras .cara:nth-child(3) { animation-delay: .5s; }

@keyframes botar {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

.acceso-titulo {
    margin: .2em 0 .3em;
    font-size: clamp(2.6rem, 11vw, 4.5rem);
    line-height: 1.1;
    text-shadow: 0 4px 0 #fff;
}

.acceso-form {
    width: 100%;
    display: grid;
    gap: 18px;
    padding: clamp(20px, 6vw, 36px);
    background: #fff;
    border-radius: 32px;
    box-shadow: 0 10px 0 var(--lila), var(--sombra);
    animation: aparecer .6s var(--rebote) both;
}

.acceso-etiqueta {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
}

.acceso-campo {
    width: 100%;
    min-height: 84px;
    padding: .3em .4em;
    font-size: clamp(2rem, 10vw, 3rem);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: var(--crema-claro);
    border: 5px solid var(--azul);
    border-radius: 22px;
    transition: border-color .2s, box-shadow .2s;
}
.acceso-campo::placeholder { color: #c4bca4; }
.acceso-campo:focus {
    outline: none;
    border-color: var(--azul-osc);
    box-shadow: 0 0 0 6px rgba(160, 197, 222, .6);
}

.con-error .acceso-campo {
    border-color: var(--rojo);
    animation: temblor .5s;
}

.acceso-error {
    margin: 0;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: clamp(1.25rem, 5vw, 1.6rem);
    color: var(--rojo-osc);
    background: var(--rosa-claro);
    border-radius: 18px;
    animation: aparecer .4s var(--rebote) both;
}
.cara.mini { width: 46px; height: 46px; flex-shrink: 0; }

.boton-gigante {
    min-height: 88px;
    padding: .35em 1em;
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    letter-spacing: .06em;
    color: #fff;
    background: var(--lila-osc);
    border: 0;
    border-radius: 26px;
    box-shadow: 0 8px 0 #4b2f68;
    transition: transform .15s var(--rebote), box-shadow .15s;
}
.boton-gigante:hover  { transform: translateY(-3px); box-shadow: 0 11px 0 #4b2f68; }
.boton-gigante:active { transform: translateY(6px);  box-shadow: 0 2px 0 #4b2f68; }

.enlace-profes {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    min-height: 48px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    color: var(--tinta-suave);
    text-decoration: none;
    background: rgba(255, 255, 255, .8);
    border-radius: 999px;
}
.enlace-profes:hover { background: #fff; color: var(--tinta); }

/* ---------- Barra superior ---------- */
.barra-alumno {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: max(14px, env(safe-area-inset-top)) 16px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.saludo {
    margin: 0;
    min-width: 0;
    padding: .25em .9em;
    display: inline-flex;
    align-items: center;
    gap: .4em;
    font-size: clamp(1.3rem, 5.5vw, 1.9rem);
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 5px 0 var(--lila);
}
.saludo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.boton-redondo {
    flex-shrink: 0;
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    color: var(--tinta);
    background: #fff;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 5px 0 var(--azul-osc);
    transition: transform .2s var(--rebote), box-shadow .2s;
}
.boton-redondo .icono { width: 34px; height: 34px; stroke-width: 2.6; }
.boton-redondo:hover  { transform: translateY(-3px) scale(1.05); }
.boton-redondo:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--azul-osc); }
.boton-redondo.salir  { color: var(--rojo-osc); box-shadow: 0 5px 0 var(--rosa-osc); }

/* ---------- Listado de actividades ---------- */
.listado {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 16px 48px;
}

.listado-titulo {
    margin: .2em 0 .8em;
    text-align: center;
    font-size: clamp(1.8rem, 7.5vw, 3rem);
    line-height: 1.15;
    text-shadow: 0 3px 0 #fff;
}

.rejilla-actividades {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 24vw, 190px), 1fr));
    gap: clamp(20px, 5vw, 36px);
    padding-top: 10px;
}

.boton-actividad {
    --c: var(--azul);
    --c-osc: #6f9fc2;
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    color: var(--tinta);
    text-decoration: none;
    background: var(--c);
    background-image: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .55) 0 18%, transparent 19%);
    border: 5px solid #fff;
    border-radius: 34px;
    box-shadow: 0 10px 0 var(--c-osc), 0 16px 26px rgba(43, 45, 66, .15);
    transition: transform .25s var(--rebote), box-shadow .25s;
    animation: aparecer .55s var(--rebote) backwards;
    animation-delay: var(--retraso, 0ms);
}
.boton-actividad.color-1 { --c: var(--rosa);  --c-osc: #d48a8d; }
.boton-actividad.color-2 { --c: var(--lila);  --c-osc: #a585bf; }
.boton-actividad.color-3 { --c: var(--crema); --c-osc: #d2bb63; }

.boton-actividad .numero {
    font-size: clamp(3.4rem, 15vw, 6rem);
    line-height: 1;
    font-weight: 700;
    text-shadow: 0 4px 0 rgba(255, 255, 255, .7);
}

.boton-actividad:hover,
.boton-actividad:focus-visible { transform: translateY(-6px) rotate(-3deg) scale(1.04); }
.boton-actividad:nth-child(even):hover { transform: translateY(-6px) rotate(3deg) scale(1.04); }
.boton-actividad:active {
    transform: translateY(6px) scale(.96);
    box-shadow: 0 3px 0 var(--c-osc), 0 6px 12px rgba(43, 45, 66, .15);
}

/* Sello de actividad terminada */
.boton-actividad .sello {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    color: var(--oro);
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
    animation: brillo 2.6s ease-in-out infinite;
}
.boton-actividad .sello .icono { width: 40px; height: 40px; stroke: #c98a00; stroke-width: 1; }

@keyframes brillo {
    0%, 100% { transform: rotate(0) scale(1); }
    50%      { transform: rotate(15deg) scale(1.12); }
}

.sin-actividades {
    text-align: center;
    font-size: clamp(1.4rem, 6vw, 2rem);
}
.sin-actividades .cara { width: 120px; animation: botar 2.4s ease-in-out infinite; }

/* ---------- Pantalla de preguntas ---------- */
.zona-preguntas {
    width: 100%;
    max-width: 920px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.etiqueta-actividad {
    min-width: 68px;
    height: 68px;
    padding: 0 12px;
    display: grid;
    place-items: center;
    font-size: 2.2rem;
    background: var(--lila);
    border: 4px solid #fff;
    border-radius: 22px;
    box-shadow: 0 5px 0 var(--lila-osc);
}

/* Indicador de progreso con estrellas */
.progreso {
    margin: 6px 0 18px;
    padding: 0 16px;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}
.progreso li {
    color: #fff;
    filter: drop-shadow(0 2px 0 rgba(43, 45, 66, .25));
    transition: transform .3s var(--rebote), color .3s;
}
.progreso .icono { width: clamp(28px, 8vw, 42px); height: clamp(28px, 8vw, 42px); stroke-width: 1; stroke: rgba(43, 45, 66, .25); }
.progreso .hecho  { color: var(--oro); }
.progreso .actual { transform: scale(1.3); animation: latido 1.2s ease-in-out infinite; }

@keyframes latido {
    0%, 100% { transform: scale(1.2); }
    50%      { transform: scale(1.4); }
}

.tarjeta-pregunta {
    margin: 0 16px;
    min-height: clamp(150px, 28vh, 260px);
    padding: clamp(22px, 5vw, 48px);
    display: grid;
    place-items: center;
    text-align: center;
    background: #fff;
    border-radius: 34px;
    box-shadow: 0 10px 0 var(--rosa), var(--sombra);
}

.texto-pregunta {
    margin: 0;
    font-size: clamp(1.7rem, 6.5vw, 3rem);
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.texto-pregunta.entrar { animation: subir .45s var(--rebote) both; }

.caritas {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(26px, 6vw, 52px) 16px 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(10px, 4vw, 44px);
}

.boton-cara {
    padding: 6px;
    aspect-ratio: 1;
    background: none;
    border: 0;
    border-radius: 50%;
    transition: transform .25s var(--rebote), opacity .25s;
}
.boton-cara .cara {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 0 rgba(43, 45, 66, .18));
}
.boton-cara:hover  { transform: translateY(-8px) scale(1.06); }
.boton-cara:active { transform: scale(.9); }

/* Respuesta anterior (si vuelve a hacer la actividad) */
.boton-cara.elegida { box-shadow: 0 0 0 6px #fff, 0 0 0 11px var(--azul-osc); }

/* Animación al elegir */
.boton-cara.pulsada { animation: elegir .6s var(--rebote) both; }
.boton-cara.apagada { opacity: .3; transform: scale(.85); }

@keyframes elegir {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.3) rotate(-8deg); }
    70%  { transform: scale(1.15) rotate(6deg); }
    100% { transform: scale(1.2); }
}

.aviso-nino {
    margin: 16px;
    padding: 12px 16px;
    text-align: center;
    font-size: 1.4rem;
    color: var(--rojo-osc);
    background: #fff;
    border-radius: 18px;
}

/* ---------- Pantalla final ---------- */
.zona-final {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 16px;
    display: grid;
    place-items: center;
}

.final-caja {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    padding: clamp(28px, 7vw, 56px) clamp(18px, 5vw, 48px);
    text-align: center;
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 12px 0 var(--lila), var(--sombra);
    animation: aparecer .7s var(--rebote) both;
}

.final-estrellas {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    color: var(--oro);
}
.final-estrellas .icono {
    width: clamp(50px, 15vw, 80px);
    height: clamp(50px, 15vw, 80px);
    stroke: #c98a00;
    stroke-width: 1;
    animation: aparecer .6s var(--rebote) both, brillo 2.4s ease-in-out .8s infinite;
}
.final-estrellas .icono:nth-child(2) {
    width: clamp(70px, 20vw, 110px);
    height: clamp(70px, 20vw, 110px);
    animation-delay: .2s, 1s;
}
.final-estrellas .icono:nth-child(3) { animation-delay: .4s, 1.2s; }

.final-titulo {
    margin: .4em 0 .8em;
    font-size: clamp(2rem, 8.5vw, 3.4rem);
    line-height: 1.15;
}

.boton-x {
    width: clamp(110px, 32vw, 150px);
    height: clamp(110px, 32vw, 150px);
    margin: 0 auto;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--rojo);
    border: 6px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 5px var(--rojo), 0 12px 0 5px var(--rojo-osc);
    transition: transform .25s var(--rebote), box-shadow .2s;
}
.boton-x .icono { width: 58%; height: 58%; stroke-width: 3.6; }
.boton-x:hover  { transform: scale(1.08) rotate(90deg); }
.boton-x:active { transform: translateY(8px); box-shadow: 0 0 0 5px var(--rojo), 0 4px 0 5px var(--rojo-osc); }

/* Confeti de celebración */
.confeti {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.confeti i {
    position: absolute;
    top: -24px;
    width: 12px;
    height: 18px;
    background: var(--col);
    border-radius: 3px;
    animation: caer var(--dur) linear var(--ret) infinite;
}
.confeti i.redondo { border-radius: 50%; width: 14px; height: 14px; }

@keyframes caer {
    to { transform: translate3d(var(--dx), 110vh, 0) rotate(720deg); }
}

@media (prefers-reduced-motion: reduce) {
    .confeti, .nube, .estrellita { display: none; }
}

/* Pantallas bajitas (móvil en horizontal) */
@media (max-height: 500px) and (orientation: landscape) {
    .tarjeta-pregunta { min-height: 0; padding: 16px 24px; }
    .caritas { max-width: 460px; padding-top: 18px; }
    .progreso { margin-bottom: 10px; }
}
