/* Gift Maker — builder, share page and the recipient's stage. */
:root { --gm-c: #ff4d8d; --gm-ink: #2d2433; --gm-night: #1b1024; --gm-paper: #fffaf3; }

/* ------------------------------------------------------------ builder */
.gm-builder { padding: 48px 0 72px; }
.gm-wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.gm-narrow { max-width: 680px; text-align: center; }
.gm-hero { text-align: center; max-width: 720px; margin: 0 auto 32px; }
.gm-badge { display: inline-block; padding: 4px 14px; border-radius: 999px; background: #fff0f6; color: #c2185b; font-weight: 600; font-size: 14px; }
.gm-lead { color: #6b6375; font-size: 1.1rem; }
.gm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.gm-step { border: 1px solid #eee4f0; border-radius: 16px; padding: 20px; margin: 0 0 16px; }
.gm-step legend { font-weight: 700; font-size: 1.05rem; padding: 0 6px; float: none; width: auto; }
.gm-step legend small { font-weight: 400; color: #8a8291; }
.gm-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gm-c); color: #fff; font-size: 14px; margin-right: 4px; }
.gm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gm-field { display: block; margin: 8px 0; font-weight: 600; font-size: 14px; }
.gm-field small { font-weight: 400; color: #8a8291; }
.gm-input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #ddd2e2; border-radius: 10px; font: inherit; font-weight: 400; background: #fff; }
.gm-input:focus { outline: 2px solid var(--gm-c); outline-offset: 1px; }
.gm-pin { max-width: 140px; letter-spacing: .5em; text-align: center; font-size: 1.2rem; }
.gm-help { font-size: 13px; color: #8a8291; margin: 8px 0 0; }
.gm-hp { position: absolute !important; left: -9999px; }
.gm-occasions { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gm-occasion input { position: absolute; opacity: 0; }
.gm-occ-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border: 2px solid #eee4f0; border-radius: 14px; cursor: pointer; text-align: center; font-weight: 600; font-size: 14px; transition: .15s; }
.gm-occ-emoji { font-size: 28px; }
.gm-occasion input:checked + .gm-occ-card { border-color: var(--gm-c); background: color-mix(in srgb, var(--gm-c) 10%, #fff); }
.gm-occasion input:focus-visible + .gm-occ-card { outline: 2px solid var(--gm-c); }
.gm-thumbs, .gm-kept { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.gm-thumb { position: relative; display: block; font-size: 13px; }
.gm-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.gm-thumb-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.gm-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0 8px; }
.gm-btn, .gm-btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 22px; border-radius: 999px; font-weight: 700; border: 2px solid var(--gm-c); cursor: pointer; text-decoration: none; }
.gm-btn { background: var(--gm-c); color: #fff; }
.gm-btn-ghost { background: transparent; color: var(--gm-c); }
.gm-btn:disabled { opacity: .6; cursor: wait; }
.gm-link-danger { background: none; border: 0; color: #c0392b; text-decoration: underline; cursor: pointer; padding: 0; }
.gm-alert { padding: 12px 16px; border-radius: 12px; background: #f6f1f8; margin: 16px 0; text-align: left; }
.gm-alert p { margin: 4px 0; }
.gm-alert-ok { background: #e8f8f0; }
.gm-alert-err { background: #fdecea; color: #a5281b; }
.gm-alert-warn { background: #fff7e0; }
.gm-copy { display: flex; gap: 8px; margin: 12px 0; }
.gm-copy .gm-input { margin: 0; }
.gm-share-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }
.gm-qr { margin: 24px auto; }
.gm-qr canvas { border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.gm-qr figcaption { font-size: 13px; color: #8a8291; }

/* Phone preview */
.gm-phone { position: sticky; top: 90px; }
.gm-phone-frame { border: 10px solid #1d1622; border-radius: 40px; overflow: hidden; aspect-ratio: 9 / 18.5; box-shadow: 0 20px 60px rgba(45,36,51,.25); }
.gm-phone .gm-stage { height: 100%; font-size: 13px; }
.gm-overlay { position: fixed; inset: 0; z-index: 9999; }
.gm-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 26px; cursor: pointer; }

/* CTA (shortcode) */
.gm-cta { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin: 24px 0; border-radius: 16px; background: color-mix(in srgb, var(--gm-c) 8%, #fff); border: 1px solid color-mix(in srgb, var(--gm-c) 25%, #fff); }
.gm-cta-emoji { font-size: 36px; }
.gm-cta p { margin: 2px 0 0; font-size: 14px; }

@media (max-width: 900px) {
  .gm-grid { grid-template-columns: 1fr; }
  .gm-phone { display: none; }
  .gm-row { grid-template-columns: 1fr; }
  .gm-cta { flex-direction: column; text-align: center; }
}

/* -------------------------------------------------------------- stage */
.gm-viewer { margin: 0; background: var(--gm-night); }
.gm-stage { position: relative; overflow: hidden; color: #fff; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--gm-c) 55%, var(--gm-night)) 0%, var(--gm-night) 70%); }
/* The theme colours headings/paragraphs; inside the stage everything follows the stage's white. */
.gm-stage h1, .gm-stage h2, .gm-stage h3, .gm-stage p, .gm-stage figcaption { color: inherit; }
.gm-stage .gm-polaroid figcaption, .gm-stage .gm-letter p { color: var(--gm-ink); }
.gm-stage-full { min-height: 100vh; min-height: 100dvh; height: 100%; }
.gm-scene { position: relative; z-index: 1; min-height: inherit; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px 20px; text-align: center; box-sizing: border-box; animation: gm-in .5s ease both; }
.gm-title { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.6em, 6vw, 2.6em); line-height: 1.15; margin: 0; max-width: 18ch; }
.gm-phone .gm-title { font-size: 1.6em; }
.gm-kicker { margin: 0; letter-spacing: .08em; text-transform: uppercase; font-size: .8em; opacity: .85; }
.gm-hint { margin: 0; opacity: .85; }
.gm-big { font-size: 3em; margin: 0; }
.gm-error { color: #ffb4c4; min-height: 1.2em; margin: 0; }
.gm-next, .gm-btn-yes, .gm-btn-no, .gm-final-actions .gm-btn-ghost { border: 0; border-radius: 999px; padding: 12px 26px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.gm-next { background: rgba(255,255,255,.15); color: #fff; backdrop-filter: blur(6px); }
.gm-btn-yes { background: var(--gm-c); color: #fff; transition: transform .2s; display: inline-block; }
.gm-btn-no { background: #fff; color: var(--gm-ink); }
.gm-final-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.gm-final-actions .gm-btn-ghost { background: rgba(255,255,255,.12); color: #fff; }
.gm-progress { position: absolute; top: 0; left: 0; right: 0; height: 4px; z-index: 2; background: rgba(255,255,255,.12); }
.gm-progress::after { content: ""; display: block; height: 100%; width: var(--gm-p); background: var(--gm-c); transition: width .4s; }

/* Gift box */
.gm-box { position: relative; width: 170px; height: 170px; border: 0; background: none; cursor: pointer; animation: gm-wiggle 2.4s ease-in-out infinite; }
.gm-box-body { position: absolute; left: 10px; right: 10px; bottom: 0; height: 110px; border-radius: 10px; background: linear-gradient(135deg, var(--gm-c), color-mix(in srgb, var(--gm-c) 60%, #000)); box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.gm-box-lid { position: absolute; left: 0; right: 0; top: 40px; height: 34px; border-radius: 8px; z-index: 2; background: color-mix(in srgb, var(--gm-c) 80%, #fff); transition: transform .8s cubic-bezier(.5,-.4,.5,1.4); }
.gm-box-ribbon { position: absolute; left: 50%; top: 40px; bottom: 0; width: 22px; margin-left: -11px; z-index: 3; background: #ffd166; }
.gm-box-ribbon::before { content: "🎀"; position: absolute; top: -34px; left: 50%; transform: translateX(-50%); font-size: 44px; }
.gm-box.is-open { animation: none; }
.gm-box.is-open .gm-box-lid, .gm-box.is-open .gm-box-ribbon { transform: translateY(-140px) rotate(-25deg); opacity: 0; transition: transform .8s, opacity .8s .3s; }
.gm-pinpad { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gm-pin-input { width: 170px; padding: 12px; border-radius: 14px; border: 2px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; text-align: center; font-size: 28px; letter-spacing: .5em; }
.gm-shake { animation: gm-shake .4s; }

/* Counter */
.gm-counter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(360px, 100%); }
.gm-cell { padding: 14px 8px; border-radius: 16px; background: rgba(255,255,255,.1); }
.gm-cell strong { display: block; font-size: 1.6em; font-variant-numeric: tabular-nums; }
.gm-cell span { font-size: .8em; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }

/* Cake */
.gm-cake { position: relative; width: 220px; }
.gm-candles { display: flex; justify-content: center; gap: 14px; height: 70px; align-items: flex-end; }
.gm-candle { position: relative; width: 12px; height: 46px; padding: 0; border: 0; border-radius: 3px; cursor: pointer; background: repeating-linear-gradient(45deg, #fff 0 6px, #ffb3cf 6px 12px); }
.gm-flame { position: absolute; left: 50%; top: -24px; width: 14px; height: 22px; margin-left: -7px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff7c2, #ffb703 55%, #fb5607); animation: gm-flicker .15s infinite alternate; box-shadow: 0 0 22px 8px rgba(255,183,3,.45); }
.gm-candle.is-out .gm-flame { opacity: 0; transform: scale(.2) translateY(-10px); transition: .4s; box-shadow: none; }
.gm-cake-top { height: 24px; border-radius: 12px 12px 0 0; background: #fff; }
.gm-cake-body { height: 90px; border-radius: 0 0 14px 14px; background: linear-gradient(#ff8fb3, #d6336c); }
.gm-mic { width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); background: transparent; font-size: 22px; cursor: pointer; }
.gm-mic.is-on { background: var(--gm-c); animation: gm-pulse 1s infinite; }

/* Toast */
.gm-toast { font-size: 110px; background: none; border: 0; cursor: pointer; line-height: 1; }
.gm-toast.is-clink { animation: gm-clink .6s ease; }

/* Question */
.gm-scene-question { position: relative; }
.gm-yesno { display: flex; gap: 16px; }

/* Photos */
.gm-polaroid { margin: 0; padding: 12px 12px 44px; background: #fff; color: var(--gm-ink); border-radius: 4px; width: min(300px, 80%); box-shadow: 0 20px 50px rgba(0,0,0,.45); transform: rotate(var(--gm-tilt, -3deg)); cursor: pointer; position: relative; }
.gm-polaroid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.gm-polaroid figcaption { position: absolute; left: 12px; right: 12px; bottom: 12px; font-family: "Segoe Script", "Bradley Hand", cursive; }
.gm-polaroid.is-in { animation: gm-drop .5s ease both; }
.gm-dots { display: flex; gap: 6px; }
.gm-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); }
.gm-dots i.is-on { background: #fff; }

/* Letter */
.gm-letter { width: min(520px, 100%); max-height: 62vh; overflow: auto; padding: 28px 26px; border-radius: 6px; background: var(--gm-paper); color: var(--gm-ink); text-align: left; box-shadow: 0 20px 50px rgba(0,0,0,.4);
  background-image: repeating-linear-gradient(transparent 0 31px, #efe3d3 31px 32px); }
.gm-letter-body { white-space: pre-wrap; margin: 0; font-family: "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive; font-size: 1.05em; line-height: 32px; }
.gm-sign { text-align: right; margin: 12px 0 0; font-family: "Segoe Script", "Bradley Hand", cursive; }

/* Finale */
.gm-ideas { width: min(520px, 100%); text-align: left; }
.gm-ideas h3 { font-size: 1em; text-align: center; opacity: .85; }
.gm-idea { display: flex; align-items: center; gap: 12px; padding: 10px; margin: 8px 0; border-radius: 12px; background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.gm-idea img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }

/* Effects */
.gm-confetti, .gm-hearts { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.gm-confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: gm-fall linear forwards; }
.gm-hearts span { position: absolute; bottom: -30px; animation: gm-rise 7s linear infinite; opacity: .7; }
.gm-report { position: fixed; right: 10px; bottom: 10px; z-index: 5; background: none; border: 0; color: rgba(255,255,255,.35); font-size: 12px; cursor: pointer; }
.gm-noscript { color: #fff; text-align: center; padding: 40px; }

@keyframes gm-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes gm-wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-5deg); } 90% { transform: rotate(5deg); } 95% { transform: rotate(-3deg); } }
@keyframes gm-shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes gm-flicker { to { transform: scale(1.06, .94) rotate(2deg); } }
@keyframes gm-pulse { 50% { box-shadow: 0 0 0 10px rgba(255,255,255,.1); } }
@keyframes gm-clink { 30% { transform: rotate(-12deg) scale(1.1); } 60% { transform: rotate(10deg) scale(1.15); } }
@keyframes gm-drop { from { opacity: 0; transform: translateY(-30px) rotate(0); } }
@keyframes gm-fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes gm-rise { to { transform: translateY(-110vh); } }

@media (prefers-reduced-motion: reduce) {
  .gm-scene, .gm-box, .gm-flame, .gm-polaroid.is-in, .gm-hearts span { animation: none !important; }
}
