:root {
  --bg: #fff8f3;
  --card: #ffffff;
  --ink: #3d3a4b;
  --muted: #857f95;
  --accent: #e57b86;
  --accent-dark: #c9606c;
  --mint: #8cc7c2;
  --sun: #f7d488;
  --line: #f1e4dc;
  --radius: 22px;
  --shadow: 0 12px 30px -14px rgba(120, 70, 80, 0.3);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Nunito, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
h1, h2, h3 { font-family: Fredoka, Nunito, sans-serif; font-weight: 600; line-height: 1.15; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }

/* ---------- En-tête ---------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 72px 16px 48px;
  background: linear-gradient(170deg, #fde2e4 0%, #fbeee6 45%, #e2f2ef 100%);
  border-radius: 0 0 48px 48px;
}
.hero > *:not(.bubbles) { position: relative; }
.mascot {
  /* Position de la barre dessinée sur le ventre (en % de l'image) — à ajuster si besoin */
  --bar-left: 26.2%;
  --bar-top: 63.1%;
  --bar-width: 17.7%;
  --bar-height: 5.2%;
  --pct-left: 30.6%;
  --pct-top: 68.4%;
  --pct-width: 10.8%;
  --pct-height: 6%;
  --belly: #f8e2d2; /* couleur du ventre, pour masquer le « 78% » dessiné */
  --love-x: 35%;    /* point de départ des cœurs (ventre) */
  --love-y: 56%;

  position: relative;
  container-type: inline-size;
  width: min(100%, 640px);
  margin: -40px auto 4px;
  animation: breathe 4s ease-in-out infinite;
}
.mascot img { display: block; width: 100%; height: auto; }
@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.belly-bar {
  position: absolute;
  left: var(--bar-left);
  top: var(--bar-top);
  width: var(--bar-width);
  height: var(--bar-height);
  padding: 0.35cqw;
  border: max(2px, 0.32cqw) solid #1d1b4f;
  border-radius: 0.9cqw;
  background: #dcd8f6;
  overflow: hidden;
  image-rendering: pixelated;
}
/* Séparations façon « blocs » de chargement (7 blocs comme le dessin) */
.belly-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(14.2857% - 1.5px), rgba(255, 255, 255, 0.85) calc(14.2857% - 1.5px) 14.2857%);
  pointer-events: none;
}
.belly-fill {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  border-radius: 0.4cqw;
  background: linear-gradient(90deg, #ef2f6b, #f777a5);
  overflow: hidden;
}
.belly-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.7) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 2.2s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.belly-pct {
  position: absolute;
  left: var(--pct-left);
  top: var(--pct-top);
  width: var(--pct-width);
  height: var(--pct-height);
  display: grid;
  place-items: center;
  background: radial-gradient(closest-side, var(--belly) 75%, transparent);
  font-family: "Pixelify Sans", Fredoka, sans-serif;
  font-weight: 700;
  font-size: 3.9cqw;
  line-height: 1;
  color: #1d1b4f;
  font-variant-numeric: tabular-nums;
}

/* Cœurs qui s'envolent du ventre */
.love span {
  position: absolute;
  left: var(--love-x);
  top: var(--love-y);
  font-size: 2.6cqw;
  line-height: 1;
  color: #ff3f84;
  text-shadow: 0 0 0 #1d1b4f, 0.15cqw 0.15cqw 0 #1d1b4f;
  opacity: 0;
  animation: love-up 5.4s ease-out infinite;
  animation-delay: var(--d);
}
@keyframes love-up {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.4); }
  15%  { opacity: 1; transform: translate(calc(-50% + var(--x) * 0.3), -3cqw) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x) * 3), -18cqw) scale(0.8) rotate(10deg); }
}

/* Petites étoiles qui scintillent */
.twinkles span {
  position: absolute;
  font-size: 2.4cqw;
  line-height: 1;
  color: #ffd23f;
  text-shadow: 0 0 1cqw rgba(255, 220, 90, 0.9);
  transform: translate(-50%, -50%) scale(0);
  animation: twinkle 3.5s ease-in-out infinite;
  animation-delay: var(--d);
}
@keyframes twinkle {
  0%, 60%, 100% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
  75% { transform: translate(-50%, -50%) scale(1.2) rotate(45deg); opacity: 1; }
}

/* Petit sursaut de joie quand la barre a fini de se remplir */
.mascot.loaded .belly-bar { animation: pop 0.5s ease-out; }
@keyframes pop {
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .mascot, .belly-fill::after, .mascot.loaded .belly-bar { animation: none; }
  .love, .twinkles { display: none; }
}
.eyebrow { margin: 0; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.hero h1 { font-size: clamp(2.8rem, 10vw, 5rem); margin: 0.1em 0 0.15em; color: var(--accent); }
.countdown {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 99px;
  font-weight: 700;
}
.countdown:empty { display: none; }
.intro { max-width: 620px; margin: 0 auto 28px; font-size: 1.1rem; white-space: pre-line; }
.progress { max-width: 420px; height: 14px; margin: 0 auto; background: rgba(255, 255, 255, 0.8); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--accent)); border-radius: inherit; transition: width 0.8s ease; }
.progress-label { margin: 8px 0 0; font-weight: 700; color: var(--muted); font-size: 0.95rem; }

.bubbles span {
  position: absolute;
  bottom: -80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  animation: float 14s linear infinite;
}
.bubbles span:nth-child(1) { left: 6%;  width: 60px; height: 60px; animation-delay: 0s; }
.bubbles span:nth-child(2) { left: 22%; width: 26px; height: 26px; animation-delay: 4s; animation-duration: 10s; }
.bubbles span:nth-child(3) { left: 45%; width: 44px; height: 44px; animation-delay: 7s; }
.bubbles span:nth-child(4) { left: 68%; width: 70px; height: 70px; animation-delay: 2s; animation-duration: 17s; }
.bubbles span:nth-child(5) { left: 84%; width: 30px; height: 30px; animation-delay: 9s; animation-duration: 11s; }
.bubbles span:nth-child(6) { left: 93%; width: 50px; height: 50px; animation-delay: 5s; }
@keyframes float {
  from { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  to { transform: translateY(-560px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .bubbles { display: none; } }

/* ---------- Contenu ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 32px 16px 48px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 6px 16px; border-radius: 99px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
}
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.toggle { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 18px; height: 18px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 1.2rem; padding: 40px 0; }

.card {
  display: flex; flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-4px); }
.card-img { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: #fdf0ea; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .emoji { font-size: 4.5rem; }
.card.full .card-img img, .card.full .card-img .emoji { filter: grayscale(0.8); opacity: 0.5; }
.badge {
  position: absolute; top: 12px; right: 12px;
  padding: 4px 12px; border-radius: 99px;
  background: var(--mint); color: #fff; font-weight: 800; font-size: 0.85rem;
}
.card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 18px 20px 20px; }
.card-body h3 { margin: 0; font-size: 1.25rem; }
.card-body p { margin: 0; color: var(--muted); }
.tag { align-self: flex-start; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-dark); }
.meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; padding-top: 8px; }
.meta strong { font-size: 1.15rem; }
.count { font-size: 0.9rem; color: var(--muted); font-weight: 700; }
.shops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.shop {
  display: inline-block;
  padding: 3px 10px; border-radius: 99px;
  background: #eef7f5; color: #3f7f78;
  font-size: 0.85rem; font-weight: 700; text-decoration: none;
}
a.shop:hover { background: #d9efeb; }
.shop-filter { width: auto; margin: 0; padding: 6px 12px; border-radius: 99px; font-weight: 700; }
.card-actions { display: flex; gap: 8px; margin-top: 8px; }
.card-actions .btn { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 800; text-decoration: none; cursor: pointer;
  padding: 10px 18px; border-radius: 14px; border: 2px solid var(--accent);
  background: var(--accent); color: #fff;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { background: #e8e2e6; border-color: #e8e2e6; color: var(--muted); cursor: default; }
.btn.ghost { background: transparent; color: var(--accent-dark); }
.btn.ghost:hover { background: #fdecee; color: var(--accent-dark); }
.btn.small { padding: 6px 12px; font-size: 0.9rem; border-radius: 10px; }
.link { font: inherit; font-weight: 700; background: none; border: none; color: var(--accent-dark); cursor: pointer; text-decoration: underline; padding: 0; }

.mine { background: #eef7f5; border-radius: var(--radius); padding: 16px 24px; margin-bottom: 28px; }
.mine h2 { margin: 0 0 8px; font-size: 1.3rem; }
.mine ul { list-style: none; margin: 0; padding: 0; }
.mine li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px dashed #cfe3df; }
.mine li:first-child { border-top: none; }

.messages { margin-top: 64px; }
.messages h2 { text-align: center; font-size: 2rem; }
.message-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.note {
  margin: 0; padding: 20px;
  background: #fff7d6; border-radius: 6px;
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.35);
  transform: rotate(var(--tilt));
}
.note:nth-child(3n + 2) { background: #fde2e4; }
.note:nth-child(3n) { background: #e2f2ef; }
.note blockquote { margin: 0 0 10px; white-space: pre-line; }
.note figcaption { font-weight: 800; text-align: right; }

footer { text-align: center; color: var(--muted); padding: 24px 16px 40px; }

/* ---------- Dialogue ---------- */
dialog {
  width: calc(100% - 32px); max-width: 440px;
  border: none; border-radius: 24px; padding: 28px;
  color: var(--ink); background: var(--card);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.4);
}
dialog::backdrop { background: rgba(61, 58, 75, 0.45); backdrop-filter: blur(3px); }
dialog h3 { margin: 0 0 4px; font-size: 1.5rem; }
form label { display: block; margin-top: 14px; font-weight: 700; }
input, textarea, select {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; color: inherit;
  padding: 10px 12px; border-radius: 12px;
  border: 2px solid var(--line); background: #fffdfb;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--mint); }
.error { color: var(--accent-dark); font-weight: 700; min-height: 1.5em; margin: 10px 0 0; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1000; }

/* ---------- Admin ---------- */
.admin main { max-width: 960px; }
.admin-header { padding: 32px 16px 8px; text-align: center; }
.admin-header h1 { margin: 0; color: var(--accent); }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 28px; }
.panel h2 { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.panel .actions { justify-content: flex-start; margin-top: 18px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.stat { background: var(--bg); border-radius: 14px; padding: 10px 16px; font-weight: 700; }
.admin-item { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.admin-item:first-of-type { border-top: none; }
.admin-item .thumb { flex: none; width: 64px; height: 64px; border-radius: 14px; background: #fdf0ea; display: grid; place-items: center; font-size: 2rem; overflow: hidden; }
.admin-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-item .info { flex: 1; min-width: 0; }
.admin-item h3 { margin: 0; font-size: 1.1rem; }
.admin-item .sub { color: var(--muted); font-size: 0.9rem; }
.admin-item ul { margin: 6px 0 0; padding-left: 18px; }
.admin-item li { margin: 2px 0; }
.admin-item .tools { display: flex; flex-direction: column; gap: 6px; }
.row-actions { display: flex; gap: 6px; }
.links-editor { margin-top: 14px; }
.links-editor .label { display: block; font-weight: 700; }
.link-row { display: grid; grid-template-columns: 1fr 2fr 110px auto; gap: 8px; align-items: center; margin-top: 8px; }
.link-row input { margin: 0; }
.links-editor > .btn { margin-top: 10px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.person { background: var(--bg); border-radius: 16px; padding: 14px 18px; }
.person h3 { margin: 0 0 6px; font-size: 1.1rem; }
.person ul { margin: 0; padding-left: 18px; }
.person li { margin: 4px 0; }
@media (max-width: 640px) {
  .link-row { grid-template-columns: 1fr auto; }
  .link-row .l-url { grid-column: 1 / -1; grid-row: 2; }
  .link-row .l-price { grid-row: 3; }
}
@media (max-width: 560px) {
  .admin-item { flex-wrap: wrap; }
  .admin-item .tools { flex-direction: row; flex-wrap: wrap; width: 100%; }
}
