/* Picado — thème « carte de Noël » : papier crème, sapin, canneberge, or. */
:root {
  --papier: #fbf6ec;
  --papier-2: #f4ecdb;
  --carte: #fffdf8;
  --encre: #1f2a24;
  --encre-douce: #5d6b63;
  --sapin: #0f3d2e;
  --sapin-2: #175a43;
  --houx: #b3202a;
  --houx-2: #8f1820;
  --or: #c99a2e;
  --or-pale: #f6e7c1;
  --bord: #e6dcc6;
  --ok: #1f7a4d;
  --erreur: #b3202a;
  --info: #2c5d8a;
  --ombre: 0 1px 2px rgba(15, 61, 46, .06), 0 8px 24px rgba(15, 61, 46, .07);
  --rayon: 16px;
  --titre: "Fraunces", Georgia, "Times New Roman", serif;
  --texte: "Figtree", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --papier: #0b1f18;
    --papier-2: #10281f;
    --carte: #132e24;
    --encre: #f3ead6;
    --encre-douce: #a9bfb2;
    --sapin: #0a2a1f;
    --sapin-2: #3f9b74;
    --houx: #e0505a;
    --houx-2: #c43c46;
    --or: #e2b85a;
    --or-pale: #3b3320;
    --bord: #24473a;
    --ok: #4cc08a;
    --info: #7fb3e0;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--papier); color: var(--encre); font: 16px/1.55 var(--texte);
}
a { color: var(--sapin-2); text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) { a { color: #8fd3b2; } }
h1, h2, h3 { font-family: var(--titre); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- en-tête ---------- */
.entete {
  position: relative; overflow: hidden; background: var(--sapin); color: #f6efdc;
  border-bottom: 4px solid var(--houx);
}
.entete::after { /* guirlande pointillée dorée */
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--or) 0 6px, transparent 6px 14px); opacity: .55;
}
.entete-in { max-width: 1080px; margin: 0 auto; padding: 14px 16px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--titre); font-size: 1.55rem; font-weight: 700; }
.logo svg { width: 34px; height: 34px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a, .nav button {
  color: #f6efdc; text-decoration: none; padding: 8px 12px; border-radius: 999px; font: 500 .95rem var(--texte);
  background: none; border: 0; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center;
}
.nav a:hover, .nav button:hover, .nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); }
.nav form { margin: 0; }
.neige { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.flocon { position: absolute; top: -10px; color: #fff; opacity: .7; animation: tombe linear infinite; font-size: 10px; }
@keyframes tombe { to { transform: translateY(140px) translateX(14px) rotate(160deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .flocon { display: none; } }

/* ---------- mise en page ---------- */
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 16px 56px; }
.etroit { max-width: 520px; margin: 0 auto; }
.moyen { max-width: 760px; margin: 0 auto; }
.pied { text-align: center; color: var(--encre-douce); font-size: .85rem; padding: 24px 16px 32px; border-top: 1px solid var(--bord); }
.pied a { color: inherit; }
.fil { font-size: .9rem; color: var(--encre-douce); margin-bottom: 10px; }
.fil a { color: inherit; }
.titre-ligne { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.titre-ligne h1 { margin: 0; }
.sous { color: var(--encre-douce); margin: 4px 0 0; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.deux { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .deux { grid-template-columns: 1.4fr 1fr; } }
.pile > * + * { margin-top: 16px; }

/* ---------- cartes ---------- */
.carte {
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 22px;
  box-shadow: var(--ombre);
}
.carte.ruban, .carte.or { position: relative; overflow: hidden; }
.carte.ruban::before, .carte.or::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--houx); }
.carte.or::before { background: var(--or); }
.carte h2:first-child, .carte h3:first-child { margin-top: 0; }
a.carte-groupe { display: block; text-decoration: none; color: inherit; position: relative; transition: transform .15s, box-shadow .15s; }
a.carte-groupe:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15,61,46,.08), 0 14px 32px rgba(15,61,46,.12); }
.carte-groupe .emoji { font-size: 2rem; line-height: 1; }
.carte-groupe h3 { margin: 10px 0 4px; font-size: 1.25rem; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--encre-douce); font-size: .9rem; }
.compte-rebours { display: inline-flex; align-items: baseline; gap: 4px; font-family: var(--titre); color: var(--houx); font-weight: 700; }
.compte-rebours b { font-size: 1.6rem; }

.pastille { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--papier-2); color: var(--encre-douce); border: 1px solid var(--bord); white-space: nowrap; }
.pastille.rouge { background: var(--houx); color: #fff; border-color: transparent; }
.pastille.verte { background: var(--sapin-2); color: #fff; border-color: transparent; }
.pastille.or { background: var(--or-pale); color: #6b4f0f; border-color: transparent; }
@media (prefers-color-scheme: dark) { .pastille.or { color: var(--or); } }

/* ---------- formulaires ---------- */
label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 6px; }
.champ { margin-bottom: 16px; }
.aide-champ { font-size: .84rem; color: var(--encre-douce); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1.5px solid var(--bord); background: var(--carte); color: var(--encre);
  font: inherit; min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--or); outline-offset: 2px;
}
.ligne { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .ligne { grid-template-columns: 1fr; } }
.case { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.case input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--houx); flex: none; }
fieldset { border: 1px solid var(--bord); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; }
legend { font-weight: 600; font-size: .92rem; padding: 0 6px; }
.emojis { display: flex; flex-wrap: wrap; gap: 6px; }
.emojis label { margin: 0; }
.emojis input { position: absolute; opacity: 0; }
.emojis span { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; font-size: 1.4rem; border-radius: 12px; border: 1.5px solid var(--bord); cursor: pointer; background: var(--carte); }
.emojis input:checked + span { border-color: var(--houx); background: var(--or-pale); }
.emojis input:focus-visible + span { outline: 3px solid var(--or); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; min-height: 44px;
  border: 1.5px solid transparent; font: 600 .97rem var(--texte); cursor: pointer; text-decoration: none; background: var(--houx); color: #fff;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--houx-2); }
.btn:active { transform: translateY(1px); }
.btn.sapin { background: var(--sapin-2); }
.btn.sapin:hover { background: var(--sapin); }
.btn.contour { background: transparent; color: var(--encre); border-color: var(--bord); }
.btn.contour:hover { background: var(--papier-2); }
.btn.petit { padding: 6px 13px; min-height: 36px; font-size: .88rem; }
.btn.lien { background: none; color: var(--sapin-2); padding: 6px 8px; min-height: 36px; text-decoration: underline; }
.btn.danger { background: transparent; color: var(--houx); border-color: var(--houx); }
.btn.danger:hover { background: var(--houx); color: #fff; }
.btn.large { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.enligne { display: inline; margin: 0; }

/* ---------- messages ---------- */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; border: 1px solid; font-weight: 500; }
.flash.ok { background: color-mix(in srgb, var(--ok) 10%, var(--carte)); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.flash.erreur { background: color-mix(in srgb, var(--erreur) 10%, var(--carte)); border-color: color-mix(in srgb, var(--erreur) 45%, transparent); }
.flash.info { background: color-mix(in srgb, var(--info) 10%, var(--carte)); border-color: color-mix(in srgb, var(--info) 40%, transparent); }
.vide { text-align: center; padding: 28px 16px; color: var(--encre-douce); }
.vide .grand { font-size: 2.4rem; display: block; margin-bottom: 6px; }

/* ---------- listes ---------- */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { padding: 14px 0; border-top: 1px solid var(--bord); display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.liste > li:first-child { border-top: 0; padding-top: 4px; }
.liste .principal { flex: 1 1 260px; min-width: 0; }
.liste .titre-souhait { font-weight: 600; font-size: 1.04rem; overflow-wrap: anywhere; }
.liste .details { color: var(--encre-douce); font-size: .92rem; white-space: pre-line; overflow-wrap: anywhere; margin-top: 2px; }
.prix { font-family: var(--titre); font-weight: 600; color: var(--sapin-2); }
.reserve { opacity: .7; }
.membre { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--sapin-2); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; font-size: .95rem; }
.avatar.rouge { background: var(--houx); }
.avatar.or { background: var(--or); color: #2b2008; }

/* grille de partage des souhaits */
.partage { width: 100%; border-collapse: collapse; font-size: .92rem; }
.partage-boite { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.partage th, .partage td { padding: 10px 8px; border-top: 1px solid var(--bord); text-align: center; }
.partage th:first-child, .partage td:first-child { text-align: left; min-width: 180px; }
.partage thead th { border-top: 0; font-weight: 600; vertical-align: bottom; }
.partage input { width: 22px; height: 22px; accent-color: var(--sapin-2); cursor: pointer; }

/* onglets du groupe */
.onglets { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--bord); margin: 0 0 22px; }
.onglets a { padding: 10px 14px; text-decoration: none; color: var(--encre-douce); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.onglets a[aria-current="page"] { color: var(--encre); border-color: var(--houx); }
.onglets a:hover { color: var(--encre); }

/* ---------- cadeau à déballer ---------- */
.revelation { text-align: center; padding: 26px 16px; }
.cadeau { position: relative; width: 150px; height: 140px; margin: 10px auto 18px; cursor: pointer; border: 0; background: none; padding: 0; }
.cadeau .boite { position: absolute; left: 10px; right: 10px; bottom: 0; height: 96px; background: var(--houx); border-radius: 8px; box-shadow: inset 0 -8px 0 rgba(0,0,0,.12); }
.cadeau .couvercle { position: absolute; left: 0; right: 0; top: 22px; height: 30px; background: var(--houx-2); border-radius: 8px; transition: transform .6s cubic-bezier(.3,1.6,.5,1), opacity .6s; }
.cadeau .ruban-v { position: absolute; left: 50%; width: 20px; margin-left: -10px; top: 22px; bottom: 0; background: var(--or); }
.cadeau .noeud { position: absolute; left: 50%; top: 0; width: 64px; margin-left: -32px; height: 30px; transition: transform .6s, opacity .6s; }
.cadeau .noeud::before, .cadeau .noeud::after { content: ""; position: absolute; top: 4px; width: 30px; height: 22px; border: 6px solid var(--or); border-radius: 50% 50% 50% 50%; }
.cadeau .noeud::before { left: 0; transform: rotate(-18deg); }
.cadeau .noeud::after { right: 0; transform: rotate(18deg); }
.cadeau:hover .couvercle { transform: translateY(-4px) rotate(-2deg); }
.cadeau.ouvert .couvercle { transform: translateY(-70px) rotate(-24deg); opacity: 0; }
.cadeau.ouvert .noeud { transform: translateY(-80px) rotate(30deg); opacity: 0; }
.nom-pige { font-family: var(--titre); font-size: clamp(2rem, 6vw, 3rem); color: var(--houx); font-weight: 700; margin: 0; }
.cache { display: none; }
.apparait { animation: apparait .6s ease-out both; }
@keyframes apparait { from { opacity: 0; transform: scale(.85); } }
@media (prefers-reduced-motion: reduce) { .cadeau .couvercle, .cadeau .noeud, .apparait { transition: none; animation: none; } }

/* ---------- accueil ---------- */
.heros { text-align: center; padding: 30px 0 10px; }
.heros h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); max-width: 14ch; margin: 0 auto 14px; }
.heros h1 em { color: var(--houx); font-style: italic; }
.heros p.chapeau { font-size: 1.15rem; color: var(--encre-douce); max-width: 36rem; margin: 0 auto 26px; }
.etapes { counter-reset: e; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 38px; }
.etape { position: relative; padding-top: 30px; }
.etape::before { counter-increment: e; content: counter(e); position: absolute; top: -16px; left: 22px; width: 38px; height: 38px; border-radius: 50%; background: var(--houx); color: #fff; font: 700 1.1rem var(--titre); display: flex; align-items: center; justify-content: center; border: 3px solid var(--papier); }

/* ---------- messages anonymes ---------- */
.fil-msg { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-height: 420px; overflow-y: auto; padding: 4px; }
.bulle { max-width: 82%; padding: 10px 14px; border-radius: 16px; white-space: pre-line; overflow-wrap: anywhere; }
.bulle.moi { align-self: flex-end; background: var(--sapin-2); color: #fff; border-bottom-right-radius: 4px; }
.bulle.eux { align-self: flex-start; background: var(--papier-2); border: 1px solid var(--bord); border-bottom-left-radius: 4px; }
.bulle small { display: block; opacity: .75; font-size: .75rem; margin-top: 4px; }

details.pli { border: 1px solid var(--bord); border-radius: 12px; padding: 0 14px; background: var(--carte); margin-bottom: 12px; }
details.pli > summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
details.pli > summary::after { content: "＋"; color: var(--encre-douce); }
details.pli[open] > summary::after { content: "－"; }
details.pli[open] { padding-bottom: 14px; }

.tableau-simple { width: 100%; border-collapse: collapse; }
.tableau-simple td, .tableau-simple th { padding: 10px 6px; border-top: 1px solid var(--bord); text-align: left; vertical-align: middle; }
.tableau-simple th { font-size: .85rem; color: var(--encre-douce); font-weight: 600; border-top: 0; }
.lien-copie { display: flex; gap: 8px; }
.lien-copie input { font-size: .85rem; }
.note { font-size: .88rem; color: var(--encre-douce); }
.separateur { border: 0; border-top: 1px dashed var(--bord); margin: 22px 0; }
.compteur { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--houx); color: #fff; font-size: .75rem; font-weight: 700; align-items: center; justify-content: center; }
.zone-danger { border-color: color-mix(in srgb, var(--houx) 45%, var(--bord)); }
.centre { justify-content: center; text-align: center; }
.espace { margin-top: 16px; }
.espace-petit { margin-top: 6px; }
.revelation-mini { font-size: 3rem; margin: 0 0 8px; text-align: center; }
