
:root {
  --bg-1: #130914;
  --bg-2: #2a1027;
  --card: rgba(255,255,255,.08);
  --card-border: rgba(255,255,255,.12);
  --pink: #ff7ab8;
  --rose: #e91f63;
  --red: #b90d36;
  --cream: #fff8fb;
  --muted: #e8cddd;
  --green: #2fa45f;
  --green-dark: #126b39;
  --soil: #5f3327;
  --pot: #c86d47;
  --pot-dark: #8f432f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 20%, rgba(255,89,153,.18), transparent 30%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.35) 0 1px, transparent 1.5px);
  background-size: 90px 90px;
  opacity: .08;
}

.ambient {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .28;
  pointer-events: none;
}
.ambient-1 { background: #ff2e86; top: -90px; left: -100px; }
.ambient-2 { background: #9a40ff; right: -120px; bottom: -120px; }

.app {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.card {
  width: min(100%, 720px);
  border: 1px solid var(--card-border);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 32px;
  padding: clamp(20px, 4vw, 38px);
  text-align: center;
}

.heading .eyebrow {
  display: inline-block;
  font-size: .76rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #ffb3d3;
  margin-bottom: 8px;
}

h1 {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 400;
  line-height: .95;
  text-shadow: 0 8px 30px rgba(255, 60, 130, .2);
}

.heading p {
  color: var(--muted);
  margin: 14px auto 0;
  max-width: 500px;
  line-height: 1.5;
}

.scene {
  position: relative;
  height: clamp(410px, 58vh, 560px);
  min-height: 410px;
  margin: 10px 0 0;
  overflow: hidden;
}

.flower {
  position: absolute;
  left: 50%;
  bottom: 34px;
  width: 280px;
  height: 410px;
  transform: translateX(-50%);
}

.pot-shadow {
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 190px;
  height: 28px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.3);
  filter: blur(12px);
  border-radius: 50%;
}

.pot {
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 128px;
  height: 95px;
  transform: translateX(-50%) scale(.82);
  opacity: .9;
}
.pot-rim {
  position: absolute;
  top: 0;
  left: 5px;
  width: 118px;
  height: 28px;
  border-radius: 10px 10px 16px 16px;
  background: linear-gradient(#df845e, #b95c3f);
  box-shadow: inset 0 4px 0 rgba(255,255,255,.15);
}
.pot-body {
  position: absolute;
  top: 18px;
  left: 15px;
  width: 98px;
  height: 76px;
  background: linear-gradient(120deg, #d87954, #a34a34);
  clip-path: polygon(6% 0, 94% 0, 80% 100%, 20% 100%);
  border-radius: 0 0 26px 26px;
}

.roots {
  position: absolute;
  left: 50%;
  bottom: 46px;
  width: 150px;
  height: 84px;
  transform: translateX(-50%);
  opacity: 0;
}
.root {
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 6px;
  height: 72px;
  background: linear-gradient(#7b543d, #4e2a20);
  border-radius: 100%;
  transform-origin: bottom;
}
.r1 { transform: rotate(-38deg) scaleY(.75); }
.r2 { transform: rotate(-16deg) scaleY(.95); }
.r3 { transform: rotate(18deg) scaleY(.92); }
.r4 { transform: rotate(40deg) scaleY(.72); }

.stem {
  position: absolute;
  left: 50%;
  bottom: 102px;
  width: 9px;
  height: 0;
  transform: translateX(-50%);
  border-radius: 8px;
  background: linear-gradient(90deg, var(--green-dark), #43be72, #1e8b4e);
  transform-origin: bottom;
  box-shadow: 0 0 14px rgba(42, 212, 111, .14);
}

.leaf {
  position: absolute;
  width: 74px;
  height: 42px;
  background: linear-gradient(135deg, #37b766, #167440);
  opacity: 0;
  box-shadow: inset -8px -5px 12px rgba(0,0,0,.08);
}
.leaf-left {
  left: 67px;
  bottom: 205px;
  border-radius: 90% 0 90% 0;
  transform: rotate(-28deg) scale(.2);
  transform-origin: 100% 100%;
}
.leaf-right {
  right: 66px;
  bottom: 252px;
  border-radius: 0 90% 0 90%;
  transform: rotate(26deg) scale(.2);
  transform-origin: 0 100%;
}
.leaf-vein {
  position: absolute;
  width: 58px;
  height: 1px;
  background: rgba(230,255,236,.5);
  top: 22px;
  left: 7px;
  transform: rotate(11deg);
}

.rose {
  position: absolute;
  left: 50%;
  bottom: 318px;
  width: 145px;
  height: 145px;
  transform: translateX(-50%) scale(.25);
  opacity: 0;
  filter: drop-shadow(0 14px 25px rgba(255, 25, 95, .25));
}

.petal, .rose-center {
  position: absolute;
  left: 50%;
  top: 50%;
  opacity: 0;
  transform-origin: 50% 90%;
  transition: all .55s cubic-bezier(.2,.9,.2,1.2);
}

.petal {
  width: 58px;
  height: 78px;
  border-radius: 65% 65% 48% 48%;
  background: linear-gradient(150deg, #ff5d96, #df174f 58%, #a60735);
  box-shadow: inset 9px 6px 15px rgba(255,255,255,.14),
              inset -9px -8px 18px rgba(91,0,28,.16);
}

.p1  { margin:-69px 0 0 -29px; transform: rotate(0deg) scale(.25); }
.p2  { margin:-61px 0 0 -59px; transform: rotate(-38deg) scale(.25); }
.p3  { margin:-59px 0 0 2px;   transform: rotate(38deg) scale(.25); }
.p4  { margin:-45px 0 0 -70px; transform: rotate(-70deg) scale(.25); }
.p5  { margin:-45px 0 0 12px;  transform: rotate(70deg) scale(.25); }
.p6  { margin:-29px 0 0 -71px; transform: rotate(-105deg) scale(.25); }
.p7  { margin:-28px 0 0 13px;  transform: rotate(105deg) scale(.25); }
.p8  { margin:-15px 0 0 -54px; transform: rotate(-145deg) scale(.25); }
.p9  { margin:-14px 0 0 -5px;  transform: rotate(145deg) scale(.25); }
.p10 { margin:-8px 0 0 -29px;  transform: rotate(180deg) scale(.25); }
.p11 { margin:-49px 0 0 -45px; transform: rotate(-20deg) scale(.25); width:50px; height:66px;}
.p12 { margin:-48px 0 0 -5px;  transform: rotate(20deg) scale(.25); width:50px; height:66px;}

.rose-center {
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border-radius: 48% 52% 45% 55%;
  background: radial-gradient(circle at 35% 30%, #ff81aa, #d7134c 55%, #90052b);
  transform: scale(.2);
}

.message-bubble {
  position: absolute;
  z-index: 9;
  top: 32px;
  left: 50%;
  width: min(90%, 500px);
  transform: translateX(-50%);
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(39, 9, 30, .72);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
  color: #ffe9f3;
  line-height: 1.45;
  animation: bubbleIn .45s ease both;
}

.hidden { display: none !important; }

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -2px auto 18px;
  width: min(100%, 460px);
}
.progress-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.09);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff6eae, #f53b7a);
  box-shadow: 0 0 20px rgba(255, 75, 143, .45);
  transition: width .55s ease;
}
#progressText {
  width: 42px;
  text-align: right;
  color: #ffc6de;
  font-size: .82rem;
}

.grow-button {
  appearance: none;
  border: 0;
  min-width: min(100%, 290px);
  padding: 16px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6aaa, #e82f73);
  color: white;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 13px 35px rgba(232,47,115,.35),
              inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.grow-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 38px rgba(232,47,115,.45);
}
.grow-button:active { transform: scale(.97); }
.grow-button:disabled {
  cursor: default;
  opacity: .72;
}
.heart {
  display: inline-block;
  margin-right: 8px;
  animation: pulse 1.2s infinite;
}

.hint {
  margin: 14px 0 0;
  color: rgba(255,255,255,.56);
  font-size: .84rem;
}

.final-message {
  margin-top: 26px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(255,157,199,.18);
  background: linear-gradient(180deg, rgba(255,95,162,.13), rgba(255,255,255,.03));
  animation: finalIn .8s ease both;
}
.final-message .mini {
  display: block;
  color: #ffc3db;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.final-message strong {
  display: block;
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  color: #fff;
}
.final-message p {
  margin: 8px auto 0;
  color: #ebcad9;
  max-width: 520px;
  line-height: 1.5;
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffd5e6;
  box-shadow: 0 0 12px #ff7dad;
  animation: floatUp 1.4s ease-out forwards;
}

.stage-roots .roots {
  opacity: 1;
  animation: rootsIn .8s ease both;
}
.stage-stem .stem {
  height: 185px;
  transition: height .9s cubic-bezier(.2,.8,.2,1);
}
.stage-leaf-left .leaf-left,
.stage-leaf-right .leaf-right {
  opacity: 1;
}
.stage-leaf-left .leaf-left {
  transform: rotate(-28deg) scale(1);
  transition: .65s cubic-bezier(.2,.9,.2,1.2);
}
.stage-leaf-right .leaf-right {
  transform: rotate(26deg) scale(1);
  transition: .65s cubic-bezier(.2,.9,.2,1.2);
}
.stage-bud .rose {
  opacity: 1;
  transform: translateX(-50%) scale(.72);
  transition: .7s cubic-bezier(.2,.9,.2,1.1);
}
.stage-petals-1 .p1,
.stage-petals-1 .p2,
.stage-petals-1 .p3,
.stage-petals-1 .p11,
.stage-petals-1 .p12 {
  opacity: 1;
}
.stage-petals-2 .p4,
.stage-petals-2 .p5,
.stage-petals-2 .p6,
.stage-petals-2 .p7 {
  opacity: 1;
}
.stage-petals-3 .p8,
.stage-petals-3 .p9,
.stage-petals-3 .p10,
.stage-petals-3 .rose-center {
  opacity: 1;
}
.stage-petals-1 .petal,
.stage-petals-2 .petal,
.stage-petals-3 .petal {
  --s: 1;
}
.stage-petals-1 .p1 { transform:rotate(0deg) scale(1); }
.stage-petals-1 .p2 { transform:rotate(-38deg) scale(1); }
.stage-petals-1 .p3 { transform:rotate(38deg) scale(1); }
.stage-petals-1 .p11{ transform:rotate(-20deg) scale(1); }
.stage-petals-1 .p12{ transform:rotate(20deg) scale(1); }

.stage-petals-2 .p4 { transform:rotate(-70deg) scale(1); }
.stage-petals-2 .p5 { transform:rotate(70deg) scale(1); }
.stage-petals-2 .p6 { transform:rotate(-105deg) scale(1); }
.stage-petals-2 .p7 { transform:rotate(105deg) scale(1); }

.stage-petals-3 .p8 { transform:rotate(-145deg) scale(1); }
.stage-petals-3 .p9 { transform:rotate(145deg) scale(1); }
.stage-petals-3 .p10{ transform:rotate(180deg) scale(1); }
.stage-petals-3 .rose-center { transform: scale(1); }

.stage-finished .rose {
  animation: roseGlow 2.4s ease-in-out infinite;
}

@keyframes rootsIn {
  from { transform: translateX(-50%) scale(.4); opacity: 0; }
  to { transform: translateX(-50%) scale(1); opacity: 1; }
}
@keyframes bubbleIn {
  from { opacity:0; transform:translate(-50%,-8px) scale(.97); }
  to { opacity:1; transform:translate(-50%,0) scale(1); }
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}
@keyframes finalIn {
  from { opacity:0; transform:translateY(10px); }
  to { opacity:1; transform:translateY(0); }
}
@keyframes roseGlow {
  0%,100% { filter: drop-shadow(0 14px 25px rgba(255, 25, 95, .25)); }
  50% { filter: drop-shadow(0 14px 34px rgba(255, 72, 143, .52)); }
}
@keyframes floatUp {
  0% { opacity:0; transform:translateY(0) scale(.3); }
  18% { opacity:1; }
  100% { opacity:0; transform:translateY(-90px) scale(1.4); }
}

@media (max-width: 600px) {
  .app { padding: 12px; }
  .card { border-radius: 24px; padding: 22px 16px 24px; }
  .scene { height: 430px; min-height: 430px; }
  .flower { transform: translateX(-50%) scale(.92); transform-origin: bottom center; }
  .message-bubble { top: 20px; font-size: .9rem; }
}

@media (max-width: 380px) {
  .flower { transform: translateX(-50%) scale(.82); }
  .scene { height: 400px; min-height: 400px; }
}
