/* ============ Primaveras para ti ============ */
:root {
  --rose-100: #fff0f6;
  --rose-200: #ffd9e8;
  --rose-300: #ffb6d1;
  --rose-400: #ff8fab;
  --rose-500: #ff5c8d;
  --rose-600: #e0427a;
  --plum: #4a2745;
  --plum-2: #7a5270;
  --plum-3: #9c7a92;
  --lav: #c9b6ff;
  --gold: #ffcf5c;
  --green: #7cc47f;
  --font-head: 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Quicksand', system-ui, sans-serif;
  --font-hand: 'Caveat', cursive;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--plum);
  background: #ffe9f3;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overflow-x: hidden;
}

em { color: var(--rose-500); font-style: normal; }

/* ============ Cielo ============ */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, #fff7fb 0%, #ffe9f3 34%, #f3e6ff 72%, #ffe4ee 100%);
}

.sun {
  position: absolute;
  top: -90px;
  right: -70px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 206, 148, 0.8) 0%, rgba(255, 206, 148, 0) 68%);
  animation: sunPulse 6s ease-in-out infinite;
}
@keyframes sunPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.12); opacity: 1; }
}

.cloud {
  position: absolute;
  left: -220px;
  width: 120px;
  height: 34px;
  background: #fff;
  border-radius: 999px;
  filter: blur(14px);
  opacity: 0.75;
  animation: drift linear infinite;
}
.cloud::before {
  content: "";
  position: absolute;
  width: 70px;
  height: 50px;
  background: inherit;
  border-radius: 50%;
  top: -24px;
  left: 18px;
}
.c1 { top: 12vh; animation-duration: 90s; }
.c2 { top: 28vh; width: 170px; height: 40px; opacity: 0.55; animation-duration: 120s; animation-delay: -50s; }
.c3 { top: 7vh; width: 90px; height: 26px; opacity: 0.45; animation-duration: 70s; animation-delay: -25s; }
@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 440px)); }
}

.sparkle {
  position: absolute;
  font-size: 18px;
  opacity: 0.15;
  animation: twinkle 2.8s ease-in-out infinite;
}
.s1 { top: 18vh; left: 12%; }
.s2 { top: 42vh; right: 14%; animation-delay: 0.8s; }
.s3 { top: 66vh; left: 9%; animation-delay: 1.5s; }
.s4 { top: 30vh; right: 32%; font-size: 13px; animation-delay: 2s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.7) rotate(0deg); }
  50% { opacity: 0.9; transform: scale(1.15) rotate(24deg); }
}

.butterfly {
  position: absolute;
  top: 22vh;
  left: 0;
  font-size: 24px;
  animation: fly 36s ease-in-out infinite;
}
@keyframes fly {
  0% { transform: translate(-6vw, 0) rotate(8deg); }
  25% { transform: translate(30vw, -7vh) rotate(-8deg); }
  50% { transform: translate(68vw, 4vh) rotate(10deg); }
  75% { transform: translate(42vw, 15vh) rotate(-5deg); }
  100% { transform: translate(-6vw, 0) rotate(8deg); }
}

/* ============ Pétalos ============ */
#petals {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.petal {
  position: absolute;
  top: -6vh;
  opacity: 0.75;
  border-radius: 100% 0 100% 100%;
  animation: fall linear infinite;
}
.petal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  border-radius: inherit;
  animation: sway var(--sw, 3s) ease-in-out infinite alternate;
}
@keyframes fall {
  to { transform: translate3d(var(--drift, 3vw), 112vh, 0) rotate(300deg); }
}
@keyframes sway {
  from { transform: translateX(calc(var(--swamp, 12px) * -1)) rotate(-10deg); }
  to { transform: translateX(var(--swamp, 12px)) rotate(12deg); }
}

/* ============ Estructura ============ */
main { position: relative; z-index: 2; }

.sec {
  max-width: 660px;
  margin: 0 auto;
  padding: 64px 20px;
}

h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.7rem, 6.5vw, 2.3rem);
  line-height: 1.15;
  text-align: center;
  margin: 0 0 6px;
  color: var(--plum);
}

.sub {
  text-align: center;
  color: var(--plum-2);
  font-size: 0.98rem;
  font-weight: 500;
  margin: 0 auto;
  max-width: 42ch;
  line-height: 1.6;
}

.card {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow: 0 18px 50px -12px rgba(224, 66, 122, 0.18);
  padding: 26px 22px;
}
.card p {
  line-height: 1.7;
  color: #5c3a56;
  font-weight: 500;
  font-size: 0.98rem;
}

/* ============ Portada ============ */
.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 20px;
  padding: 0 24px;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose-600);
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 182, 209, 0.6);
  padding: 8px 16px;
  border-radius: 999px;
  margin: 0;
}

.hero h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.25rem, 9vw, 3.6rem);
  line-height: 1.08;
  margin: 0;
  color: var(--plum);
  text-wrap: balance;
}

.hflower {
  display: inline-block;
  animation: hsway 2.4s ease-in-out infinite alternate;
}
@keyframes hsway {
  from { transform: rotate(-14deg) scale(1); }
  to { transform: rotate(14deg) scale(1.1); }
}

.tw {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--plum-2);
  min-height: 1.7em;
  margin: 0;
  max-width: 30ch;
}

.cue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--plum);
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 182, 209, 0.7);
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 10px 26px -10px rgba(224, 66, 122, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cue:active { transform: scale(0.96); }
.cue-arrow { display: inline-block; animation: cueBounce 1.4s ease-in-out infinite; }
@keyframes cueBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ============ Jardín ============ */
.garden {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px 6px;
  justify-items: center;
  margin-top: 36px;
}

.flower {
  background: none;
  border: 0;
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.flower:nth-child(7) { grid-column: 1 / -1; justify-self: center; width: 62%; }

.fsvg {
  height: var(--h, 160px);
  width: auto;
  overflow: visible;
  transform-origin: 50% 100%;
  display: block;
}

.stem { stroke: var(--green); stroke-width: 5; fill: none; stroke-linecap: round; }
.leaf { fill: #9ed6a3; }
.petals ellipse { fill: var(--pc); }
.petals ellipse.alt { fill: var(--pl); }
.head {
  transform-box: view-box;
  transform-origin: 60px 62px;
  transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.head circle { fill: var(--gold); stroke: #ffb84d; stroke-width: 2.5; }

.flower .head { transform: scale(0.28) rotate(-30deg); }
.flower.open .head { transform: scale(1) rotate(0deg); }
.flower.open .fsvg { animation: swayStem 3.6s ease-in-out infinite alternate; }
@keyframes swayStem {
  from { transform: rotate(-1.6deg); }
  to { transform: rotate(1.8deg); }
}

.soil {
  width: 62%;
  height: 11px;
  background: linear-gradient(#c08a63, #8d6449);
  border-radius: 999px;
  margin-top: 2px;
  box-shadow: 0 6px 14px -6px rgba(141, 100, 73, 0.55);
}

.reason {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1.5px solid var(--rose-300);
  color: var(--plum);
  font-weight: 700;
  font-size: 0.84rem;
  padding: 6px 14px;
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.5s ease 0.55s, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.55s;
}
.flower.open .reason { opacity: 1; transform: scale(1); }

.progress {
  text-align: center;
  margin: 30px auto 0;
  color: var(--plum-2);
  font-weight: 600;
  font-size: 0.92rem;
}
.progress b { color: var(--rose-600); }

.done {
  margin: 26px auto 0;
  text-align: center;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.done.show { opacity: 1; transform: scale(1); }

/* ============ Cartas ============ */
.stack {
  position: relative;
  height: 300px;
  margin-top: 32px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.note {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(430px, 94%);
  height: 262px;
  background: #fffdf9;
  border: 1.5px dashed var(--rose-300);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 14px 30px -14px rgba(224, 66, 122, 0.35);
  transition: transform 0.5s cubic-bezier(0.33, 1, 0.6, 1), opacity 0.5s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.note-for {
  font-family: var(--font-hand);
  font-size: 1.3rem;
  color: var(--rose-500);
  margin: 0;
}
.note-body {
  font-family: var(--font-hand);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.32;
  color: var(--plum);
  margin: 12px 0 0;
}
.note-sign {
  margin-top: auto;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  color: var(--plum-2);
}

/* ============ Deseos ============ */
.wish { text-align: center; }

.wish-flower {
  --pc: #ff5c8d;
  --pl: #ffb3cf;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
  display: inline-block;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.wish .fsvg {
  --h: 210px;
  animation: swayStem 4s ease-in-out infinite alternate;
}
.wish .head { transform: scale(1); }
.wish-flower:active .fsvg { filter: brightness(1.05); }
.wish-flower.done .fsvg { filter: drop-shadow(0 0 18px rgba(255, 92, 141, 0.65)); }

.wish-line {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--plum);
  min-height: 2.6em;
  max-width: 26ch;
  margin: 16px auto 0;
  transition: opacity 0.3s ease;
}

/* ============ Cierre ============ */
footer {
  padding: 70px 20px 56px;
  text-align: center;
}
.hand {
  font-family: var(--font-hand);
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--plum);
  margin: 0;
}
.hand.small { font-size: 1.4rem; color: var(--plum-2); margin-top: 8px; }
.fine {
  font-size: 0.8rem;
  color: var(--plum-3);
  max-width: 48ch;
  margin: 16px auto 0;
  line-height: 1.65;
}

/* ============ Destellos al tocar ============ */
.float-glyph {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  font-size: 22px;
  left: 0;
  top: 0;
}

/* ============ Reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* ============ Accesibilidad ============ */
.flower:focus-visible,
.wish-flower:focus-visible,
.cue:focus-visible {
  outline: 3px solid var(--rose-500);
  outline-offset: 4px;
  border-radius: 20px;
}

/* ============ Escritorio ============ */
@media (min-width: 600px) {
  .garden { grid-template-columns: repeat(3, 1fr); gap: 34px 10px; }
  .flower:nth-child(7) { grid-column: 2; width: auto; justify-self: center; }
}

/* ============ Movimiento reducido ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.2s !important;
  }
  html { scroll-behavior: auto; }
  #petals, .butterfly { display: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ============ Desafío del amor (whack-a-mole) ============ */
.hud {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 20px 0 0;
}
.hud-box {
  background: rgba(255, 255, 255, 0.65);
  border: 1.5px solid rgba(255, 92, 141, 0.4);
  border-radius: 14px;
  padding: 8px 18px;
  text-align: center;
  min-width: 92px;
  box-shadow: 0 8px 18px -12px rgba(224, 66, 122, 0.4);
}
.hud-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--plum-3);
}
#score {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--plum);
}
#lives {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 2px;
}

.time-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 3px rgba(90, 40, 80, 0.15);
  overflow: hidden;
  margin: 14px 0 0;
}
#timeBar {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose-400), var(--rose-500));
  transition: width 1s linear;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 400px;
  margin: 22px auto 0;
}
.hole {
  position: relative;
  aspect-ratio: 1;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow: hidden;
}
/* macetero: caja de flores rosa con tierra adentro */
.hole::before {
  content: '';
  position: absolute;
  inset: 12% 13% 10% 13%;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 44%, #7c5230 0%, #7c5230 32%, transparent 34%),
    linear-gradient(180deg, var(--rose-300), var(--rose-400));
  z-index: 0;
}
/* borde frontal del macetero, tapa la base de la criatura */
.hole::after {
  content: '';
  position: absolute;
  left: 13%;
  right: 13%;
  bottom: 10%;
  height: 34%;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, var(--rose-400), var(--rose-500));
  z-index: 2;
  pointer-events: none;
}
.hole .creature {
  position: absolute;
  left: 50%;
  bottom: 32%;
  z-index: 1;
  font-size: 44px;
  line-height: 1;
  opacity: 0;
  transform: translate(-50%, 0);
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.hole.up .creature {
  opacity: 1;
  animation: popUp 0.32s cubic-bezier(0.2, 0.8, 0.3, 1.25),
    wobble 1.1s 0.3s ease-in-out infinite;
}
@keyframes popUp {
  from { transform: translate(-50%, 85%); }
  to { transform: translate(-50%, 0); }
}
@keyframes wobble {
  0%, 100% { margin-left: 0; }
  50% { margin-left: -5px; }
}
.hole .creature.whacked {
  animation: squash 0.4s ease forwards;
}
@keyframes squash {
  35% { transform: translate(-50%, 8%) scale(1.3, 0.55); }
  100% { transform: translate(-50%, 70%) scale(0.3, 0.3); opacity: 0; }
}
.hole .creature.broken {
  animation: heartbreak 0.55s ease forwards;
}
@keyframes heartbreak {
  30% { transform: translate(-50%, -26%) scale(1.25) rotate(-14deg); }
  100% { transform: translate(-50%, 34%) scale(0.25) rotate(40deg); opacity: 0; }
}

.game-msg {
  min-height: 3.4em;
  margin: 16px 0 12px;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--plum);
}
.game-btn {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--rose-400), var(--rose-500));
  border: 0;
  border-radius: 999px;
  padding: 13px 30px;
  cursor: pointer;
  box-shadow: 0 12px 24px -10px rgba(255, 92, 141, 0.7);
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.game-btn:active { transform: scale(0.95); }
.game-btn:focus-visible {
  outline: 3px solid var(--rose-500);
  outline-offset: 4px;
}
.game-btn.hide { display: none; }

@media (min-width: 600px) {
  .board { gap: 20px; }
  .hole .creature { font-size: 48px; }
}
