:root {
  color-scheme: light;
  --bg: #fff7f1;
  --bg2: #fdeee6;
  --card: #ffffff;
  --ink: #3b2a2f;
  --ink-soft: #7a6168;
  --rose: #d94f72;
  --rose-deep: #b8375a;
  --rose-soft: #fde1e8;
  --gold: #c99433;
  --line: #f0dcd3;
  --wa: #1fa855;
  --wa-deep: #168a45;
  --shadow: 0 10px 30px -12px rgba(120, 50, 60, .28);
  --radius: 22px;
  --font: 'Nunito', 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', 'Hind Siliguri', Georgia, serif;
  --hand: 'Caveat', 'Hind Siliguri', cursive;
}
html[lang="bn"] { --font: 'Hind Siliguri', 'Nunito', system-ui, sans-serif; --display: 'Baloo Da 2', 'Hind Siliguri', serif; }
html[lang="bn"] .hero h1, html[lang="bn"] .q, html[lang="bn"] .stage h1 { font-weight: 700; letter-spacing: 0; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #ffe3ea 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #fff0d6 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--rose-deep); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; border-radius: 12px; }

.wrap { max-width: 620px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; }
.brand-name { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -.3px; }
.brand-name small { display: block; font-family: 'Hind Siliguri', sans-serif; font-size: 13px; color: var(--ink-soft); font-weight: 500; margin-top: -6px; }
.lang-btn {
  border: 2px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 8px 16px; font-weight: 700; cursor: pointer; min-height: 44px; font-size: 16px;
}

/* Landing */
.hero { text-align: center; padding: 8px 0 24px; }
.hero h1 { font-family: var(--display); font-size: clamp(32px, 8vw, 46px); line-height: 1.12; margin: 6px 0 10px; letter-spacing: -.5px; }
.hero h1 em { color: var(--rose); font-style: italic; }
.hero p { color: var(--ink-soft); margin: 0 auto 22px; max-width: 30ch; font-size: 19px; }
.hero-art { display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: end; gap: 4px; margin: 0 auto 18px; max-width: 520px; }
.hero-art > div { filter: drop-shadow(0 8px 14px rgba(120, 50, 60, .18)); animation: floaty 5s ease-in-out infinite; }
.hero-art > div:nth-child(2) { animation-delay: -1.6s; }
.hero-art > div:nth-child(3) { animation-delay: -3.2s; }
@keyframes floaty { 50% { transform: translateY(-8px); } }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 26px 0 8px; }
.how div { background: var(--card); border-radius: 18px; padding: 14px 8px; text-align: center; box-shadow: var(--shadow); font-weight: 700; font-size: 15px; }
.how b { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 6px; border-radius: 50%; background: var(--rose-soft); color: var(--rose-deep); font-size: 17px; }
.free { text-align: center; color: var(--ink-soft); font-size: 16px; margin-top: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 0 28px; border-radius: 999px; border: 0;
  font-size: 20px; font-weight: 800; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .2s ease, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(180deg, #e8668a, var(--rose-deep)); color: #fff; box-shadow: 0 10px 22px -8px rgba(184, 55, 90, .7); }
.btn-ghost { background: var(--card); color: var(--ink); border: 2px solid var(--line); }
.btn-wa { background: linear-gradient(180deg, #2ec266, var(--wa-deep)); color: #fff; box-shadow: 0 10px 22px -8px rgba(22, 138, 69, .7); width: 100%; min-height: 68px; font-size: 22px; }
.btn-wide { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.pending { opacity: .7; pointer-events: none; }

/* Wizard */
.progress { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; }
.progress span { flex: 1; height: 8px; border-radius: 99px; background: var(--line); transition: background .3s; }
.progress span.on { background: var(--rose); }
.step-label { color: var(--ink-soft); font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.q { font-family: var(--display); font-size: clamp(26px, 6.5vw, 32px); line-height: 1.2; margin: 0 0 16px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.list { grid-template-columns: 1fr; gap: 10px; }
.opt {
  position: relative; background: var(--card); border: 3px solid transparent; border-radius: var(--radius);
  padding: 10px 10px 12px; cursor: pointer; text-align: center; box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s; display: flex; flex-direction: column; align-items: center;
}
.opt:active { transform: scale(.98); }
.opt .art { width: 100%; aspect-ratio: 1 / 1; display: grid; place-items: center; }
/* Soft pastel halo behind every gift picture */
.opt .art, .preview-big .art, .giftcard .art {
  background: radial-gradient(closest-side, var(--halo, #fde6ec) 0%, rgba(253, 230, 236, .5) 62%, rgba(253, 230, 236, 0) 100%);
  border-radius: 50%;
}
[data-group="type"][data-id="c"] .art, .halo-c { --halo: #f9ecd8; }
[data-group="type"][data-id="m"] .art, .halo-m { --halo: #fdf3d6; }
.opt .art svg { width: 100%; height: 100%; }
.opt .name { font-weight: 800; font-size: 17px; margin-top: 4px; line-height: 1.25; }
.opt[aria-checked="true"] { border-color: var(--rose); background: #fff8fa; }
.opt[aria-checked="true"]::after {
  content: '✓'; position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--rose); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 18px;
}
.grid.list .opt { flex-direction: row; text-align: left; padding: 14px 16px; min-height: 64px; gap: 14px; }
.grid.list .opt .name { margin: 0; flex: 1; }
.grid.list .opt .bn { color: var(--rose-deep); font-family: 'Hind Siliguri', sans-serif; font-weight: 600; font-size: 16px; display: block; }
.grid.list .opt[aria-checked="true"]::after { position: static; flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 8px 16px 8px 10px; min-height: 48px; cursor: pointer; font-weight: 700; font-size: 16px;
}
.chip i { width: 26px; height: 26px; border-radius: 50%; display: block; border: 2px solid rgba(0, 0, 0, .08); }
.chip[aria-checked="true"] { border-color: var(--rose); background: var(--rose-soft); }
.chip[aria-pressed="true"] { border-color: var(--rose); background: var(--rose-soft); }
.msgs { display: grid; gap: 10px; margin-top: 10px; }
.msgcard {
  text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px;
  font-size: 18px; line-height: 1.45; cursor: pointer; box-shadow: 0 4px 10px -8px rgba(120, 50, 60, .4);
}
.msgcard:active { transform: scale(.99); border-color: var(--rose); }
.msgcard[lang="bn"] { font-family: 'Hind Siliguri', sans-serif; }
.msg-lang { display: inline-block; font-family: var(--font); font-size: 12px; font-weight: 800; color: var(--rose-deep); background: var(--rose-soft); border-radius: 99px; padding: 1px 8px; margin: 0 8px 4px 0; vertical-align: middle; }
.fontchip { flex-direction: column; gap: 0; padding: 8px 16px; min-width: 104px; }
.fontchip small { font-family: var(--font); font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.real { margin-top: 10px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 16px; text-align: center; }
.real h3 { margin: 0 0 10px; font-size: 18px; }
.real p { font-size: 13px; color: var(--ink-soft); margin: 8px 0 0; }

.preview-big { background: var(--card); border-radius: 28px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.preview-big .art { max-width: 340px; margin: 0 auto; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 800; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 19px; color: var(--ink); background: var(--card);
  border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; min-height: 58px;
}
.field textarea { min-height: 130px; resize: vertical; font-family: var(--hand); font-size: 24px; line-height: 1.35; }
.field input:focus, .field textarea:focus { border-color: var(--rose); outline: none; box-shadow: 0 0 0 4px var(--rose-soft); }
.field .help { color: var(--ink-soft); font-size: 15px; margin-top: 6px; }
.field .count { text-align: right; color: var(--ink-soft); font-size: 14px; }
.ok { color: var(--wa-deep); font-weight: 800; }
.bad { color: #b3261e; font-weight: 800; }
.err { color: #b3261e; font-weight: 700; margin-top: 6px; }

.navbar {
  position: sticky; bottom: 0; display: flex; gap: 12px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  margin-top: 22px; background: linear-gradient(to top, var(--bg) 70%, rgba(255, 247, 241, 0));
}
.navbar.static { position: static; background: none; }
.navbar .btn { flex: 1; }
.navbar .btn-ghost { flex: 0 0 auto; }

.send-box { display: grid; gap: 12px; }
.send-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.send-row .btn { font-size: 17px; min-height: 56px; padding: 0 12px; }

/* Shared gift card (preview + receiver) */
.giftcard { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: 20px 18px 24px; text-align: center; }
.giftcard .art { max-width: 360px; margin: 0 auto; }
.note {
  position: relative; margin: 18px auto 0; max-width: 440px; text-align: left;
  background: #fffdf6 repeating-linear-gradient(transparent 0 37px, #f1e4d4 37px 38px);
  border-radius: 6px; padding: 18px 22px 20px; box-shadow: 0 8px 20px -10px rgba(90, 50, 30, .45);
  transform: rotate(-1.2deg); font-family: var(--hand); font-size: 27px; line-height: 38px; color: #4a2d2f;
}
.note::before {
  content: ''; position: absolute; top: -12px; left: 50%; width: 90px; height: 26px; transform: translateX(-50%) rotate(2deg);
  background: rgba(244, 196, 208, .75); border-radius: 3px;
}
.note .dear { font-weight: 700; }
.note .msg { white-space: pre-wrap; word-wrap: break-word; }
.note .sig { text-align: right; margin-top: 4px; }

/* Ads: invisible unless configured */
.ad-slot { margin: 26px 0; min-height: 0; text-align: center; }
.ad-slot:empty { display: none; }
.ad-slot .ad-label { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }

footer { text-align: center; color: var(--ink-soft); font-size: 14px; padding: 30px 0 40px; }
footer nav { display: flex; gap: 18px; justify-content: center; margin-bottom: 8px; font-size: 16px; }
footer p { max-width: 46ch; margin: 6px auto; }

.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); text-align: center; transform: translate(-50%, 30px); opacity: 0; transition: .3s;
  background: #3b2a2f; color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 700; z-index: 50; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } }

/* Receiver page */
.stage { text-align: center; padding: 10px 0 0; }
.stage h1 { font-family: var(--display); font-size: clamp(28px, 7vw, 38px); margin: 6px 0 2px; line-height: 1.15; }
.stage .from { color: var(--ink-soft); font-size: 19px; margin: 0 0 8px; }
.present-wrap { position: relative; max-width: 320px; margin: 0 auto; cursor: pointer; border: 0; background: none; padding: 0; width: 100%; }
.present-wrap svg { animation: wiggle 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-3deg); } 80% { transform: rotate(3deg); } 85% { transform: rotate(-2deg); } 90% { transform: rotate(2deg); } }
.present-lid { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .7s cubic-bezier(.5, -0.3, .4, 1.4), opacity .7s; }
.opening .present-wrap svg { animation: none; }
.opening .present-lid { transform: translate(40px, -160px) rotate(28deg); opacity: 0; }
.opening .present-wrap { animation: sink .6s .45s ease-in forwards; }
@keyframes sink { to { transform: scale(.7) translateY(40px); opacity: 0; } }
.tap-btn { margin-top: 14px; }
.reveal { animation: pop .8s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pop { from { transform: scale(.4) translateY(40px); opacity: 0; } }
.reveal .note { animation: fadeIn .6s .6s ease both; }
.music {
  margin: 22px auto 0; max-width: 440px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 14px; text-align: left;
}
.music h3 { margin: 0 0 10px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.music .player { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 200px; border-radius: 14px; overflow: hidden; background: #000; }
.music .player iframe, .music .player > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.after { margin-top: 26px; display: grid; gap: 12px; }

.petal { position: fixed; top: -40px; pointer-events: none; z-index: 40; font-size: 26px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

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

/* Simple pages */
.page { background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 22px 22px 8px; margin-bottom: 20px; }
.page h1 { font-family: var(--display); margin-top: 0; }
.page h2 { font-size: 20px; margin-top: 24px; }

@media (max-width: 380px) {
  body { font-size: 17px; }
  .grid.three { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .how div { font-size: 13px; }
}
