/* Wishly : styles communs. Thème choisi par l'occasion : <body data-theme="christmas|birthday|neutral">.
   Aucune police ni ressource externe : rien n'est chargé depuis un autre site. */
:root {
  --bg: #f6f5f2; --card: #ffffff; --text: #23201d; --muted: #6f6862; --line: #e4dfd8;
  --accent: #2c6e7f; --accent-2: #4b8f6a; --accent-bg: #e6f1f0; --gold: #d0a23a; --on-accent: #fff;
  --link: #1f5f8b; --danger: #b3262b; --danger-bg: #fbe4e4; --particle: rgba(255,255,255,.85);
  --header-text: #fbfaf6;
  --banner: linear-gradient(160deg, #2c6e7f 0%, #24576a 55%, #3d6e58 100%);
  --title-font: Georgia, "Times New Roman", serif;
}
body[data-theme="christmas"] {
  --bg: #fbf6ee; --line: #eadfd2; --text: #2a1f1c; --muted: #75655f;
  --accent: #b3262b; --accent-2: #1f6b45; --accent-bg: #e7f2ea; --gold: #c9962b;
  --banner: radial-gradient(circle at 20% 0%, #c0392b 0, transparent 55%), linear-gradient(160deg, #8e1f23 0%, #5e1215 60%, #2d4d33 100%);
}
body[data-theme="birthday"] {
  --bg: #fbf7fd; --line: #eadff0; --text: #2a2130; --muted: #6f6478;
  --accent: #8a3fb8; --accent-2: #e0587f; --accent-bg: #f4e9fb; --gold: #f0b429;
  --banner: radial-gradient(circle at 80% 10%, #f7a3c0 0, transparent 45%), linear-gradient(150deg, #7b2fb0 0%, #b2459c 55%, #f08a5d 100%);
}
@media (prefers-color-scheme: dark) {
  :root, body[data-theme] {
    --bg: #141312; --card: #1e1c1b; --text: #efe9e4; --muted: #b0a79f; --line: #36312e;
    --accent: #6fb6c6; --accent-2: #7fc79a; --accent-bg: #1b2a2c; --on-accent: #10181a;
    --link: #8dc0e8; --danger: #f09092; --danger-bg: #3a1e1f; --particle: rgba(255,255,255,.7);
  }
  body[data-theme="christmas"] { --accent: #e5676b; --accent-2: #7fc79a; --accent-bg: #1b2e23; --on-accent: #1f1010; }
  body[data-theme="birthday"] { --accent: #c48ae6; --accent-2: #f08fae; --accent-bg: #2a1f33; --on-accent: #1a1020; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); overflow-wrap: anywhere; }
[hidden] { display: none !important; }

/* Bandeau */
.banner { position: relative; overflow: hidden; color: var(--header-text); background: var(--banner);
  padding: 26px 16px 44px; text-align: center; }
.banner::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 26px;
  background: radial-gradient(circle at 13px -6px, transparent 16px, var(--bg) 17px) repeat-x; background-size: 26px 26px; }
.banner h1 { font-family: var(--title-font); font-weight: 700; font-size: clamp(1.9rem, 7vw, 3rem);
  margin: 0; line-height: 1.15; text-shadow: 0 2px 8px rgba(0,0,0,.3); position: relative; z-index: 1; overflow-wrap: anywhere; }
.banner .sub { margin: 8px auto 0; max-width: 34em; opacity: .92; position: relative; z-index: 1; }
.garland { font-size: 1.35rem; letter-spacing: .3em; margin-bottom: 6px; position: relative; z-index: 1; }
.brand { position: absolute; top: 8px; left: 12px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; opacity: .75; z-index: 1; }
.particle { position: absolute; top: -12px; color: var(--particle); user-select: none; pointer-events: none;
  animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(260px) rotate(200deg); } }
@media (prefers-reduced-motion: reduce) { .particle { display: none; } }

/* Menu de langue (repris de DelpheaBlue) : drapeau + code, liste drapeau + nom. Posé au-dessus du bandeau,
   qui coupe ce qui dépasse. */
.lang-slot { position: absolute; top: 8px; right: 12px; z-index: 30; }
.lang-menu { position: relative; }
.lang-toggle { display: flex; align-items: center; justify-content: center; gap: 6px; width: 74px; min-height: 34px;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.35); border-radius: 999px;
  color: var(--header-text); font-size: .8rem; font-weight: 600; letter-spacing: .4px; user-select: none; }
.lang-toggle:hover, .lang-menu[open] .lang-toggle { border-color: var(--gold); }
.flag { width: 1.35em; height: .9em; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.18); display: block; }
.lang-list { position: absolute; top: calc(100% + 8px); right: 0; display: flex; flex-direction: column; min-width: 160px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.lang-choice { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 9px; background: none;
  color: var(--text); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; white-space: nowrap; }
.lang-choice:hover, .lang-choice:focus-visible { background: var(--accent-bg); }
.lang-choice.is-active { color: var(--accent); font-weight: 600; }

main { max-width: 900px; margin: 0 auto; padding: 10px 16px 64px; }
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }
.hello { font-size: 1.15rem; font-weight: 600; margin: 6px 0 2px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin: 14px 0 6px; }
.error { background: var(--danger-bg); color: var(--danger); border-radius: 8px; padding: 8px 12px; margin-top: 12px; }
.notice { background: var(--accent-bg); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.blocked { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty { color: var(--muted); font-style: italic; margin: 0; }

/* Occasions (onglets) */
.occasions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip { font: inherit; font-size: .9rem; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 99px; padding: 6px 14px; cursor: pointer; text-decoration: none; }
.chip[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.archived { opacity: .6; }

/* Cartes de listes */
.lists { display: grid; gap: 14px; }
.person { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; border-top: 5px solid var(--accent); }
.person:nth-child(even) { border-top-color: var(--accent-2); }
.person.mine { box-shadow: 0 0 0 2px var(--gold); }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.person > summary { display: flex; align-items: center; gap: 10px; padding: 14px 18px; }
.person > summary h2 { margin: 0; font-size: 1.2rem; flex: 1; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.person > summary h2 small { color: var(--muted); font-weight: 400; font-size: .85rem; }
.badge { font-size: .75rem; font-weight: 600; background: var(--gold); color: #2a1f1c; border-radius: 99px; padding: 1px 8px; }
.badge.soft { background: var(--accent-bg); color: var(--text); }
.chev { transition: transform .2s; color: var(--muted); flex: none; }
details[open] > summary .chev { transform: rotate(90deg); }
.person-body { padding: 0 18px 16px; }

ul.wishes { list-style: none; margin: 0; padding: 0; }
ul.wishes > li { border-top: 1px dashed var(--line); }
.wish > summary { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 10px 0; }
.wish > summary::before { content: var(--wish-icon, "🎁"); flex: none; }
.wish[open] > summary::before { content: var(--wish-icon-open, "🎀"); }
.wish.money > summary::before, .wish.money[open] > summary::before { content: "💶"; }
body[data-theme="birthday"] { --wish-icon: "🎈"; --wish-icon-open: "🎉"; }
body[data-theme="neutral"] { --wish-icon: "✨"; --wish-icon-open: "🎁"; }
.wish-text { font-weight: 600; overflow-wrap: anywhere; flex: 1 1 160px; min-width: 0; }
.wish-body { padding: 0 0 10px 30px; }
.wish-details { color: var(--muted); font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.wish-actions { display: flex; gap: 8px; margin-top: 8px; }
.wish-meta { margin-top: 6px; font-size: .8rem; color: var(--muted); }
.more { font-size: .75rem; color: var(--muted); flex: none; padding-top: 3px; }
.handle { flex: none; cursor: grab; touch-action: none; user-select: none; color: var(--muted); font-size: 1.1rem; line-height: 1;
  padding: 2px 4px; margin: 0 -2px 0 -6px; border-radius: 6px; }
.handle:active { cursor: grabbing; }
li.dragging { background: var(--accent-bg); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.18); position: relative; z-index: 2; }
body.drag-active { user-select: none; cursor: grabbing; }
.order { display: flex; gap: 4px; flex: none; }
.order button { font: inherit; font-size: .8rem; line-height: 1; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 6px; padding: 4px 7px; cursor: pointer; }
.order button:disabled { opacity: .3; cursor: default; }

/* Je m'en occupe / Je participe */
.claim { flex: none; display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: .8rem; border: 1px solid var(--line);
  border-radius: 99px; padding: 2px 9px; cursor: pointer; user-select: none; background: var(--card); color: var(--text); white-space: nowrap; margin-left: auto; }
.claim input { margin: 0; accent-color: var(--accent-2); }
.claim.mine { background: var(--accent-bg); border-color: var(--accent-2); color: var(--accent-2); font-weight: 600; }
.claim.other { background: transparent; border-style: dashed; color: var(--muted); cursor: default; }
.pledge-sum { flex-basis: 100%; text-align: right; font-size: .8rem; color: var(--muted); }
.pledge { margin-top: 8px; padding: 10px 12px; background: var(--accent-bg); border-radius: 10px; font-size: .92rem; display: grid; gap: 8px; }
.pledge .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pledge input { font: inherit; width: 7em; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.gone-title { margin: 14px 0 4px; font-size: .85rem; font-weight: 600; color: var(--danger); }
ul.gone .wish-text { text-decoration: line-through; color: var(--muted); }
.gone-tag { font-size: .85rem; color: var(--danger); margin-bottom: 4px; }

/* Boutons et formulaires */
button.small, a.small { font: inherit; font-size: .85rem; border: 1px solid var(--line); background: transparent; color: var(--text);
  border-radius: 8px; padding: 3px 10px; cursor: pointer; text-decoration: none; display: inline-block; }
button.small.danger { color: var(--danger); }
/* Bouton à deux libellés (Clôturer / Rouvrir) : les deux sont superposés, la largeur ne change pas. */
button.toggle-label { display: inline-grid; justify-items: center; }
button.toggle-label > span { grid-area: 1 / 1; }
button.toggle-label > .off { visibility: hidden; }
.occ-state { margin: -4px 0 12px; }
button.primary { font: inherit; font-weight: 600; border: 0; background: var(--accent); color: var(--on-accent); border-radius: 8px; padding: 8px 16px; cursor: pointer; }
button.primary:disabled { opacity: .6; }
button.secondary { font: inherit; font-weight: 600; border: 1px dashed var(--accent); background: transparent; color: var(--accent); border-radius: 8px; padding: 7px 15px; cursor: pointer; }
/* Souhaits secrets (ajoutés par d'autres, jamais montrés à la personne concernée) */
.secret-tag { font-size: .85rem; color: var(--muted); font-style: italic; margin-bottom: 4px; }
.secret-note { margin: 0 0 8px; font-size: .9rem; color: var(--muted); }
ul.wishes.secrets { border-top: 1px dashed var(--line); }
button.link { font: inherit; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 8px 10px; }
form.edit { display: grid; gap: 8px; margin: 10px 0; padding: 12px; background: var(--accent-bg); border-radius: 10px; }
form.edit label { font-size: .85rem; font-weight: 600; display: grid; gap: 4px; }
form.edit label.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; cursor: pointer; }
form.edit label.check input { width: auto; margin: 3px 0 0; accent-color: var(--accent-2); flex: none; }
input, textarea, select { font: inherit; }
form.edit input:not([type=checkbox]):not([type=radio]), form.edit textarea, form.edit select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
form.edit textarea { min-height: 70px; resize: vertical; }
form.edit .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.edit .note { font-size: .8rem; color: var(--muted); font-weight: 400; }
.add { margin-top: 12px; }

footer { margin-top: 40px; color: var(--muted); font-size: .82rem; text-align: center; display: grid; gap: 8px; justify-items: center; }
footer .privacy { max-width: 36em; }

/* Organisateur : bouton « Organiser » sur sa page, retour à sa liste dans l'organisation */
.organize { text-align: right; margin: 0 0 6px; }
.organize a.small { font-weight: 600; }
.back-list { margin: 0 0 10px; font-size: .92rem; }
form.new-group { display: grid; gap: 8px; }

/* Page d'accueil (sans lien personnel) */
.landing .lead { font-size: 1.1rem; margin: 8px 0 16px; }
.landing h2 { font-size: 1.1rem; margin: 24px 0 8px; }
.landing ul.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.landing ul.features li { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.landing ul.features .ico { font-size: 1.5rem; line-height: 1.2; }
.landing ul.features div { color: var(--muted); font-size: .95rem; }
.landing ul.features strong { color: var(--text); }
.landing .demo { pointer-events: none; }
.landing .demo + .hint { margin-top: 8px; }
.landing .demo details.person > summary { cursor: default; }
