:root {
  --burgundy: #6B1B3A;
  --burgundy-deep: #4A0F26;
  --cream: #FFF6E6;
  --paper: #FFFBF3;
  --marigold: #F6B91E;
  --marigold-deep: #E0A000;
  --pink: #F9D5DA;
  --pink-deep: #E9909F;
  --muted: #6F4A56;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  font-family: var(--sans);
  color: var(--burgundy);
  background:
    radial-gradient(55rem 34rem at 50% -12%, rgba(246, 185, 30, .28) 0%, transparent 62%),
    radial-gradient(48rem 34rem at 0% 110%, var(--pink) 0%, transparent 62%),
    var(--cream);
  overflow-x: hidden;
}

.stage {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
           max(1.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  position: relative; z-index: 1;
}

/* Card with alpona-style festive borders (no filter/transform ancestors: the dodging button is fixed-position) */
.card {
  width: 100%; max-width: 30rem;
  overflow: hidden;
  text-align: center;
  background: var(--paper);
  border: 1px solid rgba(107, 27, 58, .14);
  border-radius: 1.75rem;
  box-shadow: 0 26px 60px -26px rgba(107, 27, 58, .55);
  animation: arrive .9s cubic-bezier(.2,.7,.2,1) both;
}
.alpona {
  height: .95rem;
  background:
    radial-gradient(circle at 7px 50%, var(--marigold) 2.6px, transparent 3.2px) 0 0 / 14px 100% repeat-x,
    radial-gradient(circle at 0 50%, var(--pink) 1.6px, transparent 2.2px) 0 0 / 14px 100% repeat-x,
    var(--burgundy);
}
.body { padding: clamp(1.25rem, 5vw, 1.9rem) clamp(1.25rem, 6vw, 2.25rem) clamp(1.4rem, 5vw, 2rem); }

/* Diya */
.diya { width: min(50vw, 11rem); margin: 0 auto .6rem; }
.diya svg { display: block; width: 100%; height: auto; overflow: visible; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 2.6s ease-in-out infinite; }
.glow { transform-box: fill-box; transform-origin: 50% 50%; animation: pulse 3.2s ease-in-out infinite; }
.diya.joy .flame { animation: flare .9s ease-out, flicker 2.6s ease-in-out .9s infinite; }
.diya.joy .glow { animation: pulse 1.4s ease-in-out infinite; }

/* Text */
.content { transition: opacity .22s ease, transform .22s ease; }
.content.out { opacity: 0; transform: translateY(6px); }
.content.in { animation: settle .45s cubic-bezier(.2,.7,.2,1) both; }

.label { margin: 0 0 .4rem; font-size: 1rem; letter-spacing: .02em; color: var(--muted); }

h1 {
  margin: 0 0 .9rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.1rem, 9vw, 3rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1:focus { outline: none; }
.mark { background: linear-gradient(transparent 60%, rgba(246, 185, 30, .55) 60%); padding: 0 .12em; border-radius: .15em; }

.msg { margin: 0 auto .9rem; max-width: 26rem; font-size: 1.12rem; line-height: 1.55; color: var(--muted); text-wrap: pretty; overflow-wrap: break-word; }
.msg:last-of-type { margin-bottom: 1.5rem; }

.signoff { margin: 1.2rem 0 0; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--burgundy); }

.note { margin: 1.1rem auto 1.5rem; max-width: 24rem; padding: .7rem 1rem; font-family: var(--serif); font-style: italic; font-size: 1.12rem; line-height: 1.45; color: var(--burgundy); background: rgba(249, 213, 218, .55); border-radius: 1rem; }
.signoff[hidden] { display: none; }

.whisper { min-height: 1.5rem; margin: -.6rem 0 .9rem; font-size: .98rem; font-style: italic; color: var(--burgundy); }

/* Buttons */
.actions { display: grid; gap: .8rem; }
.btn {
  font: inherit; font-weight: 700; font-size: 1.08rem;
  min-height: 3.4rem; padding: .85rem 1.3rem;
  border-radius: 999px; border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}
.btn.primary { background: var(--marigold); color: var(--burgundy-deep); box-shadow: 0 10px 22px -10px rgba(224, 160, 0, .9); }
.btn.primary:hover { background: var(--marigold-deep); transform: translateY(-1px); }
.btn.soft { background: var(--pink); color: var(--burgundy); }
.btn.soft:hover { background: #F4BFC7; }
.btn.quiet { background: transparent; color: var(--burgundy); border-color: rgba(107, 27, 58, .35); }
.btn.quiet:hover { background: rgba(249, 213, 218, .5); }
.btn:active { transform: scale(.98); }
.btn:focus-visible, .link:focus-visible { outline: 3px solid var(--burgundy); outline-offset: 3px; }

.link { margin-top: 1.1rem; background: none; border: 0; padding: .6rem .8rem; min-height: 2.75rem; font: inherit; font-size: 1rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--burgundy); }

/* The shy button: leaves a same-size gap behind and floats free */
.slot { visibility: hidden; }
.nobtn.loose {
  position: fixed; z-index: 20; margin: 0;
  width: auto; background: var(--paper);
  box-shadow: 0 12px 24px -12px rgba(107, 27, 58, .6);
  transition: left .32s cubic-bezier(.3, 1.35, .5, 1), top .32s cubic-bezier(.3, 1.35, .5, 1);
}

/* Floating petals */
.petals { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.float { position: absolute; bottom: -2rem; color: var(--marigold); opacity: 0; animation: rise linear forwards; will-change: transform, opacity; }
.float.pink { color: var(--pink-deep); }
.float.burst { filter: saturate(1.1); }

@keyframes arrive { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes flicker { 0%,100% { transform: scale(1, 1) rotate(0); } 30% { transform: scale(.95, 1.06) rotate(-2deg); } 60% { transform: scale(1.04, .96) rotate(1.5deg); } }
@keyframes flare { 0% { transform: scale(1); } 40% { transform: scale(1.35, 1.5); } 100% { transform: scale(1); } }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes rise {
  0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 0; }
  12% { opacity: .85; }
  100% { transform: translate3d(var(--drift, 0), -110vh, 0) rotate(var(--spin, 40deg)); opacity: 0; }
}

.noscript { text-align: center; padding: 1rem; }

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