:root {
  --gold: #ffd866;
  --gold-deep: #d9a520;
  --olive-dark: #14140a;
  --cream: #fff6df;
  --paper-1: #f6e6b8;
  --paper-2: #e9cf8f;
  --script-font: 'Great Vibes', cursive;
  --body-font: 'Quicksand', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: #030302;
  font-family: var(--body-font);
  color: var(--cream);
  overflow-x: hidden;
}

/* ---------- Scene ---------- */

.scene {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(60% 45% at 50% 58%, rgba(255, 222, 120, 0.35) 0%, rgba(120, 110, 20, 0.18) 30%, rgba(10, 10, 4, 0.6) 60%, #020201 85%),
    radial-gradient(120% 90% at 50% 50%, #2b2a10 0%, #0c0b05 55%, #020201 100%);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

/* ---------- Stars & dust ---------- */

.stars, .dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  width: var(--s, 2px);
  height: var(--s, 2px);
  background: #fff9e6;
  border-radius: 50%;
  opacity: .6;
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.mote {
  position: absolute;
  bottom: -10px;
  width: var(--s, 4px);
  height: var(--s, 4px);
  border-radius: 50%;
  background: radial-gradient(circle, #ffe9a8 0%, rgba(255,233,168,0) 70%);
  opacity: 0;
  animation: rise var(--dur, 9s) linear infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes twinkle {
  0%, 100% { opacity: .25; transform: scale(.7); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes rise {
  0%   { opacity: 0; transform: translate(0, 0); }
  8%   { opacity: 1; }
  85%  { opacity: .8; }
  100% { opacity: 0; transform: translate(var(--dx, 0px), -110vh); }
}

/* ---------- Title ---------- */

.title {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: clamp(18px, 4vh, 34px) 16px 4px;
}

.title h1 {
  margin: 6px 0 0;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: clamp(1.15rem, 4.2vw, 1.7rem);
  letter-spacing: .02em;
  color: var(--cream);
  text-shadow: 0 0 18px rgba(255, 214, 110, .55);
}

.title h1 span {
  color: var(--gold);
  font-weight: 600;
}

.title-flower {
  font-size: clamp(1.4rem, 5vw, 2rem);
  display: inline-block;
  filter: drop-shadow(0 0 10px rgba(255, 214, 110, .7));
  animation: twinkle 4s ease-in-out infinite;
}

/* ---------- Heart made of light ---------- */

.heart-wrap {
  position: relative;
  z-index: 4;
  width: min(46vw, 220px);
  margin: 0 auto;
  margin-top: clamp(4px, 1vh, 10px);
  text-align: center;
}

.heart-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.heart-path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 216, 102, .9));
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw-heart 3.5s ease-out forwards, glow-heart 2.5s ease-in-out 3.5s infinite;
}

@keyframes draw-heart {
  to { stroke-dashoffset: 0; }
}

@keyframes glow-heart {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.heart-label {
  display: inline-block;
  margin-top: -8px;
  font-family: var(--script-font);
  font-size: clamp(1.3rem, 4.6vw, 1.8rem);
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 216, 102, .8);
  animation: labelPulse 2.6s ease-in-out infinite;
}

/* ---------- Central portal ---------- */

.portal {
  position: relative;
  display: block;
  margin: clamp(6px, 2vh, 18px) auto 0;
  width: clamp(64px, 16vw, 96px);
  height: clamp(64px, 16vw, 96px);
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 6;
  padding: 0;
}

.portal:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; border-radius: 50%; }

.portal .core {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, #fffdf3 0%, #ffe487 35%, #d9a520 75%, transparent 100%);
  animation: pulse-core 2.4s ease-in-out infinite;
}

@keyframes pulse-core {
  0%, 100% { box-shadow: 0 0 30px 10px rgba(255, 216, 102, .55), 0 0 70px 25px rgba(255, 216, 102, .25); }
  50%      { box-shadow: 0 0 48px 18px rgba(255, 216, 102, .8),  0 0 100px 40px rgba(255, 216, 102, .4); }
}

.portal .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 224, 140, .8);
  animation: ripple 3s ease-out infinite;
}
.ring-1 { animation-delay: 0s; }
.ring-2 { animation-delay: 1s; }
.ring-3 { animation-delay: 2s; }

@keyframes ripple {
  0%   { transform: scale(.5); opacity: .9; }
  100% { transform: scale(2.6); opacity: 0; }
}

.portal-bouquet {
  position: absolute;
  left: 50%;
  bottom: 96%;
  transform: translateX(-50%);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  filter: drop-shadow(0 0 10px rgba(255, 216, 102, .8));
  animation: bob 3.4s ease-in-out infinite;
}

.hint {
  text-align: center;
  margin: 10px 0 0;
  font-size: .85rem;
  letter-spacing: .02em;
  color: rgba(255, 246, 223, .75);
  animation: labelPulse 2.2s ease-in-out infinite;
  position: relative;
  z-index: 5;
}

/* ---------- Field of flowers & messages ---------- */

.field {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.flower, .bouquet {
  position: absolute;
  top: var(--top);
  left: var(--left);
  font-size: var(--size, 2rem);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 8px rgba(255, 216, 102, .55));
  animation: bob 4.5s ease-in-out infinite, twinkle 5s ease-in-out infinite;
  animation-delay: var(--delay, 0s), var(--delay, 0s);
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, -50%) rotate(-3deg); }
  50%      { transform: translate(-50%, -52%) rotate(3deg); }
}

.bouquet { text-align: center; }

.label-under {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--body-font);
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .01em;
  color: var(--cream);
  text-shadow: 0 0 6px rgba(255, 216, 102, .8);
  margin-top: 2px;
}

.message {
  position: absolute;
  top: var(--top);
  left: var(--left);
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-weight: 600;
  font-size: clamp(.72rem, 2.6vw, .9rem);
  color: var(--cream);
  text-shadow: 0 0 8px rgba(255, 216, 102, .7);
  animation: labelPulse 3.2s ease-in-out infinite;
  z-index: 3;
}

.message-center {
  font-size: clamp(.85rem, 3.4vw, 1.05rem);
  color: var(--gold);
}

.message i, .label-under i { font-style: normal; }

/* ---------- Footer credit ---------- */

.credit {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 18px 0 26px;
  font-size: .75rem;
  letter-spacing: .04em;
  color: rgba(255, 246, 223, .45);
}

/* ---------- Overlay + Card ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 3, 2, 0);
  backdrop-filter: blur(0px);
  pointer-events: none;
  transition: background .5s ease, backdrop-filter .5s ease;
}

.overlay.open {
  background: rgba(3, 3, 2, .78);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.card {
  position: relative;
  width: min(360px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 30px 26px 26px;
  text-align: center;
  border-radius: 18px;
  background:
    repeating-radial-gradient(circle at 30% 20%, rgba(255,255,255,.05) 0 2px, transparent 2px 5px),
    linear-gradient(160deg, var(--paper-1), var(--paper-2));
  border: 6px solid #f2c94c;
  box-shadow: 0 0 0 1px #b5891c inset, 0 20px 60px rgba(0,0,0,.55), 0 0 60px rgba(255, 214, 110, .35);
  color: #4a3b12;
  transform: scale(.8) translateY(20px);
  opacity: 0;
  transition: transform .5s cubic-bezier(.2,.8,.2,1.1), opacity .4s ease;
}

.overlay.open .card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.card-hearts {
  font-size: .9rem;
  letter-spacing: 10px;
  opacity: .7;
  margin-bottom: 4px;
}

.card h2 {
  font-family: var(--script-font);
  font-size: 2.4rem;
  margin: 0 0 8px;
  color: #7a5b0d;
}

.card-text {
  font-size: .92rem;
  line-height: 1.55;
  margin: 0 0 10px;
  color: #5b4816;
}

.card-sign {
  font-family: var(--script-font);
  font-size: 2rem;
  color: #8a6a12;
  margin: 4px 0 10px;
}

.vase-scene {
  position: relative;
  height: 120px;
  margin: 6px auto 2px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bunch {
  position: absolute;
  bottom: 46px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.1rem;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.25));
}

.bunch span:nth-child(1) { display: inline-block; transform: translateY(4px) rotate(-8deg); }
.bunch span:nth-child(2) { display: inline-block; transform: translateY(-6px) scale(1.1); }
.bunch span:nth-child(3) { display: inline-block; transform: translateY(4px) rotate(8deg); }
.bunch span:nth-child(4) { display: inline-block; transform: translateY(2px) rotate(14deg) scale(.85); }

.leaves {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) rotate(10deg);
  font-size: 1.6rem;
  opacity: .8;
}

.vase {
  width: 64px;
  height: 46px;
  border-radius: 8px 8px 26px 26px / 8px 8px 34px 34px;
  background: linear-gradient(160deg, #fffdf6, #e9e2d0);
  border: 1px solid #d8cba0;
  box-shadow: inset 0 -6px 10px rgba(0,0,0,.08), 0 6px 10px rgba(0,0,0,.2);
}

.tag {
  display: inline-block;
  margin: 6px 0 18px;
  padding: 3px 14px;
  border-radius: 999px;
  background: #fff3d0;
  border: 1px solid #d8ab2e;
  font-size: .72rem;
  letter-spacing: .06em;
  color: #8a6a12;
}

.close-btn {
  display: block;
  width: 100%;
  border: none;
  cursor: pointer;
  padding: 11px 18px;
  border-radius: 999px;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: .95rem;
  color: #4a3608;
  background: linear-gradient(180deg, #ffe184, #f4c22c);
  box-shadow: 0 6px 16px rgba(212, 160, 20, .5);
  transition: transform .15s ease, box-shadow .15s ease;
}

.close-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(212, 160, 20, .6); }
.close-btn:active { transform: translateY(1px) scale(.98); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Small screens ---------- */

@media (max-width: 360px) {
  .field { transform: scale(.92); transform-origin: 50% 50%; }
}
