body {
  height: 100%;
  width: 100%;
  background: #080f1a;
  overflow: hidden;
}

/* === Escena y ramo de rosas moradas (añadido) === */
.scene {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.ground {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 120px;
  background: linear-gradient(to top, #0b0a10, #121026);
  box-shadow: 0 -40px 100px rgba(0,0,0,0.35) inset;
}

.bouquet {
  position: absolute;
  left: 50%;
  bottom: 140px;
  transform: translateX(-50%);
  width: 0; height: 220px;
}
.bouquet .flower { left: 0; bottom: 0; transform: rotate(var(--angle)); }

.stem {
  width: 7px;
  height: 140px;
  background: linear-gradient(#2e7a57, #3aaa78);
  border-radius: 999px;
  transform: scaleY(0);
  transform-origin: bottom center;
  animation: growStem var(--stem, 4.5s) ease-out var(--delay, 0s) forwards;
  position: relative;
}
.stem::before, .stem::after {
  content: '';
  position: absolute;
  width: 22px; height: 12px;
  background: radial-gradient(20px 10px at 20px 6px, #3aaa78, #2e7a57);
  border-radius: 999px;
  top: 45%; left: 50%;
  transform-origin: left center;
  opacity: 0;
}
.stem::before { transform: rotate(-35deg) translateX(6px); animation: leafIn 1.4s ease-out calc(var(--delay, 0s) + var(--stem, 4.5s) * 0.4) forwards; }
.stem::after  { transform: rotate(35deg)  translateX(6px); animation: leafIn 1.4s ease-out calc(var(--delay, 0s) + var(--stem, 4.5s) * 0.6) forwards; top: 60%; }

.blossom {
  position: absolute;
  left: 50%; bottom: calc(100% - 6px);
  transform: translateX(-50%) scale(0.01);
  transform-origin: center bottom;
  width: 86px; height: 86px;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.35));
  animation: bloom 2.6s cubic-bezier(.2,.7,0,.98) calc(var(--delay, 0s) + var(--stem, 4.5s) - 0.5s) forwards;
}
.blossom::before {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 40px; height: 40px; transform: translate(-50%, -50%);
  background: radial-gradient(20px 20px at 50% 50%, #a77bff 10%, #7b45d8 40%, transparent 65%);
  border-radius: 50%; filter: blur(0.4px);
}

.petal {
  --count: var(--count, 12);
  position: absolute; left: 50%; top: 50%;
  width: 34px; height: 52px;
  background: radial-gradient(28px 44px at 18px 22px, #b38cff, #6a3bb8);
  border-radius: 18px 18px 30px 30px;
  transform-origin: 50% 90%;
  transform: rotate(calc(var(--i) * (360deg / var(--count)))) translateY(-20px);
  opacity: 0;
  animation: petalIn 0.95s ease-out calc(var(--delay, 0s) + var(--stem, 4.5s) + (var(--i) * 0.08s)) forwards;
}
.center {
  position: absolute; left: 50%; top: 50%;
  width: 20px; height: 20px;
  background: radial-gradient(12px 12px at 50% 50%, #ffe27a, #ffd24d);
  border-radius: 50%; transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(255, 210, 77, 0.45);
}

.message {
  position: fixed;
  left: 50%; top: 12vh;
  transform: translateX(-50%);
  font-family: 'Marcellus', serif;
  letter-spacing: 0.5px;
  font-size: clamp(24px, 4.5vw, 56px);
  text-align: center; color: #eae6ff;
  text-shadow: 0 2px 8px rgba(140, 120, 255, 0.35);
  opacity: 0; filter: blur(6px);
  transition: opacity 800ms ease, filter 800ms ease, transform 800ms ease;
}
.message.show { opacity: 1; filter: blur(0); transform: translateX(-50%) scale(1.02); animation: glowPulse 1.2s ease-in-out 0.2s infinite; }

.open-btn {
  position: fixed; left: 50%; top: 50vh; transform: translate(-50%, -50%);
  padding: 10px 16px; border-radius: 12px;
  border: 1px solid rgba(200, 170, 255, 0.35);
  background: linear-gradient(180deg, rgba(90,60,170,0.9), rgba(60,40,120,0.9));
  color: #eae6ff; font-weight: 600; letter-spacing: .3px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  opacity: 0; filter: blur(4px);
  transition: opacity 600ms ease, filter 600ms ease, transform 200ms ease;
}
.open-btn.show {
    opacity: 1;
    filter: blur(0);
    z-index: 99;
}
.open-btn:hover { transform: translate(-50%, calc(-50% - 2px)); }
.open-btn:active { transform: translate(-50%, -50%); }

.card {
    position: fixed;
    left: 50%;
    top: 16vh;
    transform: translateX(-50%);
    width: min(92vw, 740px);
    background: linear-gradient(180deg, rgba(40, 34, 70, 0.7), rgba(26, 22, 48, 0.7));
    backdrop-filter: blur(8px);
    border: 1px solid rgba(180, 150, 255, 0.25);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45), 0 0 0 8px rgba(100, 70, 200, 0.08) inset;
    padding: 18px 20px;
    opacity: 0;
    transform-origin: center bottom;
    transition: opacity 800ms ease, transform 800ms ease;
}
.card.show { opacity: 1; transform: translateX(-50%) scale(1.01); animation: floatY 5s ease-in-out 1s infinite; z-index: 99;}
.card h2 { margin: 0 0 10px; font-family: 'Marcellus', serif; font-weight: 400; color: #e8dcff; }
.card-body { display: grid; grid-template-columns: 1fr 220px; gap: 16px; align-items: center; }
.photo-frame { width: 100%; aspect-ratio: 3 / 2; background: repeating-linear-gradient(45deg, rgba(255,255,255,0.06), rgba(255,255,255,0.06) 6px, rgba(255,255,255,0.03) 6px, rgba(255,255,255,0.03) 12px); border-radius: 16px; border: 1px solid rgba(200, 170, 255, 0.3); display: grid; place-items: center; overflow: hidden; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.actions { display: flex; justify-content: center; }
.upload { display: inline-block; border: 1px solid rgba(200, 170, 255, 0.35); color: #eae6ff; padding: 10px 14px; border-radius: 12px; cursor: pointer; user-select: none; transition: transform 0.2s ease, box-shadow 0.2s ease; box-shadow: 0 6px 16px rgba(0,0,0,0.35); }
.upload:hover { transform: translateY(-2px); }
.upload:active { transform: translateY(0); }
.upload input { display: none; }
.note { grid-column: 1 / -1; margin: 8px 0 0; color: #d9d2ff; font-size: 14px; opacity: 0.85; }

@keyframes growStem { from { transform: scaleY(0); } 60% { transform: scaleY(1.06); } to { transform: scaleY(1); } }
@keyframes leafIn { from { opacity: 0; transform: translateX(6px) scale(0.8); } to { opacity: 1; transform: translateX(6px) scale(1); } }
@keyframes bloom { 0% { transform: translateX(-50%) scale(0.01); } 60% { transform: translateX(-50%) scale(1.08); } 100% { transform: translateX(-50%) scale(1); } }
@keyframes petalIn { from { opacity: 0; transform: rotate(calc(var(--i) * (360deg / var(--count)))) translateY(-20px) scale(0.85); } to { opacity: 1; transform: rotate(calc(var(--i) * (360deg / var(--count)))) translateY(-20px) scale(1); } }
@keyframes glowPulse { 0% { text-shadow: 0 2px 8px rgba(140, 120, 255, 0.35), 0 0 0 rgba(140,120,255,0); } 50% { text-shadow: 0 2px 12px rgba(160, 140, 255, 0.6), 0 0 12px rgba(140,120,255,0.35); } 100% { text-shadow: 0 2px 8px rgba(140, 120, 255, 0.35), 0 0 0 rgba(140,120,255,0); } }
@keyframes floatY { 0% { transform: translateX(-50%) translateY(0) scale(1.01); } 50% { transform: translateX(-50%) translateY(-6px) scale(1.01); } 100% { transform: translateX(-50%) translateY(0) scale(1.01); } }

.container {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.glass {
  height: 350px;
  width: 200px;
  background: #122139;
  border-radius: 300px 300px 0px 0px;
}
.glass:before {
  content: "";
  height: 10px;
  width: 10px;
  transform-origin: center;
  border: 10px solid #122139;
  border-radius: 100%;
  position: absolute;
  left: 87px;
  top: -25px;
}
.glass:after {
  content: "";
  position: absolute;
  height: 15px;
  width: 250px;
  background: #6a1b9a; /* morado profundo para la base */
  top: 100%;
  left: -13%;
}

.shine {
  width: 12px;
  height: 140px;
  background: #e9d5ff; /* brillo en tono lavanda */
  opacity: 0.2;
  position: absolute;
  left: 85%;
  top: 80px;
  border-radius: 100px;
  z-index: 10;
}
.shine:before {
  content: "";
  width: 12px;
  height: 20px;
  position: absolute;
  background: #e9d5ff; /* brillo en tono lavanda */
  top: 160px;
  border-radius: 100px;
}

.petals > div {
  position: absolute;
  background: #9c27b0; /* pétalos morados principales */
  width: 45px;
  height: 80px;
  top: 55px;
  transition: all 0.5s ease-out;
}
.petals > div:nth-child(1) {
  border-radius: 15px;
  box-shadow: 0px 0px 30px #c084fc; /* brillo morado */
  left: 80px;
  top: 60px;
  background: #9c27b0;
}
.petals > div:nth-child(2), .petals > div:nth-child(4), .petals > div:nth-child(6) {
  background: #7b1fa2; /* variación morada oscura */
  left: 60px;
  border-radius: 0px 30px 0px 30px;
  transform-origin: bottom right;
}
.petals > div:nth-child(3), .petals > div:nth-child(5), .petals > div:nth-child(7) {
  background: #7b1fa2; /* variación morada oscura */
  left: 100px;
  border-radius: 30px 0px 30px 0px;
  transform-origin: bottom left;
}
.petals > div:nth-child(2) {
  z-index: 5;
  background: #8e24aa; /* morado medio */
  top: 75px;
  height: 70px;
  box-shadow: 0px 0px 50px rgba(192, 132, 252, 0.5);
  animation: bloom2 3s ease-in-out;
  animation-fill-mode: forwards;
}
.petals > div:nth-child(3) {
  z-index: 4;
  background: #8e24aa; /* morado medio */
  top: 75px;
  height: 70px;
  box-shadow: 0px 0px 50px rgba(192, 132, 252, 0.5);
  animation: bloom3 3s ease-in-out, glowing 2.5s ease-in-out infinite;
  animation-fill-mode: forwards;
}
.petals > div:nth-child(4) {
  z-index: 3;
  background: #7b1fa2; /* morado oscuro */
  top: 70px;
  height: 75px;
  box-shadow: 0px 0px 50px rgba(192, 132, 252, 0.5);
  animation: bloom4 3s ease-in-out, glowing 2.5s ease-in-out infinite;
  animation-fill-mode: forwards;
}
.petals > div:nth-child(5) {
  z-index: 2;
  background: #7b1fa2; /* morado oscuro */
  top: 70px;
  height: 75px;
  box-shadow: 0px 0px 50px rgba(192, 132, 252, 0.5);
  animation: bloom5 3s ease-in-out, glowing 2.5s ease-in-out infinite;
  animation-fill-mode: forwards;
}
.petals > div:nth-child(6) {
  z-index: 1;
  background: #6a1b9a; /* morado profundo */
  top: 65px;
  height: 70px;
  box-shadow: 0px 0px 50px rgba(192, 132, 252, 0.3);
  animation: bloom6 3s ease-in-out, glowing 2.5s ease-in-out infinite;
  animation-fill-mode: forwards;
}
.petals > div:nth-child(7) {
  z-index: 0;
  background: #6a1b9a; /* morado profundo */
  top: 65px;
  height: 70px;
  box-shadow: 0px 0px 50px rgba(192, 132, 252, 0.3);
  animation: bloom7 3s ease-in-out, glowing 2.5s ease-in-out infinite;
  animation-fill-mode: forwards;
}

.deadPetals > div {
  position: absolute;
  background: #9c27b0; /* pétalos caídos morados */
  width: 20px;
  height: 15px;
  top: 120px;
  border-radius: 0px 30px 0px 30px;
  box-shadow: 0px 0px 30px rgba(192, 132, 252, 0.5);
  transition: all 0.5s ease-out;
}
.deadPetals > div:nth-child(1) {
  left: 104px;
  transform: rotate(-30deg);
  animation: falling 20s 4s ease-in-out infinite;
}
.deadPetals > div:nth-child(2) {
  left: 107px;
  transform: rotate(-30deg);
  animation: falling 20s 8s ease-in-out infinite;
}
.deadPetals > div:nth-child(3) {
  left: 82px;
  transform: rotate(-30deg);
  animation: falling 20s 12s ease-in-out infinite;
}
.deadPetals > div:nth-child(4) {
  left: 114px;
  transform: rotate(-30deg);
  animation: falling 20s 16s ease-in-out infinite;
}

.leaves > div:nth-last-child(1) {
  position: absolute;
  width: 55px;
  height: 30px;
  background: #338f37;
  top: 120px;
  left: 75px;
  border-radius: 100px;
}
.leaves > div:nth-child(1) {
  position: absolute;
  width: 6px;
  height: 210px;
  background: #054c05;
  top: 95px;
  left: 100px;
  border-radius: 0 0 100px 100px;
}
.leaves > div:nth-child(2) {
  position: absolute;
  width: 30px;
  height: 50px;
  top: 53px;
  border-radius: 5px 40px 20px 40px;
  background: #054c05;
  transform-origin: bottom;
  transform: rotate(-30deg);
  top: 180px;
  left: 80px;
  box-shadow: inset 5px 5px #066406;
}
.leaves > div:nth-child(3) {
  position: absolute;
  width: 30px;
  height: 50px;
  top: 53px;
  border-radius: 40px 5px 40px 20px;
  background: #054c05;
  transform-origin: bottom;
  transform: rotate(30deg);
  top: 150px;
  left: 95px;
  box-shadow: inset -5px 5px #066406;
}

.thorns > div {
  position: absolute;
  width: 0;
  height: 0;
  top: 140px;
}
.thorns > div:nth-child(odd) {
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 5px solid #054c05;
  left: 105px;
}
.thorns > div:nth-child(even) {
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 5px solid #054c05;
  left: 95px;
}
.thorns > div:nth-child(1) {
  top: 200px;
}
.thorns > div:nth-child(2) {
  top: 170px;
}
.thorns > div:nth-child(4) {
  top: 230px;
}

@keyframes bloom2 {
  50% {
    transform: rotate(-90deg);
    top: 200px;
    left: 100px;
  }
  100% {
    transform: rotate(-60deg);
    top: 252px;
    left: 50px;
    background: #711264;
    box-shadow: 0px 0px 0px rgba(245, 148, 184, 0);
  }
}
@keyframes bloom3 {
  100% {
    transform: rotate(45deg);
  }
}
@keyframes bloom4 {
  100% {
    transform: rotate(-20deg);
  }
}
@keyframes bloom5 {
  100% {
    transform: rotate(20deg);
  }
}
@keyframes bloom6 {
  100% {
    transform: rotate(-5deg);
  }
}
@keyframes bloom7 {
  100% {
    transform: rotate(5deg);
  }
}
@keyframes glowing {
  50% {
    background: #d736a1;
    box-shadow: 0px 0px 60px #f594b8;
  }
}
@keyframes falling {
  20% {
    top: 335px;
    background: #9d1992;
    box-shadow: 0px 0px 0px rgba(245, 148, 184, 0);
  }
  100% {
    top: 335px;
    opacity: 0;
  }
}
/* Grid del card */
.card-body {
  text-align: center;
  display: grid;
  grid-template-columns: 1fr 260px; /* texto | foto */
  gap: 16px;
  align-items: center;
}

/* Marco para la imagen (mejora visual) */
.photo-frame {
  width: 100%;
  aspect-ratio: 4 / 5;                 /* retrato vertical elegante */
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.06),
    rgba(255,255,255,0.06) 6px,
    rgba(255,255,255,0.03) 6px,
    rgba(255,255,255,0.03) 12px
  );
  border-radius: 16px;
  border: 1px solid rgba(200, 170, 255, 0.30);
  box-shadow: 0 16px 34px rgba(0,0,0,0.45),
              0 0 0 8px rgba(100, 70, 200, 0.08) inset;
  overflow: hidden;
  transform: translateZ(0);            /* para suavizar el render */
  transition: transform .25s ease, box-shadow .25s ease;
}
.photo-frame:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 46px rgba(0,0,0,0.55),
              0 0 0 10px rgba(120, 90, 230, 0.10) inset;
}

/* Imagen responsiva y recortada con gusto */
.photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;                   /* que llene sin deformarse */
  object-position: center 35%;         /* favorece retratos */
  filter: saturate(1.05) contrast(1.02);
  transition: transform .35s ease;
}
.photo-frame:hover .photo { transform: scale(1.03); }

/* Sutileza de brillo morado */
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(60% 60% at 80% 10%,
    rgba(160,140,255,0.15), transparent 60%);
  mix-blend-mode: screen;
}

/* Responsivo: en móvil la foto va arriba y ancho completo */
@media (max-width: 680px) {
  .card-body {
    grid-template-columns: 1fr;        /* una columna */
  }
  .photo-frame {
    aspect-ratio: 1 / 1;               /* cuadrada en móvil */
  }
}
