/* =====================================================================
   Pink Christmas Friday — thème « Candy Pop »
   Contours encre épais, ombres franches, couleurs bonbon.
   ===================================================================== */
:root {
  color-scheme: light;
  --ink: #2a1030;
  --ink-2: #5a3a5e;
  --muted: #7a5a7e;
  --bg: #fff3f8;
  --dot: #ffd6e8;
  --card: #ffffff;
  --bubble: #ff8cc0;
  --bubble-soft: #ffb8d9;
  --hot: #ff2e7e;
  --hot-deep: #c4105c;
  --mint: #7be0c3;
  --mint-soft: #d8f7ee;
  --sun: #ffd23f;
  --sun-soft: #fff1b8;
  --ok: #1f7a55;
  --warn: #8a5a00;
  --danger: #c0183a;
  --wa: #1fa855;
  --line: 2.5px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
  --pop-sm: 3px 3px 0 var(--ink);
  --radius: 18px;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 500 16px/1.55 var(--sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 16%, transparent 17%), radial-gradient(var(--dot) 16%, transparent 17%);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  min-height: 100vh;
}
.snow { display: none; }
.wrap {
  position: relative; z-index: 1; max-width: 640px; margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; margin: 0 0 .5em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 .8em; }
a { color: var(--hot-deep); font-weight: 700; }
code { background: var(--sun-soft); border: 1.5px solid var(--ink); padding: 0 5px; border-radius: 6px; font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ---------- En-tête ---------- */
.hero { text-align: center; padding: 26px 4px 8px; }
.hero-small { padding-top: 16px; }
.hero-kicker {
  display: inline-block; margin: 0 0 10px; padding: 3px 14px;
  font-family: var(--display); font-weight: 600; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--mint); border: 2px solid var(--ink); border-radius: 999px;
}
.hero-title {
  font-size: clamp(2.3rem, 10vw, 3.2rem); line-height: 1; margin-bottom: 6px;
  color: var(--hot); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink);
}
.hero-by { font-family: var(--display); font-weight: 600; color: var(--ink-2); margin-bottom: 18px; }

.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.facts li {
  display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; text-align: left;
  background: #fff; border: var(--line); border-radius: 14px; box-shadow: var(--pop-sm);
}
.facts span { color: var(--muted); font-size: .875rem; font-weight: 700; }
.facts strong { text-align: right; font-weight: 800; }
.hero .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero .facts li { flex-direction: column; justify-content: center; gap: 2px; text-align: center; padding: 10px 6px; }
.hero .facts li:nth-child(1) { background: var(--bubble-soft); }
.hero .facts li:nth-child(2) { background: var(--mint); }
.hero .facts li:nth-child(3) { background: var(--sun); }
.hero .facts span { color: var(--ink); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.hero .facts strong { text-align: center; font-family: var(--display); font-weight: 700; font-size: .95rem; line-height: 1.2; }
.facts-inline { margin: 14px 0 20px; }

/* ---------- Cartes ---------- */
.card { background: var(--card); border: var(--line); border-radius: var(--radius); box-shadow: var(--pop); padding: 20px; margin: 16px 0; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.card-link { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); background: var(--sun); font-weight: 600; }
.card-link strong { color: var(--ink); }
.principle .steps { margin: 12px 0 0; padding-left: 1.3em; color: var(--ink-2); }
.principle .steps li { margin: 3px 0; }
.principle .steps li::marker { font-family: var(--display); font-weight: 700; color: var(--hot); }
.num {
  display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 6px; vertical-align: 2px;
  border-radius: 10px; background: var(--sun); border: 2px solid var(--ink); font-family: var(--display); font-size: 1rem;
}

/* ---------- Formulaires ---------- */
.form { display: block; }
.field { display: block; margin: 0 0 14px; }
.label { display: block; font-weight: 800; font-size: .95rem; margin-bottom: 5px; }
.hint { font-weight: 600; color: var(--muted); font-size: .8rem; }
.req { color: var(--hot); }
input[type=text], input[type=email], input[type=tel], input[type=password], textarea {
  width: 100%; font: 600 1rem var(--sans); color: var(--ink);
  padding: 12px 14px; border-radius: 12px; border: var(--line); background: var(--bg);
  transition: box-shadow .12s, transform .12s, background .12s;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, textarea:focus { outline: none; background: #fff; box-shadow: var(--pop-sm); transform: translate(-1px, -1px); }
input::placeholder, textarea::placeholder { color: #866688; font-weight: 500; }
[aria-invalid="true"] { border-color: var(--danger) !important; background: #fff4f6 !important; }
.field-error { margin: 6px 0 0; color: var(--danger); font-weight: 800; font-size: .9rem; }
.field-error::before { content: "⚠ "; }
.check + .field-error { margin: -4px 0 10px; }
.hint-line { margin: 6px 0 0; font-size: .85rem; color: var(--muted); font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin: 10px 0; border: var(--line); border-radius: 14px; cursor: pointer; background: #fff; transition: background .15s, box-shadow .15s; }
.check:has(input:checked) { background: var(--mint-soft); box-shadow: var(--pop-sm); }
.check input { width: 22px; height: 22px; accent-color: var(--hot); flex: none; margin: 1px 0 0; }

.wishes { border: 2.5px dashed var(--ink); border-radius: 16px; padding: 14px; margin: 8px 0 4px; background: var(--sun-soft); }
.wishes legend { font-family: var(--display); font-weight: 700; padding: 2px 10px; background: var(--sun); border: 2px solid var(--ink); border-radius: 10px; }
.wishes input { margin-bottom: 8px; background: #fff; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 700 1rem var(--display); text-decoration: none; cursor: pointer; color: var(--ink);
  padding: 11px 18px; border-radius: 14px; border: var(--line); background: #fff; box-shadow: var(--pop-sm);
  transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { background: var(--bubble-soft); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--sun); font-size: 1.08rem; }
.btn-primary:hover { background: #ffdb5c; }
.btn-wa { background: #0f7a40; color: #fff; }
.btn-wa:hover { background: #0c6634; }
.btn-big { font-size: 1.12rem; padding: 15px 18px; }
.btn-link-danger { border: 0; box-shadow: none; background: none; color: var(--danger); text-decoration: underline; font-family: var(--sans); font-weight: 700; }
.btn-link-danger:hover { background: #ffe0e6; }
.btn-link-danger:active { transform: none; }
.btn-ghost { box-shadow: none; }
.btn-ghost:hover { box-shadow: var(--pop-sm); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: #ffe0e6; }
.btn-sm { padding: 8px 14px; min-height: 44px; font-size: .9rem; border-radius: 12px; }
.btn-block { display: flex; width: 100%; margin-top: 14px; }
.btn[disabled] { opacity: .65; cursor: default; }

/* ---------- Messages ---------- */
.flash { display: block; padding: 12px 16px; border-radius: 14px; margin: 12px 0; border: var(--line); box-shadow: var(--pop-sm); text-decoration: none; color: var(--ink); font-weight: 600; }
.flash ul { margin: 6px 0 0; padding-left: 1.2em; }
.flash-ok { background: var(--mint-soft); }
.flash-error { background: #ffe0e6; }
.flash-info { background: var(--bubble-soft); }
.flash-warn { background: var(--sun-soft); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-family: var(--display); font-size: .78rem; font-weight: 600; white-space: nowrap; border: 2px solid var(--ink); }
.badge-pending { background: var(--sun); }
.badge-validated { background: var(--mint); }
.badge-withdrawn { background: #e6e0e8; color: var(--ink-2); }
.tag { display: inline-block; font-size: .78rem; font-weight: 800; background: var(--bubble-soft); border: 1.5px solid var(--ink); padding: 1px 9px; border-radius: 8px; margin: 0 4px 6px 0; }
.tag-warn { background: var(--sun); }

/* ---------- Copier ---------- */
.copy { display: flex; gap: 8px; margin: 10px 0; align-items: stretch; }
.copy input { flex: 1; min-width: 0; font-size: 16px; }

/* ---------- Compte à rebours ---------- */
.countdown {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; margin: 14px 0; padding: 10px 14px;
  border-radius: 14px; background: #c4105c; color: #fff; border: var(--line); box-shadow: var(--pop-sm);
}
.cd-label { font-size: .85rem; font-weight: 800; }
@media (max-width: 440px) { .countdown { flex-direction: column; justify-content: center; text-align: center; } }
.cd-value { font-family: var(--display); font-weight: 700; font-size: 1.4rem; font-variant-numeric: tabular-nums; }

/* ---------- Dépliants ---------- */
details.fold > summary, details.fold-inner > summary { cursor: pointer; font-family: var(--display); font-weight: 700; list-style: none; }
details.fold > summary::-webkit-details-marker, details.fold-inner > summary::-webkit-details-marker { display: none; }
details.fold > summary::after {
  content: "+"; float: right; width: 26px; height: 26px; line-height: 22px; text-align: center;
  border: 2px solid var(--ink); border-radius: 8px; background: var(--mint); font-weight: 700;
}
details.fold[open] > summary::after { content: "–"; background: var(--sun); }
details.fold[open] > summary { margin-bottom: 14px; }
details.fold-inner { margin: 8px 0; }
details.fold-inner > summary { font-size: .92rem; color: var(--hot-deep); }

/* Bloc « facultatif » de la fiche de préférences */
details.more { margin: 6px 0 2px; border: 2.5px dashed var(--ink); border-radius: 16px; padding: 0 14px; background: #fffafc; }
details.more > summary { cursor: pointer; list-style: none; padding: 14px 0; font-family: var(--display); font-weight: 700; min-height: 44px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "＋ "; color: var(--hot); }
details.more[open] > summary::before { content: "－ "; }
details.more[open] { padding-bottom: 14px; }

/* Accueil : lieu, étape obligatoire */
.place { display: inline-block; margin: 14px 0 0; padding: 4px 14px; font-weight: 800; background: #fff; border: 2px solid var(--ink); border-radius: 999px; }
.step-must { font-weight: 700; }
.step-must span { display: inline-block; margin-right: 6px; padding: 1px 10px; font-family: var(--display); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; background: var(--sun); border: 2px solid var(--ink); border-radius: 8px; }
.danger-zone { margin-top: 10px; padding-top: 6px; border-top: 2px dashed #e3cfe0; text-align: right; }

/* ---------- Fiche de préférences ---------- */
.sheet { margin: 0; display: grid; gap: 10px; text-align: left; }
.sheet-row { padding: 10px 14px; border-radius: 14px; background: #fff; border: var(--line); }
.sheet-row dt { font-family: var(--display); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--hot-deep); margin-bottom: 2px; }
.sheet-row dd { margin: 0; font-weight: 600; }
.sheet-row dd ul { margin: 0; padding-left: 1.1em; }
.sheet-warn { background: var(--sun-soft); }
.sheet-warn dt { color: var(--warn); }
.sheet-wish { background: var(--mint-soft); box-shadow: var(--pop-sm); }
.sheet-wish dt { color: var(--ok); }

/* ---------- Révélation (espace perso) ---------- */
.reveal { text-align: center; overflow: hidden; }
.gift { all: unset; display: flex; flex-direction: column; align-items: center; gap: 16px; cursor: pointer; padding: 14px 0 6px; width: 100%; }
.gift:focus-visible { outline: 3px dashed var(--hot); outline-offset: 4px; border-radius: 12px; }
.gift-box { position: relative; width: 170px; height: 160px; animation: wobble 2.2s ease-in-out infinite; }
.gift-body { position: absolute; left: 14px; right: 14px; bottom: 0; height: 104px; border: 3px solid var(--ink); border-radius: 0 0 14px 14px; background: var(--hot); box-shadow: 6px 6px 0 var(--ink); }
.gift-lid {
  position: absolute; left: 0; right: 0; top: 30px; height: 36px; z-index: 2; border: 3px solid var(--ink); border-radius: 12px;
  background: repeating-linear-gradient(-45deg, #fff 0 12px, var(--hot) 12px 24px);
  transition: transform .6s cubic-bezier(.3, 1.6, .5, 1), opacity .6s;
}
.gift-ribbon { position: absolute; left: 50%; width: 28px; margin-left: -14px; top: 30px; bottom: 0; z-index: 3; background: var(--mint); border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); }
.gift-ribbon::before, .gift-ribbon::after { content: ""; position: absolute; top: -34px; width: 44px; height: 36px; border: 3px solid var(--ink); background: var(--mint); }
.gift-ribbon::before { right: 6px; border-radius: 50% 50% 8px 50%; transform: rotate(-16deg); }
.gift-ribbon::after { left: 6px; border-radius: 50% 50% 50% 8px; transform: rotate(16deg); }
.gift-cta { font-family: var(--display); font-weight: 600; background: var(--sun); border: 2px solid var(--ink); border-radius: 12px; padding: 6px 14px; box-shadow: var(--pop-sm); }
.reveal.opened .gift-lid { transform: translateY(-110px) rotate(-28deg); opacity: 0; }
.reveal.opened .gift { animation: fadeAway .5s .4s forwards; }
.reveal-content { animation: rise .7s cubic-bezier(.3, 1.4, .5, 1) both; }
.receiver-name {
  font-family: var(--display); font-weight: 700; font-size: clamp(3rem, 15vw, 4.4rem); line-height: 1; margin: 6px 0 8px;
  color: #fff; -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--ink);
}
.reveal h3 { margin-top: 10px; }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-6deg); } 20% { transform: rotate(6deg); } 30% { transform: rotate(0); } }
@keyframes fadeAway { to { opacity: 0; height: 0; padding: 0; overflow: hidden; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.95); } to { opacity: 1; transform: none; } }

.confetti { position: fixed; top: -14px; width: 10px; height: 14px; z-index: 150; pointer-events: none; border-radius: 3px; border: 1.5px solid var(--ink); animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Espace organisatrice ---------- */
.admin .wrap { max-width: 780px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0 6px; }
.admin-head .hero-kicker { margin-bottom: 6px; }
.admin-head h1 { font-size: 1.5rem; color: var(--hot); -webkit-text-stroke: 1.2px var(--ink); paint-order: stroke fill; margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: #fff; border: var(--line); border-radius: 16px; box-shadow: var(--pop-sm); margin: 10px 0 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 1 1 auto; text-align: center; padding: 10px 12px; min-height: 44px; border-radius: 11px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: .92rem; border: 2px solid transparent; }
.tabs a.active { background: var(--bubble); border-color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.stat { border: var(--line); border-radius: 14px; box-shadow: var(--pop-sm); padding: 10px 6px; text-align: center; background: #fff; }
.stat strong { display: block; font-family: var(--display); font-weight: 700; font-size: 1.7rem; line-height: 1.1; }
.stat span { font-size: .75rem; font-weight: 800; }
.stat-ok { background: var(--mint); }
.stat-pending { background: var(--sun); }
.stat-off { background: #ece6ee; }
@media (max-width: 420px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.plist { display: grid; gap: 12px; }
.pcard { background: #fff; border: var(--line); border-radius: 16px; box-shadow: var(--pop-sm); padding: 14px; position: relative; overflow: hidden; }
.pcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--bubble-soft); border-right: 2px solid var(--ink); }
.pcard > * { margin-left: 10px; }
.pcard.status-validated::before { background: var(--mint); }
.pcard.status-pending::before { background: var(--sun); }
.pcard.status-withdrawn { opacity: .7; }
.pcard.status-withdrawn::before { background: #d8d0da; }
.pcard header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pcard h3 { margin: 0 0 2px; font-size: 1.08rem; }
.pcard .flash { margin: 8px 0 8px 10px; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
form.inline { display: inline; margin: 0; }
.row-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 2px dashed var(--ink); font-weight: 700; }

.checklist { list-style: none; padding: 0; margin: 0 0 14px; }
.checklist li { padding: 7px 0 7px 34px; position: relative; font-weight: 600; }
.checklist li::before { position: absolute; left: 0; top: 6px; width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--ink); display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.checklist li.ok::before { content: "✓"; background: var(--mint); }
.checklist li.warn::before { content: "!"; background: var(--sun); }

.wheel-card { text-align: center; }
.wheel-wrap { position: relative; width: min(100%, 360px); margin: 14px auto; aspect-ratio: 1; }
.wheel-wrap canvas { width: 100%; height: 100%; display: block; }
.wheel-pointer {
  position: absolute; top: -10px; left: 50%; margin-left: -18px; width: 36px; height: 40px; z-index: 2;
  background: var(--sun); border: 3px solid var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.wheel-pointer::after { content: ""; position: absolute; inset: 0; }
.spin-result { margin-top: 16px; text-align: left; }
.spin-result ul { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.spin-result li { background: var(--mint); border: 2px solid var(--ink); padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 800; opacity: 0; animation: rise .4s ease-out forwards; }

.pairs { width: 100%; border-collapse: collapse; font-size: .92rem; font-weight: 600; }
.pairs th, .pairs td { padding: 8px 6px; border-bottom: 2px dashed #e3cfe0; text-align: left; }
.pairs th { font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.pairs td:nth-child(2) { color: var(--hot); white-space: nowrap; }

.log { list-style: none; padding: 0; margin: 0; max-height: 360px; overflow: auto; font-size: .88rem; }
.log li { padding: 6px 0; border-bottom: 2px dashed #f0dcea; }
.log time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; font-weight: 700; }

.foot { position: relative; z-index: 1; text-align: center; color: var(--ink-2); font-family: var(--display); font-weight: 600; font-size: .9rem; padding: 10px 16px 30px; }
.enter-up { animation: rise .8s cubic-bezier(.3, 1.4, .5, 1) both; }

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