:root {
  --green: #0f3d2e;
  --green-2: #165a43;
  --red: #b3202a;
  --red-2: #8f1820;
  --gold: #c9a227;
  --gold-light: #f6d77a;
  --cream: #fffaf0;
  --ink: #3b2a2a;
  --muted: #7a6a5a;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(246,215,122,.12), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(179,32,42,.18), transparent 45%),
    var(--green);
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; margin: 0; }
a { color: var(--red); }

/* Neige */
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.flake {
  position: absolute; top: -20px; color: #fff; opacity: .8; user-select: none;
  animation: fall linear infinite;
}
@keyframes fall {
  to { transform: translateY(105vh) translateX(40px) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) { .flake { display: none; } }

.wrap { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }
.hero { text-align: center; color: var(--cream); padding: 24px 8px 12px; }
.hero .emoji { font-size: 44px; letter-spacing: 6px; }
.hero h1 { font-size: clamp(30px, 6vw, 48px); margin-top: 8px; text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.hero h1 span { color: var(--gold-light); }
.hero p { color: var(--gold-light); letter-spacing: 3px; text-transform: uppercase; font-size: 13px; margin: 8px 0 0; }

.card {
  background: var(--cream);
  border: 3px solid var(--gold);
  border-radius: 18px;
  padding: 22px;
  margin-top: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.card h2 { color: var(--red); font-size: 22px; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, textarea, select {
  width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; color: var(--ink);
  background: #fff; border: 2px solid #e4d7b8; border-radius: 10px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); }
textarea { min-height: 170px; resize: vertical; line-height: 1.5; }

.btn {
  font: inherit; font-weight: bold; cursor: pointer; border: 2px solid var(--gold);
  background: var(--red); color: var(--cream); padding: 10px 18px; border-radius: 999px;
  transition: transform .1s, background .15s;
}
.btn:hover { background: var(--red-2); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.green { background: var(--green-2); }
.btn.green:hover { background: var(--green); }
.btn.ghost { background: transparent; color: var(--red); }
.btn.ghost:hover { background: rgba(179,32,42,.08); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 140px; }
.row > .fixed { flex: 0 0 auto; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.p-row { display: grid; grid-template-columns: 1fr 1fr 1.6fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
@media (max-width: 640px) { .p-row { grid-template-columns: 1fr 1fr; } .p-row .email { grid-column: 1 / -1; } }

.ex-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.ex-row .no { font-size: 20px; }

.badge { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #eee3c6; color: var(--ink); }
.badge.ok { background: #d7ecd9; color: #14532d; }
.badge.warn { background: #fde4c7; color: #7c3a05; }
.status-list { list-style: none; padding: 0; margin: 0; }
.status-list li { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px dashed #e4d7b8; }
.status-list li:last-child { border-bottom: 0; }

.msg { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 14px; display: none; }
.msg.show { display: block; }
.msg.err { background: #fde2e2; color: #7f1d1d; }
.msg.ok { background: #d7ecd9; color: #14532d; }

.hint { font-size: 13px; color: var(--muted); }
code.var { background: #f3e8c8; padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.preview-frame { width: 100%; height: 520px; border: 2px solid #e4d7b8; border-radius: 12px; background: #0f3d2e; margin-top: 12px; }

/* Révélation */
.reveal { text-align: center; }
.gift { font-size: 96px; cursor: pointer; display: inline-block; animation: wiggle 2s ease-in-out infinite; user-select: none; }
@keyframes wiggle { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) scale(1.05); } }
.target { font-size: clamp(34px, 9vw, 60px); color: var(--red); font-weight: bold; margin: 10px 0; animation: pop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.info-pill { display: inline-block; margin: 4px; padding: 6px 14px; border-radius: 999px; background: #f3e8c8; font-size: 14px; }
.footer { text-align: center; color: var(--gold-light); font-size: 13px; margin-top: 28px; }
