/* ===== Thème Noël ===== */
:root {
  --bg: #0b1a13;
  --bg-2: #102419;
  --surface: #15301f;
  --surface-2: #1b3a27;
  --border: rgba(231, 185, 76, 0.22);
  --text: #f4efe2;
  --muted: #b3c2b6;
  --red: #c8323b;
  --red-dark: #9e2229;
  --gold: #e7b94c;
  --green: #3f8f5a;
  --danger: #ff7a7a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(200, 50, 59, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(231, 185, 76, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  line-height: 1.55;
}
#snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.wrap { position: relative; z-index: 1; width: min(1120px, 100%); margin: 0 auto; padding: 0 16px; }

a { color: var(--gold); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .4em; }

/* ----- En-tête ----- */
.hero { text-align: center; padding: 56px 0 28px; }
.hero .garland { font-size: 28px; letter-spacing: 10px; margin-bottom: 8px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); color: var(--text); text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.hero h1 span { color: var(--gold); }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 1.05rem; white-space: pre-line; }
.nav { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

.banner {
  margin: 0 0 20px; padding: 12px 16px; border-radius: 12px;
  background: rgba(231, 185, 76, 0.12); border: 1px solid var(--border); color: var(--gold); text-align: center;
}

/* ----- Boutons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; padding: 10px 18px;
  font: 600 0.95rem var(--font-body); cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .15s ease, opacity .15s;
  background: var(--red); color: #fff;
}
.btn:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.gold { background: var(--gold); color: #2a1d02; }
.btn.gold:hover { background: #d4a43a; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: rgba(255,255,255,.06); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.danger { background: transparent; color: var(--danger); border-color: rgba(255,122,122,.4); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ----- Sections ----- */
section { margin: 28px 0 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { font-size: 1.8rem; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: 500 .85rem var(--font-body); }
.chip[aria-pressed="true"] { background: var(--gold); color: #2a1d02; border-color: var(--gold); }

/* ----- Grille de cadeaux ----- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.card .img { aspect-ratio: 4 / 3; background: #fff; display: grid; place-items: center; overflow: hidden; }
.card .img img { width: 100%; height: 100%; object-fit: contain; }
.card .img .ph { font-size: 64px; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 1.15rem; margin: 0; }
.card .desc { color: var(--muted); font-size: .92rem; margin: 0; }
.card .price { font-weight: 700; color: var(--gold); font-size: 1.1rem; }
.card .price small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.card .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.badge { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--gold); color: #2a1d02; z-index: 1; }
.card.reserved .img, .card.reserved .body > :not(.actions):not(.reserved-note) { opacity: .45; filter: grayscale(.6); }
.reserved-note { color: var(--gold); font-weight: 600; font-size: .92rem; }
.ribbon { position: absolute; top: 14px; right: -38px; transform: rotate(45deg); background: var(--red); color: #fff; padding: 4px 44px; font-size: .78rem; font-weight: 700; z-index: 1; }

.offers { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; }
.offers li a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.2); text-decoration: none; color: var(--text); font-size: .9rem; }
.offers li a:hover { background: rgba(231,185,76,.12); }
.offers li .p { font-weight: 700; color: var(--gold); white-space: nowrap; }
.offers li.out a { opacity: .55; }
details summary { cursor: pointer; color: var(--muted); font-size: .88rem; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ----- Cagnotte ----- */
.fund { background: linear-gradient(135deg, rgba(200,50,59,.25), rgba(231,185,76,.12)); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.fund p { color: var(--muted); }
.progress { height: 14px; border-radius: 999px; background: rgba(0,0,0,.3); overflow: hidden; margin: 12px 0 6px; }
.progress > div { height: 100%; background: repeating-linear-gradient(45deg, var(--red) 0 12px, #fff 12px 24px); transition: width .6s ease; }
.fund .stats { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .95rem; }
.fund .stats strong { color: var(--gold); font-size: 1.3rem; }

/* ----- Formulaires & dialogues ----- */
dialog {
  width: min(520px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
dialog::backdrop { background: rgba(3, 10, 6, .7); backdrop-filter: blur(3px); }
dialog form, .panel { padding: 22px; display: grid; gap: 14px; }
dialog h2 { font-size: 1.5rem; margin: 0; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=number], input[type=password], input[type=url], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(0,0,0,.25); color: var(--text); font: 400 1rem var(--font-body);
}
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.amounts { display: flex; gap: 8px; flex-wrap: wrap; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.error { color: var(--danger); font-size: .92rem; min-height: 1em; margin: 0; }
.note { color: var(--muted); font-size: .88rem; margin: 0; }
.success { padding: 14px; border-radius: 12px; background: rgba(63,143,90,.2); border: 1px solid rgba(63,143,90,.5); }
.copy { display: flex; gap: 8px; }
.copy input { font-size: .8rem; }

/* ----- Admin ----- */
.panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; }
.panel-card h2 { font-size: 1.4rem; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-list { display: grid; gap: 10px; }
.admin-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.18); }
.admin-item img, .admin-item .ph { width: 64px; height: 64px; border-radius: 10px; object-fit: contain; background: #fff; display: grid; place-items: center; font-size: 28px; }
.admin-item .meta { color: var(--muted); font-size: .85rem; }
.admin-item .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.admin-item.archived { opacity: .55; }
.results { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.9s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.offer-row { display: grid; grid-template-columns: 1fr 90px 1.6fr auto; gap: 6px; }

footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 30px 0 40px; }

@media (max-width: 560px) {
  .hero { padding-top: 36px; }
  .admin-item { grid-template-columns: 48px 1fr; }
  .admin-item img, .admin-item .ph { width: 48px; height: 48px; }
  .admin-item .btns { grid-column: 1 / -1; justify-content: flex-start; }
  .offer-row { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

.progress > div { width: 0; }
.row.start { justify-content: flex-start; margin-top: 16px; }
fieldset.box { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 10px; margin: 0; }
fieldset.box legend { padding: 0 6px; font-weight: 600; }
