/* Little Hanniel e-Gift — shared styles for /gift and /g/<code>.
   Tokens mirror styles.css :root so the pages feel like the main site. */

@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/playfair-400.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/lora-400.woff2') format('woff2'); }

:root {
  --bg-page: #FDFAF6;
  --bg-subtle: #F5EFE6;
  --surface: #FFFFFF;
  --surface-inset: #F8F2EA;
  --text-strong: #2B2118;
  --text-body: #3A3028;
  --text-secondary: #5C5046;
  --text-muted: #A89E94;
  --accent: #A67C52;
  --accent-hover: #8B6540;
  --accent-soft: #EFE0C9;
  --gold: #D4A24C;
  --gold-soft: #F7E7C4;
  --sage: #8A9A6B;
  --sage-soft: #DDE3CE;
  --berry: #D9737F;
  --whatsapp: #25D366;
  --whatsapp-ink: #128C4A;
  --border: #E8DDD3;
  --border-strong: #DBCDBE;
  --danger: #B5483A;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
  --font-sans: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-hand: 'Gochi Hand', 'Comic Sans MS', cursive;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(43, 33, 24, 0.06);
  --shadow-md: 0 8px 24px rgba(43, 33, 24, 0.08);
  --shadow-lg: 0 18px 48px rgba(43, 33, 24, 0.14);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */

.gx-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: rgba(253, 250, 246, 0.86);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.gx-sound {
  margin-left: auto; width: 36px; height: 36px; flex: none; padding: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 15px; line-height: 1;
  background: transparent; border: 0; border-radius: 50%;
}
.gx-sound:hover { background: rgba(43, 33, 24, 0.06); }
.gx-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-strong); }
.gx-brand img { height: 34px; width: auto; }
.gx-brand span { font-family: var(--font-sans); font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }

.gx-wrap { width: 100%; max-width: 520px; margin: 0 auto; padding: 8px 16px 160px; }

.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.gx-h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 7vw, 36px); line-height: 1.1; letter-spacing: -0.02em; color: var(--text-strong); margin: 0 0 8px; }
.gx-h2 { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; color: var(--text-strong); margin: 0 0 12px; }
.gx-lead { font-family: var(--font-body); color: var(--text-secondary); margin: 0 0 20px; }
.muted { color: var(--text-muted); font-size: 13px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; width: 100%;
  border: 0; border-radius: var(--radius-pill);
  background: var(--text-strong); color: #FDFAF6;
  font-weight: 600; font-size: 16px; letter-spacing: 0.01em; text-decoration: none;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s, background 0.2s, opacity 0.2s;
  box-shadow: 0 6px 18px rgba(43, 33, 24, 0.18);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn--wa { background: var(--whatsapp); color: #06301A; box-shadow: 0 8px 22px rgba(37, 211, 102, 0.38); }
.btn--ghost { background: transparent; color: var(--text-strong); box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.btn--gold { background: linear-gradient(135deg, #E9C072, var(--gold) 55%, #B9852F); color: #2B2118; box-shadow: 0 8px 22px rgba(212, 162, 76, 0.42); }
.btn--sm { min-height: 40px; padding: 0 16px; width: auto; font-size: 14px; }
.btn.is-loading { pointer-events: none; opacity: 0.8; }
.btn.is-loading::after { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  border-radius: var(--radius-pill); border: 1.5px solid var(--border-strong);
  background: var(--surface); font-size: 14px; font-weight: 500; color: var(--text-body);
  transition: transform 0.2s var(--ease-spring), border-color 0.2s, background 0.2s;
}
.chip:active { transform: scale(0.94); }
.chip[aria-pressed="true"] { border-color: var(--text-strong); background: var(--text-strong); color: #FDFAF6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- step progress (grows as you go) ---------- */

.steps { display: flex; gap: 6px; margin: 4px 0 20px; }
.steps__seg { flex: 1; height: 5px; border-radius: 99px; background: var(--border); overflow: hidden; }
.steps__seg i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: inherit; transition: width 0.7s var(--ease-out); }
.steps__seg.is-done i { width: 100%; }

.view { animation: viewIn 0.5s var(--ease-out) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }

/* ---------- surfaces ---------- */

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 14px; }
.stack > * + * { margin-top: 14px; }

/* ---------- line picker ---------- */

.lines { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.line {
  position: relative; text-align: left; padding: 0; overflow: hidden;
  border-radius: var(--radius-lg); border: 2px solid transparent;
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease-spring), border-color 0.2s, box-shadow 0.3s;
}
.line img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.line__body { padding: 10px 12px 12px; }
.line__name { font-family: var(--font-display); font-size: 17px; color: var(--text-strong); }
.line__price { font-size: 13px; color: var(--text-secondary); }
.line[aria-pressed="true"] { border-color: var(--text-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.line[aria-pressed="true"]::after {
  content: '✓'; position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--text-strong); color: #fff; font-size: 14px;
  animation: pop 0.4s var(--ease-spring);
}

/* ---------- stepper ---------- */

.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 6px 0 14px; }
.stepper button {
  width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  background: var(--surface); font-size: 24px; line-height: 1; color: var(--text-strong);
  transition: transform 0.2s var(--ease-spring), background 0.2s;
}
.stepper button:active { transform: scale(0.88); background: var(--bg-subtle); }
.stepper__val { min-width: 84px; text-align: center; }
.stepper__num { font-family: var(--font-display); font-size: 52px; line-height: 1; color: var(--text-strong); display: inline-block; }
.stepper__num.bump { animation: bump 0.35s var(--ease-spring); }
.stepper__lbl { display: block; font-size: 12px; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
@keyframes bump { 40% { transform: scale(1.18); } }

/* ---------- stamp card ---------- */

.stamps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0 4px; }
.stamp {
  position: relative; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px;
  border: 1.5px dashed var(--border-strong); background: var(--surface-inset);
}
.stamp.is-filled { border-style: solid; border-color: var(--accent-soft); background: var(--accent-soft); animation: pop 0.45s var(--ease-spring) both; }
.stamp.is-bonus { border: 0; background: radial-gradient(circle at 30% 25%, #FFF3D6, var(--gold) 70%); box-shadow: 0 4px 14px rgba(212, 162, 76, 0.5); animation: popGold 0.7s var(--ease-spring) both; overflow: hidden; }
.stamp.is-bonus::before { content: 'FREE'; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); font-size: 8px; font-weight: 800; letter-spacing: 0.08em; color: #5A3E10; }
.stamp.is-bonus::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,0.75) 50%, transparent 65%); transform: translateX(-120%); animation: sheen 2.6s 0.6s infinite; }
.stamp.is-ghost-bonus { border-color: var(--gold); color: var(--gold); font-size: 13px; font-weight: 800; }
.stamp.is-used { background: var(--sage-soft); border: 0; }
.stamp.is-used::after { content: '✓'; position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--sage); color: #fff; font-size: 11px; display: grid; place-items: center; }
.stamp.is-ready { border-style: solid; border-color: var(--accent); background: var(--surface); }
@keyframes pop { 0% { transform: scale(0.2); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes popGold { 0% { transform: scale(0) rotate(-40deg); } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* ---------- goal bar ---------- */

.goal { margin-top: 12px; }
.goal__row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.goal__row b { color: var(--text-strong); }
.bar { position: relative; height: 12px; border-radius: 99px; background: var(--bg-subtle); overflow: hidden; }
.bar > i {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.8s var(--ease-out);
}
.bar > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent); transform: translateX(-100%); animation: sheen 2.2s infinite; }
.bar--sage > i { background: linear-gradient(90deg, var(--sage), #B5C48F); }
.bar--lg { height: 16px; }

.unlock {
  position: fixed; left: 50%; top: 38%; z-index: 60; pointer-events: none;
  transform: translate(-50%, -50%);
  padding: 12px 20px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #F4D68F, var(--gold)); color: #3B2A0C;
  font-weight: 800; font-size: 16px; box-shadow: 0 12px 30px rgba(212, 162, 76, 0.5);
  animation: unlock 1.6s var(--ease-out) forwards; white-space: nowrap;
}
@keyframes unlock {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  30% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(0.95); }
}

/* ---------- summary bar (sticky bottom CTA) ---------- */

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg-page) 70%, rgba(253, 250, 246, 0));
}
.dock__inner { max-width: 520px; margin: 0 auto; }
.dock__sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--text-secondary); margin: 0 4px 8px; }
.dock__sum b { font-size: 17px; color: var(--text-strong); }
.dock__sum > span { white-space: nowrap; }
.dock__sum small { display: block; font-size: 12px; }
.dock__sum { align-items: flex-end; }
.save { color: var(--whatsapp-ink); font-weight: 700; }

/* ---------- the gift card ---------- */

.card-stage { perspective: 1100px; margin: 4px auto 18px; max-width: 360px; }
/* .gcard tilts, .gcard__inner flips, the two faces are real 3D planes.
   Nothing above the faces may set overflow/opacity/filter/isolation, or 3D flattens. */
.gcard {
  --c1: #FBF5EC; --c2: #EFE0C9; --ink: #2B2118; --sub: #8B6540; --dot: rgba(43, 33, 24, 0.14);
  position: relative; aspect-ratio: 1.586; color: var(--ink); cursor: pointer;
  transform-style: preserve-3d; transition: transform 0.6s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.gcard__inner { position: absolute; inset: 0; transform-style: preserve-3d; }
.gcard__face {
  position: absolute; inset: 0; border-radius: 20px; padding: 18px 20px;
  background: linear-gradient(140deg, var(--c1), var(--c2));
  box-shadow: 0 22px 44px rgba(43, 33, 24, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  overflow: hidden; isolation: isolate;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.gcard[data-theme="sage"] { --c1: #EEF2E4; --c2: #A9B88A; --ink: #23301A; --sub: #4D5C35; --dot: rgba(35, 48, 26, 0.16); }
.gcard[data-theme="cocoa"] { --c1: #4A3627; --c2: #21180F; --ink: #FBF3E6; --sub: #E9C072; --dot: rgba(251, 243, 230, 0.2); }
.gcard[data-theme="berry"] { --c1: #FDEEF0; --c2: #EBA3AD; --ink: #4A1E25; --sub: #9C3B4A; --dot: rgba(74, 30, 37, 0.15); }
.gcard__face::before { /* paper grain + soft pattern */
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0.5;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.4px); background-size: 14px 14px;
  mask-image: linear-gradient(120deg, transparent 40%, #000);
  -webkit-mask-image: linear-gradient(120deg, transparent 40%, #000);
}
.gcard__front::after { /* foil sweep */
  content: ''; position: absolute; inset: -40%; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.55) 50%, transparent 58%);
  transform: translateX(var(--sx, -60%)); transition: transform 0.2s linear;
  animation: foil 4.5s 1s infinite;
}
@keyframes foil { 0%, 70% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
.gcard__top { display: flex; justify-content: space-between; align-items: flex-start; }
.gcard__brand { font-family: var(--font-hand); font-size: 22px; line-height: 1; }
.gcard__tag { font-size: 9px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sub); border: 1px solid currentColor; border-radius: 99px; padding: 4px 8px; }
.gcard__mid { display: flex; align-items: baseline; gap: 10px; }
.gcard__num { font-family: var(--font-display); font-size: clamp(48px, 15vw, 62px); line-height: 0.9; letter-spacing: -0.03em; }
.gcard__what { font-family: var(--font-display); font-size: 17px; line-height: 1.15; }
.gcard__what small { display: block; font-family: var(--font-sans); font-size: 11px; color: var(--sub); font-weight: 700; letter-spacing: 0.04em; }
.gcard__bot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; font-size: 12px; }
.gcard__to b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 18px; }
.gcard__to span { color: var(--sub); }
.gcard__code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; letter-spacing: 0.12em; color: var(--sub); }
.gcard__ribbon {
  position: absolute; top: 16px; right: -38px; z-index: 3; transform: rotate(35deg);
  background: var(--gold); color: #3B2A0C; font-size: 10px; font-weight: 800; letter-spacing: 0.14em;
  padding: 5px 44px; text-transform: uppercase; box-shadow: var(--shadow-sm);
}
.gcard__ribbon ~ .gcard__top .gcard__tag { margin-right: 46px; }
.gcard__back {
  transform: rotateY(180deg); padding: 22px;
  background: linear-gradient(140deg, var(--c2), var(--c1));
  justify-content: center; align-items: center; text-align: center; gap: 2px;
}
.gcard__seal {
  position: absolute; top: 14px; left: 50%; margin-left: -15px; width: 30px; height: 30px;
  border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: #3B2A0C;
  background: radial-gradient(circle at 35% 30%, #F3D08A, var(--gold) 60%, #A87B2C);
  box-shadow: 0 2px 6px rgba(43, 33, 24, 0.25), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}
.gcard__brand--back { position: absolute; bottom: 12px; left: 0; right: 0; font-size: 14px; opacity: 0.55; }
.gcard__msg { font-family: var(--font-hand); font-size: 22px; line-height: 1.25; }
.gcard__sig { margin-top: 10px; font-size: 13px; color: var(--sub); }

/* The flip: lift off the table, spin with a slight wobble, overshoot, settle.
   Always turns the same way (0 → 180 → 360) like flipping a real card. */
.gcard.is-flip .gcard__inner { transform: rotateY(180deg); }
.gcard.is-flipping-back .gcard__inner { animation: flipToBack 0.78s cubic-bezier(0.3, 0.7, 0.3, 1) both; }
.gcard.is-flipping-front .gcard__inner { animation: flipToFront 0.78s cubic-bezier(0.3, 0.7, 0.3, 1) both; }
@keyframes flipToBack {
  0%   { transform: translateZ(0) rotateY(0) rotateZ(0) scale(1); }
  18%  { transform: translateZ(40px) rotateY(-14deg) rotateZ(-2deg) scale(1.04); }
  62%  { transform: translateZ(70px) rotateY(196deg) rotateZ(2deg) scale(1.08); }
  82%  { transform: translateZ(20px) rotateY(174deg) rotateZ(-0.6deg) scale(1.01); }
  100% { transform: translateZ(0) rotateY(180deg) rotateZ(0) scale(1); }
}
@keyframes flipToFront {
  0%   { transform: translateZ(0) rotateY(180deg) rotateZ(0) scale(1); }
  18%  { transform: translateZ(40px) rotateY(166deg) rotateZ(2deg) scale(1.04); }
  62%  { transform: translateZ(70px) rotateY(376deg) rotateZ(-2deg) scale(1.08); }
  82%  { transform: translateZ(20px) rotateY(354deg) rotateZ(0.6deg) scale(1.01); }
  100% { transform: translateZ(0) rotateY(360deg) rotateZ(0) scale(1); }
}
/* Light catches the card as it turns, and its shadow stretches while it's in the air. */
.gcard__shine {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.75) 48%, rgba(255, 240, 200, 0.4) 54%, transparent 70%);
  background-size: 250% 100%; mix-blend-mode: soft-light;
}
.gcard.is-flipping-back .gcard__shine,
.gcard.is-flipping-front .gcard__shine { animation: flipShine 0.78s ease-out; }
@keyframes flipShine {
  0% { opacity: 0; background-position: 100% 0; }
  35% { opacity: 1; }
  100% { opacity: 0; background-position: -60% 0; }
}
.gcard.is-flipping-back .gcard__face,
.gcard.is-flipping-front .gcard__face { animation: flipShadow 0.78s ease-out; }
@keyframes flipShadow {
  50% { box-shadow: 0 46px 70px rgba(43, 33, 24, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.5); }
}
.card-hint { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: -8px; margin-bottom: 14px; }

/* ---------- form fields ---------- */

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--text-strong); margin-bottom: 6px; }
.input {
  width: 100%; min-height: 52px; padding: 12px 16px;
  border-radius: var(--radius-md); border: 1.5px solid var(--border-strong); background: var(--surface);
  font-size: 16px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--text-strong); box-shadow: 0 0 0 4px rgba(166, 124, 82, 0.15); }
textarea.input { min-height: 88px; resize: none; font-family: var(--font-body); }
.counter { float: right; font-weight: 400; color: var(--text-muted); }
.phone { display: flex; align-items: stretch; border-radius: var(--radius-md); border: 1.5px solid var(--border-strong); background: var(--surface); overflow: hidden; transition: border-color 0.2s, box-shadow 0.2s; }
.phone:focus-within { border-color: var(--text-strong); box-shadow: 0 0 0 4px rgba(166, 124, 82, 0.15); }
.phone b { display: grid; place-items: center; padding: 0 12px 0 14px; font-weight: 600; color: var(--text-secondary); border-right: 1px solid var(--border); background: var(--surface-inset); }
.phone input { flex: 1; min-width: 0; border: 0; outline: none; padding: 12px 14px; font-size: 18px; letter-spacing: 0.04em; background: transparent; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

.swatches { display: flex; gap: 12px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--border-strong); transition: transform 0.25s var(--ease-spring), box-shadow 0.2s; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--text-strong); transform: scale(1.1); }
.swatch[data-v="cream"] { background: linear-gradient(140deg, #FBF5EC, #EFE0C9); }
.swatch[data-v="sage"] { background: linear-gradient(140deg, #EEF2E4, #A9B88A); }
.swatch[data-v="cocoa"] { background: linear-gradient(140deg, #4A3627, #21180F); }
.swatch[data-v="berry"] { background: linear-gradient(140deg, #FDEEF0, #EBA3AD); }

/* ---------- OTP sheet ---------- */

.sheet-bg { position: fixed; inset: 0; z-index: 70; background: rgba(43, 33, 24, 0.42); animation: fade 0.3s both; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71;
  max-width: 520px; margin: 0 auto; max-height: 92dvh; overflow: auto;
  background: var(--bg-page); border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(43, 33, 24, 0.2);
  animation: sheetUp 0.45s var(--ease-out) both;
}
.sheet::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 9px; background: var(--border-strong); margin: 0 auto 16px; }
.sheet.is-closing { animation: sheetDown 0.3s ease-in both; }
.sheet-bg.is-closing { animation: fade 0.3s reverse both; }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet__x { position: absolute; top: 12px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bg-subtle); font-size: 18px; }
.sheet__icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: #DCF8E7; font-size: 28px; margin-bottom: 12px; }

.otp { position: relative; margin: 16px 0 6px; }
.otp__boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; pointer-events: none; }
.otp__box {
  aspect-ratio: 0.86; border-radius: var(--radius-md); border: 1.5px solid var(--border-strong);
  background: var(--surface); display: grid; place-items: center;
  font-family: var(--font-display); font-size: 28px; color: var(--text-strong);
  transition: border-color 0.2s, transform 0.2s var(--ease-spring), background 0.2s;
}
.otp__box.is-active { border-color: var(--text-strong); box-shadow: 0 0 0 4px rgba(166, 124, 82, 0.15); }
.otp__box.is-filled { animation: pop 0.3s var(--ease-spring); }
.otp.is-ok .otp__box { border-color: var(--whatsapp); background: #E8FBEF; }
.otp.is-bad .otp__boxes { animation: shake 0.45s; }
.otp.is-bad .otp__box { border-color: var(--danger); }
.otp input { position: absolute; inset: 0; opacity: 0; width: 100%; font-size: 16px; caret-color: transparent; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--accent-hover); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:disabled { color: var(--text-muted); text-decoration: none; }
.devcode { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--gold-soft); font-size: 13px; }

/* ---------- payment ---------- */

.pay__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.pay__row:last-child { border-bottom: 0; }
.pay__row span { font-size: 13px; color: var(--text-secondary); }
.pay__row b { font-size: 16px; color: var(--text-strong); text-align: right; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.06em; }
.copy { border: 0; border-radius: 99px; padding: 6px 12px; background: var(--bg-subtle); font-size: 12px; font-weight: 700; color: var(--text-strong); margin-left: 8px; transition: transform 0.2s var(--ease-spring); }
.copy.is-done { background: #DCF8E7; color: var(--whatsapp-ink); transform: scale(1.06); }

/* ---------- dashboard ---------- */

.level {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 20px;
  background: linear-gradient(140deg, #3A2A1E, #21180F); color: #FBF3E6; box-shadow: var(--shadow-lg);
}
.level::after { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(233, 192, 114, 0.35), transparent 70%); }
.level__name { font-family: var(--font-display); font-size: 28px; line-height: 1.1; margin: 2px 0 4px; }
.level .eyebrow { color: #E9C072; }
.level__sub { font-size: 13px; opacity: 0.75; margin-bottom: 14px; }
.level .bar { background: rgba(255, 255, 255, 0.12); }
.level__foot { display: flex; justify-content: space-between; font-size: 12px; opacity: 0.8; margin-top: 8px; }
.level__icon { position: absolute; right: 18px; top: 18px; font-size: 44px; z-index: 1; animation: float 3.5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px) rotate(-4deg); } }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 400; color: var(--text-strong); line-height: 1.1; }
.stat span { font-size: 11px; color: var(--text-muted); letter-spacing: 0.04em; }

.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.ring .ring__track { stroke: var(--bg-subtle); }
.ring .ring__val { stroke: url(#ringGrad); transition: stroke-dashoffset 1.4s var(--ease-out); }
.ring__txt { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring__txt b { font-family: var(--font-display); font-size: 28px; font-weight: 400; color: var(--text-strong); line-height: 1; }
.ring__txt em { font-style: normal; }
.ring__txt span { display: block; font-size: 10px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.joy { display: flex; align-items: center; gap: 16px; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.badge { text-align: center; padding: 12px 6px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); }
.badge__i { width: 48px; height: 48px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--gold-soft); box-shadow: inset 0 0 0 2px #EBCB8B; }
.badge b { display: block; font-size: 12px; color: var(--text-strong); line-height: 1.2; }
.badge span { display: block; font-size: 10px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }
.badge.is-locked .badge__i { filter: grayscale(1); opacity: 0.35; background: var(--bg-subtle); box-shadow: inset 0 0 0 2px var(--border); }
.badge.is-locked b { color: var(--text-muted); }
.badge.is-new .badge__i { animation: popGold 0.8s var(--ease-spring) both; }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--bg-subtle); margin: 18px 0 12px; }
.tabs button { flex: 1; min-height: 40px; border: 0; border-radius: var(--radius-pill); background: transparent; font-weight: 600; font-size: 14px; color: var(--text-secondary); transition: background 0.25s, color 0.25s; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow-sm); }

.glist { list-style: none; margin: 0; padding: 0; }
.gitem { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: inherit; transition: transform 0.2s var(--ease-spring); }
.gitem:active { transform: scale(0.98); }
.gitem + .gitem { margin-top: 8px; }
.gitem__ic { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); }
.gitem__main { flex: 1; min-width: 0; }
.gitem__t { font-weight: 600; color: var(--text-strong); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gitem__s { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.gitem .bar { height: 6px; }
.gitem__thx { font-size: 24px; animation: pop 0.5s var(--ease-spring); }
.pill { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--bg-subtle); color: var(--text-secondary); }
.pill--wait { background: var(--gold-soft); color: #7A5512; }
.pill--live { background: #DCF8E7; color: var(--whatsapp-ink); }
.pill--done { background: var(--sage-soft); color: #4D5C35; }
.empty { text-align: center; padding: 28px 12px; color: var(--text-muted); font-size: 14px; }
.empty i { display: block; font-style: normal; font-size: 40px; margin-bottom: 6px; }

/* ---------- recipient: unwrap ---------- */

.unwrap { min-height: calc(100dvh - 64px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px 16px 40px; }
.unwrap .gx-h1 { max-width: 320px; }
.box { position: relative; width: 190px; height: 190px; margin: 26px auto 22px; border: 0; background: none; padding: 0; }
.box__glow { position: absolute; inset: -30px; border-radius: 50%; background: radial-gradient(circle, rgba(233, 192, 114, 0.55), transparent 65%); animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { transform: scale(1.12); opacity: 0.7; } }
.box__base, .box__lid { position: absolute; left: 50%; transform: translateX(-50%); }
.box__base { bottom: 0; width: 160px; height: 120px; border-radius: 10px 10px 16px 16px; background: linear-gradient(160deg, #C29468, #8B6540); box-shadow: 0 20px 40px rgba(43, 33, 24, 0.25); }
.box__base::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 26px; transform: translateX(-50%); background: linear-gradient(90deg, #E9C072, #D4A24C, #E9C072); }
.box__lid { bottom: 112px; width: 176px; height: 40px; border-radius: 10px; background: linear-gradient(160deg, #D4A57A, #9C7148); box-shadow: 0 6px 12px rgba(43, 33, 24, 0.2); transform-origin: 30% 100%; z-index: 2; }
.box__lid::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 28px; transform: translateX(-50%); background: linear-gradient(90deg, #E9C072, #D4A24C, #E9C072); }
.box__bow { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); width: 80px; height: 40px; }
.box__bow::before, .box__bow::after { content: ''; position: absolute; bottom: -4px; width: 40px; height: 34px; border-radius: 50% 50% 10% 50%; background: linear-gradient(160deg, #F0CF86, #C99436); box-shadow: inset 0 -4px 6px rgba(0,0,0,0.1); }
.box__bow::before { left: 0; transform: rotate(-24deg); }
.box__bow::after { right: 0; transform: rotate(24deg) scaleX(-1); }
.box.is-idle { animation: wiggle 2.8s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-6deg); } 88% { transform: rotate(5deg); } 92% { transform: rotate(-3deg); } 96% { transform: rotate(2deg); } }
.box.is-shake { animation: bigShake 0.6s ease-in-out; }
@keyframes bigShake { 0%, 100% { transform: translate(0) rotate(0); } 15% { transform: translate(-6px, 2px) rotate(-7deg); } 30% { transform: translate(6px, -2px) rotate(7deg); } 45% { transform: translate(-5px, 1px) rotate(-5deg); } 60% { transform: translate(5px, 0) rotate(5deg); } 80% { transform: scale(1.06, 0.94); } }
.box.is-open .box__lid { animation: lidOff 0.9s var(--ease-out) forwards; }
@keyframes lidOff { to { transform: translate(60px, -180px) rotate(48deg); opacity: 0; } }
.box.is-open .box__base { animation: baseDrop 0.9s 0.2s ease-in forwards; }
@keyframes baseDrop { to { transform: translate(-50%, 40px) scale(0.9); opacity: 0; } }
.tap { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.4; } }

.reveal-card { animation: cardRise 1s var(--ease-spring) both; }
@keyframes cardRise { 0% { opacity: 0; transform: translateY(120px) scale(0.4) rotate(-12deg); } 100% { opacity: 1; transform: none; } }
.reveal-copy { animation: viewIn 0.6s 0.6s var(--ease-out) both; }

/* ---------- recipient: wallet ---------- */

.jar__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.jar__head b { font-family: var(--font-display); font-weight: 400; font-size: 30px; color: var(--text-strong); }
.jar__head span { font-size: 13px; color: var(--text-secondary); }
.flavors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 14px; }
.flavor { padding: 0; overflow: hidden; border-radius: var(--radius-md); border: 2px solid var(--border); background: var(--surface); text-align: center; transition: transform 0.25s var(--ease-spring), border-color 0.2s; }
.flavor img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.flavor__ph { aspect-ratio: 1; display: grid; place-items: center; font-size: 34px; background: var(--accent-soft); }
.flavor span { display: block; padding: 6px 4px 8px; font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--text-strong); }
.flavor[aria-pressed="true"] { border-color: var(--text-strong); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.react { display: flex; justify-content: space-between; gap: 6px; }
.react button { flex: 1; aspect-ratio: 1; max-width: 54px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface); font-size: 24px; transition: transform 0.25s var(--ease-spring); }
.react button:active { transform: scale(0.85); }
.react button[aria-pressed="true"] { border-color: var(--text-strong); transform: scale(1.12); background: var(--gold-soft); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius-md); background: var(--gold-soft); color: #5A3E10; font-size: 14px; }
.notice i { font-style: normal; font-size: 22px; line-height: 1; }
.hist { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.hist li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.hist li:last-child { border-bottom: 0; }

.done-hero { text-align: center; padding: 8px 0 6px; }
.done-hero i { display: block; font-style: normal; font-size: 54px; animation: popGold 0.9s var(--ease-spring) both; }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 80; transform: translateX(-50%); padding: 10px 18px; border-radius: 99px; background: var(--text-strong); color: #FDFAF6; font-size: 14px; box-shadow: var(--shadow-lg); animation: toast 2.6s var(--ease-out) forwards; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 20px); } 12%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 10px); } }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

@media (min-width: 760px) {
  .gx-wrap { padding-top: 24px; }
}

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

/* Windows' "animate controls" setting off also reports reduced motion, for many people
   who never chose it. A tap should still visibly turn the card, so keep a short, plain
   turn here: no lift, wobble or overshoot. This must stay after the rule above. */
@media (prefers-reduced-motion: reduce) {
  .gcard.is-flipping-back .gcard__inner { animation: flipPlainBack 0.45s ease-in-out both !important; }
  .gcard.is-flipping-front .gcard__inner { animation: flipPlainFront 0.45s ease-in-out both !important; }
}
@keyframes flipPlainBack { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
@keyframes flipPlainFront { from { transform: rotateY(180deg); } to { transform: rotateY(360deg); } }

/* ---------- legal pages and page footers ---------- */

.legal-foot { max-width: 520px; margin: 0 auto; padding: 8px 16px 170px; text-align: center; font-size: 12px; color: var(--text-secondary); }
.legal-foot p { margin: 4px 0; }
.legal-foot a, .legal-note a, .legal a { color: var(--accent-hover); text-decoration: underline; }
.legal-note { text-align: center; font-size: 12px; color: var(--text-secondary); margin: 14px 0 0; }
.gift-about { max-width: 520px; margin: -130px auto 24px; padding: 0 16px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.gift-about h2 { font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--text-strong); margin: 0 0 6px; }
.gift-about ul { list-style: none; margin: 10px 0; padding: 0; }
.gift-about li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.gift-about b { color: var(--text-strong); white-space: nowrap; }
.legal { padding-bottom: 24px; color: var(--text-body); font-size: 15px; line-height: 1.6; }
.legal h2 { font-family: var(--font-display); font-weight: 400; font-size: 19px; color: var(--text-strong); margin: 24px 0 6px; }
.legal p { margin: 0 0 10px; }
.legal ul { margin: 0 0 10px; padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }
.legal + .legal-foot { padding-bottom: 32px; }
