/* OposAL · estilos. Mobile-first, iPhone, una mano. */

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

#app {
  --pad-top: calc(env(safe-area-inset-top) + 16px);
  --pad-right: calc(env(safe-area-inset-right) + var(--gutter));
  --pad-bottom: calc(env(safe-area-inset-bottom) + 20px);
  --pad-left: calc(env(safe-area-inset-left) + var(--gutter));
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: var(--pad-top) var(--pad-right) var(--pad-bottom) var(--pad-left);
}

h1 { font-size: 28px; line-height: 1.2; margin: 8px 0 0; font-weight: 700; }
h1, h2 { font-family: var(--font-display); }
h2 { font-size: 20px; line-height: 1.3; margin: 0; font-weight: 650; }
p { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 15px; }

/* Botones */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tap);
  padding: 14px 20px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--on-accent);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 80ms ease, opacity 120ms ease;
}
.btn:active { transform: scale(0.98); opacity: 0.9; }
.btn[disabled] { opacity: 0.45; cursor: default; transform: none; }
.btn-secundario { background: var(--soft); color: var(--text); }
.btn-texto { background: transparent; color: var(--accent); min-height: 48px; }
.btn-grande { min-height: 64px; font-size: 20px; }

/* Bienvenida */
.bienvenida {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center; /* el texto queda sobre el naranja (contraste), no sobre el rosa del final */
  gap: 14px;
  margin: calc(-1 * var(--pad-top)) calc(-1 * var(--pad-right)) calc(-1 * var(--pad-bottom)) calc(-1 * var(--pad-left));
  padding: 32px var(--pad-right) calc(env(safe-area-inset-bottom) + 28px) var(--pad-left);
  background: var(--sunset);
  color: var(--on-sunset);
}
.bienvenida h1 { font-family: var(--font-display); font-size: 32px; margin: 0; }
.bienvenida form { display: flex; flex-direction: column; gap: 14px; }
.campo-nombre {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 16px;
  border: 0;
  border-radius: var(--radius-btn);
  font: inherit;
  font-size: 18px;
  background: var(--surface);
  color: var(--text);
}
.bienvenida .btn { background: var(--surface); color: var(--text); }
.bienvenida .error { background: var(--surface); color: var(--text); border-radius: 14px; padding: 12px 16px; font-size: 15px; }

/* Superficies */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* Inicio: cabecera de atardecer a sangre y tarjeta "Hoy" flotando encima */
.cabecera-sol {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  margin: calc(-1 * var(--pad-top)) calc(-1 * var(--pad-right)) 0 calc(-1 * var(--pad-left));
  padding: calc(env(safe-area-inset-top) + 34px) var(--pad-right) 78px var(--pad-left);
  background: var(--sunset);
  color: var(--on-sunset);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}
.cabecera-sol h1 { position: relative; margin: 0; font-size: 30px; font-weight: 700; }
.cabecera-sol .enlace-volver {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 4px;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
.cabecera-sol .animo { position: relative; margin-top: 4px; font-size: 16px; }
.cabecera-sol .sol {
  position: absolute;
  right: -34px;
  bottom: -56px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--sun-glow);
  pointer-events: none;
}
.panel-hoy {
  gap: 10px;
  margin-top: -48px;
  position: relative;
  border: 0;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.panel-hoy h2 { font-size: 18px; color: var(--muted); font-weight: 600; }
.cifra-hoy {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  background: linear-gradient(120deg, var(--accent), var(--plum));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.fila-hoy { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 18px; }
.hecho { color: var(--muted); font-size: 16px; }
.titulo-seccion { font-size: 22px; margin-top: 8px; }
.tema h2 { font-size: 19px; }

.aviso {
  background: var(--soft);
  border-radius: 14px;
  padding: 14px 16px;
}

.lista { display: flex; flex-direction: column; gap: 12px; list-style: none; margin: 0; padding: 0; }
.errores li { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }

/* Barra de progreso por mazo */
.barra {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
}
.barra span { display: block; height: 100%; }
.barra .dominadas { background: var(--plum); }
.barra .aprendiendo { background: var(--o2); }
.barra .nuevas { background: var(--amber); }

.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.leyenda .dominadas { background: var(--plum); }
.leyenda .aprendiendo { background: var(--o2); }
.leyenda .nuevas { background: var(--amber); }

/* Estudio: quieto y centrado; el color queda en la franja, la barra y los botones */
.estudio { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.franja-sol {
  height: 8px;
  margin: calc(-1 * var(--pad-top)) calc(-1 * var(--pad-right)) 0 calc(-1 * var(--pad-left));
  background: var(--sunset);
}
.estudio-cabecera { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 15px; margin-top: calc(var(--pad-top) - 8px); }
.estudio-cabecera a { color: var(--muted); text-decoration: none; padding: 10px 0; }
.progreso-sesion { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: -8px; }
.progreso-sesion i { display: block; height: 100%; background: linear-gradient(90deg, var(--o1), var(--plum)); border-radius: 999px; transition: width 240ms ease; }
.tarjeta {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.tarjeta .seccion { font-family: var(--font-ui); font-size: 14px; color: var(--muted); white-space: normal; }
.tarjeta .respuesta { border-top: 1px solid var(--line); padding-top: 18px; }
.cloze-hueco { color: var(--accent); font-weight: 700; border-bottom: 2px solid var(--accent); }
.cloze-respuesta { background: var(--soft); color: var(--text); border-radius: 6px; padding: 0 4px; font-weight: 700; }

.zona-pulgar {
  position: sticky;
  bottom: 0;
  padding-top: 8px;
  padding-bottom: env(safe-area-inset-bottom);
  background: linear-gradient(to bottom, transparent, var(--bg) 18px);
}

/* Fin de sesión: el atardecer completo y el sol que se pone en el mar */
.fin {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  text-align: center;
  margin: calc(-1 * var(--pad-top)) calc(-1 * var(--pad-right)) calc(-1 * var(--pad-bottom)) calc(-1 * var(--pad-left));
  padding: var(--pad-top) var(--pad-right) calc(var(--alto-playa) + 24px) var(--pad-left);
  background: var(--sunset-v);
  color: var(--on-sunset);
  overflow: hidden;
  --alto-playa: 28vh;
}
.fin > :not(.playa) { position: relative; z-index: 2; }
.fin h1 { margin: 0; }
.fin .cifra-fin { font-family: var(--font-display); font-size: 72px; font-weight: 700; line-height: 1; }
.fin .premio { font-family: var(--font-display); font-style: italic; font-size: 19px; max-width: 320px; }
.fin .btn { background: var(--surface); color: var(--text); margin-top: 10px; box-shadow: var(--shadow-card); }
.sol-fin { animation: sol-baja 1.6s ease-out both; }
@keyframes sol-baja {
  from { transform: translate(-50%, -90px); opacity: 0.2; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Playa: sol en el horizonte, mar con tres capas de olas y el reflejo dorado */
.playa {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--alto-playa);
  pointer-events: none;
}
.sol-playa {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  width: 130px;
  height: 65px;
  border-radius: 130px 130px 0 0;
  background: var(--sun-disc);
  box-shadow: var(--sun-shadow);
  transform: translateX(-50%);
}
.mar {
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--mar-3), var(--mar-4));
}
.ola {
  position: absolute;
  left: 0;
  width: 200%;
  height: 40px;
  animation: ola 14s linear infinite;
}
.ola-1 { top: -34px; animation-duration: 22s; }
.ola-2 { top: -24px; animation-duration: 16s; animation-direction: reverse; }
.ola-3 { top: -14px; animation-duration: 11s; }
.ola-1 path { fill: var(--mar-1); }
.ola-2 path { fill: var(--mar-2); }
.ola-3 path { fill: var(--mar-3); }
@keyframes ola {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.reflejo {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 120px;
  height: 46%;
  transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, var(--reflejo) 0 3px, transparent 3px 11px);
  -webkit-mask-image: radial-gradient(ellipse at top, var(--nieve) 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at top, var(--nieve) 0%, transparent 70%);
  opacity: 0.55;
  animation: destello 3.2s ease-in-out infinite alternate;
}
@keyframes destello {
  from { opacity: 0.3; transform: translateX(-50%) scaleX(0.85); }
  to { opacity: 0.65; transform: translateX(-50%) scaleX(1.05); }
}

/* Constelación de Tauro */
.constelacion { position: absolute; pointer-events: none; overflow: visible; }
.constelacion .trazos line { stroke: var(--estrella); stroke-width: 0.5; stroke-linecap: round; opacity: 0.55; }
.constelacion circle { fill: var(--estrella); }
.constelacion .aldebaran { fill: var(--oro); }
.constelacion .brilla { animation: brilla 2.8s ease-in-out calc(var(--i) * 0.37s) infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes brilla {
  from { opacity: 0.45; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.15); }
}
.constelacion-cabecera { top: calc(env(safe-area-inset-top) + 22px); right: 14px; width: 140px; opacity: 0.9; }

/* Carga: capa sobre la app con la escena de la playa (estilos y animación al final del archivo) */
.carga {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: var(--cielo-dia-1);
  color: var(--on-cielo);
  text-align: center;
  cursor: pointer;
  opacity: 1;
  transition: opacity 250ms ease;
  touch-action: manipulation;
}
.carga.carga-sale { opacity: 0; pointer-events: none; }

/* Navidad: copos que caen despacio */
.nieve { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.nieve i {
  position: absolute;
  top: -12px;
  width: var(--z);
  height: var(--z);
  border-radius: 50%;
  background: var(--nieve);
  opacity: 0.85;
  animation: cae var(--t) linear var(--r) infinite;
}
@keyframes cae {
  from { transform: translate(0, -10px); }
  to { transform: translate(var(--x), 105vh); }
}

/* Navidad: guirnalda de luces en la cabecera */
.guirnalda { position: absolute; top: env(safe-area-inset-top); left: 0; right: 0; height: 24px; pointer-events: none; }
.guirnalda svg { position: absolute; inset: 0; width: 100%; height: 20px; overflow: visible; }
.guirnalda path { fill: none; stroke: var(--cable); stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: 0.6; }
.luz {
  position: absolute;
  width: 9px;
  height: 13px;
  margin-left: -4.5px;
  border-radius: 50% 50% 45% 45%;
  animation: titila 1.6s ease-in-out infinite alternate;
}
.luz-1 { background: var(--luz-1); box-shadow: 0 0 10px var(--luz-1); }
.luz-2 { background: var(--luz-2); box-shadow: 0 0 10px var(--luz-2); }
.luz-3 { background: var(--luz-3); box-shadow: 0 0 10px var(--luz-3); }
.luz-4 { background: var(--luz-4); box-shadow: 0 0 10px var(--luz-4); }
@keyframes titila { from { opacity: 0.55; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .sol-fin, .ola, .reflejo, .constelacion .brilla, .luz { animation: none; }
  .nieve { display: none; }
  .carga { transition: none; }
  .progreso-sesion i, .btn { transition: none; }
}

/* Calendario */
.mes { padding: 14px 12px 12px; gap: 8px; }
.mes-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mes-cab h2 { font-size: 18px; color: var(--text); text-align: center; }
.mes-flecha {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: var(--radius-btn);
  background: var(--soft);
  color: var(--text);
  font: inherit;
  font-size: 24px;
  cursor: pointer;
  touch-action: manipulation;
}
.mes-rejilla { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.cab-dia { font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.celda {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
  touch-action: manipulation;
}
.celda .num { font-size: 15px; }
.celda .cara { font-style: normal; font-size: 13px; min-height: 15px; }
.celda.sel { box-shadow: inset 0 0 0 2px var(--o2); }
.celda.hoy { background: linear-gradient(135deg, var(--o1), var(--o2)); color: var(--on-sunset); font-weight: 700; }
.celda .punto { position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--o2); }
.celda.hoy .punto { background: var(--on-sunset); }
.dia { gap: 10px; }
.animo-fila { display: flex; justify-content: space-between; gap: 6px; }
.cara-btn {
  flex: 1 1 0;
  min-width: 44px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.cara-btn { max-width: 52px; }
.cara-btn.sel { background: var(--soft); box-shadow: 0 0 0 2px var(--o2); }
.escala { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.apuntes { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.apunte { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); }
.apunte-toggle {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.apunte-texto { overflow-wrap: anywhere; }
.apunte-toggle.hecho .apunte-texto { text-decoration: line-through; color: var(--muted); }
.caja {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid var(--muted);
  border-radius: 7px;
  font-style: normal;
  font-size: 15px;
  font-weight: 700;
  color: var(--on-accent);
}
.apunte-toggle.hecho .caja { background: var(--accent); border-color: var(--accent); }
.apunte-borrar {
  flex: none;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 24px;
  cursor: pointer;
  touch-action: manipulation;
}
.apuntar-form { display: flex; flex-direction: column; gap: 10px; }
.campo-apunte {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  font: inherit;
  font-size: 17px;
  background: var(--bg);
  color: var(--text);
}
.error-apunte { font-size: 15px; color: var(--text); }
.error-apunte:empty { display: none; }
.error-apunte:not(:empty) { background: var(--soft); border-radius: 14px; padding: 12px 16px; }

.oculto { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.empuja { margin-top: auto; }
/* Menú principal */
.menu-lista { display: flex; flex-direction: column; gap: 12px; margin-top: -36px; position: relative; }
.op {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--tap);
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  color: var(--text);
  text-decoration: none;
  touch-action: manipulation;
}
.op-ico {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 24px;
}
.op-ico.i1 { background: linear-gradient(135deg, var(--o1), var(--o2)); }
.op-ico.i2 { background: linear-gradient(135deg, var(--o2), var(--plum)); }
.op-ico.i3 { background: var(--soft); }
.op-ico.i4 { background: linear-gradient(135deg, var(--o2), var(--plum)); }
.op-texto { display: flex; flex-direction: column; min-width: 0; }
.op-texto b { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.op-texto span { font-size: 15px; color: var(--muted); }


/* Flashcards: tarjeta Aleatorio y lista de temas */
.flash-lista { display: flex; flex-direction: column; gap: 12px; margin-top: -36px; position: relative; }
.alea {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-height: var(--tap);
  padding: 18px 16px;
  background: var(--sunset);
  color: var(--on-sunset);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  touch-action: manipulation;
}
.alea b { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.alea span { font-size: 15px; }
.tema-cuerpo { display: flex; flex-direction: column; gap: 10px; min-height: var(--tap); color: inherit; text-decoration: none; }
a.tema-cuerpo { touch-action: manipulation; }
.tema-t { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tema-t h2 { min-width: 0; }
.tema-n { flex: 0 0 auto; font-weight: 600; color: var(--accent); }

/* Supuestos: lista y detalle */
.sup-lista { display: flex; flex-direction: column; gap: 12px; margin-top: -36px; position: relative; }
.sup {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: var(--tap);
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  color: var(--text);
  text-decoration: none;
  touch-action: manipulation;
}
.sup-t { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sup-t b { min-width: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.sup-f { flex: 0 0 auto; font-size: 14px; color: var(--muted); }
.sup-p { font-size: 15px; font-weight: 700; color: var(--accent); }
.sup-p.quieta { font-weight: 500; color: var(--muted); }
.puntos { display: flex; gap: 4px; }
.puntos i { flex: 1; height: 6px; border-radius: 999px; background: var(--line); }
.puntos i.ok { background: linear-gradient(90deg, var(--o1), var(--plum)); }
.sup-enlace {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 12px 16px;
  background: var(--soft);
  border-radius: var(--radius-card);
  color: var(--text);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
}
.preg {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  color: var(--text);
  text-decoration: none;
  touch-action: manipulation;
}
.preg-tag { flex: 0 0 auto; padding: 2px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.preg-tag.caso { background: var(--accent); color: var(--on-accent); }
.preg-tag.teoria { background: var(--soft); color: var(--accent); }
.preg-texto { flex: 1; min-width: 0; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.preg-ok { flex: 0 0 auto; color: var(--accent); font-size: 20px; font-weight: 700; }
.sup-vacio { margin-top: -36px; position: relative; }

/* Práctica de supuestos */
.practica .tarjeta-sup { flex: 0 1 auto; font-size: 20px; }
.texto-sup { display: flex; flex-direction: column; gap: 14px; }
.texto-sup p { white-space: pre-line; overflow-wrap: anywhere; }
.practica .esquema { font-family: var(--font-ui); font-size: 15px; color: var(--muted); flex: 1 1 150px; }
.crono-fila { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; flex-shrink: 0; }
.crono { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 20px; }
.crono-btn { width: auto; flex: 0 1 auto; min-height: var(--tap); padding: 8px 16px; margin-left: auto; font-size: 16px; }
.que-cubriste { font-size: 22px; flex-shrink: 0; }
.puntos-clave { display: flex; flex-direction: column; gap: 10px; }
.punto-clave {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.punto-caja {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--muted);
  border-radius: 8px;
  font-weight: 700;
  line-height: 1;
}
.punto-texto { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.punto-clave[aria-checked="true"] { border-color: var(--accent); background: var(--soft); }
.punto-clave[aria-checked="true"] .punto-caja { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.punto-clave[aria-checked="true"] .punto-caja::after { content: '✓'; }
.detalle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
.detalle summary { display: flex; align-items: center; min-height: 56px; padding: 12px 16px; font-weight: 600; cursor: pointer; touch-action: manipulation; list-style: none; }
.detalle summary::-webkit-details-marker { display: none; }
.detalle summary::after { content: '›'; margin-left: auto; padding-left: 12px; font-size: 26px; line-height: 1; color: var(--accent); transition: transform 120ms ease; }
.detalle[open] summary::after { transform: rotate(90deg); }
.detalle .texto-sup { padding: 0 16px 16px; font-size: 16px; }
.resumen-sup { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.3; }

/* Cabeceras de playa: olas en el borde de abajo */
/* El mar empieza por encima del solape de las tarjetas (36px) para que las olas se vean. */
.olas-cabecera {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 66px;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(transparent 30px, var(--mar-2) 30px, var(--mar-3));
}
.olas-cabecera .ola { height: 30px; }
.olas-cabecera .ola-1 { top: 0; opacity: 0.7; }
.olas-cabecera .ola-2 { top: 8px; }
.cabecera-sol > h1, .cabecera-sol > p, .cabecera-sol > a { z-index: 1; }

/* Horóscopo de Tauro: una pared de noche con luces de Navidad que deletrean una palabra */
.horoscopo {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px 18px;
  border-radius: var(--radius-card);
  background: var(--brillo-rojo), var(--cielo-noche);
  color: var(--on-noche);
  box-shadow: var(--shadow-card);
  /* Un solo ciclo para todo: 0–40 % las luces deletrean, 56–66 % parpadean todas (apagón): se abre
     la grieta, relampaguea, brilla el rojo y crecen las enredaderas; 67–98 % a oscuras (pasa la bici). */
  --ciclo-horo: 12s;
}
.horoscopo > :not(.esporas, .enredadera, .bici, .horo-fondo) { position: relative; }
.horo-cab { display: flex; align-items: center; gap: 12px; }
.horo-signo {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--oro);
  box-shadow: 0 0 18px var(--noche-2);
}
.glifo-tauro { width: 26px; height: 26px; fill: none; stroke: var(--oro); stroke-width: 2; stroke-linecap: round; }
.horo-titulo { font-family: var(--font-display); font-size: 20px; font-weight: 700; animation: neon var(--ciclo-horo) linear infinite; }
/* Durante el apagón el título se enciende en rojo neón, con un par de chispazos */
@keyframes neon {
  0%, 55% { text-shadow: none; }
  57% { text-shadow: 0 0 2px var(--grieta), 0 0 10px var(--grieta); }
  59% { text-shadow: none; }
  61%, 70% { text-shadow: 0 0 2px var(--grieta), 0 0 12px var(--grieta), 0 0 24px var(--grieta); }
  80%, 100% { text-shadow: none; }
}
.horo-fechas { font-size: 14px; color: var(--on-noche-suave); }
.horo-temporada { align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: var(--oro); color: var(--noche); font-size: 14px; font-weight: 700; }
.horo-frase { font-family: var(--font-display); font-style: italic; font-size: 19px; line-height: 1.4; }

/* Luces que deletrean: cada casilla tiene su bombilla y su letra pintada */
.luces-pared { position: relative; height: 62px; margin: 0 -6px; }
.luces-pared .cable { position: absolute; left: 0; right: 0; top: 2px; width: 100%; height: 14px; overflow: visible; }
.luces-pared .cable path { fill: none; stroke: var(--cable-pared); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
/* El apagón es de toda la fila a la vez: parpadeo nervioso, oscuridad y vuelta a empezar */
.casillas {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  animation: apagon var(--ciclo-horo) linear infinite;
}
@keyframes apagon {
  0%, 55% { opacity: 1; }
  56% { opacity: 0.2; }
  57% { opacity: 1; }
  58.5% { opacity: 0.1; }
  59% { opacity: 0.9; }
  61% { opacity: 0.3; }
  61.5% { opacity: 1; }
  63% { opacity: 0.15; }
  64% { opacity: 1; }
  65.5% { opacity: 0.05; }
  66% { opacity: 0.7; }
  67%, 98% { opacity: 0.12; }
  100% { opacity: 1; }
}
/* Cada letra se enciende a su turno (0,4 s entre una y otra) y se apaga ya en la oscuridad */
.casilla { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.c-1 { --luz: var(--luz-1); }
.c-2 { --luz: var(--luz-2); }
.c-3 { --luz: var(--luz-3); }
.c-4 { --luz: var(--luz-4); }
.bombilla {
  position: relative;
  width: 10px;
  height: 15px;
  margin-top: 7px;
  border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%;
  background: var(--luz);
  opacity: 0.25;
  animation: enciende var(--ciclo-horo) ease-in-out calc(var(--i) * 0.4s) infinite;
}
/* casquillo y brillo del cristal */
.bombilla::before {
  content: '';
  position: absolute;
  left: 1.5px;
  right: 1.5px;
  top: -5px;
  height: 6px;
  border-radius: 1.5px;
  background: var(--casquillo);
}
.bombilla::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 3px;
  width: 2.5px;
  height: 5px;
  border-radius: 2px;
  background: var(--cristal);
}
.letra-pared {
  font-family: var(--font-display);
  font-size: clamp(15px, 5.2vw, 22px);
  font-weight: 700;
  line-height: 1;
  color: var(--letra-apagada);
  animation: letra var(--ciclo-horo) ease-in-out calc(var(--i) * 0.4s) infinite;
}
@keyframes enciende {
  0%, 2% { opacity: 0.25; box-shadow: none; }
  3% { opacity: 1; box-shadow: 0 0 10px 2px var(--luz), 0 0 22px var(--luz); }
  3.5% { opacity: 0.4; box-shadow: none; }
  4%, 68% { opacity: 1; box-shadow: 0 0 10px 2px var(--luz), 0 0 22px var(--luz); }
  70%, 100% { opacity: 0.25; box-shadow: none; }
}
@keyframes letra {
  0%, 2% { color: var(--letra-apagada); text-shadow: none; }
  4%, 68% { color: var(--on-noche); text-shadow: 0 0 12px var(--luz); }
  70%, 100% { color: var(--letra-apagada); text-shadow: none; }
}

/* Fondo: papel pintado, resplandor rojo, grieta y relámpago (por debajo del texto) */
.horo-fondo { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.horo-papel, .horo-portal, .horo-rayo { position: absolute; inset: 0; }
.horo-papel { background: var(--papel-pintado); }
.horo-portal { background: var(--portal); opacity: 0; animation: portal var(--ciclo-horo) ease-in-out infinite; }
@keyframes portal {
  0%, 55% { opacity: 0; }
  58% { opacity: 0.7; }
  60% { opacity: 0.3; }
  63%, 70% { opacity: 1; }
  86%, 100% { opacity: 0; }
}
.horo-rayo { background: var(--rayo); opacity: 0; animation: rayo var(--ciclo-horo) linear infinite; }
@keyframes rayo {
  0%, 57% { opacity: 0; }
  57.4% { opacity: 0.55; }
  58% { opacity: 0; }
  58.6% { opacity: 0.35; }
  59.4%, 100% { opacity: 0; }
}
/* Solo en la franja de las luces (alto fijo): así no cruza el título aunque se parta en dos líneas */
.horo-grieta { position: absolute; left: 0; top: 0; width: 100%; height: 84px; overflow: visible; }
.horo-grieta path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: grieta var(--ciclo-horo) ease-out infinite;
}
.grieta-trazo { stroke: var(--grieta); stroke-width: 2; }
.grieta-halo { stroke: var(--grieta-halo); stroke-width: 7; opacity: 0.35; }
.grieta-rama { stroke: var(--grieta); stroke-width: 1.3; animation-delay: 0.25s; }
@keyframes grieta {
  0%, 56% { stroke-dashoffset: 1; opacity: 0; }
  57% { opacity: 1; }
  63%, 72% { stroke-dashoffset: 0; opacity: 1; }
  66% { opacity: 0.6; }
  84%, 100% { stroke-dashoffset: 0; opacity: 0; }
}

/* Partículas que suben despacio */
.esporas { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.esporas i {
  position: absolute;
  bottom: -8px;
  width: var(--z);
  height: var(--z);
  border-radius: 50%;
  background: var(--espora);
  opacity: 0;
  animation: flota var(--t) linear var(--r) infinite;
}
@keyframes flota {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: 0.7; }
  85% { opacity: 0.5; }
  100% { transform: translate(var(--x), -260px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bombilla, .letra-pared, .casillas, .horo-titulo { animation: none; }
  .horo-fondo > :not(.horo-papel) { display: none; }
  .bombilla { opacity: 1; box-shadow: 0 0 10px 2px var(--luz); }
  .letra-pared { color: var(--on-noche); }
  .esporas { display: none; }
}

/* Iconos del menú: dibujos de línea */
/* Tarjetas del menú en naranja; el icono, en un cuadrado crema con trazo ciruela */
.menu-lista .op { background: var(--op-fondo); color: var(--on-sunset); }
.menu-lista .op-texto span { color: var(--on-sunset); }
.menu-lista .op-ico, .menu-lista .op-ico.i1, .menu-lista .op-ico.i2, .menu-lista .op-ico.i3, .menu-lista .op-ico.i4, .menu-lista .op-ico.i5 {
  background: var(--ico-fondo);
  color: var(--ico-trazo);
  box-shadow: 0 2px 8px var(--ico-sombra);
}
.icono { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Cabecera del menú: A Coruña al atardecer */
.cabecera-playa { padding-bottom: 128px; }
.torre { position: absolute; right: 12px; bottom: 40px; width: 54px; height: 86px; pointer-events: none; }
.torre svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.torre .silueta { fill: var(--silueta); }
.torre .rocas { fill: var(--rocas); }
.torre .rampa { fill: none; stroke: var(--rampa); stroke-width: 1.2; }
.torre .linterna { fill: var(--reflejo); }
.haz {
  position: absolute;
  left: 50%;
  top: 13%;
  width: 170px;
  height: 28px;
  margin-top: -14px;
  transform-origin: left center;
  background: var(--haz);
  clip-path: polygon(0 44%, 100% 0, 100% 100%, 0 56%);
  animation: haz 8s linear infinite;
}
@keyframes haz {
  0%, 100% { transform: scaleX(1); opacity: 0.9; }
  25%, 75% { transform: scaleX(0.05); opacity: 0.15; }
  50% { transform: scaleX(-1); opacity: 0.9; }
}
.barco { position: absolute; bottom: 40px; pointer-events: none; animation: balanceo 3.4s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.barco svg { display: block; width: 100%; height: auto; overflow: visible; }
.barco-sushi { right: 78px; width: 92px; }
.barco-carbonara { right: 180px; width: 72px; animation-delay: -1.7s; }
@keyframes balanceo {
  from { transform: translateY(0) rotate(-3deg); }
  to { transform: translateY(-4px) rotate(3deg); }
}
.barco .casco { fill: var(--madera); }
.barco .tablas { fill: none; stroke: var(--madera-2); stroke-width: 1.2; }
.barco .arroz { fill: var(--arroz); }
.barco .salmon { fill: var(--salmon); }
.barco .vetas { fill: none; stroke: var(--salmon-veta); stroke-width: 1.2; stroke-linecap: round; }
.barco .alga { fill: var(--alga); }
.barco .pasta { fill: none; stroke: var(--pasta); stroke-width: 2.6; stroke-linecap: round; }
.barco .panceta { fill: var(--panceta); }
.barco .pimienta { fill: var(--pimienta); }
.barco .cuenco { fill: var(--cuenco); }
.barco .tenedor { fill: none; stroke: var(--tenedor); stroke-width: 1.8; stroke-linecap: round; }
.vapor path { fill: none; stroke: var(--vapor); stroke-width: 1.4; stroke-linecap: round; opacity: 0; transform-box: fill-box; animation: vapor 3s ease-in-out infinite; }
@keyframes vapor {
  0% { opacity: 0; transform: translateY(4px); }
  40% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-6px); }
}

/* Horóscopo: enredaderas en las esquinas y una bici con el faro encendido */
.horoscopo { padding-bottom: 58px; }
.enredadera {
  position: absolute;
  bottom: -4px;
  width: 128px;
  fill: none;
  stroke: var(--enredadera);
  stroke-width: 3;
  stroke-linecap: round;
  pointer-events: none;
  transform-origin: bottom left;
  animation: respira 7s ease-in-out infinite alternate;
}
.enr-izq { left: -8px; }
.enr-der { right: -8px; transform: scaleX(-1); transform-origin: bottom center; animation-name: respira-der; }
@keyframes respira { from { transform: scale(0.94); } to { transform: scale(1.04) rotate(-1.5deg); } }
@keyframes respira-der { from { transform: scaleX(-1) scale(0.94); } to { transform: scaleX(-1) scale(1.04) rotate(-1.5deg); } }
/* Zarcillos: crecen durante el apagón y se recogen a oscuras */
.enredadera .zarcillo {
  stroke-width: 2.2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: zarcillo var(--ciclo-horo) ease-in-out calc(var(--i) * 0.15s) infinite;
}
@keyframes zarcillo {
  0%, 55% { stroke-dashoffset: 1; }
  66%, 84% { stroke-dashoffset: 0; }
  97%, 100% { stroke-dashoffset: 1; }
}
/* La bici cruza a oscuras, en uno de cada dos ciclos (8,2–11,8 s de 24 s) */
.bici { position: absolute; bottom: 8px; left: -80px; width: 48px; pointer-events: none; animation: pedalea calc(2 * var(--ciclo-horo)) linear infinite; }
.bici svg { display: block; width: 100%; height: auto; overflow: visible; fill: none; stroke: var(--bici-trazo); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bici .ciclista, .bici .buje { fill: var(--bici-trazo); stroke: none; }
.bici .radios path { stroke-width: 0.8; }
.bici .radios { transform-box: fill-box; transform-origin: center; animation: gira 0.5s linear infinite; }
.bici .biela { stroke-width: 1.8; animation: gira 0.8s linear infinite; }
.bici .faro { animation: faro 1.6s ease-in-out infinite; }
@keyframes faro { 0%, 100% { opacity: 1; } 40% { opacity: 0.75; } 44% { opacity: 0.35; } 48% { opacity: 1; } }
.faro {
  position: absolute;
  left: 68%;
  top: 54%;
  width: 90px;
  height: 30px;
  margin-top: -15px;
  background: var(--faro);
  clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 58%);
}
@keyframes pedalea {
  0%, 34% { left: -80px; }
  49%, 100% { left: calc(100% + 100px); }
}

@media (prefers-reduced-motion: reduce) {
  .haz, .barco, .vapor path, .enredadera { animation: none; }
  .enredadera .zarcillo { animation: none; stroke-dashoffset: 0; }
  .bici { display: none; }
}

/* ── Pantalla de inicio: escena de la playa (js/views/escena-playa.js) ─────
   Una sola línea de tiempo de --dur-escena (14 s; igual que DURACION en carga.js). En % de 14 s:
   0–11 sale el sol · 11–31 la chica va a la bolsa y saca la crema · 34–44 se la echa en los brazos
   44–54 en el cuerpo · 54–65 en la cara · 66–70 brillitos · 72–84 se tumba al lado del chico.
   El chico la mira, bosteza (46–52 %), lucha contra el sueño y a los 64 % se duerme (salen las zetas).
   El perrito, las olas, la gaviota y el sol van en bucle aparte. */
.carga { --dur-escena: 14s; }
.escena-playa { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.carga-textos {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 28px) 28px 0;
  pointer-events: none;
}
.carga h1 { margin: 0; font-size: 34px; color: var(--on-cielo); }
.carga-mensaje { margin: 0; max-width: 300px; font-size: 17px; line-height: 1.4; }
.carga-pista { margin: 2px 0 0; font-size: 14px; opacity: 0.85; }
.letra-saludo { display: inline-block; animation: letra-sube 0.55s cubic-bezier(0.2, 0.8, 0.2, 1.25) calc(0.3s + var(--i) * 0.06s) both; }
@keyframes letra-sube {
  from { opacity: 0; transform: translateY(16px) rotate(-8deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}
.carga-mensaje { animation: funde 0.8s ease-out 1.2s both; }
.carga-pista { animation: funde 0.8s ease-out 2s both; }
@keyframes funde { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* «C ♥ R» escritas en la arena, en la esquina de abajo */
.carga-iniciales {
  position: absolute;
  z-index: 2;
  right: calc(env(safe-area-inset-right) + 14px);
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  width: 80px;
  height: 34px;
  overflow: visible;
}
.letra-arena {
  fill: none;
  stroke: var(--arena-trazo);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: letra-arena 1s ease-in-out calc(0.8s + var(--i) * 0.9s) forwards;
}
@keyframes letra-arena { to { stroke-dashoffset: 0; } }

/* Fondo */
.cielo-a { stop-color: var(--cielo-dia-1); }
.cielo-b { stop-color: var(--cielo-dia-2); }
.mar-a { stop-color: var(--mar-dia-1); }
.mar-b { stop-color: var(--mar-dia-2); }
.arena-a { stop-color: var(--arena-1); }
.arena-b { stop-color: var(--arena-2); }
.sol-halo { fill: var(--sol-halo); opacity: 0.45; }
.sol-disco { fill: var(--sol-disco); }
.sol-rayos path { stroke: var(--sol-rayo); stroke-width: 4; stroke-linecap: round; }
.sol-asoma { animation: sol-asoma 1.4s ease-out both; }
@keyframes sol-asoma { from { opacity: 0; transform: translateY(40px) scale(0.8); } to { opacity: 1; transform: translateY(0) scale(1); } }
.sol-rayos { animation: gira 40s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.gaviota { fill: none; stroke: var(--gaviota); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; animation: aletea 0.45s ease-in-out infinite alternate; }
@keyframes aletea { to { transform: scaleY(0.4); } }
.gaviota-vuela { animation: vuela 18s linear infinite; }
.gaviota-vuela.gaviota-2 { animation-duration: 23s; animation-delay: -9s; }
@keyframes vuela { to { transform: translateX(470px); } }
.ola-linea { fill: none; stroke: var(--mar-linea); stroke-width: 1.4; stroke-linecap: round; opacity: 0.7; animation: ola-linea 4s linear infinite; }
.ola-linea.ola-b { animation-duration: 5.5s; animation-direction: reverse; }
.ola-linea.ola-c { animation-duration: 3.2s; }
@keyframes ola-linea { to { transform: translateX(-40px); } }
.destello-mar { fill: var(--espuma); animation: destello-mar 1.4s ease-in-out infinite alternate; }
@keyframes destello-mar { from { opacity: 0.15; } to { opacity: 0.95; } }
.arena-mojada { fill: var(--arena-mojada); opacity: 0.55; }
.espuma { fill: var(--espuma); opacity: 0.9; }
.espuma { animation: espuma 3.2s ease-in-out infinite alternate; }
@keyframes espuma { to { transform: translate(-8px, 6px); } }
.estrella-mar { fill: var(--estrella-mar); }
.concha { fill: var(--concha); stroke: var(--arena-trazo); stroke-width: 0.8; stroke-linejoin: round; }

/* Sombrilla, toallas, bolsa y bote */
.sombra-sombrilla { fill: var(--arena-sombra); opacity: 0.3; }
.palo { fill: none; stroke: var(--palo); stroke-width: 3; stroke-linecap: round; }
.palo-punta { fill: var(--palo); }
.tela-1 { fill: var(--sombrilla-2); }
.tela-2 path { fill: var(--sombrilla-1); }
.sombrilla-mece { animation: mece 3s ease-in-out infinite alternate; }
@keyframes mece { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
.toalla-chico .toalla { fill: var(--toalla-chico); }
.toalla-chica .toalla { fill: var(--toalla-chica); }
.toalla-raya { fill: none; stroke: var(--toalla-raya); stroke-width: 2.2; opacity: 0.8; }
.bolsa-cuerpo { fill: var(--bolsa); }
.bolsa-raya { fill: var(--bolsa-raya); }
.bolsa-asa { fill: none; stroke: var(--bolsa-asa); stroke-width: 2.2; stroke-linecap: round; }
.bolsa-toalla { fill: var(--toalla-chica); }
.bote-cuerpo { fill: var(--bote); stroke: var(--arena-sombra); stroke-width: 0.6; }
.bote-tapa { fill: var(--bote-tapa); }

/* Personajes */
.piel { fill: var(--piel); }
.pelo-chica { fill: var(--pelo-chica); }
.pelo-chico { fill: var(--pelo-chico); }
.banador-chica { fill: var(--banador-chica); }
.banador-chico { fill: var(--banador-chico); }
.tirante { fill: none; stroke: var(--banador-chica); stroke-width: 1.6; stroke-linecap: round; }
.flor { fill: var(--sombrilla-1); }
.mejilla { fill: var(--mejillas); opacity: 0.6; }
.ojo { fill: var(--ojo); }
.trazo-ojo { fill: none; stroke: var(--ojo); stroke-width: 1.1; stroke-linecap: round; }
.sonrisa { fill: none; stroke: var(--boca); stroke-width: 1.1; stroke-linecap: round; }
.chico-bostezo { fill: var(--boca); }
.chico-parpados { fill: var(--piel-sombra); }
.crema circle, .crema-chorro { fill: var(--crema); }
.brillo { fill: var(--espuma); }
.zeta { fill: none; stroke: var(--on-cielo); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* La chica: se mueve, se inclina hacia la bolsa y al final se tumba (gira -90° sobre los pies) */
.chica-mueve { animation: chica-mueve var(--dur-escena) ease-in-out both; }
@keyframes chica-mueve {
  0%, 9% { transform: translate(0, 0); }
  14%, 26% { transform: translate(14px, 0); }
  31%, 66% { transform: translate(0, 0); }
  68% { transform: translate(0, -6px); }
  70%, 73% { transform: translate(0, 0); }
  84%, 100% { transform: translate(-28px, -10px); }
}
.chica-gira { animation: chica-gira var(--dur-escena) ease-in-out both; }
@keyframes chica-gira {
  0%, 11% { transform: rotate(0deg); }
  16%, 25% { transform: rotate(25deg); }
  30%, 73% { transform: rotate(0deg); }
  84%, 100% { transform: rotate(-90deg); }
}
/* Brazo derecho: busca en la bolsa, saca el bote, y lo pasa por el brazo, el cuerpo y la cara */
.chica-brazo-der { animation: chica-brazo-der var(--dur-escena) ease-in-out both; }
@keyframes chica-brazo-der {
  0%, 11% { transform: rotate(0deg); }
  16% { transform: rotate(-57deg); }
  19% { transform: rotate(-48deg); }
  21% { transform: rotate(-62deg); }
  23% { transform: rotate(-50deg); }
  25% { transform: rotate(-57deg); }
  29% { transform: rotate(-150deg); }
  32% { transform: rotate(40deg); }
  34% { transform: rotate(45deg); }
  36% { transform: rotate(62deg); }
  38% { transform: rotate(42deg); }
  40% { transform: rotate(62deg); }
  42% { transform: rotate(42deg); }
  44% { transform: rotate(50deg); }
  46% { transform: rotate(8deg); }
  48% { transform: rotate(22deg); }
  50% { transform: rotate(6deg); }
  52% { transform: rotate(22deg); }
  54% { transform: rotate(10deg); }
  57% { transform: rotate(150deg); }
  59% { transform: rotate(164deg); }
  61% { transform: rotate(150deg); }
  63% { transform: rotate(164deg); }
  65% { transform: rotate(155deg); }
  69%, 100% { transform: rotate(0deg); }
}
.chica-brazo-izq { animation: chica-brazo-izq var(--dur-escena) ease-in-out both; }
@keyframes chica-brazo-izq {
  0%, 32% { transform: rotate(0deg); }
  34%, 44% { transform: rotate(28deg); }
  46% { transform: rotate(-8deg); }
  48% { transform: rotate(-22deg); }
  50% { transform: rotate(-6deg); }
  52% { transform: rotate(-22deg); }
  54% { transform: rotate(-10deg); }
  57% { transform: rotate(-150deg); }
  59% { transform: rotate(-164deg); }
  61% { transform: rotate(-150deg); }
  63% { transform: rotate(-164deg); }
  65% { transform: rotate(-155deg); }
  69%, 100% { transform: rotate(0deg); }
}
.bote { animation: bote-mano var(--dur-escena) linear both; }
@keyframes bote-mano { 0%, 22% { opacity: 0; } 23%, 70% { opacity: 1; } 71%, 100% { opacity: 0; } }
.bote-arena { animation: bote-arena var(--dur-escena) linear both; }
@keyframes bote-arena { 0%, 70% { opacity: 0; } 71%, 100% { opacity: 1; } }
.crema-chorro { animation: chorro var(--dur-escena) linear both; }
@keyframes chorro { 0%, 31% { opacity: 0; } 32%, 33% { opacity: 1; } 34%, 100% { opacity: 0; } }
.crema-brazo { animation: crema-brazo var(--dur-escena) linear both; }
@keyframes crema-brazo { 0%, 34% { opacity: 0; } 35%, 40% { opacity: 1; } 44%, 100% { opacity: 0; } }
.crema-cuerpo { animation: crema-cuerpo var(--dur-escena) linear both; }
@keyframes crema-cuerpo { 0%, 45% { opacity: 0; } 46%, 50% { opacity: 1; } 54%, 100% { opacity: 0; } }
.crema-cara { animation: crema-cara var(--dur-escena) linear both; }
@keyframes crema-cara { 0%, 56% { opacity: 0; } 57%, 60% { opacity: 1; } 64%, 100% { opacity: 0; } }
.brillos { animation: brillos var(--dur-escena) linear both; }
@keyframes brillos { 0%, 64% { opacity: 0; } 66% { opacity: 1; } 68% { opacity: 0.4; } 70% { opacity: 1; } 74%, 100% { opacity: 0; } }
.chica-ojos { animation: chica-ojos var(--dur-escena) linear both; }
@keyframes chica-ojos { 0%, 39% { opacity: 1; } 40% { opacity: 0; } 41%, 86% { opacity: 1; } 87%, 100% { opacity: 0; } }
.chica-ojos-cerrados { animation: chica-ojos-cerrados var(--dur-escena) linear both; }
@keyframes chica-ojos-cerrados { 0%, 39% { opacity: 0; } 40% { opacity: 1; } 41%, 86% { opacity: 0; } 87%, 100% { opacity: 1; } }

/* El chico: la mira, parpadea, bosteza, los párpados le pesan y se queda dormido */
.chico-pupilas { animation: chico-pupilas var(--dur-escena) ease-in-out both; }
@keyframes chico-pupilas { 0% { transform: translate(0, 0); } 5%, 60% { transform: translate(0, 1.2px); } 64%, 100% { transform: translate(0, 0); } }
.chico-parpados { animation: chico-parpados var(--dur-escena) ease-in-out both; }
@keyframes chico-parpados {
  0%, 18% { transform: scaleY(0); }
  19% { transform: scaleY(1); }
  20%, 37% { transform: scaleY(0); }
  38% { transform: scaleY(1); }
  39%, 46% { transform: scaleY(0); }
  50% { transform: scaleY(0.45); }
  53% { transform: scaleY(0.2); }
  57% { transform: scaleY(0.6); }
  60% { transform: scaleY(0.35); }
  64%, 100% { transform: scaleY(1); }
}
.chico-dormido { animation: chico-dormido var(--dur-escena) linear both; }
@keyframes chico-dormido { 0%, 63% { opacity: 0; } 64%, 100% { opacity: 1; } }
.chico-bostezo { animation: chico-bostezo var(--dur-escena) ease-in-out both; }
@keyframes chico-bostezo { 0%, 45% { opacity: 0; } 47%, 51% { opacity: 1; } 53%, 100% { opacity: 0; } }
.chico-sonrisa { animation: chico-sonrisa var(--dur-escena) ease-in-out both; }
@keyframes chico-sonrisa { 0%, 45% { opacity: 1; } 47%, 51% { opacity: 0; } 53%, 100% { opacity: 1; } }
.chico-cabeza { animation: chico-cabeza var(--dur-escena) ease-in-out both; }
@keyframes chico-cabeza { 0% { transform: rotate(0deg); } 6%, 58% { transform: rotate(-7deg); } 66%, 100% { transform: rotate(5deg); } }
.zetas { animation: zetas var(--dur-escena) linear both; }
@keyframes zetas { 0%, 64% { opacity: 0; } 66%, 100% { opacity: 1; } }
.zeta { animation: zeta 2.4s ease-out infinite both; }
.zeta-1 { animation-delay: 0.8s; }
.zeta-2 { animation-delay: 1.6s; }
@keyframes zeta {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(16px, -30px) scale(1.3); }
}

/* El perrito: corretea por la orilla de un lado a otro, da la vuelta y vuelve */
.perro { fill: var(--perro); }
.perro-mancha { fill: var(--perro-oscuro); }
.pata { fill: var(--perro-oscuro); animation: pata 0.3s ease-in-out infinite alternate; }
.pata-b { animation-direction: alternate-reverse; }
@keyframes pata { from { transform: rotate(28deg); } to { transform: rotate(-28deg); } }
.cola-trazo { fill: none; stroke: var(--perro); stroke-width: 2.8; stroke-linecap: round; }
.cola { animation: cola 0.25s ease-in-out infinite alternate; }
@keyframes cola { from { transform: rotate(-18deg); } to { transform: rotate(22deg); } }
.collar { fill: none; stroke: var(--collar); stroke-width: 2.4; stroke-linecap: round; }
.lengua { fill: var(--mejillas); }
.perro-bota { animation: perro-bota 0.3s ease-in-out infinite alternate; }
@keyframes perro-bota { to { transform: translateY(-3px); } }
.perro-corre { animation: perro-corre 7s ease-in-out infinite; }
@keyframes perro-corre {
  0% { transform: translateX(36px); }
  45%, 52% { transform: translateX(250px); }
  96%, 100% { transform: translateX(36px); }
}
.perro-gira { animation: perro-gira 7s linear infinite; }
@keyframes perro-gira {
  0%, 47% { transform: scaleX(1); }
  48%, 97% { transform: scaleX(-1); }
  98%, 100% { transform: scaleX(1); }
}

/* Movimiento reducido: la escena se ve quieta, ya en su final (los dos tumbados, «C ♥ R» escrito) */
@media (prefers-reduced-motion: reduce) {
  .escena-playa, .escena-playa *, .carga-iniciales, .carga-iniciales * {
    animation-delay: calc(-1 * var(--dur-escena)) !important;
    animation-play-state: paused !important;
  }
  .letra-saludo, .carga-mensaje, .carga-pista { animation: none; }
}

/* Legislación: accesos, fichas desplegables por norma */
.op-ico.i5 { background: var(--soft); }
.leg-acceso .btn { margin-top: 6px; }
.leg-aviso { text-align: center; padding: 4px 8px 0; }
.norma {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.norma summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: var(--tap);
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
}
.norma summary::-webkit-details-marker { display: none; }
.norma-t { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.norma-t b { min-width: 0; font-family: var(--font-display); font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.norma-f { flex: 0 0 auto; font-size: 14px; color: var(--muted); }
.norma-n { font-size: 14px; font-weight: 600; color: var(--accent); }
.norma[open] summary { border-bottom: 1px solid var(--line); }
.norma-cuerpo { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 18px; font-size: 16px; }
.norma-cuerpo h3 { margin: 6px 0 0; font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.norma-cuerpo ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.norma-nombre { font-weight: 600; }
.norma-nota { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 15px; }

/* Estudiar en papel: vista previa en pantalla */
.papel-intro { font-size: 16px; }
.papel-pasos { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.papel-barra { display: flex; flex-direction: column; gap: 10px; }
.papel-volver { color: var(--accent); font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.papel { background: var(--papel); color: var(--tinta); border-radius: var(--radius-card); padding: 18px; display: flex; flex-direction: column; gap: 14px; font-size: 15px; line-height: 1.45; }
.papel h1, .papel h2, .papel h3 { color: var(--tinta); }
.papel-titulo { margin: 0; }
.papel-ambito { border-bottom: 2px solid var(--papel-acento); padding-bottom: 4px; margin-top: 8px; }
.papel-ayuda, .papel-aviso, .ficha-boletin { color: var(--tinta-suave); font-size: 13px; }
.ficha { border: 1px solid var(--papel-linea); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; break-inside: avoid; }
.ficha h3 { margin: 0; font-size: 18px; color: var(--papel-acento); }
.ficha ul, .ficha ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.ficha-nombre { font-weight: 600; }
.ficha-nota { font-style: italic; }
.ficha-repasos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; }
.casilla { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.casilla::before { content: ''; width: 13px; height: 13px; border: 1.5px solid var(--tinta); border-radius: 3px; }
.hoja-tarjetas { display: grid; grid-template-columns: 1fr 1fr; gap: 0; position: relative; padding-top: 22px; }
.hoja-pie { position: absolute; top: 0; left: 0; font-size: 12px; color: var(--tinta-suave); }
.corte { border: 1px dashed var(--papel-linea); min-height: 150px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 6px; text-align: center; overflow-wrap: anywhere; }
.corte-norma { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--papel-acento); }
.corte p { font-size: 14px; }
.reverso .corte p { font-weight: 600; }
.test-bloque h3 { margin: 4px 0; color: var(--papel-acento); }
.test-bloque ol, .soluciones ol { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 10px; }
.test-bloque li { break-inside: avoid; }
.linea { display: block; height: 22px; border-bottom: 1px solid var(--papel-linea); }
.soluciones { break-before: page; display: flex; flex-direction: column; gap: 10px; }

/* Al imprimir: solo el papel, a página completa y siempre en claro */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: var(--papel); color: var(--tinta); }
  #app { max-width: none; padding: 0; gap: 0; min-height: 0; }
  .no-imprimir { display: none !important; }
  .papel { border-radius: 0; padding: 0; font-size: 11pt; }
  .papel-titulo { font-size: 20pt; }
  .hoja-tarjetas { height: 270mm; grid-template-rows: repeat(4, 1fr); break-after: page; padding-top: 6mm; }
  .hoja-tarjetas:last-child { break-after: auto; }
  .corte { min-height: 0; }
  .corte p { font-size: 11pt; }
}
