/* LCZ Aula - papel milimetrado, tinta azul y una traza verde de respuesta al escalon */
:root {
  --papel: #EDF1EC;
  --cuadricula: #D5DED6;
  --tinta: #12233A;
  --tinta-suave: #4A5B70;
  --traza: #2A7A96;
  --traza-oscura: #1F5F7A;
  --dorado: #B8862F;
  --alerta: #B4431F;
  --hoja: #FFFFFF;
  --titulos: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --texto: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--tinta);
  font: 16px/1.5 var(--texto);
  background-color: var(--papel);
  background-image:
    linear-gradient(var(--cuadricula) 1px, transparent 1px),
    linear-gradient(90deg, var(--cuadricula) 1px, transparent 1px);
  background-size: 24px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--traza-oscura); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--traza);
  outline-offset: 2px;
}

.cabecera {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem) 0;
  background: var(--papel);
}
.marca {
  font: 600 1.35rem/1 var(--titulos);
  align-items: center;
  color: var(--tinta);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
}
.simbolo { width: 2.6rem; height: auto; color: var(--traza); align-self: center; }
.marca span { align-self: center; }
.salir { display: flex; align-items: baseline; gap: .9rem; margin: 0; }
.quien { color: var(--tinta-suave); font-size: .95rem; }
.boton-texto {
  background: none; border: 0; padding: .2rem 0; cursor: pointer;
  font: inherit; color: var(--traza-oscura); text-decoration: underline;
}
.respuesta { display: block; width: 100%; height: 44px; background: var(--papel); }

.contenido {
  flex: 1;
  width: min(100%, 1060px);
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 3rem) 3rem;
}
h1 { font: 600 1.9rem/1.2 var(--titulos); margin: 0 0 .75rem; }

/* Entrada */
.entrada {
  max-width: 25rem;
  margin: 6vh auto 0;
  background: var(--hoja);
  border: 1px solid var(--tinta);
  padding: 2rem;
}
.bajada { color: var(--tinta-suave); margin: 0 0 1.5rem; }
.formulario { display: grid; gap: .4rem; }
.formulario label { font-weight: 600; margin-top: .6rem; }
.formulario input[type=text], .formulario input[type=password] {
  font: inherit; color: inherit;
  padding: .7rem .75rem;
  border: 1px solid var(--tinta-suave);
  border-radius: 2px;
  background: var(--papel);
}
.boton {
  margin-top: 1.25rem;
  font: 600 1rem var(--texto);
  color: #fff;
  background: var(--traza);
  border: 0;
  border-radius: 2px;
  padding: .85rem 1rem;
  cursor: pointer;
}
.boton:hover { background: var(--traza-oscura); }
.aviso {
  border-left: 4px solid var(--alerta);
  background: #FBEDE7;
  color: #6F2710;
  padding: .7rem .9rem;
  margin: 0 0 .5rem;
}

/* Cursos */
.ciclo { margin-bottom: 2.5rem; }
.curso {
  background: var(--hoja);
  border: 1px solid var(--tinta);
  margin-bottom: .9rem;
}
.curso > summary {
  cursor: pointer;
  padding: .9rem 1.1rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  list-style: none;
}
.curso > summary::-webkit-details-marker { display: none; }
.curso > summary::after {
  content: "Mostrar";
  margin-left: auto;
  color: var(--traza-oscura);
  font-size: .95rem;
  text-decoration: underline;
}
.curso[open] > summary::after { content: "Ocultar"; }
.curso-nombre { font: 600 1.3rem var(--titulos); }
.curso-cuenta { color: var(--tinta-suave); font-size: .95rem; }
.sesiones { list-style: none; margin: 0; padding: 0; }
.sesion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1.5rem;
  padding: .8rem 1.1rem;
  border-top: 1px solid var(--cuadricula);
}
.sesion-datos { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; }
.sesion-nombre { font-weight: 700; min-width: 2.6rem; }
.sesion-fecha { font-variant-numeric: tabular-nums; }
.sesion-dur { color: var(--tinta-suave); font-size: .95rem; }
.partes, .otras-partes { display: flex; flex-wrap: wrap; gap: .5rem; }
.parte {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
  padding: .45rem .8rem;
  border: 1px solid var(--traza);
  border-radius: 2px;
  color: var(--traza-oscura);
  background: var(--hoja);
  text-decoration: none;
  font-weight: 600;
}
.parte small { font-weight: 400; color: var(--tinta-suave); }
.parte:hover, .parte.actual { background: var(--traza); color: #fff; }
.parte:hover small, .parte.actual small { color: #DDF1EC; }

/* Reproductor */
.miga { color: var(--tinta-suave); margin-bottom: .4rem; font-size: .95rem; }
.titulo-video small { font: 400 1rem var(--texto); color: var(--tinta-suave); margin-left: .6rem; }
.reproductor {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #0B1420;
  border: 1px solid var(--tinta);
  color: #E7EEF0;
}
.reproductor [hidden] { display: none !important; }
.espera {
  aspect-ratio: 16 / 9;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: #E7EEF0;
  text-align: center;
}
.espera > * { width: min(100%, 30rem); }
.espera p { margin: 0 0 .8rem; }
.espera-nota { color: #9FB2BE; font-size: .92rem; }
.espera a { color: #8FCBDD; }
.barra { height: 6px; background: #22344A; margin: 0 0 1rem; }
.barra-avance { height: 100%; width: 0; background: #3B93AE; transition: width .6s linear; }

/* Escena: la ventana por la que se mira el video. El zoom escala el <video> dentro de ella. */
.escena {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: #000;
  touch-action: pan-y;            /* un dedo desplaza la pagina; el pellizco lo maneja el reproductor */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.escena.con-zoom { touch-action: none; cursor: grab; }
.escena.arrastrando { cursor: grabbing; }
.escena video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  transform-origin: 0 0;
  pointer-events: none;
}
.marca-zoom {
  position: absolute;
  left: 0; top: 0;
  max-width: 92%;
  padding: .15rem .45rem;
  font: 500 clamp(.72rem, 1.9vw, 1.05rem)/1.3 var(--texto);
  color: rgba(255, 255, 255, .5);
  background: rgba(0, 0, 0, .25);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.gran-play {
  position: absolute;
  left: 50%; top: 50%;
  width: clamp(3.4rem, 12vw, 5rem);
  height: clamp(3.4rem, 12vw, 5rem);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(11, 20, 32, .72);
  border: 2px solid #3B93AE;
  pointer-events: none;
}
.gran-play svg { width: 55%; height: 55%; fill: #E7EEF0; margin-left: 6%; }
.cargando, .aviso {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: .25rem .7rem;
  font-size: .9rem;
  color: #E7EEF0;
  background: rgba(11, 20, 32, .8);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.cargando { bottom: .8rem; }
.aviso { top: .8rem; border-left: 3px solid #3B93AE; }

/* Mandos propios */
.mandos {
  padding: .1rem .35rem .3rem;
  background: #0B1420;
  transition: opacity .25s ease;
}
.avance, .volumen { accent-color: #3B93AE; cursor: pointer; margin: 0; }
.avance { display: block; width: 100%; height: 1.6rem; }
.fila-mandos { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem; }
.hueco { flex: 1 1 0; min-width: .2rem; }
.mando {
  display: inline-grid;
  place-items: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 .35rem;
  border: 0;
  background: none;
  color: #E7EEF0;
  font: inherit;
  cursor: pointer;
  border-radius: 2px;
}
.mando:hover { background: #1B2C42; }
.mando:disabled { opacity: .35; cursor: default; background: none; }
.mando:focus-visible { outline: 3px solid #3B93AE; outline-offset: -3px; }
.mando svg { width: 1.45rem; height: 1.45rem; fill: currentColor; display: block; }
.mando-texto { font-size: .92rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.grupo-zoom { display: inline-flex; align-items: center; border: 1px solid #2A3E58; margin: 0 .2rem; }
.mando-zoom { min-width: 3rem; color: #8FCBDD; }
.tiempo { padding: 0 .4rem; font-size: .9rem; color: #C9D6DE; font-variant-numeric: tabular-nums; white-space: nowrap; }
.volumen { width: 5rem; }
.i-pausa, .i-mudo, .i-salir { display: none !important; }
.reproductor:not(.en-pausa) .i-play { display: none; }
.reproductor:not(.en-pausa) .i-pausa { display: block !important; }
.reproductor.en-mudo .i-sonido { display: none; }
.reproductor.en-mudo .i-mudo { display: block !important; }
.reproductor.completa .i-entrar { display: none; }
.reproductor.completa .i-salir { display: block !important; }
.solo-completa { display: none; }
.reproductor.completa .solo-completa { display: inline-grid; }

/* Pantalla completa (real, o simulada con CSS donde el navegador no la permite) */
.reproductor.completa { width: 100%; height: 100%; border: 0; background: #000; }
.reproductor.pantalla-falsa { position: fixed; inset: 0; z-index: 1000; height: 100dvh; }
html.sin-desplazar, html.sin-desplazar body { overflow: hidden; }
.reproductor.completa .escena { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; touch-action: none; }
.reproductor.completa .mandos {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.6rem max(.6rem, env(safe-area-inset-right)) max(.4rem, env(safe-area-inset-bottom)) max(.6rem, env(safe-area-inset-left));
  background: linear-gradient(to top, rgba(0, 0, 0, .88), rgba(0, 0, 0, 0));
}
.reproductor.completa.ocultos .mandos { opacity: 0; pointer-events: none; }
.reproductor.completa.ocultos .escena { cursor: none; }

.ayuda-zoom { margin: .7rem 0 0; color: var(--tinta-suave); font-size: .9rem; max-width: 46rem; }

@media (max-width: 640px) {
  .volumen { display: none; }
  #b-atras, #b-adelante { display: none; }
  .mando { min-width: 2.35rem; }
  .tiempo { font-size: .82rem; padding: 0 .2rem; }
}
@media (max-width: 400px) {
  #b-mudo { display: none; }
}
.controles {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .8rem;
  margin-top: .9rem;
}
.velocidades { display: inline-flex; border: 1px solid var(--tinta); background: var(--hoja); }
.vel {
  font: inherit; color: var(--tinta); background: none; border: 0;
  padding: .45rem .8rem; cursor: pointer; font-variant-numeric: tabular-nums;
}
.vel + .vel { border-left: 1px solid var(--cuadricula); }
.vel[aria-pressed=true] { background: var(--tinta); color: #F3C46B; }

.vacio { background: var(--hoja); border: 1px solid var(--tinta); padding: 2rem; max-width: 38rem; }

.pie {
  padding: 1rem clamp(1rem, 4vw, 3rem);
  color: var(--tinta-suave);
  font-size: .88rem;
  border-top: 1px solid var(--cuadricula);
  background: var(--papel);
}

@media (max-width: 560px) {
  h1 { font-size: 1.5rem; }
  .entrada { margin-top: 2vh; padding: 1.4rem; }
  .quien { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .barra-avance { transition: none; }
  .mandos { transition: none; }
}

/* Reglas de uso */
.reglas { max-width: 40rem; }
.lista-reglas { padding-left: 1.3rem; margin: 0 0 1rem; }
.lista-reglas li { margin: .45rem 0; }
.casilla { display: flex; gap: .6rem; align-items: flex-start; margin: 1rem 0; cursor: pointer; }
.casilla input { margin-top: .25rem; accent-color: var(--traza); }
