/* ==========================================================================
   Flores Moradas con Música — styles.css
   Two visual worlds: soft lavender cream welcome  →  nocturne starry experience.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  --bg-night: #17121F;
  --bg-welcome: #F7F3FA;
  --violeta: #9D4EDD;
  --violeta-mid: #C77DFF;
  --violeta-deep: #7B2CBF;
  --lila: #E0AAFF;
  --text-warm: #F4EFFA;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(199, 125, 255, 0.28);

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-eyebrow: 'Cinzel', 'Playfair Display', Georgia, serif;

  --ease-out: cubic-bezier(0.22, 0.8, 0.3, 1);
  --ease-soft: cubic-bezier(0.2, 0.9, 0.3, 1);
  --player-h: 74px;
}

/* --------------------------------------------------------------------------
   2. BASE / RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(15px, 1.05vw + 12px, 17px);
  line-height: 1.65;
  color: #2E2440;
  background-color: var(--bg-welcome);
  transition: background-color 1.2s ease;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.opened {
  background-color: var(--bg-night);
  color: var(--text-warm);
}

img,
svg { display: block; max-width: 100%; }

button { font: inherit; cursor: pointer; }

a { -webkit-tap-highlight-color: transparent; }

::selection {
  background: var(--violeta);
  color: #17121F;
}

:focus-visible {
  outline: 2px solid var(--violeta);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-solo {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
.cejilla {
  margin: 0 0 clamp(10px, 2vw, 16px);
  font-family: var(--font-eyebrow);
  font-weight: 600;
  font-size: clamp(10px, 0.6vw + 9px, 12px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #7B5EA7;
}

.cejilla-violeta {
  background: linear-gradient(90deg, var(--violeta-deep), var(--violeta), var(--violeta-mid));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.titulo {
  margin: 0 0 clamp(10px, 2vw, 18px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 5.2vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.ayuda {
  margin: 0 auto;
  max-width: 34ch;
  font-weight: 300;
  font-size: clamp(14px, 1.2vw + 11px, 17px);
  color: rgba(244, 239, 250, 0.72);
}

/* --------------------------------------------------------------------------
   4. WORLD A — WELCOME
   -------------------------------------------------------------------------- */
.inicio {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(20px, 6vw, 48px);
  text-align: center;
  background-color: var(--bg-welcome);
}

.inicio-vineta {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(199, 125, 255, 0.20) 0%, rgba(199, 125, 255, 0) 55%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0) 52%, rgba(190, 170, 220, 0.45) 100%);
}

.inicio-caja {
  position: relative;
  max-width: 640px;
}

.inicio-titulo {
  margin: 0 0 clamp(14px, 3vw, 24px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 8vw, 76px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  background: linear-gradient(105deg, #4C1D95 0%, var(--violeta-deep) 28%, var(--violeta) 52%, var(--violeta-mid) 74%, #A855F7 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brillo-texto 7s ease-in-out infinite;
}

.inicio-dedicatoria {
  margin: 0 auto clamp(26px, 5vw, 40px);
  max-width: 30ch;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(16px, 2vw + 12px, 22px);
  line-height: 1.55;
  color: #4A3F63;
}

.inicio-pie {
  margin: clamp(22px, 4vw, 34px) 0 0;
  font-family: var(--font-eyebrow);
  font-size: clamp(9px, 0.6vw + 8px, 11px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #8F7FAF;
}

/* Entrance of the welcome content (body.welcome-active) */
.welcome-active .inicio-caja > * {
  opacity: 0;
  animation: subir 0.9s var(--ease-out) forwards;
}
.welcome-active .inicio-caja > *:nth-child(1) { animation-delay: 0.15s; }
.welcome-active .inicio-caja > *:nth-child(2) { animation-delay: 0.30s; }
.welcome-active .inicio-caja > *:nth-child(3) { animation-delay: 0.55s; }
.welcome-active .inicio-caja > *:nth-child(4) { animation-delay: 0.80s; }
.welcome-active .inicio-pie { animation-delay: 1.05s; }

/* Gift button */
.btn-abrir {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 1.6vw, 14px);
  min-height: 56px;
  padding: clamp(13px, 2vw, 17px) clamp(22px, 4vw, 36px);
  border: 1px solid rgba(199, 125, 255, 0.65);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--violeta) 0%, var(--violeta-mid) 55%, var(--violeta-deep) 100%);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(14px, 1.4vw + 11px, 17px);
  letter-spacing: 0.01em;
  box-shadow: 0 12px 30px rgba(123, 44, 191, 0.35);
  animation: btn-brillo 2.8s ease-in-out infinite;
  transition: transform 0.3s var(--ease-soft), box-shadow 0.3s ease;
}

.btn-abrir:hover,
.btn-abrir:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(199, 125, 255, 0.5);
}

.btn-abrir:active { transform: translateY(0) scale(0.98); }

.btn-abrir-ico {
  display: inline-block;
  font-size: clamp(19px, 2vw + 13px, 26px);
  line-height: 1;
  animation: regalo 2.6s ease-in-out infinite;
}

.btn-abrir-texto { display: inline-block; }

/* Leaving: fade + scale out, then JS adds .oculto (display:none) */
.inicio.saliendo {
  animation: salir 0.9s var(--ease-soft) forwards;
  pointer-events: none;
}

.inicio.oculto { display: none; }

/* --------------------------------------------------------------------------
   5. WORLD B — NOKTURNE + STARS
   -------------------------------------------------------------------------- */
.experiencia {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  visibility: hidden;
}

body.opened .experiencia { visibility: visible; }

.cielo {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 26%, #221A3A 0%, var(--bg-night) 58%, #100C1A 100%);
}

/* Two layered star fields built from radial-gradients (no JS) */
.cielo::before,
.cielo::after {
  content: "";
  position: absolute;
  inset: -8%;
  pointer-events: none;
}

.cielo::before {
  background-image:
    radial-gradient(1.7px 1.7px at 34px 52px,  rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 100%),
    radial-gradient(1.2px 1.2px at 128px 18px, rgba(214, 183, 255, 0.9),  rgba(214, 183, 255, 0) 100%),
    radial-gradient(1px   1px   at 214px 96px, rgba(255, 255, 255, 0.8),  rgba(255, 255, 255, 0) 100%),
    radial-gradient(1.4px 1.4px at 78px 168px, rgba(233, 192, 255, 0.85), rgba(233, 192, 255, 0) 100%),
    radial-gradient(1px   1px   at 176px 214px, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 100%),
    radial-gradient(1.3px 1.3px at 258px 148px, rgba(199, 125, 255, 0.75),   rgba(199, 125, 255, 0) 100%);
  background-size: 280px 262px;
}

.cielo::after {
  opacity: 0.75;
  background-image:
    radial-gradient(1.1px 1.1px at 62px 34px,  rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 100%),
    radial-gradient(1.6px 1.6px at 196px 132px, rgba(207, 170, 255, 0.8), rgba(207, 170, 255, 0) 100%),
    radial-gradient(1px   1px   at 308px 62px,  rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 100%),
    radial-gradient(1.2px 1.2px at 144px 268px, rgba(233, 192, 255, 0.7), rgba(233, 192, 255, 0) 100%);
  background-size: 342px 318px;
  background-position: 40px 70px;
}

/* A few brighter, slowly twinkling stars */
.destello {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #F3E8FF;
  box-shadow: 0 0 10px 3px rgba(199, 125, 255, 0.55);
  opacity: 0.3;
  animation: titilar 4.2s ease-in-out infinite;
}

.destello-1 { top: 8%;  left: 12%; animation-delay: 0s;    transform: scale(1.1); }
.destello-2 { top: 17%; left: 78%; animation-delay: -0.9s; transform: scale(0.8); }
.destello-3 { top: 31%; left: 46%; animation-delay: -1.8s; transform: scale(1.3); }
.destello-4 { top: 46%; left: 8%;  animation-delay: -2.6s; transform: scale(0.9); }
.destello-5 { top: 58%; left: 88%; animation-delay: -1.2s; transform: scale(1.1); }
.destello-6 { top: 69%; left: 26%; animation-delay: -3.1s; transform: scale(0.75); }
.destello-7 { top: 12%; left: 60%; animation-delay: -2.2s; transform: scale(1); }
.destello-8 { top: 82%; left: 68%; animation-delay: -0.5s; transform: scale(1.2); }

/* Staggered reveal of the experience after the gift opens */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}

body.opened .reveal {
  opacity: 1;
  transform: none;
}

#ramo > *:nth-child(1) { transition-delay: 0.20s; }
#ramo > *:nth-child(2) { transition-delay: 0.35s; }
#ramo > *:nth-child(3) { transition-delay: 0.50s; }
#ramo > *:nth-child(4) { transition-delay: 0.68s; }
#cierre > *:nth-child(1) { transition-delay: 1s; }

/* --------------------------------------------------------------------------
   6. SECTIONS LAYOUT
   -------------------------------------------------------------------------- */
.seccion {
  position: relative;
  z-index: 3;
  padding:
    clamp(64px, 11vh, 116px)
    clamp(18px, 5vw, 44px)
    clamp(36px, 7vh, 72px);
  text-align: center;
}

.seccion-cierre {
  padding-bottom: calc(var(--player-h) + 46px + env(safe-area-inset-bottom));
}

/* --------------------------------------------------------------------------
   7. GLASS CARDS
   -------------------------------------------------------------------------- */
.panel-cierre,
.tarjeta-msg,
.reproductor {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.panel-cierre {
  position: relative;
  max-width: 660px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 48px) clamp(20px, 4vw, 44px);
  border-radius: clamp(20px, 3vw, 30px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
}

.panel-cierre::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(199, 125, 255, 0.10), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}

.cierre-texto {
  position: relative;
  margin: 0 auto clamp(24px, 4vw, 34px);
  max-width: 46ch;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(16px, 1.6vw + 12px, 21px);
  line-height: 1.7;
  color: var(--text-warm);
}

.cierre-firma {
  position: relative;
  margin: clamp(22px, 4vw, 30px) 0 0;
  font-family: var(--font-eyebrow);
  font-size: clamp(9px, 0.6vw + 8px, 11px);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(199, 125, 255, 0.6);
}

/* --------------------------------------------------------------------------
   8. BOUQUET SVG + HOVER GLOW
   -------------------------------------------------------------------------- */
.ramo-wrap {
  position: relative;
  margin-top: clamp(18px, 4vw, 34px);
}

/* Soft radial violet glow behind the bouquet */
.ramo-wrap::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  width: 80%;
  height: 68%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
    rgba(199, 125, 255, 0.30) 0%,
    rgba(199, 125, 255, 0.12) 45%,
    rgba(199, 125, 255, 0) 72%);
  filter: blur(26px);
  pointer-events: none;
}

.ramo-svg {
  position: relative;
  width: min(94vw, 470px);
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.hojas { opacity: 0.95; }

.flor {
  cursor: pointer;
  outline: none;
  transform-box: fill-box;
  transform-origin: 50% 56%;
  transition: transform 0.35s var(--ease-soft), filter 0.35s ease;
}

.flor-sway {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: balanceo 5.4s ease-in-out infinite;
}

.flor[data-index="1"] .flor-sway { animation-delay: -0.7s; animation-duration: 6.1s; }
.flor[data-index="2"] .flor-sway { animation-delay: -1.5s; animation-duration: 5.8s; }
.flor[data-index="3"] .flor-sway { animation-delay: -2.3s; animation-duration: 6.4s; }
.flor[data-index="4"] .flor-sway { animation-delay: -3.1s; animation-duration: 5.6s; }
.flor[data-index="5"] .flor-sway { animation-delay: -1.1s; animation-duration: 6.6s; }
.flor[data-index="6"] .flor-sway { animation-delay: -2.7s; animation-duration: 5.2s; }

.flor:hover,
.flor:focus-visible {
  transform: scale(1.1);
  filter: drop-shadow(0 0 16px rgba(199, 125, 255, 0.75));
}

.flor:active { transform: scale(1.04); }

.foco {
  fill: none;
  stroke: var(--violeta);
  stroke-width: 3;
  stroke-dasharray: 7 9;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.flor:focus-visible .foco,
.flor:focus .foco { opacity: 0.95; }

/* --------------------------------------------------------------------------
   9. FLOWER OPEN STATES
   -------------------------------------------------------------------------- */
.flor.abierta .flor-sway {
  filter: saturate(1.28) brightness(1.1);
}

.flor.pop {
  animation: pop 0.55s var(--ease-soft);
}

.anillo {
  fill: none;
  stroke: var(--violeta);
  stroke-width: 3.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  pointer-events: none;
}

.flor-nueva .anillo {
  opacity: 1;
  animation: anillo-pulso 2.4s ease-out infinite;
}

.flor-nueva .flor-sway { animation-duration: 4.6s; }

/* --------------------------------------------------------------------------
   10. MESSAGE CARD (shared, only one at a time)
   -------------------------------------------------------------------------- */
.fondo-msg {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(12, 8, 18, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0s linear 0.4s;
}

.fondo-msg.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.35s ease, visibility 0s linear 0s;
}

.tarjeta-msg {
  position: fixed;
  z-index: 60;
  width: min(374px, calc(100vw - 28px));
  padding: clamp(24px, 4vw, 34px) clamp(22px, 3.5vw, 32px) clamp(20px, 3vw, 26px);
  border-radius: clamp(20px, 2.5vw, 28px);
  text-align: center;
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.5),
    0 0 42px rgba(199, 125, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.96);
  transition:
    opacity 0.35s ease,
    transform 0.45s var(--ease-soft),
    visibility 0s linear 0.45s;
}

.tarjeta-msg.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition:
    opacity 0.35s ease,
    transform 0.45s var(--ease-soft),
    visibility 0s linear 0s;
}

.msg-ornamento {
  margin: 0 0 clamp(6px, 1.5vw, 12px);
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1;
}

.msg-titulo {
  margin: 0 0 clamp(8px, 1.6vw, 14px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(21px, 3vw, 27px);
  line-height: 1.2;
  background: linear-gradient(100deg, var(--violeta-deep), var(--violeta), var(--violeta-mid));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.msg-cuerpo {
  margin: 0;
  font-weight: 300;
  font-size: clamp(14.5px, 1.2vw + 11px, 16.5px);
  line-height: 1.72;
  color: var(--text-warm);
}

.msg-pie {
  margin: clamp(14px, 2.5vw, 20px) 0 0;
  font-family: var(--font-eyebrow);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(199, 125, 255, 0.55);
}

.btn-cerrar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(199, 125, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-warm);
  font-size: 16px;
  line-height: 1;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.btn-cerrar:hover,
.btn-cerrar:focus-visible {
  background: rgba(199, 125, 255, 0.18);
  border-color: var(--violeta);
  transform: rotate(90deg);
}

/* --------------------------------------------------------------------------
   11. MUSIC PLAYER + RANGE
   -------------------------------------------------------------------------- */
.reproductor {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 18px);
  min-height: var(--player-h);
  padding:
    11px clamp(14px, 3vw, 26px)
    calc(11px + env(safe-area-inset-bottom));
  background: rgba(23, 18, 31, 0.74);
  border-top: 1px solid var(--glass-border);
  transform: translateY(140%);
  opacity: 0;
  transition:
    transform 0.85s var(--ease-soft) 0.9s,
    opacity 0.6s ease 0.9s;
}

body.opened .reproductor {
  transform: none;
  opacity: 1;
}

.ecualizador {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  flex: 0 0 auto;
}

.ecualizador span {
  display: block;
  width: 3px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(to top, var(--violeta-deep), var(--violeta));
  opacity: 0.45;
  animation: eq 1.05s ease-in-out infinite;
  animation-play-state: paused;
}

.ecualizador span:nth-child(2) { animation-delay: -0.22s; }
.ecualizador span:nth-child(3) { animation-delay: -0.44s; }
.ecualizador span:nth-child(4) { animation-delay: -0.66s; }
.ecualizador span:nth-child(5) { animation-delay: -0.88s; }

.reproductor.sonando .ecualizador span {
  animation-play-state: running;
  opacity: 1;
}

.btn-musica {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(199, 125, 255, 0.45);
  border-radius: 50%;
  background: linear-gradient(140deg, rgba(199, 125, 255, 0.22), rgba(199, 125, 255, 0.06));
  color: var(--violeta);
  font-size: 14px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-musica:hover,
.btn-musica:focus-visible {
  transform: scale(1.07);
  box-shadow: 0 0 22px rgba(199, 125, 255, 0.45);
}

.btn-musica .ico {
  position: absolute;
  display: block;
  line-height: 1;
  transition: opacity 0.25s ease, transform 0.35s var(--ease-soft);
}

.btn-musica .ico-pausa { opacity: 0; transform: scale(0.5) rotate(-45deg); letter-spacing: -2px; }
.btn-musica .ico-play  { opacity: 1; transform: scale(1); }

.reproductor.sonando .btn-musica .ico-play  { opacity: 0; transform: scale(0.5) rotate(45deg); }
.reproductor.sonando .btn-musica .ico-pausa { opacity: 1; transform: scale(1) rotate(0deg); }

.pista {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pista-titulo {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(12px, 1vw + 10px, 14px);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-warm);
}

.tiempos {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: rgba(244, 239, 250, 0.6);
}

.barra {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  outline: none;
  cursor: pointer;
}

.barra::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.barra::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -4.5px;
  border: 2px solid #17121F;
  border-radius: 50%;
  background: var(--violeta);
  box-shadow: 0 0 12px rgba(199, 125, 255, 0.75);
}

.barra::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.barra::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violeta-deep), var(--violeta));
}

.barra::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid #17121F;
  border-radius: 50%;
  background: var(--violeta);
  box-shadow: 0 0 12px rgba(199, 125, 255, 0.75);
}

.nota-musica {
  margin: 0;
  font-size: 13px;
  font-weight: 300;
  color: rgba(244, 239, 250, 0.75);
}

.reproductor.sin-progreso .ecualizador,
.reproductor.sin-progreso .pista,
.reproductor.sin-progreso .btn-musica { display: none; }

/* --------------------------------------------------------------------------
   12. PETALS + SPARKLES (keyframes)
   -------------------------------------------------------------------------- */
.petalos,
.chispas {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.petalos { z-index: 2; }
.chispas { z-index: 120; }

.petalo {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--size, 16px);
  height: calc(var(--size, 16px) * 1.3);
  border-radius: 62% 12% 62% 14%;
  background: linear-gradient(145deg, #F9EFFF 0%, var(--pc, var(--lila)) 62%, #A06CD9 100%);
  filter: blur(var(--blur, 0px));
  opacity: 0;
  animation: caer var(--dur, 10s) linear var(--delay, 0s) 1 both;
  will-change: transform, opacity;
}

.petalo-2 {
  background: linear-gradient(145deg, #F3E4FF 0%, var(--violeta-mid) 65%, var(--violeta-deep) 100%);
}

.petalo-3 {
  background: linear-gradient(145deg, #FDFAFF 0%, #EFE3FA 62%, #D4C0EB 100%);
}

.chispa {
  position: fixed;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFFFFF 0%, var(--violeta) 42%, rgba(199, 125, 255, 0) 72%);
  box-shadow: 0 0 14px 2px rgba(199, 125, 255, 0.85);
  opacity: 0;
  animation: chispa 0.95s cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
  will-change: transform, opacity;
}

@keyframes caer {
  0% {
    opacity: 0;
    transform: translate3d(calc(var(--x, 50) * 1vw), -14vh, 0) rotate(0deg);
  }
  8%  { opacity: var(--op, 0.88); }
  20% { transform: translate3d(calc((var(--x, 50) + var(--sway, 6)) * 1vw), 12vh, 0) rotate(calc(var(--rot, 0) * 0.35deg)); }
  40% { transform: translate3d(calc((var(--x, 50) - var(--sway, 6)) * 1vw), 38vh, 0) rotate(calc(var(--rot, 0) * 0.95deg)); }
  60% { transform: translate3d(calc((var(--x, 50) + var(--sway, 6)) * 1vw), 64vh, 0) rotate(calc(var(--rot, 0) * 1.55deg)); }
  80% {
    opacity: var(--op, 0.88);
    transform: translate3d(calc((var(--x, 50) - var(--sway, 6) * 0.8) * 1vw), 90vh, 0) rotate(calc(var(--rot, 0) * 2.1deg));
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(var(--x, 50) * 1vw), 114vh, 0) rotate(calc(var(--rot, 0) * 2.6deg));
  }
}

@keyframes chispa {
  0%   { opacity: 1; transform: translate(-50%, -50%) translate(0, 0) scale(0.6); }
  100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--dx, 0), var(--dy, 0)) scale(0); }
}

@keyframes btn-brillo {
  0%, 100% { box-shadow: 0 12px 30px rgba(123, 44, 191, 0.32), 0 0 0 0 rgba(199, 125, 255, 0.45); }
  50%      { box-shadow: 0 16px 38px rgba(123, 44, 191, 0.45), 0 0 0 16px rgba(199, 125, 255, 0); }
}

@keyframes regalo {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-5px) rotate(6deg); }
}

@keyframes brillo-texto {
  0%, 100% { background-position: 0% center; }
  50%      { background-position: 100% center; }
}

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

@keyframes salir {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.06); visibility: hidden; }
}

@keyframes titilar {
  0%, 100% { opacity: 0.18; }
  50%      { opacity: 0.95; }
}

@keyframes balanceo {
  0%, 100% { transform: rotate(-1.6deg); }
  50%      { transform: rotate(2deg); }
}

@keyframes anillo-pulso {
  0%   { transform: scale(0.84); opacity: 0.95; }
  70%  { transform: scale(1.14); opacity: 0; }
  100% { transform: scale(1.14); opacity: 0; }
}

@keyframes pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.24); }
  100% { transform: scale(1.1); }
}

@keyframes eq {
  0%, 100% { height: 5px; }
  50%      { height: 21px; }
}

/* --------------------------------------------------------------------------
   13. WHATSAPP / CIERRE ACTIONS
   -------------------------------------------------------------------------- */
.btn-whatsapp {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 12px);
  max-width: 100%;
  min-height: 54px;
  padding: 14px clamp(18px, 3vw, 28px);
  border: 1px solid rgba(37, 211, 102, 0.55);
  border-radius: 999px;
  background:
    linear-gradient(140deg, rgba(199, 125, 255, 0.16), rgba(37, 211, 102, 0.16));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #EAFBF0;
  font-weight: 600;
  font-size: clamp(13.5px, 1vw + 11px, 15.5px);
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(199, 125, 255, 0.16) inset;
  transition: transform 0.3s var(--ease-soft), box-shadow 0.3s ease, background 0.3s ease;
}

.btn-whatsapp:hover,
.btn-whatsapp:focus-visible {
  transform: translateY(-3px);
  background: linear-gradient(140deg, rgba(199, 125, 255, 0.26), rgba(37, 211, 102, 0.26));
  box-shadow:
    0 20px 46px rgba(0, 0, 0, 0.45),
    0 0 26px rgba(37, 211, 102, 0.35),
    0 0 26px rgba(199, 125, 255, 0.2);
}

.btn-whatsapp-ico {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #25D366;
  box-shadow: 0 0 16px rgba(37, 211, 102, 0.6);
  font-size: 15px;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   14. RESPONSIVE — 768px
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root { --player-h: 86px; }

  .ramo-svg { width: min(96vw, 420px); }

  .ayuda { max-width: 26ch; }

  .tarjeta-msg {
    width: calc(100vw - 24px);
    padding-top: clamp(28px, 6vw, 34px);
  }

  .reproductor {
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .ecualizador { display: none; }

  .pista-titulo { font-size: 12.5px; }

  .btn-whatsapp {
    width: 100%;
    text-align: center;
    border-radius: 22px;
  }
}

/* --------------------------------------------------------------------------
   15. RESPONSIVE — 480px
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .seccion {
    padding-left: 16px;
    padding-right: 16px;
  }

  .inicio-dedicatoria { max-width: 26ch; }

  .btn-abrir {
    width: 100%;
    justify-content: center;
  }

  .ramo-svg { width: 96vw; }

  .panel-cierre { border-radius: 20px; }

  .msg-ornamento { font-size: 30px; }

  .btn-musica { width: 44px; height: 44px; }
}

/* --------------------------------------------------------------------------
   16. ACCESSIBILITY
   -------------------------------------------------------------------------- */
.btn-abrir:focus-visible,
.btn-musica:focus-visible,
.btn-cerrar:focus-visible,
.btn-whatsapp:focus-visible,
.barra:focus-visible {
  outline: 3px solid var(--violeta);
  outline-offset: 3px;
}

.flor:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.2s !important;
    transition-delay: 0s !important;
  }

  .reveal { transform: none; }
  .btn-abrir { animation: none; }
  .destello { animation: none; opacity: 0.6; }
  .flor-sway { animation: none; }
  .anillo { animation: none; opacity: 0.8; }
  .petalo,
  .chispa { display: none; }
}
