:root {
  --creme: #efe5cf;
  --creme-clair: #f8f2e4;
  --rouge: #9e1111;
  --bordeaux: #6e0e12;
  --vert: #1b3a20;
  --or: #b38b4d;
  --or-clair: #e2b886;
  --texte: #4a2a1c;
  --texte-doux: #8a6a52;
  --rayon: 18px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Open Sans', system-ui, sans-serif;
  color: var(--texte);
  background: var(--creme);
  line-height: 1.5;
}

/* Le fond doré à paillettes des cartes Canva, en CSS */
.bokeh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.75) 0 2.2%, transparent 2.6%),
    radial-gradient(circle at 82% 9%, rgba(255,255,255,.6) 0 1.6%, transparent 2%),
    radial-gradient(circle at 92% 46%, rgba(255,255,255,.55) 0 2.8%, transparent 3.2%),
    radial-gradient(circle at 6% 62%, rgba(255,255,255,.5) 0 1.8%, transparent 2.2%),
    radial-gradient(circle at 70% 88%, rgba(255,255,255,.55) 0 2.4%, transparent 2.8%),
    radial-gradient(circle at 28% 94%, rgba(255,255,255,.45) 0 1.4%, transparent 1.8%),
    radial-gradient(ellipse at 50% 0%, #f7efd9 0%, transparent 60%),
    radial-gradient(ellipse at 100% 100%, #d9c9a3 0%, transparent 55%),
    linear-gradient(160deg, #f2e9d4 0%, #e6d8b8 55%, #efe5cf 100%);
  filter: blur(1.5px);
}
.bokeh::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 65% 22%, #fff, transparent),
    radial-gradient(1px 1px at 40% 70%, #fff, transparent),
    radial-gradient(2px 2px at 85% 65%, #fff, transparent),
    radial-gradient(1px 1px at 10% 85%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 55% 50%, #fff, transparent);
  background-size: 340px 340px;
  animation: scintille 6s ease-in-out infinite alternate;
}
@keyframes scintille { from { opacity: .35; } to { opacity: 1; } }

.visuellement-cache {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ─── En-tête ───────────────────────────────────────────── */
.entete {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 56px) 20px 8px;
  text-align: center;
}
.surtitre {
  margin: 0 0 14px;
  font-size: clamp(10px, 2.6vw, 13px);
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--texte-doux);
}
h1 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: clamp(30px, 7.5vw, 54px);
  line-height: 1.05;
  color: var(--rouge);
  text-wrap: balance;
}
h1 span { color: var(--vert); font-size: .72em; }
.statut {
  margin: 16px 0 0;
  font-weight: 600;
  color: var(--bordeaux);
  min-height: 1.5em;
}

.progression {
  margin: 22px auto 0;
  max-width: 360px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(179, 139, 77, .35);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.progression-texte {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--texte-doux);
}
.progression-texte strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  letter-spacing: 0;
  color: var(--vert);
}
.barre {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(179, 139, 77, .2);
  overflow: hidden;
}
.barre-remplie {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--or), var(--or-clair));
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}

/* ─── Grille des cases ──────────────────────────────────── */
main { max-width: 600px; margin: 0 auto; padding: 24px 16px 40px; }

.grille {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(8px, 2.6vw, 20px);
}
.grille li { position: relative; }

.case {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(110, 14, 18, .22);
  transition: transform .25s ease, box-shadow .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.rond {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bordeaux);
  transition: filter .3s ease, opacity .3s ease;
}
/* la porte Canva est un rond au centre d'un carré : on ne garde que le rond */
.case img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.27);
  display: block;
  pointer-events: none;
}
.case:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 10px 22px rgba(110, 14, 18, .3); }
.case:focus-visible { outline: 3px solid var(--vert); outline-offset: 4px; }

.case.fermee { cursor: default; }
.case.fermee:hover { transform: none; }
.case.secoue { animation: secoue .4s ease; }
@keyframes secoue {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-7deg); }
  75% { transform: rotate(7deg); }
}

.case.aujourdhui {
  box-shadow: 0 0 0 3px var(--or-clair), 0 0 0 6px rgba(179,139,77,.35), 0 8px 22px rgba(110,14,18,.3);
  animation: appel 2.2s ease-in-out infinite;
}
@keyframes appel {
  0%, 100% { box-shadow: 0 0 0 3px var(--or-clair), 0 0 0 6px rgba(179,139,77,.35), 0 8px 22px rgba(110,14,18,.3); }
  50% { box-shadow: 0 0 0 3px var(--or-clair), 0 0 0 12px rgba(179,139,77,0), 0 8px 22px rgba(110,14,18,.3); }
}

.cadenas, .coche {
  position: absolute;
  right: -4%;
  bottom: -4%;
  width: 32%;
  max-width: 34px;
  min-width: 20px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: clamp(9px, 2.4vw, 15px);
  pointer-events: none;
}
.cadenas { background: var(--creme-clair); box-shadow: 0 2px 6px rgba(74,42,28,.18); }
.coche {
  background: var(--vert);
  color: var(--or-clair);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  animation: pop .35s cubic-bezier(.2,1.6,.4,1);
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ─── Fin du calendrier ─────────────────────────────────── */
.final {
  margin-top: 40px;
  padding: 26px 20px 28px;
  text-align: center;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(179, 139, 77, .35);
  border-radius: var(--rayon);
  backdrop-filter: blur(6px);
}
.final h2 {
  margin: 0 0 6px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  color: var(--vert);
}
.final p { margin: 0 auto 18px; max-width: 46ch; color: var(--texte); }

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font: 700 14px/1 'Open Sans', sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--or-clair);
  background: var(--rouge);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.bouton:hover { background: var(--bordeaux); }
.bouton:active { transform: scale(.97); }
.bouton-or { background: var(--vert); }
.bouton-or:hover { background: #12291a; }
.bouton[aria-disabled="true"] {
  background: rgba(138, 106, 82, .25);
  color: var(--texte-doux);
  cursor: not-allowed;
}

.pied {
  padding: 10px 20px 36px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--texte-doux);
}

/* ─── Fenêtre de la carte ───────────────────────────────── */
.fenetre {
  width: min(94vw, 520px);
  max-height: 96vh;
  padding: 16px 16px 18px;
  border: 0;
  border-radius: 24px;
  background: var(--creme-clair);
  color: var(--texte);
  box-shadow: 0 30px 80px rgba(40, 10, 10, .45);
}
.fenetre::backdrop { background: rgba(40, 14, 10, .55); backdrop-filter: blur(4px); }
.fenetre[open] { animation: entree .3s cubic-bezier(.2,.8,.2,1); }
@keyframes entree { from { opacity: 0; transform: translateY(16px) scale(.97); } }

.fenetre-haut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.fenetre-haut h2 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  color: var(--rouge);
}
.fermer {
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: rgba(138, 106, 82, .14);
  color: var(--texte);
  font-size: 16px;
  cursor: pointer;
}

.scene { perspective: 1400px; }
.carte {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.3,.9,.25,1);
}
.carte.retournee { transform: rotateY(180deg); }
.carte.sans-anim { transition: none; }
.face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 10px 28px rgba(110, 14, 18, .2);
}
.face-arriere { transform: rotateY(180deg); }

.defi {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  margin: 14px 0 10px;
  border: 2px solid var(--vert);
  border-radius: 14px;
  background: transparent;
  color: var(--vert);
  font: 700 15px 'Open Sans', sans-serif;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.defi-case {
  width: 22px; height: 22px;
  border: 2px solid currentColor;
  border-radius: 6px;
  display: grid; place-items: center;
}
.defi[aria-pressed="true"] { background: var(--vert); color: var(--or-clair); }
.defi[aria-pressed="true"] .defi-case::after { content: '✓'; font-size: 15px; line-height: 1; }
.defi[aria-pressed="true"] .defi-texte::after { content: ' ✨'; }

.fenetre-bas {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fenetre-bas .bouton { flex: 1; font-size: 13px; padding: 0 12px; }
.nav {
  flex: none;
  width: 46px; height: 46px;
  border: 0; border-radius: 50%;
  background: rgba(138, 106, 82, .14);
  color: var(--texte);
  font-size: 26px; line-height: 1;
  cursor: pointer;
}
.nav:disabled { opacity: .3; cursor: default; }

/* ─── Bulle d'info et confettis ─────────────────────────── */
.bulle {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translate(-50%, 140%);
  max-width: min(92vw, 420px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--bordeaux);
  color: var(--creme-clair);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  z-index: 10;
  pointer-events: none;
}
.bulle.visible { transform: translate(-50%, 0); }

.confetti {
  position: fixed;
  top: -20px;
  width: 10px; height: 14px;
  z-index: 20;
  pointer-events: none;
  animation: tombe linear forwards;
}
@keyframes tombe {
  to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
