:root {
  --bg: #f8f1e7;
  --card: #fffdf9;
  --ink: #2a2420;
  --muted: #6e625a;
  --line: #e6dccf;
  --green: #1f5a43;
  --green-ink: #ffffff;
  --red: #a8322a;
  --gold: #c8962e;
  --reserved-bg: #efe8de;
  --mine-bg: #e6f1ea;
  --focus: #c8962e;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17201c;
    --card: #1f2a25;
    --ink: #f3ece2;
    --muted: #b5aa9e;
    --line: #34413b;
    --green: #6fc39c;
    --green-ink: #10201a;
    --red: #ef8a80;
    --gold: #e2b75a;
    --reserved-bg: #1a2320;
    --mine-bg: #213a2f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.5 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 28px 16px 64px; }

header { text-align: center; margin-bottom: 28px; }
.garland { font-size: 28px; letter-spacing: 10px; margin: 0 0 8px; }
h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: clamp(30px, 8vw, 42px);
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--red);
}
.intro { color: var(--muted); margin: 0 auto; max-width: 30em; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 0 var(--line);
}
.card h2 { font-size: 21px; line-height: 1.3; margin: 0 0 6px; overflow-wrap: anywhere; }
.card .desc { margin: 0 0 8px; white-space: pre-line; overflow-wrap: anywhere; }
.card .price { margin: 0 0 14px; color: var(--muted); font-weight: 700; }
.actions { display: grid; gap: 10px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; width: 100%;
  padding: 12px 18px;
  border-radius: 14px;
  border: 2px solid transparent;
  font: inherit; font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--green); color: var(--green-ink); }
.btn-ghost { background: transparent; color: var(--green); border-color: var(--green); }
.btn-quiet { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 700; }
.btn-danger { background: var(--red); color: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.card.reserved { background: var(--reserved-bg); box-shadow: none; }
.card.reserved h2, .card.reserved .desc { color: var(--muted); }
.card.mine { background: var(--mine-bg); border-color: var(--green); }
.badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 16px; font-weight: 800;
  background: var(--line); color: var(--muted);
}
.card.mine .badge { background: var(--green); color: var(--green-ink); }

.confirm { display: grid; gap: 10px; padding-top: 4px; }
label { font-weight: 700; }
.hint { font-weight: 400; color: var(--muted); }
input, textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--green); outline: none; }

.empty, .loading { text-align: center; color: var(--muted); padding: 40px 0; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: 20px;
  max-width: 560px; margin: 0 auto;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--ink); color: var(--bg);
  font-weight: 700; text-align: center;
  transform: translateY(calc(100% + 40px)); visibility: hidden;
  transition: transform .25s ease, visibility .25s;
}
.toast.show { transform: none; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

footer { text-align: center; color: var(--muted); font-size: 15px; margin-top: 36px; }

/* Admin */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 22px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.note { background: var(--reserved-bg); border-radius: 12px; padding: 12px 14px; color: var(--muted); font-size: 16px; margin: 0 0 20px; }
.row-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-tools .wide { grid-column: 1 / -1; }
.error-msg { color: var(--red); font-weight: 700; margin: 0 0 10px; }
.reveal-list { margin: 12px 0 0; padding-left: 20px; }

a { color: var(--green); font-weight: 700; }

/* Images */
.card-img {
  display: block;
  width: calc(100% + 40px);
  margin: -20px -20px 16px;
  height: 220px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--line);
}
.card.reserved .card-img { opacity: .45; filter: grayscale(1); height: 140px; }
.card.mine .card-img, .card.reserved .card-img { margin-top: 0; border-radius: 12px; width: 100%; margin-left: 0; margin-right: 0; border: 1px solid var(--line); }
.thumb { display: block; width: 100%; max-height: 240px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.thumb[hidden] { display: none; }
.photo-msg:empty { display: none; }
.photo-msg { margin: 0; }
.label { font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
label.btn { font-weight: 800; }

[hidden] { display: none !important; }

/* ===== Thème Forêt (liste d'Alma, pour une enfant) : sapins, champignons, animaux ===== */
/* Toujours en clair, quel que soit le réglage du téléphone. */
:root {
  --bg: #f3f7ec;          /* vert tendre */
  --card: #fffdf6;
  --ink: #23402b;         /* vert sapin foncé */
  --muted: #586b5a;
  --line: #d6e3c8;
  --green: #2f6b3f;       /* boutons couleur sapin */
  --green-ink: #ffffff;
  --red: #d93a2b;         /* chapeau de champignon */
  --gold: #f2b84b;        /* lumière dorée */
  --reserved-bg: #eaeee2;
  --mine-bg: #fff3df;
  --focus: #f2b84b;
  --radius: 24px;
  color-scheme: light;
}
.foret-theme {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='%232f6b3f' fill-opacity='.07'%3E%3Cpath d='M30 52 L42 52 L36 38Z M28 44 L44 44 L36 28Z'/%3E%3Cpath d='M102 118 L114 118 L108 104Z M100 110 L116 110 L108 94Z'/%3E%3C/g%3E%3Cg fill='%23d93a2b' fill-opacity='.10'%3E%3Cpath d='M98 30 Q106 18 114 30Z'/%3E%3Cpath d='M20 112 Q27 102 34 112Z'/%3E%3C/g%3E%3Cg fill='%23f2b84b' fill-opacity='.35'%3E%3Ccircle cx='70' cy='70' r='2'/%3E%3Ccircle cx='128' cy='62' r='1.6'/%3E%3Ccircle cx='60' cy='128' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
}
.foret {
  display: block;
  width: min(100%, 340px); height: auto;
  margin: 0 auto 8px;
}
.coucou {
  margin: 0 0 2px;
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif;
  font-size: 20px; font-weight: 700;
  color: var(--red);
}
.foret-theme h1 {
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.05;
}
.foret-theme .card {
  border: 3px solid var(--line);
  box-shadow: 0 6px 0 #c4d8b0;
}
.foret-theme .card h2 { font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-weight: 800; font-size: 23px; }
.foret-theme .card.reserved { box-shadow: none; }
.foret-theme .card.mine { border-color: var(--gold); box-shadow: 0 6px 0 var(--gold); }
.foret-theme .btn { border-radius: 999px; }
.foret-theme .btn-primary { box-shadow: 0 4px 0 #1d4728; }
.foret-theme .btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #1d4728; }
.foret-theme .card.mine .badge { background: var(--gold); color: var(--ink); }
.foret-theme .card-img { border-bottom: 3px solid var(--line); }
.foret-theme footer .garland { font-size: 26px; letter-spacing: 8px; margin-bottom: 6px; }
.merci { font-weight: 800; color: var(--ink); }
