/* ───────────── Palette & typo ───────────── */
:root {
  --nuit: #070d2b;         /* ciel de minuit */
  --sapin: #0e2f25;        /* vert sapin profond */
  --sapin-2: #164536;
  --baie: #c8213a;         /* rouge houx */
  --baie-dark: #9c1429;
  --or: #f0b848;           /* guirlande dorée */
  --kraft: #ecd8b6;        /* papier kraft des étiquettes */
  --kraft-dark: #d9bd8f;
  --encre: #3b2414;        /* texte brun sur kraft */
  --neige: #f4f8fa;
  --vert-ok: #2f8a5b;

  --noel: 'Mountains of Christmas', 'Fredoka', cursive;
  --display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--neige);
  background: linear-gradient(180deg, var(--nuit) 0%, #0d2147 45%, #10403c 100%) fixed;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-x: hidden;
  display: flex; flex-direction: column;
}

#snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

/* ───────────── Guirlande lumineuse ───────────── */
.garland { position: relative; height: 46px; margin-top: env(safe-area-inset-top, 0px); z-index: 2; }
.garland .wire { position: absolute; inset: 0 0 auto; width: 100%; height: 40px; }
.garland .wire path { fill: none; stroke: #0a1f18; stroke-width: 2.5; }
.bulbs { position: absolute; inset: 0; display: flex; justify-content: space-around; }
.bulb {
  width: 12px; height: 18px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  margin-top: var(--y, 14px);
  background: var(--c); box-shadow: 0 0 14px 3px var(--c);
  animation: twinkle var(--d, 2.4s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
  position: relative;
}
.bulb::before { content: ''; position: absolute; top: -5px; left: 3px; width: 6px; height: 6px; background: #2b2b2b; border-radius: 2px; }
@keyframes twinkle { from { opacity: 1; } to { opacity: .35; box-shadow: 0 0 4px 0 var(--c); } }

/* ───────────── Mise en page ───────────── */
main { position: relative; z-index: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 18px 40px; outline: none; flex: 1; }
.foot { position: relative; z-index: 1; text-align: center; font-size: 14px; font-weight: 800; color: #24406b; padding: 150px 12px 14px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; }
.hero { text-align: center; padding: 6px 0 30px; }
.hero .tree { width: min(58vw, 230px); height: auto; display: block; margin: 0 auto -18px; filter: drop-shadow(0 18px 24px rgba(0,0,0,.45)); }
.hero h1 {
  font-family: var(--noel);
  font-size: clamp(60px, 17vw, 112px);
  font-weight: 700; line-height: .95;
  color: #fff;
  text-shadow:
    0 2px 0 #ffd9de, 0 4px 0 var(--baie), 0 7px 0 var(--baie-dark),
    0 0 34px rgba(255, 201, 77, .55), 0 16px 30px rgba(0,0,0,.5);
  animation: glow 3.2s ease-in-out infinite alternate;
}
.hero h1 .kdo {
  display: inline-block; transform: rotate(-5deg);
  background: linear-gradient(180deg, #fff3c4 10%, var(--or) 55%, #e08a1b 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(0 4px 0 #8a4b06) drop-shadow(0 0 18px rgba(255,201,77,.6));
}
@keyframes glow { to { text-shadow: 0 2px 0 #ffd9de, 0 4px 0 var(--baie), 0 7px 0 var(--baie-dark), 0 0 60px rgba(255, 201, 77, .95), 0 16px 30px rgba(0,0,0,.5); } }
.hero p { margin: 18px auto 0; max-width: 30ch; opacity: .92; font-size: 18px; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.page-title { text-align: center; padding: 10px 0 22px; }
.page-title h1 { font-family: var(--noel); font-size: clamp(42px, 11vw, 64px); text-shadow: 0 3px 0 var(--baie-dark), 0 0 30px rgba(255,201,77,.5), 0 10px 24px rgba(0,0,0,.5); }
.page-title .sub { opacity: .75; margin-top: 6px; }

/* ───────────── L'étiquette cadeau (carte principale) ───────────── */
.tag {
  position: relative;
  background: var(--kraft);
  background-image:
    repeating-linear-gradient(90deg, rgba(120,80,30,.035) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(0deg, rgba(120,80,30,.03) 0 1px, transparent 1px 4px);
  color: var(--encre);
  border-radius: 18px 6px 6px 18px;
  padding: 26px 24px 24px 52px;
  margin: 0 0 22px;
  box-shadow: 0 2px 0 var(--kraft-dark), 0 18px 34px -16px rgba(0,0,0,.6);
}
/* le trou de l'étiquette + la ficelle */
.tag::before {
  content: '';
  position: absolute; left: 18px; top: 28px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--sapin);
  box-shadow: inset 0 0 0 3px var(--kraft-dark);
}
.tag::after {
  content: '';
  position: absolute; left: -30px; top: 33px;
  width: 56px; height: 4px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--baie) 0 6px, #fff 6px 12px);
  transform: rotate(-8deg); transform-origin: right center;
}
.tag h2 { font-size: 28px; color: var(--baie-dark); margin-bottom: 4px; }
.tag .hint { color: #6d5236; margin: 0 0 16px; font-size: 15px; }
.tag.red { background: var(--baie); color: #fff; box-shadow: 0 2px 0 var(--baie-dark), 0 18px 34px -16px rgba(0,0,0,.6); background-image: none; }
.tag.red h2 { color: #fff; }
.tag.red .hint { color: #ffd9de; }
.tag.red::before { box-shadow: inset 0 0 0 3px var(--baie-dark); }

/* ───────────── Formulaires ───────────── */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 800; font-size: 15px; margin-bottom: 6px; }
input[type=text], input[type=url], select {
  width: 100%;
  font: inherit; font-size: 17px;
  color: var(--encre);
  background: #fffaf1;
  border: 2px solid var(--kraft-dark);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--baie); box-shadow: 0 0 0 4px rgba(200,33,58,.18); }
.field.attention input { border-color: var(--baie); background: #fff0f1; animation: wiggle .4s; }
@keyframes wiggle { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

/* choix solo / couple */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  display: block; cursor: pointer; text-align: center;
  padding: 14px 10px; border-radius: 14px;
  background: #fffaf1; border: 2px dashed var(--kraft-dark);
  font-weight: 800; transition: transform .12s;
}
.choice label .emo { display: block; font-size: 30px; line-height: 1.2; }
.choice label small { display: block; font-weight: 600; opacity: .7; font-size: 13px; }
.choice input:checked + label { border: 2px solid var(--baie); background: #fff; transform: rotate(-1.5deg); box-shadow: 0 6px 0 -2px var(--baie); }
.choice input:focus-visible + label { outline: 3px solid var(--or); }

.check { display: flex; gap: 10px; align-items: center; font-weight: 700; margin: 4px 0 16px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--baie); }

/* ───────────── Boutons ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 18px/1 var(--display);
  border: 0; border-radius: 999px; cursor: pointer;
  padding: 14px 22px;
  color: #fff; background: var(--baie);
  box-shadow: 0 4px 0 var(--baie-dark);
  transition: transform .08s, box-shadow .08s, filter .15s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--baie-dark); }
.btn:focus-visible, .mini:focus-visible, a:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.green { background: var(--vert-ok); box-shadow: 0 4px 0 #1d5e3c; }
.btn.gold { background: var(--or); color: var(--encre); box-shadow: 0 4px 0 #b5852a; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn.big { font-size: 22px; padding: 18px 26px; }
.mini {
  font: 700 14px var(--body); border: 0; cursor: pointer;
  border-radius: 999px; padding: 7px 12px;
  background: rgba(59,36,20,.08); color: inherit;
}
.mini.ok { background: var(--vert-ok); color: #fff; }
.mini.no { background: transparent; box-shadow: inset 0 0 0 2px var(--baie); color: var(--baie-dark); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }

/* ───────────── Code de partage en "petits cadeaux" ───────────── */
.code { display: flex; justify-content: center; gap: 6px; margin: 6px 0 16px; flex-wrap: wrap; }
.code span {
  width: 44px; height: 50px; display: grid; place-items: center;
  font: 700 26px var(--display); color: #fff;
  background: var(--sapin-2); border-radius: 8px;
  border-top: 8px solid var(--or);
  box-shadow: 0 3px 0 rgba(0,0,0,.25);
}
.code span:nth-child(even) { background: #fff; color: var(--baie); transform: rotate(3deg); }
.code span:nth-child(odd) { transform: rotate(-2deg); }
.linkbox {
  color: var(--encre);
  display: flex; gap: 8px; align-items: center;
  background: #fffaf1; border: 2px dashed var(--kraft-dark); border-radius: 12px;
  padding: 8px 8px 8px 12px; margin-bottom: 12px;
}
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

/* ───────────── Listes de personnes ───────────── */
.people { list-style: none; padding: 0; margin: 0; }
.people li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 2px dotted var(--kraft-dark);
}
.people li:last-child { border-bottom: 0; }
.people .who { flex: 1; font-weight: 800; min-width: 0; }
.people .who small { display: block; font-weight: 600; opacity: .65; }
.avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font: 700 16px var(--display); color: #fff;
  background: var(--av, var(--baie));
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  background: #fffaf1; font-weight: 800; font-size: 15px;
  box-shadow: 0 2px 0 var(--kraft-dark);
}
.chip .avatar { width: 26px; height: 26px; font-size: 12px; }
.chip.me { background: var(--baie); color: #fff; box-shadow: 0 2px 0 var(--baie-dark); }
.empty { text-align: center; opacity: .7; padding: 10px 0; font-style: italic; }
/* badge */
.badge { display: inline-block; font: 700 13px var(--body); padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.16); }
.count { font: 700 15px var(--body); background: var(--baie); color: #fff; border-radius: 999px; padding: 1px 9px; vertical-align: middle; margin-left: 6px; }

/* ───────────── Idées cadeaux ───────────── */
.person-ideas { padding: 12px 0; border-bottom: 2px dotted var(--kraft-dark); }
.person-ideas:last-child { border-bottom: 0; }
.person-ideas h3 { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.person-ideas ul { list-style: none; margin: 8px 0 0; padding: 0; }
.idea { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0 6px 6px; }
.idea::before { content: '🎀'; flex: none; }
.idea .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.idea .by { font-size: 13px; opacity: .6; }
.idea a { color: var(--baie-dark); font-weight: 800; }
.idea .del { flex: none; border: 0; background: none; cursor: pointer; font-size: 16px; opacity: .5; }
.idea .del:hover { opacity: 1; }
details.add-idea { margin-top: 6px; }
details.add-idea summary { cursor: pointer; font-weight: 800; color: var(--baie-dark); list-style: none; }
details.add-idea summary::-webkit-details-marker { display: none; }
details.add-idea form { margin-top: 10px; }

/* ───────────── Écran d'attente ───────────── */
.waiting { text-align: center; }
.waiting .big-emo { font-size: 74px; display: inline-block; animation: sway 2.6s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(8deg) translateY(-4px); } }
/* le compte à rebours est une boule de Noël qui se balance */
.countdown {
  position: relative; width: 132px; height: 132px; margin: 34px auto 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 800; font-size: 14px; color: #ffe9ec;
  background: radial-gradient(circle at 32% 28%, #ff8a9a 0 8%, #e42a47 30%, var(--baie-dark) 100%);
  box-shadow: inset -10px -14px 24px rgba(0,0,0,.3), 0 0 40px rgba(228,42,71,.55), 0 20px 30px -10px rgba(0,0,0,.5);
  transform-origin: 50% -34px; animation: swing 3.4s ease-in-out infinite alternate;
}
.countdown::before { content: ''; position: absolute; top: -12px; left: 50%; width: 26px; height: 16px; margin-left: -13px; border-radius: 5px 5px 2px 2px; background: linear-gradient(90deg, #b5852a, #ffe08a, #b5852a); }
.countdown::after { content: ''; position: absolute; top: -40px; left: 50%; width: 2px; height: 28px; background: var(--or); }
.countdown b { font: 700 44px/1 var(--noel); color: #fff; display: block; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
@keyframes swing { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }

/* ───────────── LE CADEAU (moment fort) ───────────── */
.reveal { text-align: center; padding: 10px 0 30px; }
.reveal h2 { font-size: clamp(28px, 7vw, 38px); }
.reveal .lead { opacity: .85; margin: 8px 0 30px; }
.gift {
  --size: min(64vw, 240px);
  position: relative; width: var(--size); height: var(--size);
  margin: 40px auto 30px; cursor: pointer; border: 0; padding: 0; background: none;
  animation: shake 2.2s ease-in-out infinite;
}
.gift:focus-visible { outline: 3px solid var(--or); outline-offset: 10px; border-radius: 12px; }
@keyframes shake {
  0%, 70%, 100% { transform: rotate(0); }
  74% { transform: rotate(-5deg); } 78% { transform: rotate(5deg); }
  82% { transform: rotate(-4deg); } 86% { transform: rotate(3deg); } 90% { transform: rotate(0); }
}
.gift .box {
  position: absolute; left: 6%; right: 6%; bottom: 0; height: 72%;
  background: var(--baie); border-radius: 6px;
  box-shadow: inset -18px 0 0 rgba(0,0,0,.12), 0 20px 30px -10px rgba(0,0,0,.5);
}
.gift .lid {
  position: absolute; left: 0; right: 0; top: 14%; height: 20%;
  background: #e0334c; border-radius: 6px; z-index: 2;
  box-shadow: inset -18px 0 0 rgba(0,0,0,.1), 0 6px 0 rgba(0,0,0,.15);
  transition: transform .7s cubic-bezier(.3,1.6,.5,1), opacity .5s .3s;
}
.gift .box::before, .gift .lid::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 16%; transform: translateX(-50%);
  background: var(--or);
}
.gift .bow { position: absolute; left: 50%; top: -42%; width: 0; height: 0; }
.gift .bow::before, .gift .bow::after {
  content: ''; position: absolute; width: calc(var(--size) * .26); height: calc(var(--size) * .2);
  border: calc(var(--size) * .05) solid var(--or); border-radius: 50%; bottom: -8px;
}
.gift .bow::before { right: -2px; transform: rotate(-24deg); }
.gift .bow::after  { left: -2px; transform: rotate(24deg); }
.gift .tap { position: absolute; bottom: -38px; left: 0; right: 0; font: 600 17px var(--display); color: var(--or); }
.gift.open { animation: none; cursor: default; }
.gift.open .lid { transform: translate(30%, -140%) rotate(28deg); opacity: 0; }
.gift.open .tap { opacity: 0; }

.result {
  display: none;
  background: var(--neige); color: var(--encre);
  border-radius: 24px; padding: 28px 22px;
  margin-top: -170px; position: relative; z-index: 3;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.7);
}
.result.show { display: block; animation: pop .7s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes pop { from { transform: translateY(80px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.result .to { font-size: 17px; opacity: .7; }
.result .name {
  font: 700 clamp(40px, 11vw, 64px)/1 var(--display); color: var(--baie);
  margin: 10px 0 14px; overflow-wrap: anywhere;
}
.result .secret { font-size: 14px; opacity: .65; margin: 12px 0 0; }

.confetti { position: fixed; top: -20px; width: 10px; height: 14px; z-index: 50; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); } }

/* ───────────── Organisateur : paires ───────────── */
.pair { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 2px dotted var(--kraft-dark); font-weight: 800; }
.pair:last-child { border-bottom: 0; }
.pair .arrow { flex: none; }
.pair .hidden-to { opacity: .55; font-weight: 600; font-style: italic; }
.progress { height: 12px; background: rgba(59,36,20,.12); border-radius: 999px; overflow: hidden; margin: 8px 0 16px; }
.progress div { height: 100%; background: repeating-linear-gradient(-45deg, var(--baie) 0 10px, #fff 10px 20px); transition: width .6s; }

/* ───────────── Divers ───────────── */
.my-draws { list-style: none; padding: 0; margin: 0; }
.my-draws a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; color: inherit; text-decoration: none; font-weight: 800; border-bottom: 2px dotted var(--kraft-dark); }
.my-draws li:last-child a { border-bottom: 0; }
.my-draws a:hover span:first-child { color: var(--baie-dark); }
.back { display: inline-block; color: var(--neige); opacity: .75; text-decoration: none; font-weight: 700; margin-bottom: 4px; }
.back:hover { opacity: 1; }
.banner {
  background: var(--or); color: var(--encre); border-radius: 16px; padding: 14px 16px;
  font-weight: 800; margin-bottom: 20px; display: flex; gap: 12px; align-items: center;
  animation: pop .6s cubic-bezier(.2,1.5,.4,1) both;
}
.banner .btn { flex: none; padding: 10px 14px; font-size: 15px; }
.center { text-align: center; }
.spinner { text-align: center; padding: 60px 0; font-size: 40px; animation: sway 1.2s ease-in-out infinite; }
.muted { opacity: .7; }
hr.dash { border: 0; border-top: 2px dashed var(--kraft-dark); margin: 18px 0; }

#toasts { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--neige); color: var(--encre); padding: 12px 16px; border-radius: 14px; font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: pop .4s both; }
.toast.err { background: var(--baie); color: #fff; }

@media (max-width: 420px) {
  .tag { padding: 22px 16px 20px 44px; }
  .tag::before { left: 14px; }
  .code span { width: 38px; height: 44px; font-size: 22px; }
  .row { flex-direction: column; gap: 0; }
}

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

.tag .badge { background: rgba(59,36,20,.1); }
.tag.red .badge { background: rgba(255,255,255,.2); }
.pair > span:first-child { flex: 0 1 38%; }

/* ───────────── Budget ───────────── */
.money { position: relative; display: block; max-width: 180px; }
.money input { padding-right: 40px; font-weight: 800; font-size: 20px; }
.money b { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 700 20px var(--display); color: var(--baie-dark); }
input[type=number] { width: 100%; font: inherit; color: var(--encre); background: #fffaf1; border: 2px solid var(--kraft-dark); border-radius: 12px; padding: 12px 14px; outline: none; }
.budget-big { display: inline-block; margin-top: 10px; padding: 6px 16px; border-radius: 999px; background: var(--or); color: var(--encre); font-weight: 700; }
.budget-big b { font: 700 20px var(--display); }
.budget-line { margin: 0 0 14px; font-weight: 700; }
.budget-line b { color: var(--baie); }

/* ═════════════════════ DÉCOR DE NOËL XXL ═════════════════════ */

/* ───── Le ciel ───── */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 90px 120px, #cfe3ff, transparent),
    radial-gradient(2px 2px at 150px 60px, #fff6d6, transparent),
    radial-gradient(1px 1px at 210px 170px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 260px 20px, #fff, transparent);
  background-size: 290px 210px;
  animation: stars 4s ease-in-out infinite alternate;
}
@keyframes stars { from { opacity: .45; } to { opacity: 1; } }
.aurora { position: absolute; left: -20%; width: 140%; height: 44vh; top: -6vh; filter: blur(60px); opacity: .5; mix-blend-mode: screen; }
.aurora.a1 { background: radial-gradient(ellipse at 30% 50%, #2cf2a6 0%, transparent 60%); animation: aurora 16s ease-in-out infinite alternate; }
.aurora.a2 { background: radial-gradient(ellipse at 72% 40%, #b05cff 0%, transparent 55%); animation: aurora 22s ease-in-out infinite alternate-reverse; opacity: .38; }
@keyframes aurora { from { transform: translateX(-8%) skewX(-8deg) scaleY(.8); } to { transform: translateX(8%) skewX(10deg) scaleY(1.15); } }
.moon {
  position: absolute; top: 74px; right: max(18px, calc(50% - 300px));
  width: 86px; height: 86px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffdf2, #f6e7b0 60%, #e2cc86);
  box-shadow: 0 0 0 14px rgba(255,244,200,.06), 0 0 0 34px rgba(255,244,200,.04), 0 0 80px 20px rgba(255,236,170,.35);
}
.moon::before, .moon::after { content: ''; position: absolute; border-radius: 50%; background: rgba(190,165,90,.35); }
.moon::before { width: 16px; height: 16px; top: 22px; left: 46px; }
.moon::after { width: 10px; height: 10px; top: 52px; left: 26px; }

/* le traîneau traverse le ciel devant la lune */
.sleigh { position: absolute; top: 84px; left: 0; font-size: 30px; white-space: nowrap; transform: translateX(110vw); animation: fly 34s linear infinite 3s; }
.sleigh-bob { animation: bob 1.6s ease-in-out infinite alternate; filter: drop-shadow(0 0 10px rgba(255,220,140,.7)); }
.sled { position: relative; margin-left: 4px; }
.santa { position: absolute; left: 4px; top: -16px; font-size: 22px; }
.trail { font-size: 18px; margin-left: 6px; opacity: .9; }
@keyframes fly { 0% { transform: translateX(110vw) rotate(-4deg); } 38%, 100% { transform: translateX(-340px) rotate(-4deg); } }
@keyframes bob { from { transform: translateY(-5px); } to { transform: translateY(7px); } }

/* ───── Le village enneigé ───── */
.land { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(150px, 26vh, 240px); z-index: 0; pointer-events: none; }
.land .window { animation: candle 2.3s ease-in-out infinite alternate; filter: drop-shadow(0 0 8px #ffc94d); }
@keyframes candle { 0% { opacity: .75; } 60% { opacity: 1; } 100% { opacity: .85; } }
.land .smoke circle { animation: smoke 4s ease-out infinite; opacity: 0; }
.land .smoke circle:nth-child(2) { animation-delay: 1.3s; }
.land .smoke circle:nth-child(3) { animation-delay: 2.6s; }
@keyframes smoke { 0% { opacity: 0; transform: translateY(14px) scale(.5); } 30% { opacity: .7; } 100% { opacity: 0; transform: translate(14px, -26px) scale(1.4); } }

/* ───── Guirlande : ampoules plus grosses, halo plus fort ───── */
.garland { height: 58px; }
.garland .wire path { stroke: #06301f; stroke-width: 4; }
.bulb { width: 15px; height: 22px; box-shadow: 0 0 22px 6px var(--c), 0 0 60px 10px var(--c); }
.bulb::before { left: 4px; width: 7px; background: #c9a43a; }

/* ───── Le sapin de l'accueil ───── */
.tree .ball { animation: ball 1.8s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.tree .ball:nth-of-type(2n) { animation-delay: .6s; }
.tree .ball:nth-of-type(3n) { animation-delay: 1.1s; }
@keyframes ball { from { opacity: .55; } to { opacity: 1; filter: drop-shadow(0 0 6px currentColor); } }
.tree .star { transform-box: fill-box; transform-origin: center; animation: star 2.4s ease-in-out infinite alternate; filter: drop-shadow(0 0 10px #ffd257); }
@keyframes star { from { transform: scale(.9) rotate(-6deg); } to { transform: scale(1.15) rotate(6deg); } }

/* ───── Neige posée sur les étiquettes ───── */
.tag { margin-top: 12px; }
.snowcap {
  position: absolute; top: -10px; left: 8px; right: 0; height: 26px; pointer-events: none;
  border-radius: 14px 8px 0 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 26' preserveAspectRatio='none'%3E%3Cpath fill='%23fff' d='M0 0H120V12Q110 24 100 13Q92 5 82 12Q72 26 60 13Q52 6 44 12Q34 21 24 12Q12 2 0 12Z'/%3E%3C/svg%3E") repeat-x top left / 120px 26px;
  filter: drop-shadow(0 3px 0 rgba(170,200,225,.9));
}
.tag h2 { font-size: 30px; }
.tag.red { background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.07) 0 14px, transparent 14px 28px); }

/* ───── Boutons sucre d'orge ───── */
.btn { position: relative; overflow: hidden; }
.btn, .btn.green, .btn.gold {
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.16) 0 12px, transparent 12px 24px);
  background-size: 34px 34px;
}
.btn:hover { animation: candy 1s linear infinite; }
@keyframes candy { to { background-position: 34px 0; } }
.btn.big { box-shadow: 0 5px 0 var(--baie-dark), 0 0 30px rgba(209,31,60,.55); }
.btn.big.green { box-shadow: 0 5px 0 #1d5e3c, 0 0 30px rgba(47,138,91,.6); }
.btn.big::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg); animation: shine 3.4s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn.ghost { background-image: none; }
.btn.ghost::after { display: none; }

/* ───── Le cadeau : rayons de lumière ───── */
.reveal h2 { font-family: var(--noel); font-size: clamp(38px, 10vw, 56px); text-shadow: 0 3px 0 var(--baie-dark), 0 0 30px rgba(255,201,77,.6); }
.gift .rays {
  position: absolute; inset: -55%; z-index: -1; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,210,90,.38) 0 9deg, transparent 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0 28%, transparent 68%); mask: radial-gradient(circle, #000 0 28%, transparent 68%);
  animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gift .box { background: linear-gradient(135deg, #e42a47, var(--baie) 55%, var(--baie-dark)); box-shadow: inset -18px 0 0 rgba(0,0,0,.12), 0 0 50px rgba(255,201,77,.35), 0 20px 30px -10px rgba(0,0,0,.5); }
.gift .box::before, .gift .lid::before { background: linear-gradient(90deg, #d79a1e, #ffe08a 45%, var(--or)); }
.gift.open .rays { animation: spin 5s linear infinite, burst .8s ease-out forwards; }
@keyframes burst { to { inset: -110%; background: repeating-conic-gradient(rgba(255,235,160,.7) 0 9deg, transparent 9deg 22deg); } }
.result { border: 4px solid var(--or); box-shadow: 0 0 0 6px rgba(255,201,77,.25), 0 0 80px rgba(255,201,77,.5), 0 30px 60px -20px rgba(0,0,0,.7); }
.result .name { font-family: var(--noel); font-size: clamp(50px, 14vw, 84px); text-shadow: 0 3px 0 #ffd9de; }

/* ───── Confettis en flocons, étincelles au toucher ───── */
.confetti.emo { width: auto; height: auto; background: none !important; font-size: 22px; }
.avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--av, var(--baie)); }
.chip .avatar { box-shadow: none; }
.badge { backdrop-filter: blur(4px); }
.back { text-shadow: 0 2px 6px rgba(0,0,0,.5); }

@media (max-width: 420px) {
  .moon { width: 64px; height: 64px; top: 66px; }
  .sleigh { font-size: 24px; top: 74px; }
}
.gift .tap { text-shadow: 0 2px 6px #000, 0 0 12px #000; }

/* ═════════════════════ MAGIE DE NOËL ═════════════════════ */

/* poussière d'or au-dessus de tout, sans gêner les clics */
#magic { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

/* étoiles filantes */
.shoot { position: absolute; width: 130px; height: 2px; border-radius: 2px; opacity: 0; background: linear-gradient(90deg, #fff, rgba(255,240,190,.6) 30%, transparent); filter: drop-shadow(0 0 6px #fff); }
.shoot.s1 { top: 14%; left: 62%; animation: shoot 11s ease-in infinite 2s; }
.shoot.s2 { top: 30%; left: 28%; animation: shoot 17s ease-in infinite 8s; }
@keyframes shoot {
  0% { opacity: 0; transform: rotate(-32deg) translateX(0); }
  2% { opacity: 1; }
  7%, 100% { opacity: 0; transform: rotate(-32deg) translateX(-460px); }
}

/* bouton de la boîte à musique */
.sound {
  position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--or); cursor: pointer;
  font-size: 22px; line-height: 1; background: var(--baie); color: #fff;
  box-shadow: 0 4px 0 var(--baie-dark), 0 0 24px rgba(255,201,77,.5);
}
.sound:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.sound.playing { animation: ring 1.2s ease-in-out infinite alternate; }
@keyframes ring { from { transform: rotate(-10deg); } to { transform: rotate(10deg) scale(1.06); } }
#toasts { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }

/* le prénom s'écrit lettre par lettre */
.result .name .word { display: inline-block; white-space: nowrap; }
.result.magic .name .letter {
  display: inline-block; opacity: 0;
  animation: letter .6s cubic-bezier(.2,1.6,.4,1) forwards;
  animation-delay: calc(.35s + var(--i) * .09s);
}
@keyframes letter {
  0% { opacity: 0; transform: translateY(26px) scale(.3) rotate(-18deg); filter: blur(6px); color: #fff; text-shadow: 0 0 30px var(--or); }
  60% { opacity: 1; color: var(--or); text-shadow: 0 0 26px var(--or), 0 0 50px #fff; filter: blur(0); }
  100% { opacity: 1; transform: none; }
}
.result.magic .to { animation: fadein .5s both; }
.result.magic .budget-line, .result.magic .secret, .result.magic .name ~ div, .result.magic .name ~ .muted { animation: fadein .8s 1.4s both; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }
.result { background: radial-gradient(circle at 50% 0%, #fffdf3, var(--neige) 60%); }

/* le sortilège du tirage */
.spell {
  position: fixed; inset: 0; z-index: 95; display: grid; place-content: center; justify-items: center; gap: 26px;
  background: radial-gradient(circle at 50% 45%, rgba(40,20,90,.92), rgba(7,13,43,.97) 70%);
  animation: fadein .4s both; transition: opacity .5s;
}
.spell.out { opacity: 0; }
.orbit { position: relative; width: min(78vw, 320px); aspect-ratio: 1; }
.orbit::before { content: ''; position: absolute; inset: 8%; border-radius: 50%; border: 2px dashed rgba(255,201,77,.5); box-shadow: 0 0 60px rgba(255,201,77,.35), inset 0 0 60px rgba(255,201,77,.2); animation: spin 6s linear infinite; }
.orb { position: absolute; inset: 0; animation: spin 2.6s cubic-bezier(.5,0,.5,1) infinite; animation-delay: calc(var(--i) * -2.6s / var(--n)); }
.orb span {
  position: absolute; top: 0; left: 50%; translate: -50% 0; white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis;
  padding: 6px 14px; border-radius: 999px; background: var(--kraft); color: var(--encre); font-weight: 800; font-size: 15px;
  box-shadow: 0 0 20px rgba(255,201,77,.7);
  animation: spin 2.6s cubic-bezier(.5,0,.5,1) infinite reverse; animation-delay: inherit;
}
.core { position: absolute; inset: 0; display: grid; place-items: center; font-size: 74px; animation: pulse .7s ease-in-out infinite alternate; filter: drop-shadow(0 0 30px var(--or)); }
@keyframes pulse { from { transform: scale(.85) rotate(-8deg); } to { transform: scale(1.15) rotate(8deg); } }
.spell-text { margin: 0; font: 700 clamp(26px, 7vw, 38px) var(--noel); color: #fff; text-shadow: 0 0 24px var(--or); text-align: center; padding: 0 20px; }

/* ───────────── Choisir son nom ───────────── */
.tag.warn { text-align: center; }
.tag.warn p { margin: 6px 0 0; font-size: 18px; }
.pick-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pick {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  font: 800 19px var(--display); color: var(--encre);
  background: #fffaf0; border: 0; border-radius: 14px; padding: 12px 14px; cursor: pointer;
  box-shadow: 0 3px 0 var(--kraft-dark), 0 8px 18px -10px rgba(0,0,0,.4);
  transition: transform .15s, box-shadow .15s;
}
.pick:hover:not([disabled]) { transform: translateY(-2px) rotate(-.4deg); box-shadow: 0 5px 0 var(--or), 0 0 22px rgba(240,184,72,.55); }
.pick:active:not([disabled]) { transform: translateY(2px); }
.pick .who { flex: 1; min-width: 0; }
.pick .state { flex: none; font-size: 15px; font-family: var(--body); }
.pick[disabled] { opacity: .5; cursor: not-allowed; filter: grayscale(.6); }
.ipwarn { display: block; font-size: 12px; font-weight: 700; color: var(--baie-dark); }
.tag.warn .big-emo { font-size: 54px; display: inline-block; animation: sway 2.6s ease-in-out infinite; }
