/* css/aula-guia.css — guía animada de «Mi clase» (includes/aula_guia.php).
   Las pantallas simuladas se dibujan a 400×340 px y se escalan con --ag-s,
   que calcula js/aula-guia.js según el hueco disponible. */

.ag { width: min(1180px, 96vw); max-width: 96vw; max-height: 96dvh; padding: 0; border: 0; border-radius: 20px; background: #f7f3ee; color: #2a2018; font-family: Arial, Helvetica, sans-serif; box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: auto; }
.ag::backdrop { background: rgba(14, 40, 46, .72); }
.ag *, .ag *::before, .ag *::after { box-sizing: border-box; }
.ag [hidden] { display: none !important; }
.ag-caja { padding: 16px 20px 18px; }

.ag-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ag-cab h2 { margin: 0; font-size: 19px; color: #7a6a5a; }
.ag-x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; color: #2a2018; font-size: 26px; line-height: 1; cursor: pointer; }
.ag-x:hover { background: #ffe3d6; }

.ag-explica { min-height: 90px; display: flex; align-items: center; justify-content: center; margin: 4px 0 10px; }
.ag-texto { display: flex; align-items: center; gap: 14px; animation: ag-entra .35s ease; }
.ag-num { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: #ff6b35; color: #fff; font-size: 24px; font-weight: 700; }
.ag-texto p { margin: 0; }
.ag-texto strong { display: block; font-size: 24px; line-height: 1.2; }
.ag-texto p span { display: block; font-size: 17px; color: #5a4a3a; }
.ag-texto .ag-quien { display: inline-block; margin-bottom: 3px; padding: 2px 10px; border-radius: 999px; background: #1f6672; color: #fff; font-size: 11.5px; font-style: normal; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ag-de-alumno .ag-quien, .ag-de-alumno .ag-num { background: #2f6fb5; }
.ag-texto.ag-de-alumno .ag-quien { background: #2f6fb5; }

/* Escenario: dos pantallas */
.ag-escena { --ag-s: 1; position: relative; display: flex; justify-content: center; gap: 22px; }
.ag-lado { margin: 0; transition: opacity .3s, filter .3s; }
.ag-lado figcaption { margin: 0 0 6px; text-align: center; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #1f6672; }
.ag-lado[data-lado="alumno"] figcaption { color: #1f4f86; }
.ag-lado.apagado { opacity: .45; filter: saturate(.5); }
.ag-marco { width: calc(400px * var(--ag-s) + 16px); height: calc(340px * var(--ag-s) + 16px); padding: 5px; border: 3px solid #1f6672; border-radius: 14px; background: #fff; overflow: hidden; transition: box-shadow .3s; }
.ag-tablet { border-color: #2f6fb5; border-radius: 26px; }
.ag-lado:not(.apagado) .ag-marco { box-shadow: 0 6px 22px rgba(31, 102, 114, .22); }
.ag-pantalla { position: relative; width: 400px; height: 340px; transform: scale(var(--ag-s)); transform-origin: 0 0; text-align: center; }
.ag-vista { position: absolute; inset: 0; padding: 14px 18px; visibility: hidden; opacity: 0; transition: opacity .3s; }
.ag-vista.on { visibility: visible; opacity: 1; }
.ag-vista h3 { margin: 4px 0 12px; font-size: 20px; }
.ag-vista p { margin: 0; }

.ag-btn { display: inline-block; padding: 9px 22px; border-radius: 999px; background: #ff6b35; color: #fff; font-size: 15px; font-weight: 700; white-space: nowrap; transition: transform .15s, background .2s; }
.ag-btn.pulsado { transform: scale(.9); background: #d94f1c; }
.ag-centro { display: table; margin: 16px auto 0; }

/* Docente */
.ag-vista[data-vista="inicio"] .ag-btn { margin-top: 90px; font-size: 20px; padding: 14px 34px; }
.ag-pin { margin: 6px 0; font-family: 'Courier New', monospace; font-size: 100px; font-weight: 700; letter-spacing: .1em; line-height: 1.1; color: #e6572a; animation: ag-pop .5s ease; }
.ag-vista .ag-donde { margin: 0 6px; font-size: 16px; font-weight: 700; line-height: 1.35; }
.ag-vista .ag-contador { display: inline-block; margin-top: 12px; padding: 7px 18px; border-radius: 999px; background: #e3f1f3; color: #1f6672; font-size: 17px; font-weight: 700; }
.ag-juegos { display: flex; gap: 10px; align-items: stretch; margin-top: 26px; }
.ag-juego { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 6px 10px; border: 2px solid #e5dfd7; border-radius: 12px; transition: border-color .3s, background .3s; }
.ag-juego img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: 6px; }
.ag-juego strong { flex: 1; font-size: 12px; line-height: 1.25; }
.ag-juego .ag-btn { padding: 7px 16px; font-size: 13px; }
.ag-juego.activa { border-color: #ff6b35; background: #fff3ec; }
.ag-vista .ag-aviso { margin-top: 18px; font-size: 17px; font-weight: 700; color: #1e7a45; opacity: 0; transition: opacity .3s; }
.ag-vista .ag-aviso.on { opacity: 1; }
.ag-vista .ag-resumen { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; font-weight: 700; color: #1f6672; }
.ag-orden { padding: 5px 10px; border: 1px solid #cfc6bb; border-radius: 8px; color: #4a3d30; font-weight: 400; font-size: 13px; white-space: nowrap; }
.ag-orden.pulsado { background: #ffe3d6; border-color: #ff6b35; }
.ag-fila { display: grid; grid-template-columns: 44px 1fr 56px; align-items: center; gap: 10px; height: 40px; padding: 0 6px; border-bottom: 1px solid #eee8e0; text-align: left; font-size: 18px; }
.ag-fila-cab { height: 26px; grid-template-columns: 44px 1fr; border-bottom-width: 2px; font-size: 11px; text-transform: uppercase; color: #7a6a5a; }
.ag-filas { position: relative; height: 160px; }
.ag-filas .ag-fila { position: absolute; left: 0; right: 0; top: 0; opacity: 0; transition: top .6s ease, opacity .35s; }
.ag-filas .ag-fila.on { opacity: 1; }
.ag-fila em { font-style: normal; font-weight: 700; font-size: 15px; }
.ag-barra { height: 13px; border-radius: 999px; background: #e9eff1; overflow: hidden; }
.ag-barra i { display: block; height: 100%; }
.ag-barra.bien i { background: #2e9e63; }
.ag-barra.media i { background: #e0a226; }
.ag-barra.baja i { background: #d9604c; }

/* Alumnado: la portada y la pantalla del PIN a escala */
.ag-vista.ag-web { padding: 0; }
.ag-vista .ag-url { height: 30px; margin: 0; padding: 7px 12px; background: #eef2f5; border-radius: 8px 8px 0 0; color: #4a5a6a; font-size: 13px; line-height: 16px; white-space: nowrap; overflow: hidden; }
.ag-hero { position: relative; height: 310px; padding: 12px 6px; background: linear-gradient(#e9def2, #f7f3ee); }
.ag-cab-web { display: flex; justify-content: center; gap: 7px; }
.ag-pin-web, .ag-crear, .ag-entrar { position: relative; padding: 8px 13px; border: 2px solid #6f4a86; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; transition: transform .15s, background .2s; }
.ag-pin-web { margin-right: 10px; border-color: #2f6fb5; background: #2f6fb5; color: #fff; }
.ag-pin-web.pulsado { transform: scale(.9); background: #1c4a7e; }
.ag-crear { background: #6f4a86; color: #fff; opacity: .5; }
.ag-entrar { background: #fff; color: #6f4a86; opacity: .5; }
.ag-flecha { position: absolute; top: 46px; left: 50%; margin-left: -17px; width: 34px; font-size: 34px; line-height: 1; color: #ff6b35; opacity: 0; }
.ag-flecha.on { opacity: 1; animation: ag-arriba .6s ease-in-out infinite alternate; }
.ag-logo { display: block; width: 250px; margin: 62px auto 22px; }
.ag-mini { display: flex; justify-content: center; gap: 10px; }
.ag-mini img { width: 104px; aspect-ratio: 3/2; object-fit: cover; border-radius: 8px; opacity: .75; }

.ag-fondo { display: flex; align-items: center; justify-content: center; height: 310px; background: #f7f3ee; }
.ag-tarjeta { width: 300px; padding: 12px 20px 16px; border: 2px solid #bcd3ee; border-radius: 16px; background: #f2f7fd; }
.ag-tarjeta strong { display: block; margin-bottom: 4px; color: #1f4f86; font-size: 21px; }
.ag-tarjeta small { display: block; color: #7a6a5a; font-size: 12.5px; line-height: 1.35; }
.ag-logo-peq { display: block; width: 130px; margin: 0 auto 8px; }
.ag-caja-pin { display: grid; place-items: center; height: 58px; margin: 10px 0; border: 2px solid #bcd3ee; border-radius: 10px; background: #fff; font-family: 'Courier New', monospace; font-size: 38px; font-weight: 700; letter-spacing: .3em; }
.ag-boton-azul { display: block; padding: 11px; border-radius: 10px; background: #2f6fb5; color: #fff; font-size: 18px; font-weight: 700; transition: transform .15s, background .2s; }
.ag-boton-azul.pulsado { transform: scale(.93); background: #1c4a7e; }
.ag-tarjeta-num { width: 380px; padding: 14px 14px 16px; }
.ag-tarjeta-num strong { margin-bottom: 12px; }
/* Resalte pulsante de «mira aquí» */
.ag-escena .senala { box-shadow: 0 0 0 5px rgba(255, 107, 53, .85); animation: ag-senala 1s ease-in-out infinite alternate; }
.ag-numeros { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.ag-numeros span { display: grid; place-items: center; height: 40px; border: 2px solid #bcd3ee; border-radius: 9px; background: #fff; color: #1f4f86; font-size: 17px; font-weight: 700; }
.ag-numeros span.pulsado { background: #2f6fb5; border-color: #2f6fb5; color: #fff; }
.ag-vista .ag-chip { display: inline-block; margin-bottom: 12px; padding: 6px 16px; border: 1px solid #bcd3ee; border-radius: 999px; background: #f2f7fd; color: #1f4f86; font-weight: 700; font-size: 15px; }
.ag-vista .ag-espera { margin-top: 40px; padding: 50px 20px; border: 2px dashed #d8d0c6; border-radius: 14px; color: #7a6a5a; font-size: 16px; }
.ag-actividad { width: 250px; margin: 0 auto; padding: 8px 8px 12px; border: 3px solid #ff6b35; border-radius: 14px; animation: ag-pop .5s ease; }
.ag-actividad img { display: block; width: 100%; height: 130px; object-fit: cover; border-radius: 8px; }
.ag-actividad small { display: block; margin-top: 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: #c2521f; }
.ag-actividad strong { display: block; font-size: 15px; line-height: 1.25; }
.ag-actividad .ag-btn { margin-top: 8px; }
.ag-jugando { padding-top: 90px; }
.ag-jugando span { display: inline-block; margin: 0 12px; font-size: 56px; color: #2f6fb5; animation: ag-salta .8s ease-in-out infinite alternate; }
.ag-jugando span:nth-child(2) { animation-delay: .25s; color: #ff6b35; }
.ag-jugando span:nth-child(3) { animation-delay: .5s; color: #2e9e63; }
.ag-jugando p { margin-top: 20px; font-size: 17px; color: #7a6a5a; }
.ag-fin { margin-top: 44px; padding: 22px 18px 26px; border: 2px solid #bcd3ee; border-radius: 16px; background: #f2f7fd; animation: ag-pop .5s ease; }
.ag-vista .ag-fin-cab { font-size: 13px; font-weight: 700; text-transform: uppercase; color: #1f4f86; }
.ag-vista .ag-fin-nota { margin-top: 14px; font-size: 22px; font-weight: 700; }
.ag-fin .ag-btn { margin-top: 20px; font-size: 18px; padding: 13px 30px; }
.ag-fin .ag-btn.hecho { background: #2e9e63; }

/* Dedo que pulsa */
.ag-dedo { position: absolute; left: 50%; top: 100%; z-index: 2; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 3px solid #fff; border-radius: 50%; background: rgba(42, 32, 24, .55); box-shadow: 0 2px 8px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: left .6s ease, top .6s ease, opacity .3s; }
.ag-dedo.on { opacity: 1; }
.ag-dedo.toca::after { content: ''; position: absolute; inset: -3px; border: 3px solid #ff6b35; border-radius: 50%; animation: ag-onda .55s ease-out forwards; }

.ag-progreso { height: 6px; margin: 14px 0 12px; border-radius: 999px; background: #e5dfd7; overflow: hidden; }
.ag-progreso i { display: block; width: 0; height: 100%; background: #ff6b35; }
.ag-controles { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.ag-ctl { padding: 10px 18px; border: 1px solid #d8d0c6; border-radius: 999px; background: #fff; color: #2a2018; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.ag-ctl:hover:not(:disabled) { border-color: #ff6b35; }
.ag-ctl:disabled { opacity: .4; cursor: default; }
.ag-ctl-play { min-width: 160px; background: #ff6b35; border-color: #ff6b35; color: #fff; }
.ag-puntos { display: flex; gap: 6px; margin-left: 8px; }
.ag-puntos button { width: 34px; height: 34px; border: 1px solid #d8d0c6; border-radius: 50%; background: #fff; color: #7a6a5a; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.ag-puntos button.on { background: #1f6672; border-color: #1f6672; color: #fff; }
.ag button:focus-visible { outline: 3px solid #2f6fb5; outline-offset: 2px; }
.ag-datos { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 26px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: #7a6a5a; }
.ag-datos li::before { content: '• '; color: #ff6b35; }

/* Resumen previo: mientras se muestra, los pasos quedan ocultos. */
.ag-inicio { display: none; padding: 6px 0 10px; text-align: center; }
.ag.ag-en-inicio .ag-inicio { display: block; animation: ag-entra .35s ease; }
.ag.ag-en-inicio .ag-explica, .ag.ag-en-inicio .ag-escena, .ag.ag-en-inicio .ag-progreso, .ag.ag-en-inicio .ag-controles, .ag.ag-en-inicio .ag-datos { display: none; }
.ag-inicio .ag-ini-sub { margin: 6px 0 22px; font-size: 28px; font-weight: 700; }
.ag-ideas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 960px; margin: 0 auto 28px; padding: 0; list-style: none; }
.ag-ideas li { padding: 26px 20px 24px; border: 2px solid #bcd3ee; border-radius: 18px; background: #fff; }
.ag-ideas svg { display: block; width: 62px; height: 62px; margin: 0 auto 14px; padding: 14px; border-radius: 50%; background: #2f6fb5; fill: #fff; }
.ag-ideas strong { display: block; margin-bottom: 8px; font-size: 21px; line-height: 1.2; }
.ag-ideas span { display: block; font-size: 16.5px; line-height: 1.4; color: #5a4a3a; }
.ag-ideas li.ag-idea-juego { border-color: #bfe3cd; }
.ag-idea-juego svg { background: #2e9e63; }
.ag-ideas li.ag-idea-envio { border-color: #ffd2bd; }
.ag-idea-envio svg { background: #ff6b35; }
.ag-ctl.ag-ver { padding: 15px 34px; font-size: 18px; }
.ag-vista .ag-actividad:not([hidden]) ~ .ag-todos { display: none; }
.ag-vista .ag-todos { display: inline-block; margin-top: 12px; color: #7a6a5a; font-size: 13.5px; text-decoration: underline; }

/* Pantalla estrecha: solo se ve la pantalla protagonista de cada momento.
   .solo = pasos 2 y 3, la entrada del alumnado: su pantalla, sola y en grande. */
.ag-escena.estrecha .ag-lado.apagado, .ag-escena.solo .ag-lado[data-lado="profe"] { display: none; }

@media (max-width: 600px) {
  .ag-caja { padding: 12px 12px 14px; }
  .ag-inicio .ag-ini-sub { margin-bottom: 14px; font-size: 21px; }
  .ag-ideas { grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
  .ag-ideas li { display: grid; grid-template-columns: 46px 1fr; column-gap: 12px; align-items: center; padding: 12px; text-align: left; }
  .ag-ideas svg { grid-row: span 2; width: 46px; height: 46px; margin: 0; padding: 11px; }
  .ag-ideas strong { margin: 0 0 2px; font-size: 16px; }
  .ag-ideas span { font-size: 13.5px; }
  .ag-ctl.ag-ver { padding: 12px 20px; font-size: 15px; }
  .ag-explica { min-height: 128px; }
  .ag-texto { gap: 10px; }
  .ag-num { width: 36px; height: 36px; font-size: 18px; }
  .ag-texto strong { font-size: 18px; }
  .ag-texto p span { font-size: 14px; }
  .ag-ctl { padding: 9px 12px; font-size: 14px; }
  .ag-ctl-play { min-width: 0; }
  .ag-puntos { margin-left: 0; width: 100%; justify-content: center; }
}

@keyframes ag-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ag-pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@keyframes ag-salta { from { transform: translateY(8px); } to { transform: translateY(-14px); } }
@keyframes ag-senala { from { box-shadow: 0 0 0 3px rgba(255,107,53,.9); } to { box-shadow: 0 0 0 9px rgba(255,107,53,.25); } }
@keyframes ag-arriba { from { transform: translateY(8px); } to { transform: translateY(-2px); } }
@keyframes ag-onda { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(2.2); } }

@media (prefers-reduced-motion: reduce) {
  .ag *, .ag *::after { animation: none !important; transition: none !important; }
}
