/* =========================================================
   01 · Pantalla de título (#inicio)
   Logo metálico, menú de recreativa y el ciclo de día y noche del cielo.
   ========================================================= */

.stage--title { background: linear-gradient(180deg, #1b0a3a 0%, #5a1a5e 38%, #c2305a 62%, #ff8a2a 85%); }

/* Cielo de la pantalla de título: un día entero en 36 s.
   0 % amanece por la izquierda · 25 % mediodía · 50 % se pone por la derecha
   · después sale la luna y las estrellas hasta el siguiente amanecer.
   El fondo de la pantalla es el atardecer; día y noche se superponen encima. */
.sky {
  --cycle: 36s;
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.sky > span { position: absolute; inset: 0; }
.sky__day {
  background: linear-gradient(180deg, #16307f 0%, #2f5fc4 45%, #6f9ae8 66%, #f0a35e 84%);
  opacity: 0;
  animation: sky-day var(--cycle) linear infinite;
}
.sky__night {
  background: linear-gradient(180deg, #03031a 0%, #0b0a30 50%, #241046 72%, #3a1450 86%);
  opacity: 0;
  animation: sky-night var(--cycle) linear infinite;
}
.sky__stars {
  opacity: 0;
  animation: sky-night var(--cycle) linear infinite;
}

/* Cada astro: la pista avanza en horizontal y el cuerpo sube y baja → arco */
.sky__track {
  inset: 0 auto auto 0 !important;
  width: 0;
  height: 0;
  animation: sky-x var(--cycle) linear infinite;
}
.sky__body {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  translate: -50% -50%;
  animation: sky-y var(--cycle) infinite;
}
.sky__body svg { max-width: none; }
.sky__track--sun .sky__body svg { width: clamp(120px, 15vw, 240px); height: auto; aspect-ratio: 1; }
.sky__track--moon .sky__body svg { width: clamp(64px, 7vw, 110px); height: auto; aspect-ratio: 1; }
/* La luna recorre el mismo arco, medio ciclo después */
.sky__track--moon,
.sky__track--moon .sky__body { animation-delay: calc(var(--cycle) / -2); }

@keyframes sky-x {
  0% { transform: translateX(-8vw); }
  50%, 100% { transform: translateX(108vw); }
}
@keyframes sky-y {
  0% { transform: translateY(92vh); animation-timing-function: cubic-bezier(.2, .6, .45, 1); }
  25% { transform: translateY(18vh); animation-timing-function: cubic-bezier(.55, 0, .8, .4); }
  50%, 100% { transform: translateY(92vh); }
}
@keyframes sky-day {
  0% { opacity: 0; }
  10%, 38% { opacity: 1; }
  48%, 100% { opacity: 0; }
}
@keyframes sky-night {
  0% { opacity: 1; }
  7%, 47% { opacity: 0; }
  58%, 100% { opacity: 1; }
}

/* Fuera de pantalla, el cielo se detiene */
.stage--title:not(.is-current) .sky *,
.stage--title:not(.is-current) .sky { animation-play-state: paused; }

.title {
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
}
.title__h { display: grid; justify-items: center; gap: 18px; }
.logo { display: grid; justify-items: center; line-height: .86; }
.logo__line {
  position: relative;
  display: block;
  /* Se ajusta al ancho y al alto para que el título quepa en pantallas bajas */
  font: 400 clamp(2.6rem, min(9vw, 9.5vh), 7.5rem)/.9 var(--f-display);
  letter-spacing: .02em;
  background: linear-gradient(180deg, #fffbe0 0%, #ffe066 30%, #ffb300 49%, #b85400 50%, #e88a10 70%, #ffd860 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px #3a1000;
}
.logo__line--big { font-size: clamp(4.2rem, min(17vw, 17vh), 13rem); }
/* Extrusión del rótulo, por detrás */
.logo__line::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  color: #5a1800;
  -webkit-text-stroke: 0;
  text-shadow: 2px 2px 0 #5a1800, 4px 4px 0 #4a1200, 6px 6px 0 #3a0c00, 8px 8px 0 #2a0800, 10px 12px 0 rgb(0 0 0 / .6);
}
.title__tag {
  display: block;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--cream);
  font: 700 clamp(var(--px-2xs), 1.82vw, 1.17rem)/1.6 var(--f-pixel);
  box-shadow: 4px 4px 0 var(--red);
}
.title__tag em { font-style: normal; color: var(--gold); }
.title__lead {
  max-width: 54ch;
  margin: 18px 0 14px;
  /* Placa oscura: el texto se lee igual de día, al atardecer y de noche */
  padding: 8px 14px;
  background: rgb(7 5 15 / .55);
  color: var(--cream);
  font-size: 1.05rem;
  text-shadow: 2px 2px 0 var(--ink);
}
.title__lead strong { color: var(--gold); }

.menu {
  display: grid;
  justify-items: start;
  gap: 4px;
  margin: 0;
  padding: 12px 22px;
  list-style: none;
  background: rgb(7 5 15 / .7);
  border: 3px solid var(--cream);
  outline: 3px solid var(--ink);
}
.menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  color: var(--text);
  font: 700 var(--px-xs)/1 var(--f-pixel);
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: 2px 2px 0 var(--ink);
}
.menu__cursor { width: 10px; height: 10px; color: var(--gold); opacity: 0; }
.menu__item--start { color: var(--gold); }
.menu__item--start .menu__cursor { opacity: 1; animation: blink .9s steps(1) infinite; }
.menu__item:focus-visible .menu__cursor { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .menu__item:hover { color: var(--gold); }
  .menu__item:hover .menu__cursor { opacity: 1; }
}
.insert-coin {
  margin-top: 16px;
  color: var(--gold);
  font: 700 1.04rem/1 var(--f-pixel);
  text-shadow: 3px 3px 0 var(--red);
  animation: blink 1.1s steps(1) infinite;
}

@media (max-width: 560px) {
  .title__lead { font-size: .98rem; }
}

/* Movimiento reducido: atardecer fijo con el sol a la derecha */
@media (prefers-reduced-motion: reduce) {
  .sky__track--sun { transform: translateX(78vw); }
  .sky__track--sun .sky__body { transform: translateY(52vh); }
  .sky__track--moon { display: none; }
}
