/* =========================================================
   Un jardín para ti — hoja de estilos
   Paleta: #091229 · #5E4AE3 · #F7A8D9 · #F7D77A · #FFFFFF · #7FDBFF
========================================================= */

:root {
  --navy: #091229;
  --navy-deep: #050a1a;
  --purple: #5E4AE3;
  --pink: #F7A8D9;
  --gold: #F7D77A;
  --pearl: #FFFFFF;
  --celeste: #7FDBFF;

  --glass-bg: rgba(9, 18, 41, 0.35);
  --glass-border: rgba(255, 255, 255, 0.16);

  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --font-ui: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --vh: 1vh; /* corregido por JS para móviles */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--navy);
  color: var(--pearl);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
}

.app {
  position: relative;
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, rgba(94, 74, 227, 0.25), transparent 60%),
    radial-gradient(ellipse 90% 60% at 80% 0%, rgba(127, 219, 255, 0.10), transparent 55%),
    linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 55%, #120a2b 100%);
  cursor: default;
}

/* ============ CIELO ============ */

.sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  mix-blend-mode: screen;
  will-change: transform;
}
.nebula--1 {
  width: 46vw; height: 46vw; left: -10vw; top: -8vw;
  background: radial-gradient(circle, var(--purple), transparent 70%);
  animation: driftA 46s ease-in-out infinite;
}
.nebula--2 {
  width: 40vw; height: 40vw; right: -12vw; top: 8vw;
  background: radial-gradient(circle, var(--pink), transparent 70%);
  animation: driftB 54s ease-in-out infinite;
}
.nebula--3 {
  width: 50vw; height: 50vw; left: 25vw; bottom: -22vw;
  background: radial-gradient(circle, var(--celeste), transparent 72%);
  opacity: 0.22;
  animation: driftA 60s ease-in-out infinite reverse;
}

@keyframes driftA {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(3vw, 4vw, 0) scale(1.08); }
}
@keyframes driftB {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-4vw, 3vw, 0) scale(1.06); }
}

.moon {
  position: absolute;
  top: 7%;
  right: 10%;
  width: min(9vw, 90px);
  height: min(9vw, 90px);
}
.moon__glow {
  position: absolute;
  inset: -60%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 215, 122, 0.55), rgba(247, 215, 122, 0.08) 55%, transparent 70%);
  filter: blur(6px);
  animation: moonPulse 6s ease-in-out infinite;
}
.moon__craters {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(9, 18, 41, 0.18) 0 8%, transparent 9%),
    radial-gradient(circle at 60% 60%, rgba(9, 18, 41, 0.14) 0 6%, transparent 7%),
    radial-gradient(circle at 70%, rgba(255,255,255,0.9), #FFF7DE 55%, var(--gold) 100%);
  box-shadow: 0 0 40px 6px rgba(247, 215, 122, 0.5);
}
@keyframes moonPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.stars-field {
  position: absolute;
  inset: 0;
  width: 2px;
  height: 2px;
  background: transparent;
  border-radius: 50%;
  animation: twinkle 5s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.constellations {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.constellations path {
  fill: none;
  stroke: var(--celeste);
  stroke-width: 1;
  opacity: 0.45;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(127, 219, 255, 0.6));
}

.shooting-stars { position: absolute; inset: 0; }
.shooting-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--pearl);
  border-radius: 50%;
  box-shadow: 0 0 6px 2px rgba(255,255,255,0.8);
  will-change: transform, opacity;
}
.shooting-star::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 90px;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(255,255,255,0.9), transparent);
}

/* ============ LUCIÉRNAGAS ============ */

.fireflies { position: absolute; inset: 0; pointer-events: none; }
.firefly {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px 3px rgba(247, 215, 122, 0.75);
  will-change: transform, opacity;
}

/* ============ MARIPOSAS ============ */

.butterflies { position: absolute; inset: 0; pointer-events: none; }
.butterfly { position: absolute; will-change: transform; }
.butterfly svg { display: block; transform-origin: center; }
.butterfly .wing {
  animation: flap 0.5s ease-in-out infinite alternate;
  transform-origin: 12px 12px;
}
@keyframes flap {
  0% { transform: scaleX(1); }
  100% { transform: scaleX(0.55); }
}

/* ============ JARDÍN ============ */

.garden {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.flower {
  position: absolute;
  bottom: 0;
  transform-origin: bottom center;
  will-change: transform;
  animation: sway var(--sway-dur, 6s) ease-in-out infinite;
  animation-delay: var(--sway-delay, 0s);
  filter: drop-shadow(0 0 6px var(--glow-color, rgba(247, 168, 217, 0.5)));
}
.flower svg { display: block; overflow: visible; }
.flower__bloom {
  transform-origin: center;
  animation: bloomOpen 1.6s cubic-bezier(.2,.9,.25,1) both;
  animation-delay: var(--bloom-delay, 0s);
}
@keyframes bloomOpen {
  0% { transform: scale(0.15); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes sway {
  0%, 100% { transform: rotate(-3.5deg); }
  50% { transform: rotate(3.5deg); }
}

.flower--pop {
  animation: bloomOpen 1.1s cubic-bezier(.2,.9,.25,1) both, sway var(--sway-dur, 6s) ease-in-out infinite;
}

/* ============ PARTÍCULAS ============ */

.particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity;
}

/* ============ ESCENARIO / MENSAJE ============ */

.stage {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vh, 28px);
  padding: 4vh 5vw;
  text-align: center;
}

.glass-card {
  position: relative;
  max-width: min(640px, 88vw);
  padding: clamp(24px, 4vw, 48px) clamp(20px, 5vw, 44px);
  border-radius: 22px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 20px 60px rgba(5, 10, 26, 0.55),
    0 0 40px rgba(94, 74, 227, 0.25);
  overflow: hidden;
}

.glass-card__sheen {
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, transparent, rgba(247, 215, 122, 0.15), transparent 30%);
  animation: sheenRotate 12s linear infinite;
  pointer-events: none;
}
@keyframes sheenRotate {
  to { transform: rotate(360deg); }
}

.message {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(16px, 2.4vw, 21px);
  line-height: 1.85;
  letter-spacing: 0.015em;
  color: var(--pearl);
  text-shadow: 0 0 18px rgba(247, 168, 217, 0.35), 0 0 2px rgba(255,255,255,0.4);
  white-space: pre-wrap;
  min-height: 1.85em;
}

.message .cursor-blink {
  display: inline-block;
  width: 0.5em;
  opacity: 0.6;
  animation: blink 1s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 1.2s ease forwards;
  animation-delay: 1s;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.03em;
  cursor: pointer;
  color: var(--pearl);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
}
.btn:hover { transform: translate3d(0, -2px, 0); }
.btn:active { transform: translate3d(0, 0, 0) scale(0.97); }
.btn:focus-visible {
  outline: 2px solid var(--celeste);
  outline-offset: 3px;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
}
.btn--ghost[aria-pressed="true"] {
  background: rgba(127, 219, 255, 0.18);
  box-shadow: 0 0 22px rgba(127, 219, 255, 0.35);
}

.btn--primary {
  background: linear-gradient(135deg, rgba(94, 74, 227, 0.55), rgba(247, 168, 217, 0.45));
  box-shadow: 0 8px 30px rgba(94, 74, 227, 0.35);
}
.btn--primary:hover {
  box-shadow: 0 10px 36px rgba(247, 168, 217, 0.45);
}

.btn__icon { font-size: 14px; color: var(--gold); }

.hint {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  opacity: 0;
  animation: fadeUp 1.2s ease forwards;
  animation-delay: 1.6s;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 640px) {
  .moon { top: 5%; right: 8%; width: 60px; height: 60px; }
  .message { font-size: 15px; line-height: 1.75; }
  .glass-card { padding: 22px 18px; border-radius: 18px; }
  .btn { padding: 10px 16px; font-size: 13px; }
}

@media (min-width: 1600px) {
  .glass-card { max-width: 720px; }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
