:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --ink: #2b2420;
  --muted: #7a6f68;
  --line: #ece4db;
  --accent: #c8553d;
  --accent-ink: #ffffff;
  --accent-soft: #f6e3dc;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(43 36 32 / .05), 0 8px 24px rgb(43 36 32 / .06);
}
.theme-lou  { --accent: #d4683a; --accent-soft: #fae6da; }
.theme-lily { --accent: #8a5cc2; --accent-soft: #ece3f7; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Nunito", system-ui, sans-serif;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
a { color: var(--accent); }
h1, h2 { font-family: "Fraunces", Georgia, serif; line-height: 1.15; margin: 0; }

.back { display: inline-block; text-decoration: none; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.back:hover { color: var(--accent); }

.hero { text-align: center; padding: 32px 0 28px; }
.hero-left { text-align: left; }
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); }
.eyebrow { margin: 0 0 8px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; color: var(--accent); }
.hero-sub { color: var(--muted); margin: 10px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Choix espace / occasion */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; max-width: 640px; margin: 0 auto; }
.choice {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 36px 16px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
  border: 2px solid transparent; transition: transform .15s, border-color .15s;
}
.choice:hover { transform: translateY(-3px); border-color: var(--accent); }
.choice-emoji { font-size: 3rem; line-height: 1; }
.choice-label { font-family: "Fraunces", Georgia, serif; font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.choice-sub { color: var(--muted); font-size: .9rem; }

/* Grille de cadeaux */
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card-img { position: relative; aspect-ratio: 1; background: #fff; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.card-img-ph { font-size: 4rem; opacity: .4; }
.ribbon { position: absolute; top: 14px; left: 14px; background: var(--ink); color: #fff; font-weight: 700; font-size: .8rem; padding: 4px 10px; border-radius: 999px; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.brand { margin: 0; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.card-title { font-size: 1.2rem; }
.desc { margin: 0; color: var(--muted); font-size: .95rem; }
.card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.price { font-weight: 700; font-size: 1.15rem; }
.link { font-weight: 600; font-size: .9rem; text-decoration: none; }
.link:hover { text-decoration: underline; }
.card-action { margin-top: 10px; }
.card-action .btn { width: 100%; }
.reserved-by { margin: 0 0 6px; color: var(--muted); font-size: .95rem; }
.is-reserved .card-img img { opacity: .45; filter: grayscale(.6); }
.is-reserved .card-title, .is-reserved .price { color: var(--muted); }

/* Boutons */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  background: var(--accent); color: var(--accent-ink);
  padding: 11px 18px; border-radius: 12px; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { color: var(--ink); filter: none; box-shadow: inset 0 0 0 1.5px var(--muted); }
.btn-sm { padding: 5px 10px; font-size: .85rem; }

/* Modale */
.modal { border: 0; border-radius: var(--radius); padding: 0; width: min(440px, calc(100% - 32px)); box-shadow: 0 20px 60px rgb(0 0 0 / .25); color: var(--ink); }
.modal::backdrop { background: rgb(43 36 32 / .45); }
.modal form { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.modal-title { font-size: 1.3rem; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.field input { font: inherit; font-weight: 400; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); }
.field input:focus { outline: none; border-color: var(--accent); }
.modes { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.modes legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.mode { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.mode:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mode input { accent-color: var(--accent); margin-top: 4px; }
.mode span { display: flex; flex-direction: column; }
.mode small { color: var(--muted); }
.modal-error { margin: 0; color: #b42318; font-weight: 600; min-height: 1.2em; }
.modal-error:empty { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Admin */
.admin-list { margin-bottom: 36px; }
.admin-list h2 { font-size: 1.3rem; margin-bottom: 10px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.admin-list h2 a { color: inherit; text-decoration: none; }
.count { font-family: "Nunito", sans-serif; font-size: .9rem; color: var(--muted); font-weight: 600; }
.admin-list { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #faf6f1; }
tr:last-child td { border-bottom: 0; }
.is-free td { color: var(--muted); }
.muted { color: var(--muted); font-style: italic; }

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-img img { padding: 8px; }
  .card-body { padding: 12px; gap: 4px; }
  .card-title { font-size: 1rem; }
  .desc { font-size: .85rem; }
  .price { font-size: 1rem; }
  .btn { padding: 10px 12px; }
}

/* Suivi des achats (admin) */
.badge { font-family: "Nunito", sans-serif; font-size: .8rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.badge-todo { background: #fdecc8; color: #8a5a00; }
.is-todo td:first-child { box-shadow: inset 3px 0 0 #e0a100; }
.is-bought td { color: var(--muted); }
.achat-toggle {
  appearance: none; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  border: 1.5px dashed var(--line); background: transparent; color: var(--muted);
}
.is-todo .achat-toggle { border-color: #e0a100; color: #8a5a00; background: #fff8e6; }
.achat-toggle.is-on { border: 1.5px solid #2f8f5b; background: #e5f4ec; color: #1f6b42; }
.achat-toggle:hover { filter: brightness(.96); }
.admin-list td:nth-child(2) { white-space: nowrap; }

/* Portraits de Lou et Lily */
.choice-avatar, .hero-avatar {
  display: block; border-radius: 50%; object-fit: cover; aspect-ratio: 1;
  border: 4px solid #fff;
  box-shadow: 0 6px 20px rgb(43 36 32 / .15), 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}
.choice-avatar { width: 140px; margin-bottom: 6px; transition: transform .2s; }
.choice:hover .choice-avatar { transform: scale(1.04) rotate(-2deg); }
.hero-avatar { width: 96px; margin: 0 auto 12px; }
