/* =============================================================================
   app.css — Hoja de estilo de la aplicación móvil de astronomía.

   El diseño parte de tres ideas:

   1. El fondo es el cielo. No un color plano, sino dos nebulosas muy suaves y un
      campo de estrellas dibujado en un lienzo, con parpadeos de distinta
      duración. Todo lo demás flota encima.
   2. Los paneles son cristal. Fondo translúcido, desenfoque y un borde luminoso
      de un píxel. Es lo que da la sensación de profundidad sin recargar.
   3. Una sola tipografía para los números y otra para el texto, con mucho aire.
      Las cifras son las protagonistas: se ven grandes y en versalitas.

   La paleta es fría —azules nocturnos— para no romper la adaptación del ojo a la
   oscuridad, con dos acentos cálidos: ámbar para la Luna y el Sol, cian para los
   datos y las acciones.
   ========================================================================== */

/* ------------------------------------------------------------- variables */
:root {
  /* Fondos */
  --espacio:        #04050c;
  --espacio-2:      #070a16;
  --cristal:        rgba(19, 25, 48, 0.62);
  --cristal-alto:   rgba(28, 36, 66, 0.72);
  --cristal-borde:  rgba(146, 176, 255, 0.14);
  --cristal-brillo: rgba(255, 255, 255, 0.055);

  /* Texto */
  --tinta:      #eef2ff;
  --tinta-2:    #a8b4d8;
  --tinta-3:    #6f7ca6;

  /* Acentos */
  --ambar:      #ffc86b;
  --ambar-suave:#ffe0a8;
  --cian:       #63e2ff;
  --cian-hondo: #1c6f8c;
  --violeta:    #9b7bff;
  --verde:      #5ee2a8;
  --rojo:       #ff7a6b;

  /* Medidas */
  --radio:      20px;
  --radio-chico:13px;
  --barra-alto: 62px;
  --nav-alto:   66px;
  --sombra:     0 18px 50px -22px rgba(0, 0, 0, 0.95);
  --sombra-alta:0 26px 70px -24px rgba(0, 0, 0, 1);
  --curva:      cubic-bezier(0.22, 0.68, 0.36, 1);

  --fuente: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
            Roboto, "Helvetica Neue", Arial, sans-serif;
  --fuente-titulo: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia,
                   "Times New Roman", serif;
}

/* ------------------------------------------------------------- reseteo */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  background: var(--espacio);
  color: var(--tinta);
  font-family: var(--fuente);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor;
      stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------- fondo */
.fondo {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(140% 90% at 50% -10%, #101a36 0%, #070b18 45%, #04050c 100%);
}

.fondo-nebulosa {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  will-change: transform;
}

.fondo-nebulosa--a {
  width: 78vmax; height: 78vmax;
  top: -34vmax; left: -26vmax;
  background: radial-gradient(circle at 40% 40%,
    rgba(96, 76, 200, 0.4), rgba(52, 40, 120, 0.16) 45%, transparent 70%);
  animation: derivar-a 46s ease-in-out infinite alternate;
}

.fondo-nebulosa--b {
  width: 68vmax; height: 68vmax;
  bottom: -28vmax; right: -22vmax;
  background: radial-gradient(circle at 60% 60%,
    rgba(28, 130, 170, 0.32), rgba(18, 70, 110, 0.14) 45%, transparent 70%);
  animation: derivar-b 58s ease-in-out infinite alternate;
}

@keyframes derivar-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vmax, 4vmax, 0) scale(1.14); }
}
@keyframes derivar-b {
  from { transform: translate3d(0, 0, 0) scale(1.06); }
  to   { transform: translate3d(-5vmax, -5vmax, 0) scale(1); }
}

#fondo-estrellas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Viñeta para que el texto siempre tenga contraste suficiente */
.fondo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 40%, transparent 30%,
    rgba(4, 5, 12, 0.6) 100%);
}

/* ------------------------------------------------------------- estructura */
.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------- cabecera */
.cabecera {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--barra-alto);
  padding: calc(env(safe-area-inset-top) + 10px) 18px 10px;
  background: linear-gradient(180deg, rgba(5, 7, 16, 0.94), rgba(5, 7, 16, 0.6) 70%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}

.cabecera-lugar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--cristal-borde);
  background: var(--cristal);
  text-align: left;
  transition: background 0.25s, border-color 0.25s, transform 0.2s var(--curva);
}
.cabecera-lugar:active { transform: scale(0.97); }
.cabecera-lugar svg { color: var(--cian); flex: none; }
.cabecera-lugar span { display: flex; flex-direction: column; line-height: 1.15; }
.cabecera-lugar strong { font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }
.cabecera-lugar small { font-size: 11px; color: var(--tinta-3); letter-spacing: 0.02em; }

.cabecera-reloj { text-align: right; line-height: 1.1; }
.reloj-hora {
  display: block;
  font-family: var(--fuente-titulo);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff, #b9c6ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cabecera-reloj small { font-size: 11px; color: var(--tinta-3); letter-spacing: 0.03em; text-transform: uppercase; }

/* ------------------------------------------------------------- vistas */
.vistas {
  flex: 1;
  padding: 4px 16px calc(var(--nav-alto) + env(safe-area-inset-bottom) + 26px);
}

.vista { animation: entrar 0.5s var(--curva) both; }
.vista[hidden] { display: none; }

@keyframes entrar {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}

.vista-cabecera { padding: 14px 4px 18px; }

.vista-cabecera h1 {
  font-family: var(--fuente-titulo);
  font-size: 33px;
  font-weight: 500;
  letter-spacing: -0.015em;
  background: linear-gradient(120deg, #ffffff 10%, #cdd8ff 55%, var(--ambar) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.vista-sub {
  margin: 7px 0 0;
  font-size: 13.5px;
  color: var(--tinta-2);
  max-width: 42ch;
}

/* El botón para volver a abrir a Astro Bot cuando se ha cerrado la bienvenida. */
.vista-cabecera { position: relative; padding-right: 76px; }
.boton-bot {
  position: absolute;
  top: 14px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cian);
  background: rgba(99, 226, 255, 0.08);
  border: 1px solid rgba(99, 226, 255, 0.22);
  transition: background 0.2s, transform 0.2s var(--curva);
}
.boton-bot svg { width: 15px; height: 15px; }
.boton-bot:active { transform: scale(0.95); background: rgba(99, 226, 255, 0.16); }

/* ------------------------------------------------------------- tarjetas */
.tarjeta {
  position: relative;
  margin-bottom: 14px;
  padding: 18px;
  border-radius: var(--radio);
  border: 1px solid var(--cristal-borde);
  background:
    linear-gradient(180deg, var(--cristal-brillo), transparent 42%),
    var(--cristal);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: var(--sombra);
  animation: subir 0.55s var(--curva) both;
}

.tarjeta::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  border-radius: var(--radio) var(--radio) 0 0;
  background: linear-gradient(90deg, transparent, rgba(160, 190, 255, 0.34), transparent);
}

@keyframes subir {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* Retardo escalonado para que las tarjetas entren una tras otra */
.vista .tarjeta:nth-of-type(1) { animation-delay: 0.02s; }
.vista .tarjeta:nth-of-type(2) { animation-delay: 0.06s; }
.vista .tarjeta:nth-of-type(3) { animation-delay: 0.1s; }
.vista .tarjeta:nth-of-type(4) { animation-delay: 0.14s; }
.vista .tarjeta:nth-of-type(5) { animation-delay: 0.18s; }
.vista .tarjeta:nth-of-type(6) { animation-delay: 0.22s; }

.tarjeta-titulo {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--tinta-2);
}
.tarjeta-titulo svg { color: var(--cian); flex: none; }

.tarjeta--compacta { padding: 15px 16px; }
.tarjeta--compacta .tarjeta-titulo { margin-bottom: 10px; }
.tarjeta--mapa { padding: 16px 14px 14px; }

.rejilla-dos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.rejilla-dos .tarjeta { margin-bottom: 0; }

@media (max-width: 340px) {
  .rejilla-dos { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------- Luna heroica */
.tarjeta--luna {
  padding: 20px 18px 16px;
  background:
    radial-gradient(120% 100% at 22% 0%, rgba(255, 200, 107, 0.13), transparent 58%),
    linear-gradient(180deg, var(--cristal-brillo), transparent 42%),
    var(--cristal);
}

.luna-heroe {
  display: flex;
  align-items: center;
  gap: 18px;
}

#luna-heroe {
  width: 132px;
  height: 132px;
  flex: none;
  filter: drop-shadow(0 0 26px rgba(255, 216, 150, 0.3));
}

.luna-heroe-datos {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.etiqueta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ambar);
}

.cifra-grande {
  font-family: var(--fuente-titulo);
  font-size: 42px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--tinta);
}

.dato-suave { font-size: 12.5px; color: var(--tinta-3); }

.barra-progreso {
  position: relative;
  height: 3px;
  margin-top: 18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.barra-progreso-relleno {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--cian-hondo), var(--ambar));
  transition: width 0.8s var(--curva);
}

/* ------------------------------------------------------------- listas de datos */
.lista-datos { display: flex; flex-direction: column; gap: 8px; }

.lista-datos > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.lista-datos dt {
  font-size: 12.5px;
  color: var(--tinta-3);
  flex: none;
}

.lista-datos dd {
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--tinta);
}

.lista-datos dd.destacado { color: var(--ambar); }
.lista-datos dd.apagado { color: var(--tinta-3); font-weight: 400; }

.nota {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--tinta-3);
}

/* ------------------------------------------------- planetas de la portada */
.lista-planetas { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }

/*
 * Las fichas de los planetas van dentro de la tarjeta, así que no repiten el
 * cristal: un cristal sobre otro se apaga y pesa. Se quedan en un plano más
 * cercano, con el borde más tenue, y el protagonismo se lo lleva el reproductor.
 */
.ficha--noche {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: none;
}

.ficha--noche .ficha-cab {
  gap: 6px;
  padding: 8px 9px 8px 11px;
}

.ficha-abrir {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  padding: 0;
  text-align: left;
  color: inherit;
}

/*
 * El símbolo no es un punto: es el planeta. Un degradado radial con la luz en
 * la esquina superior izquierda y el color del cuerpo en el resto basta para
 * que se lea como una esfera y no como un botón con un lunar dentro.
 */
.ficha--noche .ficha-simbolo {
  width: 28px;
  height: 28px;
  font-size: 0;
  border: none;
  background:
    radial-gradient(circle at 34% 28%,
      rgba(255, 255, 255, 0.9) 0%,
      rgba(255, 255, 255, 0.32) 8%,
      currentColor 40%,
      rgba(0, 0, 0, 0.48) 100%);
  box-shadow: 0 0 14px -3px currentColor, inset 0 -2px 6px rgba(0, 0, 0, 0.35);
}

.ficha--noche .ficha-titulos { display: block; }
.ficha--noche .ficha-titulos strong { font-size: 14.5px; }
.ficha--noche .ficha-titulos small {
  font-size: 11px;
  line-height: 1.35;
  margin-top: 2px;
  color: var(--tinta-3);
}
.ficha--noche .ficha-flecha { font-size: 16px; color: var(--tinta-3); }

/* El botón de play de la cabecera: permite escuchar sin desplegar la ficha. */
.ficha-play {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--cian);
  background: rgba(99, 226, 255, 0.1);
  border: 1px solid rgba(99, 226, 255, 0.26);
  transition: background 0.22s var(--curva), transform 0.18s var(--curva);
}
.ficha-play svg { width: 14px; height: 14px; }
.ficha-play:active { transform: scale(0.93); }
.ficha-play:hover { background: rgba(99, 226, 255, 0.17); }
.ficha.sonando .ficha-play { background: rgba(99, 226, 255, 0.2); }

.icono-play,
.icono-pausa { display: block; }
.ficha-play .icono-pausa,
.audio-play .icono-pausa { display: none; }
.ficha.sonando .ficha-play .icono-pausa,
.ficha.sonando .audio-play .icono-pausa { display: block; }
.ficha.sonando .ficha-play .icono-play,
.ficha.sonando .audio-play .icono-play { display: none; }

.ficha--noche .ficha-interior { padding: 0 13px 14px; }

.ficha--noche .ficha-descripcion {
  margin: 0 0 11px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--tinta-2);
}

/* ---------------------------------------------------------- audio de la ficha */
.audio-guia {
  padding: 12px 12px 10px;
  border-radius: var(--radio-chico);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(99, 226, 255, 0.1), transparent 62%),
    rgba(9, 16, 30, 0.62);
  border: 1px solid rgba(99, 226, 255, 0.14);
  transition: border-color 0.25s var(--curva);
}
.ficha.sonando .audio-guia { border-color: rgba(99, 226, 255, 0.36); }

.audio-guia-cab { display: flex; align-items: center; gap: 10px; }

.audio-guia-icono {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 50%;
  color: var(--cian);
  background: rgba(99, 226, 255, 0.12);
  border: 1px solid rgba(99, 226, 255, 0.18);
}

.audio-guia-titulos { min-width: 0; }
.audio-guia-titulos strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-guia-titulos small {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--tinta-3);
  font-variant-numeric: tabular-nums;
}

.audio-guia-controles {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 9px;
}

.audio-play {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #041820;
  background: linear-gradient(155deg, #8deeff, #3cb6e4);
  box-shadow: 0 8px 20px -9px rgba(99, 226, 255, 0.95);
  transition: transform 0.18s var(--curva), box-shadow 0.22s var(--curva);
}
.audio-play svg { width: 17px; height: 17px; margin-left: 1px; }
.audio-play:hover { box-shadow: 0 9px 26px -8px rgba(99, 226, 255, 1); }
.audio-play:active { transform: scale(0.94); }
.ficha.sonando .audio-play {
  background: linear-gradient(155deg, #ffe3a6, #ffc86b);
  box-shadow: 0 8px 22px -9px rgba(255, 200, 107, 0.9);
}

/* Barra de progreso: es un `input` de rango de verdad, para que se pueda
   arrastrar con el dedo y mover con el teclado. El relleno se pinta con la
   variable `--progreso`, que actualiza el guion en cada `timeupdate`. */
.audio-barra {
  flex: 1;
  min-width: 0;
  height: 24px;
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.audio-barra:focus-visible { outline: 2px solid rgba(99, 226, 255, 0.7); outline-offset: 2px; border-radius: 999px; }

.audio-barra::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    var(--cian) 0 var(--progreso, 0%),
    rgba(255, 255, 255, 0.16) var(--progreso, 0%) 100%);
}
.audio-barra::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 226, 255, 0.16);
}
.audio-barra::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}
.audio-barra::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--cian);
}
.audio-barra::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 226, 255, 0.16);
}

.audio-tiempo {
  flex: none;
  min-width: 32px;
  text-align: right;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--tinta-2);
}

.audio-guia audio { display: none; }

/* La transcripción: el mismo texto que suena, para quien no pueda oírlo. */
.audio-transcripcion {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--tinta-3);
}
.audio-transcripcion summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--tinta-2);
  list-style: none;
}
.audio-transcripcion summary::-webkit-details-marker { display: none; }
.audio-transcripcion summary::before {
  content: '▸';
  font-size: 10px;
  color: var(--cian);
  transition: transform 0.25s var(--curva);
}
.audio-transcripcion[open] summary::before { transform: rotate(90deg); }
.audio-transcripcion p {
  margin: 9px 0 0;
  font-size: 13px;
  line-height: 1.62;
  color: var(--tinta-2);
}

.ficha--noche .ficha-rejilla { gap: 7px; margin: 12px 0 0; }
.ficha--noche .ficha-dato { padding: 8px 10px; }
.ficha--noche .ficha-dato dt { font-size: 9.5px; }
.ficha--noche .ficha-dato dd { font-size: 13.5px; }

/* Si el audio no se puede cargar, el reproductor lo dice y no finge funcionar. */
.ficha.audio-fallido .audio-guia-controles { opacity: 0.45; }
.ficha.audio-fallido .audio-play { pointer-events: none; }

/* Y la guía, además, se puede ver con un avatar que la lee. */
.audio-guia-pie {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.audio-video {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--cian);
  background: rgba(99, 226, 255, 0.08);
  border: 1px solid rgba(99, 226, 255, 0.22);
  transition: background 0.2s, border-color 0.2s, transform 0.18s var(--curva);
}
.audio-video svg { width: 15px; height: 15px; }
.audio-video:hover { background: rgba(99, 226, 255, 0.15); border-color: rgba(99, 226, 255, 0.4); }
.audio-video:active { transform: scale(0.97); }

/* El avatar incrustado en la ficha, con el fondo del panel detrás. */
.avatar-inline {
  position: relative;
  margin: 0 0 10px;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(120% 100% at 50% 18%, rgba(99, 226, 255, 0.12), transparent 62%),
    rgba(6, 11, 22, 0.55);
  border: 1px solid rgba(99, 226, 255, 0.12);
}
.avatar-inline[hidden] { display: none; }
.avatar-inline canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
}
.avatar-inline-estado {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--tinta-3);
  background: rgba(5, 8, 16, 0.6);
  transition: opacity 0.25s var(--curva);
}
.avatar-inline.listo .avatar-inline-estado { opacity: 0; pointer-events: none; }
.avatar-inline.cargando .avatar-inline-estado { opacity: 1; }

.boton-video-planeta { margin-top: 12px; }

/* ------------------------------------------------------- el avatar en vídeo */
#hoja-video {
  align-items: stretch;
  background: #04050c;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#hoja-video .hoja--video {
  height: 100dvh;
  max-height: none;
  max-width: 560px;
  margin: 0 auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#hoja-video .hoja-cab {
  padding: calc(env(safe-area-inset-top) + 12px) 18px 10px;
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
#hoja-video .hoja-cab h2 { font-size: 18px; }

#hoja-video .hoja-cuerpo--video {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 12px);
  gap: 10px;
}

.video-marco {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* El lienzo es un elemento reemplazado: con las medidas en «auto» y los dos
   máximos, se encoge manteniendo la proporción 9:16, como una imagen. */
.video-marco canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.95);
}

.video-controles {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-acciones {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.video-acciones .nota {
  flex: 1;
  min-width: 140px;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
}

.boton--grabar {
  padding: 10px 16px;
  font-size: 13px;
  color: #1a0a0c;
  background: linear-gradient(120deg, #ffa0a0, #ff5d6c);
  box-shadow: 0 8px 22px -12px rgba(255, 93, 108, 0.85);
}
.boton--grabar svg { width: 14px; height: 14px; }
.boton--grabar.grabando { animation: latido-grabar 1.2s infinite; }
@keyframes latido-grabar {
  0%, 100% { box-shadow: 0 8px 22px -12px rgba(255, 93, 108, 0.8); }
  50% { box-shadow: 0 8px 30px -6px rgba(255, 93, 108, 0.95); }
}

#hoja-video.sonando #video-play .icono-pausa { display: block; }
#hoja-video.sonando #video-play .icono-play { display: none; }

@media (prefers-reduced-motion: reduce) {
  .boton--grabar.grabando { animation: none; }
}

@media (max-width: 360px) {
  /* En un móvil justo, la distancia en kilómetros es el dato más largo: se le
     quita un poco de cuerpo para que no empuje la celda. */
  .ficha--noche .ficha-dato { padding: 7px 8px; }
  .ficha--noche .ficha-dato dd { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .audio-play,
  .ficha-play,
  .audio-transcripcion summary::before { transition: none; }
}


.insignia {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.insignia--visible { background: rgba(94, 226, 168, 0.16); color: var(--verde); }
.insignia--no { background: rgba(255, 255, 255, 0.07); color: var(--tinta-3); }
.insignia--pronto { background: rgba(255, 200, 107, 0.16); color: var(--ambar); }

/* ------------------------------------------------------------- eventos */
.lista-eventos { display: flex; flex-direction: column; }

.lista-eventos li {
  display: flex;
  gap: 13px;
  padding: 12px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.lista-eventos li:last-child { border-bottom: none; }

.evento-fecha {
  flex: none;
  width: 52px;
  text-align: center;
  padding-top: 2px;
}
.evento-dia {
  display: block;
  font-family: var(--fuente-titulo);
  font-size: 21px;
  line-height: 1;
  font-weight: 500;
  color: var(--tinta);
}
.evento-mes {
  display: block;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tinta-3);
  margin-top: 2px;
}

.evento-cuerpo { flex: 1; min-width: 0; }
.evento-titulo { font-size: 14.5px; font-weight: 600; }
.evento-detalle { font-size: 12.5px; color: var(--tinta-3); margin-top: 2px; }
.evento-cuenta {
  display: inline-block;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--cian);
  font-variant-numeric: tabular-nums;
}

.lista-eventos--compacta li:first-child { padding-top: 2px; }

/* ------------------------------------------------------------- estrellas */
.lista-estrellas { display: flex; flex-direction: column; gap: 2px; }

.lista-estrellas li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.lista-estrellas li:last-child { border-bottom: none; }

.estrella-punto {
  width: 8px; height: 8px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.estrella-nombre { flex: 1; font-size: 14px; }
.estrella-nombre small { color: var(--tinta-3); font-size: 11.5px; margin-left: 5px; }
.estrella-altura { font-size: 12.5px; color: var(--tinta-2); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- fases del mes */
.lista-fases { display: flex; flex-direction: column; }

.lista-fases li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.lista-fases li:last-child { border-bottom: none; }

.fase-icono {
  width: 38px; height: 38px;
  flex: none;
  display: grid;
  place-items: center;
}
.fase-icono canvas { width: 38px; height: 38px; }

.fase-texto { flex: 1; min-width: 0; }
.fase-texto strong { display: block; font-size: 14.5px; font-weight: 600; }
.fase-texto small { font-size: 12px; color: var(--tinta-3); }

.fase-hora {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ambar);
}

/* Tira de fases: barra de iluminación día a día */
.tira-fases {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  align-items: end;
  height: 92px;
  margin: 4px 0 2px;
}

.tira-dia {
  position: relative;
  height: 100%;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  transition: background 0.25s, transform 0.2s var(--curva);
}

.tira-dia-relleno {
  width: 100%;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--ambar-suave), rgba(255, 200, 107, 0.22));
  transition: height 0.5s var(--curva);
}

.tira-dia.activo { background: rgba(99, 226, 255, 0.16); transform: translateY(-3px); }
.tira-dia.hoy .tira-dia-relleno { background: linear-gradient(180deg, var(--cian), rgba(99, 226, 255, 0.25)); }

.tira-dia-num {
  position: absolute;
  top: 3px;
  left: 0; right: 0;
  text-align: center;
  font-size: 9px;
  color: var(--tinta-3);
  pointer-events: none;
}

/* ------------------------------------------------------------- detalle de día */
.detalle-dia { display: flex; gap: 16px; align-items: flex-start; }
.detalle-dia-luna { flex: none; }
#luna-detalle { width: 104px; height: 104px; filter: drop-shadow(0 0 18px rgba(255, 216, 150, 0.26)); }
.detalle-dia-datos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 360px) {
  .detalle-dia { flex-direction: column; align-items: stretch; }
  #luna-detalle { width: 92px; height: 92px; }
}

/* ------------------------------------------------------------- meses */
.lista-meses { display: flex; flex-direction: column; gap: 4px; }

.mes-fila {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--radio-chico);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  text-align: left;
  width: 100%;
  transition: background 0.22s, border-color 0.22s;
}
.mes-fila:active { background: rgba(255, 255, 255, 0.07); }
.mes-fila.activo { border-color: rgba(99, 226, 255, 0.34); background: rgba(99, 226, 255, 0.08); }

.mes-nombre { flex: none; width: 92px; font-size: 14px; font-weight: 600; }
.mes-iconos { display: flex; gap: 6px; flex: 1; }
.mes-iconos canvas { width: 22px; height: 22px; opacity: 0.92; }

/* ------------------------------------------------------------- mapa del horizonte */
#mapa-horizonte {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 62vh;
  touch-action: none;
}

/* ------------------------------------------------------------- fichas (planetas y eventos) */
.lista-fichas { display: flex; flex-direction: column; gap: 12px; }

.ficha {
  position: relative;
  border-radius: var(--radio);
  border: 1px solid var(--cristal-borde);
  background:
    linear-gradient(180deg, var(--cristal-brillo), transparent 40%),
    var(--cristal);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: var(--sombra);
  overflow: hidden;
  animation: subir 0.5s var(--curva) both;
}

.ficha-cab {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  width: 100%;
  text-align: left;
}

.ficha-simbolo {
  width: 42px; height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  background: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.2), transparent 62%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ficha-titulos { flex: 1; min-width: 0; }
.ficha-titulos strong { display: block; font-size: 16px; font-weight: 600; }
.ficha-titulos small { display: block; font-size: 12.5px; color: var(--tinta-3); margin-top: 1px; }

.ficha-flecha {
  flex: none;
  color: var(--tinta-3);
  transition: transform 0.3s var(--curva);
}
.ficha.abierta .ficha-flecha { transform: rotate(90deg); }

.ficha-cuerpo {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s var(--curva);
}
.ficha.abierta .ficha-cuerpo { grid-template-rows: 1fr; }
.ficha-cuerpo > div { overflow: hidden; }

.ficha-interior { padding: 0 16px 16px; }

.ficha-descripcion {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--tinta-2);
  margin: 0 0 14px;
}

.ficha-rejilla {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 12px;
}

.ficha-dato {
  padding: 10px 12px;
  border-radius: var(--radio-chico);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.ficha-dato dt {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tinta-3);
}
.ficha-dato dd {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}

.ficha-curioso {
  padding: 12px 14px;
  border-radius: var(--radio-chico);
  border-left: 2px solid var(--ambar);
  background: rgba(255, 200, 107, 0.075);
  font-size: 13px;
  line-height: 1.6;
  color: var(--tinta-2);
}

.ficha-curioso strong { color: var(--ambar); }

/* ------------------------------------------------------------- filtros */
.filtro {
  display: flex;
  gap: 7px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  /* Los filtros no caben en un teléfono y la fila se desliza. El difuminado de la
     derecha es lo que avisa de que hay más botones: sin él, el último se corta a
     hueso y parece que no existe. */
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
}

/* Cuando la fila no se desliza, el difuminado sobra y corta el último botón. Se
   quita en las filas de dos botones, que siempre caben. */
.filtro--mini {
  -webkit-mask-image: none;
  mask-image: none;
}
.filtro::-webkit-scrollbar { display: none; }

.filtro-boton {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--tinta-2);
  border: 1px solid var(--cristal-borde);
  background: var(--cristal);
  transition: all 0.25s var(--curva);
}
.filtro-boton.activo {
  color: #05070f;
  font-weight: 600;
  border-color: transparent;
  background: linear-gradient(120deg, var(--ambar), #ffb03d);
  box-shadow: 0 6px 20px -8px rgba(255, 200, 107, 0.7);
}
.filtro--mini { margin-bottom: 10px; }
.filtro--mini .filtro-boton { padding: 6px 12px; font-size: 12px; }

/* ------------------------------------------------------------- carta del cielo */
.tarjeta--cielo { padding: 16px 12px 12px; }

.cielo-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.cielo-cabecera .tarjeta-titulo { margin-bottom: 0; }

.cielo-controles { display: flex; gap: 6px; flex-wrap: wrap; }

.icono-mini {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--tinta-3);
  border: 1px solid var(--cristal-borde);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.22s var(--curva);
}
.icono-mini.activo {
  color: var(--cian);
  border-color: rgba(99, 226, 255, 0.4);
  background: rgba(99, 226, 255, 0.1);
}

#carta-cielo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 68vh;
  border-radius: var(--radio-chico);
  touch-action: none;
  background: radial-gradient(circle at 50% 45%, #081020 0%, #03040a 78%);
}

/* ------------------------------------------------------------- constelación del mes */
.constelacion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.constelacion-nombre {
  font-family: var(--fuente-titulo);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.constelacion-nombre small {
  display: block;
  font-family: var(--fuente);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tinta-3);
  margin-top: 3px;
}

.constelacion-texto { font-size: 13.5px; line-height: 1.65; color: var(--tinta-2); }

.constelacion-etiquetas { display: flex; flex-wrap: wrap; gap: 6px; }

.etiqueta-mini {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--tinta-2);
  border: 1px solid var(--cristal-borde);
  background: rgba(255, 255, 255, 0.04);
}
.etiqueta-mini b { color: var(--ambar); font-weight: 600; }

/* ------------------------------------------------------------- cielo profundo */
.lista-dso { display: flex; flex-direction: column; }

.lista-dso li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
  text-align: left;
}
.lista-dso li:last-child { border-bottom: none; }

/* Las filas de cielo profundo se pueden pulsar para ver la ficha. */
.lista-dso li.dso {
  cursor: pointer;
  transition: background 0.2s var(--curva);
  border-radius: 10px;
  padding-inline: 8px;
  margin-inline: -8px;
}
.lista-dso li.dso:hover,
.lista-dso li.dso:focus-visible { background: rgba(255, 255, 255, 0.04); }
.lista-dso li.dso:active { background: rgba(255, 255, 255, 0.07); }

.dso-simbolo {
  width: 34px; height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 15px;
  background: rgba(155, 123, 255, 0.12);
  border: 1px solid rgba(155, 123, 255, 0.2);
}

.dso-texto { flex: 1; min-width: 0; }
.dso-texto strong { display: block; font-size: 14px; font-weight: 500; }
.dso-texto small { font-size: 11.5px; color: var(--tinta-3); }

/* La altura se colorea según lo bien situado que esté el objeto: por debajo de
   30° la atmósfera emborrona mucho, y por encima de 45° está en su mejor momento. */
.dso-altura {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
  font-size: 12.5px;
  color: var(--tinta-2);
  font-variant-numeric: tabular-nums;
}
.dso-altura small { font-size: 10.5px; color: var(--tinta-3); letter-spacing: 0.02em; }
.dso-altura.alto { color: var(--ambar); }
.dso-altura.bajo { color: var(--tinta-3); }

/* ---------------------------------------------- cabeceras de mes y avisos */

/* La agenda se agrupa por meses: una lista de ochenta entradas seguidas no deja
   ver de un vistazo cómo se reparte el año. */
.grupo-mes {
  margin: 22px 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tinta-3);
}
.lista-fichas > .grupo-mes:first-child { margin-top: 4px; }

.aviso-resto {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--tinta-2);
  background: rgba(155, 123, 255, 0.08);
  border: 1px dashed rgba(155, 123, 255, 0.25);
}

/* ------------------------------------------------------------- glosario */
.glosario { display: flex; flex-direction: column; gap: 2px; }

.glosario details {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4px 0;
}
.glosario details:last-child { border-bottom: none; }

.glosario summary {
  padding: 10px 0;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.glosario summary::-webkit-details-marker { display: none; }
.glosario summary::after {
  content: '+';
  color: var(--cian);
  font-size: 17px;
  line-height: 1;
  transition: transform 0.28s var(--curva);
}
.glosario details[open] summary::after { transform: rotate(45deg); }
.glosario p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--tinta-3);
}

/* ------------------------------------------------------------- navegación */
.navegacion {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
  background: linear-gradient(180deg, rgba(6, 8, 18, 0.72), rgba(5, 7, 15, 0.97) 55%);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border-top: 1px solid rgba(146, 176, 255, 0.1);
}

.nav-boton {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 2px 6px;
  border-radius: 14px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--tinta-3);
  transition: color 0.25s, background 0.25s, transform 0.2s var(--curva);
}
.nav-boton svg { width: 21px; height: 21px; stroke-width: 1.65; }
.nav-boton:active { transform: scale(0.94); }

.nav-boton.activo {
  color: var(--ambar);
  background: radial-gradient(60% 70% at 50% 20%, rgba(255, 200, 107, 0.16), transparent 72%);
}

.nav-boton.activo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--ambar), transparent);
}

/* ------------------------------------------------------------- hojas modales */
.hoja-fondo {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  background: rgba(3, 4, 10, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fundido 0.28s ease both;
}
.hoja-fondo[hidden] { display: none; }

@keyframes fundido { from { opacity: 0; } to { opacity: 1; } }

.hoja {
  width: 100%;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  border-radius: 26px 26px 0 0;
  border: 1px solid var(--cristal-borde);
  border-bottom: none;
  background: linear-gradient(180deg, rgba(22, 28, 52, 0.97), rgba(8, 11, 22, 0.99));
  box-shadow: var(--sombra-alta);
  animation: subir-hoja 0.42s var(--curva) both;
}

@keyframes subir-hoja {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

.hoja-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.hoja-cab h2 { font-family: var(--fuente-titulo); font-size: 21px; font-weight: 500; }

.cerrar {
  width: 32px; height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 21px;
  line-height: 1;
  color: var(--tinta-2);
  background: rgba(255, 255, 255, 0.07);
  transition: background 0.2s, transform 0.2s var(--curva);
}
.cerrar:active { transform: scale(0.9); background: rgba(255, 255, 255, 0.13); }

.hoja-cuerpo {
  padding: 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ------------------------------------------------------------- Astro Bot */
.hoja--bienvenida { max-width: 560px; margin: 0 auto; }
.bienvenida { gap: 12px; }
.bienvenida-fila { display: flex; align-items: center; gap: 14px; }
.bienvenida-bot {
  flex: none;
  width: 126px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(99, 226, 255, 0.14);
  background:
    radial-gradient(120% 100% at 50% 20%, rgba(99, 226, 255, 0.14), transparent 62%),
    rgba(6, 11, 22, 0.5);
}
.bienvenida-bot canvas { display: block; width: 100%; height: auto; }
.bienvenida-texto { min-width: 0; }
.bienvenida-saludo {
  font-family: var(--fuente-titulo);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
}
.bienvenida-saludo strong { color: var(--cian); font-weight: 600; }
.bienvenida-preguntar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin-top: 9px;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cian);
  background: rgba(99, 226, 255, 0.12);
  border: 1px solid rgba(99, 226, 255, 0.32);
  transition: background 0.2s, transform 0.2s var(--curva);
}
.bienvenida-preguntar svg { width: 15px; height: 15px; flex: none; }
.bienvenida-preguntar-flecha { margin-left: 1px; font-size: 14px; }
.bienvenida-preguntar:hover { background: rgba(99, 226, 255, 0.18); }
.bienvenida-preguntar:active { transform: scale(0.97); }
.bienvenida-intro {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--tinta-2);
}
.bienvenida-lista {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.bienvenida-lista li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.bienvenida-numero {
  flex: none;
  width: 18px;
  font-family: var(--fuente-titulo);
  font-size: 15px;
  color: var(--ambar);
}
.bienvenida-punto {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.bienvenida-item { min-width: 0; }
.bienvenida-item strong { display: block; font-size: 13.5px; }
.bienvenida-item small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--tinta-3);
}
.bienvenida-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.bienvenida-acciones .boton {
  flex: 1;
  min-width: 128px;
  padding: 12px 14px;
  font-size: 13.5px;
}
.boton.boton--fantasma {
  color: var(--tinta);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}
.boton.boton--fantasma:active { transform: scale(0.975); }
.boton:focus-visible,
.boton-bot:focus-visible,
.cerrar:focus-visible {
  outline: 2px solid rgba(99, 226, 255, 0.8);
  outline-offset: 2px;
}
/* El foco del navegador pintaba el botón fantasma como un botón blanco. */
.boton.boton--fantasma:focus,
.boton.boton--fantasma:focus-visible {
  color: var(--tinta);
  background: rgba(255, 255, 255, 0.06);
}
.bienvenida #bienvenida-preferencia { align-self: flex-start; margin: 0; }

/* ------------------------------------------------------------- chat */
.hoja--chat { max-width: 560px; margin: 0 auto; }
.chat {
  overflow: hidden;
  gap: 10px;
  min-height: 0;
}
.chat-cab { display: flex; align-items: center; gap: 10px; flex: none; }
.chat-avatar {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(99, 226, 255, 0.18);
  background:
    radial-gradient(120% 100% at 50% 20%, rgba(99, 226, 255, 0.16), transparent 62%),
    rgba(6, 11, 22, 0.6);
}
.chat-avatar canvas { display: block; width: 100%; height: auto; }
.chat-cab-texto { min-width: 0; }
.chat-cab-texto strong { display: block; font-family: var(--fuente-titulo); font-size: 18px; font-weight: 500; }
.chat-cab-texto small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--tinta-3); }
.chat-mensajes {
  flex: 1;
  min-height: 140px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 2px 4px;
}
.chat-mensaje {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.chat-mensaje--bot {
  align-self: flex-start;
  background: rgba(99, 226, 255, 0.075);
  border: 1px solid rgba(99, 226, 255, 0.14);
  border-bottom-left-radius: 4px;
}
.chat-mensaje--yo {
  align-self: flex-end;
  background: rgba(246, 196, 83, 0.11);
  border: 1px solid rgba(246, 196, 83, 0.2);
  border-bottom-right-radius: 4px;
}
.chat-escuchar {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--cian);
  background: rgba(99, 226, 255, 0.08);
  border: 1px solid rgba(99, 226, 255, 0.18);
}
.chat-escuchar svg { width: 13px; height: 13px; }
.chat-escuchar:active { transform: scale(0.96); }
.chat-sugerencias { display: flex; flex-wrap: wrap; gap: 6px; flex: none; }
.chat-chip {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1.2;
  text-align: left;
  color: var(--tinta-2);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.chat-chip:active { background: rgba(99, 226, 255, 0.12); }
.chat-form { display: flex; gap: 8px; align-items: stretch; flex: none; }
.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  font-size: 13.5px;
}
.chat-form .boton { flex: none; padding: 10px 15px; font-size: 13.5px; }
.chat-nota { margin: 0; }

/* ------------------------------------------------------------- controles */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tinta-3);
}

input[type="search"],
input[type="number"],
input[type="date"],
input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radio-chico);
  border: 1px solid var(--cristal-borde);
  background: rgba(255, 255, 255, 0.05);
  font-size: 15px;
  color: var(--tinta);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.25s, background 0.25s;
}
input:focus {
  outline: none;
  border-color: rgba(99, 226, 255, 0.55);
  background: rgba(99, 226, 255, 0.07);
}
input::placeholder { color: var(--tinta-3); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 18px;
  border-radius: var(--radio-chico);
  font-size: 14.5px;
  font-weight: 600;
  color: #05070f;
  background: linear-gradient(120deg, var(--ambar), #ffb03d);
  box-shadow: 0 10px 26px -12px rgba(255, 200, 107, 0.8);
  transition: transform 0.2s var(--curva), box-shadow 0.25s;
}
.boton:active { transform: scale(0.975); }
.boton.ancho { width: 100%; }
.boton svg { width: 19px; height: 19px; }

.boton-texto {
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cian);
  padding: 6px 0;
}
.boton-texto:active { opacity: 0.7; }

/* ------------------------------------------------------------- resultados */
.lista-resultados {
  display: flex;
  flex-direction: column;
  max-height: 260px;
  overflow-y: auto;
  border-radius: var(--radio-chico);
  border: 1px solid var(--cristal-borde);
  background: rgba(255, 255, 255, 0.035);
}
.lista-resultados[hidden] { display: none; }

.lista-resultados button {
  padding: 12px 14px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
  transition: background 0.2s;
}
.lista-resultados button:last-child { border-bottom: none; }
.lista-resultados button:active { background: rgba(255, 255, 255, 0.07); }
.lista-resultados small { display: block; font-size: 11.5px; color: var(--tinta-3); }

/* ------------------------------------------------------------- ficha de la hoja */
.hoja--ficha .hoja-cuerpo { gap: 16px; }

.aviso {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 5, 12, 0.9);
  backdrop-filter: blur(8px);
}
.aviso[hidden] { display: none; }

.aviso-caja {
  max-width: 400px;
  padding: 24px;
  border-radius: var(--radio);
  border: 1px solid var(--cristal-borde);
  background: var(--cristal-alto);
  text-align: center;
}
.aviso-caja h2 { font-family: var(--fuente-titulo); font-size: 21px; margin-bottom: 10px; }
.aviso-caja p { font-size: 13.5px; line-height: 1.6; color: var(--tinta-2); margin: 0 0 18px; }

/* ------------------------------------------------------------- utilidades */
.oculto { display: none !important; }

.vacio {
  padding: 22px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--tinta-3);
}

/* Respeta a quien pide menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* En pantallas grandes se centra y se limita el ancho, como una app móvil */
/* ------------------------------------------------- mapa del cielo de hoy */

/*
 * La panorámica va en una caja con la proporción justa para que la línea del
 * horizonte quede a la vista sin que la tarjeta crezca más que las demás. El
 * lienzo se estira al ancho disponible; la altura la fija el propio guion, así
 * que aquí sólo se da el marco.
 */
.mapa-cielo {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(146, 176, 255, 0.16);
  background: #04060f;
}

.mapa-cielo canvas {
  display: block;
  width: 100%;
  height: auto;
}

.mapa-leyenda {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--tinta-3);
  opacity: 0.85;
}

/* ------------------------------------------- emisión en directo (ISS) */

/*
 * El reproductor va en una caja con la proporción del vídeo, para que al cargar el
 * iframe no salte el diseño. La portada con la miniatura hace de cartel: se ve el
 * aspecto del directo sin descargar el reproductor de YouTube entero.
 */
.directo {
  position: relative;
  display: flex;
  margin-top: 2px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #06090f;
  border: 1px solid var(--cristal-borde);
}

.directo-portada {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: linear-gradient(160deg, #101a33, #05070f);
  cursor: pointer;
  overflow: hidden;
}

.directo-miniatura {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  transition: transform 0.6s var(--curva), opacity 0.3s var(--curva);
}
.directo-portada:hover .directo-miniatura,
.directo-portada:focus-visible .directo-miniatura {
  transform: scale(1.04);
  opacity: 0.85;
}

/* Sin miniatura queda un degradado con la textura del cielo, no un hueco roto. */
.directo.sin-miniatura .directo-portada {
  background:
    radial-gradient(120% 90% at 30% 15%, rgba(99, 226, 255, 0.16), transparent 60%),
    linear-gradient(160deg, #16213f, #05070f);
}

.directo-velo {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 7, 15, 0.15) 0%, rgba(5, 7, 15, 0.55) 100%);
}

.directo-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.directo-play svg {
  width: 62px;
  height: 62px;
  padding: 17px;
  border-radius: 999px;
  fill: #05070f;
  background: linear-gradient(120deg, var(--ambar), #ffb03d);
  box-shadow: 0 10px 34px -8px rgba(255, 200, 107, 0.75);
  transition: transform 0.25s var(--curva), box-shadow 0.25s var(--curva);
}
.directo-portada:hover .directo-play svg,
.directo-portada:focus-visible .directo-play svg {
  transform: scale(1.08);
  box-shadow: 0 14px 40px -8px rgba(255, 200, 107, 0.9);
}

/* Sello de «en directo»: el punto rojo que late es lo que distingue un directo de
   un vídeo grabado sin tener que leer nada. */
.directo-sello {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(9, 12, 20, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.directo-punto {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ff3b52;
  box-shadow: 0 0 0 0 rgba(255, 59, 82, 0.7);
  animation: latido 2s infinite;
}
@keyframes latido {
  0%   { box-shadow: 0 0 0 0 rgba(255, 59, 82, 0.65); }
  70%  { box-shadow: 0 0 0 8px rgba(255, 59, 82, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 82, 0); }
}

/* El marco del reproductor ya cargado. */
.directo-marco {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}
.directo-marco iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.directo-pie { margin-top: 8px; }

.enlace-discreto {
  color: var(--cian);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(99, 226, 255, 0.35);
  padding-bottom: 1px;
}
.enlace-discreto:hover { border-bottom-color: var(--cian); }

/* Si el sistema pide menos movimiento, se para el latido del punto rojo. */
@media (prefers-reduced-motion: reduce) {
  .directo-punto { animation: none; }
  .directo-miniatura,
  .directo-play svg { transition: none; }
}

@media (min-width: 620px) {
  .vistas { max-width: 560px; margin: 0 auto; width: 100%; }
  .cabecera { max-width: 560px; margin: 0 auto; width: 100%; }
  .navegacion { max-width: 560px; left: 50%; transform: translateX(-50%);
                border-radius: 22px 22px 0 0; }
}
