/* ==========================================================================
   Secret Santa : thème "Noël sobre" : sapin profond, crème, rouge baie, or doux
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --pine: #1d3b33;
  --pine-2: #2a5246;
  --pine-deep: #10221c;
  --cream: #f5f0e6;
  --paper: #fffdf9;
  --ink: #1d2521;
  --muted: #6f7670;
  --line: #e7e0d2;
  --red: #a3302b;
  --red-dark: #82231f;
  --gold: #b88d4e;
  --gold-soft: #efe3cc;
  --green-soft: #e3ece6;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(29, 37, 33, .05), 0 10px 30px -12px rgba(29, 37, 33, .18);
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html { background: var(--pine-deep); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 15.5px/1.55 var(--sans);
  color: var(--ink);
  background: radial-gradient(1100px 600px at 50% -10%, #24483d 0%, var(--pine-deep) 65%) fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--pine-2); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Colonne "mobile" centrée, y compris sur PC */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: clip;
}
@media (min-width: 560px) {
  body { padding: 32px 0; }
  .app { min-height: calc(100dvh - 64px); border-radius: 28px; box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .55); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  color: var(--cream);
  padding: calc(52px + env(safe-area-inset-top)) 24px 78px;
  background:
    radial-gradient(120% 90% at 50% 0%, #2f5c4f 0%, var(--pine) 55%, var(--pine-deep) 100%);
}
.hero-compact { padding-top: calc(34px + env(safe-area-inset-top)); padding-bottom: 66px; }
.hero-inner { position: relative; z-index: 2; }
.hero .sparkle { color: var(--gold); width: 26px; height: 26px; display: block; margin: 0 auto 10px; }
.eyebrow {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold-soft);
  opacity: .85;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 8.6vw, 40px);
  line-height: 1.08;
  letter-spacing: -.01em;
  margin: 10px 0 10px;
  text-wrap: balance;
}
.hero-compact h1 { font-size: clamp(26px, 7vw, 32px); }
.hero-sub { margin: 0; color: rgba(245, 240, 230, .78); font-size: 15px; }
.hero-sub a { color: var(--gold-soft); }
.hero-chip {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; padding: 6px 12px;
  border: 1px solid rgba(239, 227, 204, .28);
  border-radius: 999px;
  font-size: 13px; color: var(--gold-soft);
  background: rgba(255, 255, 255, .04);
}
.hero-action {
  position: absolute; z-index: 3;
  top: calc(14px + env(safe-area-inset-top)); right: 14px;
  color: var(--gold-soft);
  background: rgba(255, 255, 255, .06);
  border-color: rgba(239, 227, 204, .2);
}
.treeline {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  width: 100%; height: 64px;
  color: var(--pine-deep); opacity: .55;
}

/* Neige légère */
.snow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.snow i {
  position: absolute; top: -10px; left: var(--x);
  width: var(--s); height: var(--s);
  border-radius: 50%;
  background: #fff;
  opacity: var(--o);
  animation: snow var(--d) linear var(--delay) infinite;
}
@keyframes snow { to { transform: translate3d(var(--drift), 460px, 0); } }
@media (prefers-reduced-motion: reduce) { .snow { display: none; } }

/* ---------- Contenu ---------- */
.content { flex: 1; position: relative; z-index: 2; margin-top: -40px; padding: 0 14px 28px; }
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin-bottom: 14px;
}
.card > h2, .card-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  margin: 0 0 12px;
  display: flex; align-items: center; gap: 12px;
}
.card-title .count { margin-left: auto; font: 500 13px var(--sans); color: var(--muted); }
.ico {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--gold-soft);
  color: var(--red);
}
.ico svg { width: 18px; height: 18px; }
.card p { margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.stack > * + * { margin-top: 10px; }

.prose p { margin: 0 0 10px; }
.prose ul { margin: 0; padding: 0; list-style: none; }
.prose li { position: relative; padding-left: 22px; margin: 0 0 9px; }
.prose li::before {
  content: ''; position: absolute; left: 4px; top: .62em;
  width: 7px; height: 7px; transform: rotate(45deg);
  background: var(--gold); border-radius: 1px;
}

.budget { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.budget-amount { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--red); letter-spacing: -.02em; }
.budget-label { color: var(--muted); font-size: 14px; }

.info-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.info-row + .info-row { border-top: 1px dashed var(--line); }
.info-row svg { flex: none; width: 18px; height: 18px; color: var(--gold); margin-top: 3px; }
.info-row strong { display: block; font-weight: 600; }

.steps { counter-reset: step; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: step; display: flex; gap: 14px; align-items: flex-start; padding: 8px 0; }
.steps li::before {
  content: counter(step);
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font: 500 14px var(--serif);
  color: var(--pine); background: var(--green-soft);
}

.names { display: flex; flex-wrap: wrap; gap: 8px; }
.name-tag {
  padding: 6px 12px; border-radius: 999px;
  background: var(--cream); border: 1px solid var(--line);
  font-size: 14px;
}

.footer { text-align: center; padding: 8px 16px calc(28px + env(safe-area-inset-bottom)); font-size: 13px; }
.footer a { color: var(--muted); text-decoration: none; }

/* ---------- Formulaires ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #3c443f; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.input, .field input, .field select, .field textarea {
  width: 100%;
  font-size: 16px; /* évite le zoom iOS */
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--pine-2);
  box-shadow: 0 0 0 3px rgba(42, 82, 70, .14);
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.row > .narrow { flex: 0 0 76px; }

.switch-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; cursor: pointer; }
.switch-row + .switch-row { border-top: 1px dashed var(--line); }
.switch-row > span { flex: 1; }
.switch-row strong { display: block; font-weight: 600; font-size: 15px; }
.switch-row small { color: var(--muted); font-size: 13px; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 46px; height: 28px; border-radius: 999px;
  background: #d9d3c6; position: relative; cursor: pointer; transition: background .2s;
  margin: 0;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s;
}
.switch:checked { background: var(--pine-2); }
.switch:checked::after { transform: translateX(18px); }

.check-row { display: flex; gap: 10px; align-items: center; margin: 4px 0 14px; font-size: 14.5px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--pine-2); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border-radius: 14px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none;
  cursor: pointer; transition: transform .1s, background .15s, opacity .15s;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 18px -8px rgba(163, 48, 43, .7); }
.btn-primary:hover:not(:disabled) { background: var(--red-dark); }
.btn-pine { background: var(--pine); color: var(--cream); }
.btn-pine:hover:not(:disabled) { background: var(--pine-2); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover:not(:disabled) { background: var(--cream); }
.btn-danger-ghost { background: transparent; color: var(--red); border-color: rgba(163, 48, 43, .25); }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }

.icon-btn {
  width: 38px; height: 38px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 11px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--cream); color: var(--ink); }
.icon-btn.danger:hover { color: var(--red); }

/* ---------- Listes / pastilles ---------- */
.list { margin: 0 -18px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
.item + .item { border-top: 1px solid var(--line); }
.item-main { flex: 1; min-width: 0; }
.item-main strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-main .sub { font-size: 13px; color: var(--muted); }
.item-actions { display: flex; gap: 6px; flex: none; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font: 500 17px var(--serif);
  color: var(--pine); background: var(--green-soft);
}
.avatar.done { color: #fff; background: var(--pine-2); }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--cream); color: var(--muted);
  white-space: nowrap;
}
.pill.green { background: var(--green-soft); color: var(--pine-2); }
.pill.gold { background: var(--gold-soft); color: #7d5a22; }
.pill.red { background: #f6e1df; color: var(--red-dark); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  padding: 8px 14px; min-height: 38px;
  border-radius: 999px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 14.5px;
  transition: background .15s, color .15s, border-color .15s;
}
.chip[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: var(--cream); }
.chip:disabled { opacity: .35; cursor: not-allowed; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 14px;
  background: var(--gold-soft); color: #5e4519; font-size: 14px;
  margin-bottom: 14px;
}
.notice svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.notice.ok { background: var(--green-soft); color: var(--pine); }
.notice.err { background: #f6e1df; color: var(--red-dark); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 16px; }
.stat { background: var(--cream); border-radius: 14px; padding: 12px 8px; text-align: center; }
.stat b { display: block; font: 500 24px/1.1 var(--serif); color: var(--pine); }
.stat span { font-size: 12px; color: var(--muted); }

.meter { height: 6px; background: var(--cream); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; background: var(--pine-2); border-radius: 99px; }
.meter.warn > i { background: var(--gold); }
.meter.bad > i { background: var(--red); }

.rel-arrow { color: var(--gold); font-weight: 600; margin: 0 4px; }

/* ---------- Barre d'onglets (admin) ---------- */
.tabbar {
  position: sticky; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 249, .92);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; border: 0; background: none; cursor: pointer;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  border-radius: 12px; position: relative;
}
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button[aria-selected="true"] { color: var(--red); }
.tabbar .badge {
  position: absolute; top: 4px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; background: var(--red); color: #fff;
  font-size: 11px; line-height: 18px;
}

/* ---------- Dialogues & toasts ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0;
  width: 100%; max-width: 480px; max-height: 88dvh;
  border-radius: 24px 24px 0 0;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .3);
}
@media (min-width: 560px) { dialog.sheet { margin: auto; border-radius: 24px; } }
dialog.sheet::backdrop { background: rgba(16, 34, 28, .55); backdrop-filter: blur(2px); }
dialog.sheet[open] { animation: sheet-in .25s ease-out; }
@keyframes sheet-in { from { transform: translateY(30px); opacity: 0; } }
.sheet-body { padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); overflow: auto; max-height: 88dvh; }
.sheet-body h3 { font: 500 22px/1.2 var(--serif); margin: 0 0 8px; }
.sheet-body .btn-row { margin-top: 18px; }

.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 100;
  width: min(440px, calc(100% - 28px));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  padding: 12px 16px; border-radius: 14px;
  background: var(--pine-deep); color: var(--cream);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  font-size: 14.5px; animation: toast-in .2s ease-out;
}
.toast.error { background: var(--red-dark); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, #efe9dd, #f8f4ec, #efe9dd); background-size: 200% 100%; animation: sk 1.2s infinite; margin-bottom: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Effet néon glitch (police Dune Rise, licence SIL OFL : /fonts/OFL.txt) ---------- */
@font-face {
  font-family: 'Dune Rise';
  src: url('/fonts/Dune_Rise.ttf') format('truetype');
  font-display: swap;
}
.glitch { position: relative; }
.g-dune {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  visibility: hidden; pointer-events: none;
}
.g-dune > span {
  display: block; max-width: 100%; text-align: center;
  font-family: 'Dune Rise', var(--serif); font-weight: 400;
  text-transform: uppercase; letter-spacing: .02em; line-height: 1.2;
  overflow-wrap: normal; word-break: keep-all; hyphens: none; /* jamais de mot coupé : on réduit la taille à la place */
  text-wrap: balance;
}
.glitch.is-dune .g-classic { visibility: hidden; }
.glitch.is-dune .g-dune { visibility: visible; }
.glitch.glitching { text-shadow: -2px 0 rgba(212, 170, 100, .75), 2px 0 rgba(70, 175, 155, .55); }

/* ---------- Easter egg : les petites têtes qui passent ---------- */
.peek-layer {
  position: fixed; top: 0; bottom: 0; left: 50%; z-index: 40;
  width: min(480px, 100%); transform: translateX(-50%);
  overflow: hidden; pointer-events: none;
}
@media (min-width: 560px) { .peek-layer { top: 32px; bottom: 32px; border-radius: 28px; } }
.peek-layer { transition: opacity .3s; }
body.scene-playing .peek-layer { opacity: 0; } /* une tête déjà visible s'efface quand la scène démarre */
/* .peek = glissement horizontal ; .peek-body = tête penchée ; la bulle reste droite */
.peek { position: absolute; width: 116px; pointer-events: auto; cursor: pointer; transition: transform .7s cubic-bezier(.3, 1.35, .5, 1); }
.peek-body { transform-origin: 50% 100%; }
.peek-body svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .22)); }
.peek-right { right: 0; transform: translateX(115%); }
.peek-right.in { transform: translateX(32%); }
.peek-right .peek-body { transform: rotate(-20deg) scaleX(-1); } /* penché vers l'écran, pompon côté écran */
.peek-left { left: 0; transform: translateX(-115%); }
.peek-left.in { transform: translateX(-32%); }
.peek-left .peek-body { transform: rotate(20deg); }
/* Bulle : élément à part, jamais tourné, largeur bornée → toujours entière à l'écran */
.peek-bubble {
  position: absolute; z-index: 1;
  max-width: calc(100% - 96px);
  padding: 7px 12px; border-radius: 14px;
  background: var(--paper); color: var(--ink);
  font: 500 13.5px/1.3 var(--sans); text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
  opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.peek-bubble-right { right: 58px; transform-origin: right bottom; border-bottom-right-radius: 4px; }
.peek-bubble-left { left: 58px; transform-origin: left bottom; border-bottom-left-radius: 4px; }
.peek-bubble.show { opacity: 1; transform: scale(1); }

/* ---------- Révélation : le paquet cadeau ---------- */
.reveal-card { text-align: center; padding-top: 28px; padding-bottom: 26px; }
.gift {
  position: relative; display: block;
  width: 168px; height: 168px; margin: 8px auto 6px;
  border: 0; padding: 0; background: none; cursor: pointer;
  animation: wiggle 3.2s ease-in-out 1.2s infinite;
}
.gift:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; border-radius: 16px; }
.gift-box, .gift-lid {
  position: absolute; border-radius: 8px;
  background-color: var(--red);
  background-image: linear-gradient(90deg, transparent 43%, var(--gold) 43%, var(--gold) 57%, transparent 57%);
}
.gift-box { left: 22px; right: 22px; bottom: 6px; height: 98px; background-color: var(--red-dark);
  box-shadow: inset 0 14px 18px -12px rgba(0, 0, 0, .35); }
.gift-lid { left: 12px; right: 12px; top: 46px; height: 30px; z-index: 2;
  transition: transform .7s cubic-bezier(.3, 1.4, .5, 1), opacity .6s .25s; box-shadow: 0 6px 10px -6px rgba(0, 0, 0, .4); }
.gift-bow { position: absolute; left: 50%; top: -26px; width: 0; height: 0; }
.gift-bow::before, .gift-bow::after {
  content: ''; position: absolute; top: 0;
  width: 34px; height: 26px;
  border: 7px solid var(--gold); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.gift-bow::before { right: 0; transform: rotate(-22deg); transform-origin: right bottom; }
.gift-bow::after { left: 0; transform: rotate(22deg); transform-origin: left bottom; }
.gift-shadow { position: absolute; left: 30px; right: 30px; bottom: -4px; height: 10px; border-radius: 50%; background: rgba(29, 37, 33, .12); filter: blur(3px); }
.gift.open { animation: none; cursor: default; }
.gift.open .gift-lid { transform: translate(18px, -90px) rotate(24deg); opacity: 0; }
.gift.open .gift-box { animation: box-out .5s .45s ease-in forwards; }
@keyframes box-out { to { transform: scale(.6); opacity: 0; } }
@keyframes wiggle {
  0%, 82%, 100% { transform: rotate(0); }
  86% { transform: rotate(-4deg); } 90% { transform: rotate(4deg); } 94% { transform: rotate(-2deg); }
}
.gift-hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

/* ---------- Scène de livraison (tracteur du Père Houdon + Saturnin) ---------- */
.scene { position: relative; height: 200px; margin: 6px -18px 0; overflow: hidden; text-align: left; }
.scene-ground {
  position: absolute; left: 0; right: 0; bottom: 12px; height: 2px;
  background: repeating-linear-gradient(90deg, #e2d9c6 0 12px, transparent 12px 20px);
}
.tractor { position: absolute; left: 0; top: 70px; width: 210px; height: 120px; transform: translateX(-230px); }
.tractor svg { display: block; overflow: visible; }
.tractor .wheel { transform-box: fill-box; transform-origin: center; }
.tractor.driving .wheel { animation: spin .45s linear infinite; }
.tractor .driver { transform-box: fill-box; transform-origin: 50% 100%; }
.tractor.driving .driver { animation: bob .18s ease-in-out infinite alternate; }
.tractor .bed { transform-box: view-box; transform-origin: 2px 85px; transition: transform .35s ease-in-out; }
.tractor.dump .bed { transform: rotate(-24deg); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { to { transform: translateY(-1.6px); } }
.puffs { position: absolute; left: 168px; top: 22px; }
.puffs i { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: rgba(110, 110, 110, .35); opacity: 0; }
.tractor.driving .puffs i { animation: puff .9s ease-out infinite; }
.tractor.driving .puffs i:nth-child(2) { animation-delay: .3s; }
.tractor.driving .puffs i:nth-child(3) { animation-delay: .6s; }
@keyframes puff {
  0% { opacity: .75; transform: translate(0, 0) scale(.5); }
  100% { opacity: 0; transform: translate(-28px, -24px) scale(1.9); }
}
.gift-mover { position: absolute; left: 0; top: 0; width: 110px; height: 110px; transform: translate(-300px, 36px); transform-origin: 50% 100%; z-index: 2; }
.gift-scale { width: 168px; height: 168px; transform: scale(.655); transform-origin: 0 0; }
.scene .gift { margin: 0; animation: none; }
.scene .gift:disabled { cursor: default; }
.scene .gift.ready { animation: wiggle 2.6s ease-in-out .4s infinite; }
.scene .gift.shake { animation: shake .3s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: rotate(0); } 25% { transform: rotate(7deg) translateX(4px); } 60% { transform: rotate(-4deg); }
}
.saturnin { position: absolute; left: 0; top: 99px; width: 80px; transform: translateX(-100px); z-index: 3; }
.saturnin svg { display: block; overflow: visible; }
.saturnin-body { transform-origin: 50% 100%; }
.saturnin.walking .saturnin-body { animation: waddle .3s ease-in-out infinite alternate; }
.saturnin.happy .saturnin-body { animation: hop .4s ease-in-out infinite alternate; }
@keyframes waddle { from { transform: rotate(-8deg); } to { transform: rotate(8deg) translateY(-4px); } }
@keyframes hop { from { transform: translateY(0); } to { transform: translateY(-10px) rotate(-4deg); } }
.say {
  position: absolute; z-index: 5; max-width: calc(100% - 12px);
  padding: 6px 11px; border-radius: 13px;
  background: #fff; color: var(--ink);
  font: 600 13.5px/1.25 var(--sans); white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
  opacity: 0; transform: scale(.6); transform-origin: 50% 100%;
  transition: opacity .18s, transform .25s cubic-bezier(.3, 1.6, .5, 1);
  pointer-events: none;
}
.say.show { opacity: 1; transform: scale(1); }

.replay-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 6px 12px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.replay-btn svg { width: 15px; height: 15px; transition: transform .5s ease; }
.replay-btn:hover { background: var(--cream); color: var(--ink); }
.replay-btn:hover svg, .replay-btn:active svg { transform: rotate(-300deg); }

.reveal-result { animation: result-in .7s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes result-in { from { transform: translateY(14px) scale(.96); opacity: 0; } }
.receiver-name {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(40px, 13vw, 56px); line-height: 1.05;
  color: var(--red); margin: 6px 0 10px; letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.wish-box {
  text-align: left; margin-top: 18px; padding: 16px;
  border-radius: 16px; background: var(--cream); border: 1px dashed #dacfb9;
  overflow-wrap: anywhere; font-size: 15px;
}
.wish-text { white-space: pre-wrap; }
.wish-box .eyebrow { color: var(--gold); opacity: 1; margin-bottom: 6px; display: block; }

.sparks { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.sparks i {
  position: absolute; width: 7px; height: 7px; border-radius: 2px;
  background: var(--gold); opacity: 0;
  animation: spark 1s ease-out forwards;
}
@keyframes spark {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) rotate(220deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .gift, .gift.open .gift-box, .reveal-result { animation: none; }
  .gift-lid { transition: none; }
}
