/* Winlab · ayuda «¿Cómo funciona la pantalla?» (winlab/ayuda.js): botón «?», recorrido con luz y «Para las familias».
   Autónomo: lo cargan la página de la clase (clase.css + winlab.css) y la portada (comun.css). */
:root { --ay-texto: #1d3557; --ay-acento: #855cd6; --ay-acento-osc: #6a43c0; --ay-amarillo: #ffbf00; --ay-borde: #d3def0; }

/* el botón «?» del panel de la clase (cabecera) y su copia flotante con el panel plegado */
#ayuda-abrir.ayuda-clase, #ayuda-plegado {
  width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; cursor: pointer; padding: 0;
  background: var(--ay-amarillo); color: var(--ay-texto); font: inherit; font-size: 1.3rem; font-weight: 900; line-height: 1;
  box-shadow: 0 3px 0 #c99700;
}
#ayuda-abrir.ayuda-clase:hover, #ayuda-plegado:hover { background: #ffd24d; }
#ayuda-abrir:focus-visible, #ayuda-plegado:focus-visible { outline: 4px solid var(--ay-acento); outline-offset: 2px; }
#ayuda-plegado { display: none; position: fixed; left: 8px; bottom: 112px; z-index: 10; width: 44px; height: 44px; }
body.plegado #ayuda-plegado { display: block; }

/* el botón «? Ayuda» de la portada (cabecera morada) */
#ayuda-abrir.ayuda-portada {
  margin-left: auto; flex: none; color: var(--ay-texto); background: var(--ay-amarillo); border: 0; cursor: pointer;
  border-radius: 14px; padding: 10px 16px; font: inherit; font-weight: 900; white-space: nowrap; box-shadow: 0 4px 0 #c99700;
}
#ayuda-abrir.ayuda-portada:hover { background: #ffd24d; }

/* el diálogo: a pantalla completa y transparente; la luz oscurece todo menos lo que se explica */
dialog#ayuda {
  position: fixed; inset: 0; margin: 0; padding: 0; border: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  background: transparent; overflow: hidden; color: var(--ay-texto);
}
dialog#ayuda::backdrop { background: transparent; }
dialog#ayuda.ay-modo-familias .ay-foco { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; border-width: 0; }
.ay-foco {
  position: fixed; border-radius: 14px; border: 4px solid var(--ay-amarillo); pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(8, 16, 32, .62), 0 0 18px 4px rgba(255, 191, 0, .55);
  transition: left .25s, top .25s, width .25s, height .25s;
}
.ay-foco.sin-objetivo { border-width: 0; }
.ay-burbuja {
  position: fixed; width: min(430px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto;
  background: #fff; border-radius: 20px; padding: 14px 18px 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  border: 3px solid var(--ay-acento); font-size: 19px; line-height: 1.45;
}
.ay-burbuja[hidden] { display: none; }
.ay-familias { width: min(640px, calc(100vw - 24px)); }
.ay-arriba { display: flex; align-items: center; gap: 10px; }
.ay-cuenta { font-weight: 800; color: var(--ay-acento); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.ay-cerrar {
  margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ay-borde); background: #fff;
  color: var(--ay-texto); font: inherit; font-size: 1.2rem; font-weight: 900; cursor: pointer; flex: none;
}
.ay-cerrar:hover { border-color: var(--ay-acento); color: var(--ay-acento); }
.ay-burbuja h2 { margin: 4px 0 6px; font-size: 1.35rem; line-height: 1.2; }
.ay-burbuja h3 { margin: 14px 0 4px; font-size: 1.1rem; color: var(--ay-acento-osc); }
.ay-texto p { margin: 6px 0; }
.ay-texto ul, .ay-texto ol { margin: 6px 0; padding-left: 1.3em; }
.ay-texto li { margin: 4px 0; }
.ay-lista { list-style: none; padding-left: 0 !important; }
.ay-familias .ay-texto { font-size: .95em; }
.ay-botones { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ay-boton {
  flex: 1 1 auto; min-height: 50px; border: 0; border-radius: 14px; padding: 8px 16px; cursor: pointer; font: inherit;
  font-weight: 800; color: #fff; background: var(--ay-acento); box-shadow: 0 4px 0 var(--ay-acento-osc);
}
.ay-boton.suave { background: #fff; color: var(--ay-texto); border: 2px solid var(--ay-borde); box-shadow: 0 3px 0 var(--ay-borde); }
.ay-boton:disabled { opacity: .4; cursor: default; }
.ay-boton[hidden] { display: none; }
.ay-boton:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.ay-enlace {
  display: block; margin: 12px auto 0; background: none; border: 0; padding: 6px 10px; min-height: 44px; cursor: pointer;
  font: inherit; font-size: .95rem; font-weight: 800; color: var(--ay-acento-osc); text-decoration: underline;
}
dialog#ayuda button:focus-visible { outline: 4px solid var(--ay-amarillo); outline-offset: 2px; }
/* dibujitos de los botones de verdad, para reconocerlos */
.ay-mini {
  display: inline-block; white-space: nowrap; padding: 1px 9px; border-radius: 10px; font-weight: 800; font-size: .9em;
  background: var(--ay-acento); color: #fff;
}
.ay-mini.naranja { background: #ff7b3d; }
.ay-mini.gris { background: #dbe3f0; color: var(--ay-texto); }
.ay-mini.blanco { background: #fff; color: var(--ay-texto); border: 2px solid var(--ay-borde); }
.ay-morado { color: var(--ay-acento); }
.ay-verde { color: #2a9d55; }
.ay-estrella { color: #e0a800; font-size: 1.2em; }
.ay-interrogacion {
  display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--ay-amarillo);
}
.ay-ejemplo { margin: 8px 0; }
.ay-orden li { margin: 2px 0; }
@media (max-width: 640px) {
  .ay-burbuja { font-size: 17px; padding: 12px 14px 14px; }
  .ay-burbuja h2 { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) { .ay-foco { transition: none; } }

/* Cabecera del panel de la clase: con ⌂, «?» y ◀ no le queda sitio al título y se partía en 4-5 líneas.
   Logo y botones arriba; «WINLAB» y el título de la clase debajo, a todo lo ancho. */
.cabecera:has(#ayuda-abrir.ayuda-clase) { flex-wrap: wrap; row-gap: 6px; }
.cabecera:has(#ayuda-abrir.ayuda-clase) > div { order: 2; flex: 1 1 100%; min-width: 0; }
.cabecera:has(#ayuda-abrir.ayuda-clase) > .logo { order: 0; margin-right: auto; }
.cabecera:has(#ayuda-abrir.ayuda-clase) > a, .cabecera:has(#ayuda-abrir.ayuda-clase) > button { order: 1; }
