:root {
  --bg1: #0b1020;
  --bg2: #0a2a2a;

  --stem: #2fb36d;
  --stem-dark: #1f7a4a;
  --center: #f7c948;
  --petal1: #ff4fa0;
  --petal2: #ff8cc8;

  --bloom: 0; /* 0 closed, 1 open*/
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(
      70% 60% at 50% 25%,
      rgba(84, 255, 190, 0.1),
      transparent 55%
    ),
    radial-gradient(60% 60% at 50% 30%, var(--bg2), var(--bg1));

  overflow: hidden;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
  color: #eaf2ff;
}

.scene {
  position: relative;
  width: min(520px, 92vw);
  height: min(520px, 92vw);
  display: grid;
  place-items: center;
}

/* ----- hint note (does NOT block clicks) ----- */

.note {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  font-size: 13px;
  user-select: none;
  opacity: 0.92;
  transition: opacity 400ms ease;
  pointer-events: none; /*  IMPORTANT: never blocks click  */
  z-index: 5;
}

.note__ping {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9cffd3;
  box-shadow: 0 0 0 0 rgba(156, 255, 211, 0.55);
  animation: ping 1.2s ease-in-out infinite;
}

@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(156, 255, 211, 0.45);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(156, 255, 211, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(156, 255, 211, 0);
  }
}

.note.is-hidden {
  opacity: 0;
}

.ground {
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: radial-gradient(
    70% 120% at 50% 0%,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0.3)
  );
  filter: blur(1px);
  pointer-events: none;
}

.flower {
  position: relative;
  width: 260px;
  height: 360px;
  cursor: pointer;
  transform-origin: 50% 92%;
  animation: sway 4.2s ease-in-out infinite;
  will-change: transform;
  z-index: 2;
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(-2.2deg);
  }

  50% {
    transform: rotate(2.2deg);
  }
}

.flower:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 6px;
  border-radius: 18px;
}

.plant {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  width: 160px;
  height: 240px;
}

.stem {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 14px;
  height: 220px;
  border-radius: 999px;
  background:
    radial-gradient(
      80% 40% at 40% 20%,
      rgba(255, 255, 255, 0.2),
      transparent 55%
    ),
    linear-gradient(180deg, var(--stem), var(--stem-dark));
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.leaf {
  position: absolute;
  left: 50%;
  width: 96px;
  height: 56px;
  background:
    radial-gradient(
      70% 80% at 35% 35%,
      rgba(255, 255, 255, 0.22),
      rgba(255, 255, 255, 0) 55%
    ),
    linear-gradient(180deg, #39d07f, #1f7a4a);
  border-radius: 100% 30% 100% 30%;
  filter: saturate(1.15);
  box-shadow:
    0 12px 18px rgba(0, 0, 0, 0.25),
    inset 0 -10px 18px rgba(0, 0, 0, 0.12);
  transform-origin: 10px 70%;
  will-change: transform;
}

.leaf--left {
  bottom: 122px;
  transform: translateX(-5px) rotate(-18deg);
  animation: leafLeft 4.2s ease-in-out infinite;
}

.leaf--right {
  bottom: 92px;
  transform: translateX(-15px) rotate(22deg) scaleX(-1);
  animation: leafRight 4.2s ease-in-out infinite;
}

@keyframes leafLeft {
  0%,
  100% {
    transform: translateX(-5px) rotate(-16deg);
  }

  50% {
    transform: translateX(-5px) rotate(-24deg);
  }
}

@keyframes leafRight {
  0%,
  100% {
    transform: translateX(-15px) rotate(20deg) scaleX(-1);
  }

  50% {
    transform: translateX(-15px) rotate(30deg) scaleX(-1);
  }
}

.head {
  position: absolute;
  left: 50%;
  bottom: 238px;
  width: 170px;
  height: 170px;
  transform: translateX(-50%) translateY(calc((1 - var(--bloom)) * 14px))
    scale(calc(0.9 + var(--bloom) * 0.1));
  display: grid;
  place-items: center;
  transition: transform 700ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.clickTag {
  position: absolute;
  left: 50%;
  top: -26px;
  transform: translateX(-50%);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  opacity: calc(0.25 + (1 - var(--bloom)) * 0.75);
  transition: opacity 400ms ease;
  user-select: none;
  white-space: nowrap;
  pointer-events: none; /* IMPORTANT */
}

.petals {
  position: absolute;
  inset: 0;
}

.petal {
  --i: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 92px;
  border-radius: 999px;
  background:
    radial-gradient(
      circle at 30% 25%,
      rgba(255, 255, 255, 0.55),
      rgba(255, 255, 255, 0) 40%
    ),
    linear-gradient(180deg, var(--petal2), var(--petal1));
  transform-origin: 50% 92%;
  transform: translate(-50%, -78%) rotate(calc(var(--i) * 30deg))
    translateY(calc((1 - var(--bloom)) * 22px))
    scaleY(calc(0.22 + var(--bloom) * 0.78))
    scaleX(calc(0.86 + var(--bloom) * 0.14));
  filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.28));
  transition: transform 700ms cubic-bezier(0.2, 0.9, 0.2, 1);
  transition-delay: calc(var(--i) * 18ms);
}

.center {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.6),
      rgba(255, 255, 255, 0) 45%
    ),
    radial-gradient(circle at 50% 55%, #ffd86b, var(--center));
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
  transform: scale(calc(0.78 + var(--bloom) * 0.22));
  transition: transform 700ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

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

.badge {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  opacity: 0.82;
  user-select: none;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.badge b {
  opacity: 0.95;
}

/* end */

.pollenDot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.8),
      rgba(255, 255, 255, 0) 50%
    ),
    radial-gradient(circle at 50% 60%, #ffe08a, #ffb703);
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: floatUp 900ms ease-out forwards;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.25));
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(0.6);
  }

  15% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(calc(var(--x) * 1.2), calc(var(--y) - 120px)) scale(1);
  }
}
