  :root { color-scheme: only light; }
  html, body { -webkit-tap-highlight-color: transparent; }
  body {
    background: #fde2e7;
    color: #4a1d2c;
    overflow-x: hidden;
  }

  /* fond fixe (background-attachment: fixed est ignoré sur iOS) */
  body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(120% 80% at 50% 0%, #fff5f7 0%, #fde2e7 55%, #f9cfd8 100%); }
  .min-h-\[100dvh\] { min-height: 100vh; min-height: 100dvh; } /* repli pour les anciens iPhone */
  #player { right: 16px; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
  #player .hidden { display: none; }
  button[hidden], p[hidden] { display: none !important; }

  /* ---------- Transitions entre écrans ---------- */
  .screen { opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .5s ease, transform .5s ease; }
  .screen[hidden] { display: none !important; }
  .screen.active { opacity: 1; transform: none; }
  .screen.leaving { opacity: 0; transform: translateY(-18px) scale(.98); }

  .glass { background: rgba(255,255,255,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.8); box-shadow: 0 20px 50px -20px rgba(190,18,69,.35); }

  .btn-love {
    background: linear-gradient(135deg, #dc3a64, #be1245);
    box-shadow: 0 10px 25px -8px rgba(225,29,85,.6);
    transition: transform .2s ease, box-shadow .2s ease;
  }
  .btn-love:active { transform: scale(.96); }
  .btn-love:hover { box-shadow: 0 14px 30px -8px rgba(225,29,85,.75); }
  .pulse { animation: soft-beat 2.2s ease-in-out infinite; }
  @keyframes soft-beat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

  /* ---------- Cœurs flottants en fond ---------- */
  .bg-heart { position: fixed; bottom: -40px; pointer-events: none; z-index: 0; animation: rise linear forwards; }
  @keyframes rise {
    0%   { transform: translate(0,0) rotate(0); opacity: 0; }
    10%  { opacity: var(--o); }
    100% { transform: translate(var(--dx), -110vh) rotate(var(--r)); opacity: 0; }
  }

  /* ---------- Quiz ---------- */
  .shake { animation: shake .45s; }
  @keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }
  .q-anim { animation: qin .45s ease; }
  @keyframes qin { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
  .dot { transition: all .35s ease; }
  .opt { transition: transform .15s ease, background .3s, border-color .3s, color .3s, opacity .3s; }
  .opt:active { transform: scale(.97); }
  .opt.wrong { opacity: .45; text-decoration: line-through; text-decoration-color: rgba(190,18,69,.5); }
  .opt.right { background: #ecfdf5; border-color: #10b981; color: #065f46; box-shadow: 0 0 0 3px rgba(16,185,129,.25), 0 0 24px rgba(16,185,129,.45); }

  /* ---------- Toast ---------- */
  #toast { transform: translate(-50%, -250%); transition: transform .4s cubic-bezier(.2,1.4,.4,1); }
  #toast.show { transform: translate(-50%, 0); }

  /* ---------- Puzzle ---------- */
  #puzzle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; transition: gap .6s ease, box-shadow .8s ease; }
  .piece { aspect-ratio: 1; background-size: 300% 300%; border-radius: 8px; transition: transform .2s ease, box-shadow .2s ease, border-radius .6s ease; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
  .piece.selected { transform: scale(.9); box-shadow: 0 0 0 3px #e11d55, 0 6px 16px rgba(225,29,85,.5); }
  .piece.swapped { animation: pop .3s ease; }
  @keyframes pop { 50% { transform: scale(1.08); } }
  #puzzle.solved { gap: 0; box-shadow: 0 0 0 4px #fff, 0 0 40px 10px rgba(251,113,144,.7); }
  #puzzle.solved .piece { border-radius: 0; box-shadow: none; }
  .check-path { stroke-dasharray: 60; stroke-dashoffset: 60; }
  .check-on .check-path { animation: draw .6s .2s ease forwards; }
  .check-on .check-circle { animation: popIn .4s ease forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
  .check-circle { transform-origin: center; transform: scale(0); }

  /* ---------- Jeu de paires ---------- */
  #paires { display: grid; grid-template-columns: repeat(var(--col, 3), 1fr); gap: 8px; }
  .paire { position: relative; aspect-ratio: 1; border-radius: 12px; perspective: 500px; }
  .paire:focus-visible { outline: 3px solid #e11d55; outline-offset: 2px; }
  .paire span { position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .45s; }
  .paire .dos { display: grid; place-items: center; font-size: 26px; color: #fff; background: linear-gradient(140deg, #f7a8b8, #e0607f); box-shadow: 0 6px 14px -8px rgba(143,16,55,.5); }
  .paire .face { transform: rotateY(180deg); background-size: cover; background-position: center; box-shadow: 0 6px 14px -8px rgba(143,16,55,.5); }
  .paire.vue .dos { transform: rotateY(180deg); }
  .paire.vue .face { transform: none; }
  .paire.trouvee .face { box-shadow: 0 0 0 3px #fff, 0 0 18px 2px rgba(251,113,144,.7); }

  /* ---------- Enveloppe ---------- */
  .env-wrap { perspective: 900px; }
  .envelope { position: relative; width: 280px; height: 180px; background: #f5b8c3; border-radius: 6px; cursor: pointer; margin-top: 108px; box-shadow: 0 20px 40px -15px rgba(143,16,55,.45); }
  .envelope .letter { position: absolute; left: 16px; right: 16px; top: 8px; height: 160px; background: #fffaf5; border-radius: 4px; z-index: 1; transition: transform .9s .45s cubic-bezier(.3,1.3,.5,1); display: flex; align-items: center; justify-content: center; }
  .envelope .pocket { position: absolute; inset: 0; width: 0; height: 0; border-left: 140px solid #f7c3cc; border-right: 140px solid #f7c3cc; border-bottom: 95px solid #f9ced6; border-top: 85px solid transparent; z-index: 2; border-radius: 0 0 6px 6px; }
  .envelope .flap { position: absolute; top: 0; left: 0; width: 0; height: 0; border-left: 140px solid transparent; border-right: 140px solid transparent; border-top: 105px solid #ee9aab; transform-origin: top; transition: transform .6s ease, z-index 0s .3s; z-index: 3; }
  .envelope .seal { position: absolute; left: 50%; top: 82px; transform: translate(-50%,-50%); z-index: 4; transition: opacity .3s, transform .3s; }
  .envelope.open .flap { transform: rotateX(180deg); z-index: 0; }
  .envelope.open .seal { opacity: 0; transform: translate(-50%,-50%) scale(1.6); }
  .envelope.open .letter { transform: translateY(-100px); }
  .envelope:not(.open) { animation: wiggle 2.8s ease-in-out infinite; }
  @keyframes wiggle { 0%,85%,100% { transform: rotate(0); } 88% { transform: rotate(-2deg); } 92% { transform: rotate(2deg); } 96% { transform: rotate(-1deg); } }

  /* ---------- Final ---------- */
  .reveal > * { opacity: 0; transform: translateY(14px); }
  .reveal.go > * { animation: up .8s ease forwards; }
  .reveal.go > *:nth-child(1) { animation-delay: .1s; }
  .reveal.go > *:nth-child(2) { animation-delay: .5s; }
  .reveal.go > *:nth-child(3) { animation-delay: .9s; }
  .reveal.go > *:nth-child(4) { animation-delay: 1.3s; }
  .reveal.go > *:nth-child(5) { animation-delay: 1.7s; }
  .reveal.go > *:nth-child(6) { animation-delay: 2.1s; }
  .reveal.go > *:nth-child(7) { animation-delay: 2.5s; }
  @keyframes up { to { opacity: 1; transform: none; } }


  /* ---------- Lettre manuscrite ---------- */
  .letter-paper {
    position: relative; padding: 46px 22px 26px 34px; border-radius: 4px 4px 14px 14px;
    background:
      radial-gradient(120% 60% at 0% 0%, rgba(253,205,214,.25), transparent 60%),
      radial-gradient(100% 70% at 100% 100%, rgba(250,220,190,.3), transparent 60%),
      #fffcf6;
    box-shadow: 0 30px 60px -25px rgba(143,16,55,.45), 0 1px 0 rgba(143,16,55,.05), inset 0 0 0 1px rgba(190,18,69,.06);
    transform: rotate(-.6deg); cursor: pointer;
  }
  .letter-paper::before { /* marge rouge */
    content: ''; position: absolute; top: 0; bottom: 0; left: 24px; width: 1px; background: rgba(244,63,107,.28);
  }
  .letter-seal {
    position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
    width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 20px; background: radial-gradient(circle at 35% 30%, #f43f6b, #9f1239 70%);
    box-shadow: 0 4px 10px rgba(143,16,55,.4), inset 0 -3px 6px rgba(0,0,0,.2);
  }
  .letter-date { font-family: 'Dancing Script', cursive; font-size: 17px; color: #9f1239; text-align: right; opacity: .75; margin-bottom: 8px; }
  .handwriting {
    font-family: 'Dancing Script', cursive; font-size: 23px; line-height: 36px; color: #4c1426; min-height: 144px;
    background-image: repeating-linear-gradient(to bottom, transparent 0 35px, rgba(190,18,69,.13) 35px 36px);
  }
  .handwriting p { text-indent: 1.1em; }
  .handwriting p:first-child { text-indent: 0; }
  .caret { display: inline-block; width: 2px; height: .95em; margin-left: 2px; vertical-align: -.12em; background: #be1245; animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
  .letter-sign { font-family: 'Great Vibes', cursive; font-size: 30px; color: #be1245; text-align: right; margin-top: 14px; opacity: 0; transform: translateY(6px); transition: opacity 1.2s ease, transform 1.2s ease; }
  .letter-sign.show { opacity: 1; transform: none; }
  .letter-skip { font-size: 11px; letter-spacing: .08em; text-align: center; color: rgba(143,16,55,.65); margin-top: 16px; transition: opacity .6s; }
  .letter-skip.gone { opacity: 0; }
  .reveal.go > .rest { animation: none; }
  .reveal > .rest { opacity: 0; transform: translateY(18px); transition: opacity 1s ease, transform 1s ease; pointer-events: none; }
  .reveal > .rest.show { opacity: 1; transform: none; pointer-events: auto; }

  /* ---------- Prénoms, attente, photos ---------- */
  .pour { font-family: 'Playfair Display', serif; font-size: 18px; margin-bottom: 14px; text-wrap: balance; overflow-wrap: anywhere; }
  .font-script { overflow-wrap: anywhere; text-wrap: balance; }
  .mot-attente { font-family: 'Dancing Script', cursive; font-size: 24px; line-height: 1.35; margin-top: 18px; white-space: pre-line; overflow-wrap: anywhere; }
  #photo-lettre .tirage { max-width: 260px; margin: 0 auto 34px; transform: rotate(1.6deg); }
  #photo-lettre img { max-height: 34vh; }
  #album { display: grid; gap: 26px; margin-top: 20px; }
  .tirage { background: #fffdf9; padding: 10px 10px 12px; border-radius: 4px; box-shadow: 0 18px 40px -18px rgba(60,10,30,.5); width: fit-content; max-width: 88%; margin: 0 auto; }
  #album .tirage:nth-child(odd) { transform: rotate(-1.4deg); }
  #album .tirage:nth-child(even) { transform: rotate(1.2deg); }
  .tirage img { display: block; max-width: 100%; max-height: 62vh; border-radius: 2px; }
  .tirage figcaption { font-family: 'Dancing Script', cursive; font-size: 20px; line-height: 1.25; text-align: center; color: #4c1426; padding: 10px 4px 0; overflow-wrap: anywhere; }
  .liens { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; margin-top: 24px; }
  #btn-bons { flex-basis: 100%; }
  .envelope .letter { text-align: center; padding: 0 10px; }

  /* ---------- Cartes à gratter ---------- */
  .vgrid { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
  .vcard { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: #fffaf5;
    box-shadow: 0 6px 14px -8px rgba(143,16,55,.45); transition: transform .35s ease, opacity .5s ease, filter .5s ease, box-shadow .35s ease; }
  /* tant qu'une carte n'est pas commencée, glisser verticalement fait défiler la page */
  .vcard canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: pointer; transition: opacity .8s ease; }
  .vcard.claimed canvas { touch-action: none; }
  .vface { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 6px; border: 2px dashed #fda4b4; border-radius: 14px; }
  .vemoji { font-size: 26px; line-height: 1; }
  .vtitle { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 12px; line-height: 1.2; margin-top: 6px; color: #8f1037; }
  .vsub { font-size: 9.5px; line-height: 1.25; margin-top: 3px; color: rgba(143,16,55,.72); }
  .vcard.locked { opacity: .4; filter: grayscale(.7); }
  .vcard.locked::after { content: '🔒'; position: absolute; top: 5px; right: 6px; font-size: 12px; }
  .vcard.revealed { transform: scale(1.05); box-shadow: 0 0 0 2px #e11d55, 0 12px 26px -8px rgba(225,29,85,.6); z-index: 1; }
  .vsummary { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .9s ease, opacity .9s ease, margin .9s ease; }
  .vsummary.show { max-height: 1200px; opacity: 1; margin-top: 16px; }
  .twrap { margin-top: 12px; filter: drop-shadow(0 8px 14px rgba(143,16,55,.18)); } /* ombre hors du masque */
  .ticket { display: flex; background: #fffaf5; border-radius: 14px; position: relative;
    -webkit-mask: radial-gradient(circle 9px at calc(100% - 80px) 0, transparent 97%, #000) top / 100% 51% no-repeat,
                  radial-gradient(circle 9px at calc(100% - 80px) 100%, transparent 97%, #000) bottom / 100% 51% no-repeat;
            mask: radial-gradient(circle 9px at calc(100% - 80px) 0, transparent 97%, #000) top / 100% 51% no-repeat,
                  radial-gradient(circle 9px at calc(100% - 80px) 100%, transparent 97%, #000) bottom / 100% 51% no-repeat; }
  .tmain { flex: 1; min-width: 0; padding: 12px 12px 10px 14px; border-right: 2px dashed #fda4b4; }
  .tlabel { font-size: 9px; font-weight: 600; letter-spacing: .25em; color: #e11d55; }
  .trow { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
  .trow .temoji { font-size: 26px; line-height: 1; }
  .ttitle { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 15px; line-height: 1.15; color: #8f1037; }
  .tsub { font-family: 'Playfair Display', serif; font-style: italic; font-size: 11px; color: rgba(143,16,55,.75); margin-top: 2px; }
  .tfoot { font-size: 8px; font-weight: 600; letter-spacing: .12em; color: #be1245; margin-top: 8px; }
  .tstub { width: 80px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #be1245; text-align: center; }
  .tstub .tno { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 18px; }
  .tstub small { font-size: 7.5px; font-weight: 600; letter-spacing: .15em; }

  /* ---------- Lecteur audio ---------- */
  .bars span { display: inline-block; width: 3px; margin: 0 1px; background: currentColor; border-radius: 2px; height: 4px; }
  .playing .bars span { animation: bar .9s ease-in-out infinite; }
  .playing .bars span:nth-child(2) { animation-delay: .2s; }
  .playing .bars span:nth-child(3) { animation-delay: .4s; }
  .playing .bars span:nth-child(4) { animation-delay: .1s; }
  @keyframes bar { 0%,100% { height: 4px; } 50% { height: 14px; } }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  }
  [data-section=album] h2 { font-size: 38px; line-height: 1.2; }

  /* ---------- Entrée en scène : le pli scellé de l'accueil (couleurs par décor : ambiances.css) ---------- */
  :root { --pli-dos: #e58fa1; --pli-cote: #f7c3cc; --pli-bas: #f9ced6; --pli-rabat: #f2a8b6; --pli-trait: rgba(190,18,69,.22); --pli-carte: #fffaf5; --pli-ombre: rgba(143,16,55,.45);
    --ruban-1: #e0446f; --ruban-2: #b01243; --cire-1: #d32d5c; --cire-2: #9f1239; --cire-trait: #ffe4e9; }
  .reserve { position: absolute; }
  #s-home .pour { font-size: 19px; line-height: 1.35; margin-bottom: 10px; }
  #s-home .accroche { margin-top: 10px; text-wrap: balance; overflow-wrap: anywhere; }
  #s-home .btn-love { margin-top: 30px; }
  #s-home #btn-recommencer { margin-top: 18px; }
  #s-home .resume { margin-top: 20px; text-wrap: balance; }
  #s-home > * { transition: opacity .45s ease, transform .2s ease, box-shadow .2s ease; }
  #s-home.ouverture > :not(.pli) { opacity: 0; pointer-events: none; }
  .pli { --l: min(70vw, 272px); position: relative; flex: none; width: var(--l); height: calc(var(--l) * 2 / 3); margin-top: 30px; perspective: 900px; cursor: pointer; -webkit-user-select: none; user-select: none; }
  .pli:not(.ouvert) { animation: flotte 3.8s ease-in-out infinite; }
  @keyframes flotte { 50% { transform: translateY(-5px); } }
  .pli > * { position: absolute; }
  .pli-dos { inset: 0; border-radius: 7px; background: var(--pli-dos); box-shadow: 0 24px 40px -20px var(--pli-ombre); }
  .pli-carte { left: 6%; right: 6%; top: 7%; bottom: 5%; z-index: 1; display: grid; justify-items: center; align-content: start; padding-top: 8%; border-radius: 4px; background: var(--pli-carte); box-shadow: inset 0 0 0 1px var(--pli-trait); transition: transform .55s .7s cubic-bezier(.3, 1.15, .5, 1); }
  .pli-carte svg { width: 19%; fill: none; stroke: var(--cire-2); stroke-width: 1.1; stroke-linejoin: round; }
  .pli-poche { inset: 0; width: 100%; height: 100%; z-index: 2; border-radius: 7px; }
  .pli-poche .cote { fill: var(--pli-cote); }
  .pli-poche .bas { fill: var(--pli-bas); }
  .pli-poche path, .pli-rabat path { stroke: var(--pli-trait); stroke-width: .8; stroke-linejoin: round; }
  .pli-rabat { left: 0; top: 0; width: 100%; height: 60%; z-index: 3; border-radius: 7px 7px 0 0; transform-origin: 50% 0; filter: drop-shadow(0 2px 2px rgba(0,0,0,.1)); transition: transform .6s .3s cubic-bezier(.5, 0, .3, 1), z-index 0s .6s; }
  .pli-rabat path { fill: var(--pli-rabat); }
  .pli-ruban { left: 45.5%; width: 9%; z-index: 4; background: linear-gradient(90deg, var(--ruban-2), var(--ruban-1) 32%, var(--ruban-1) 68%, var(--ruban-2)); transition: transform .45s .12s ease-in, opacity .4s .14s ease-in; }
  .pli-ruban.h { top: 0; height: 56%; }
  .pli-ruban.b { top: 56%; bottom: 0; border-radius: 0 0 2px 2px; }
  .sceau { left: 50%; top: 56%; width: 28%; height: 42%; margin: -14% 0 0 -14%; z-index: 5; filter: drop-shadow(0 3px 3px rgba(0,0,0,.28)); }
  .sceau svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .5s .1s cubic-bezier(.3, .6, .4, 1), opacity .32s .26s ease-in; }
  .sceau .g { clip-path: polygon(0 0, 54% 0, 46% 22%, 56% 40%, 45% 60%, 54% 80%, 47% 100%, 0 100%); }
  .sceau .d { clip-path: polygon(54% 0, 100% 0, 100% 100%, 47% 100%, 54% 80%, 45% 60%, 56% 40%, 46% 22%); }
  .cire-fond { fill: var(--cire-1); }
  .cire-creux { fill: var(--cire-2); fill-opacity: .5; stroke: #000; stroke-opacity: .14; stroke-width: 1.2; }
  .cire-reflet { fill: none; stroke: #fff; stroke-opacity: .38; stroke-width: 2.4; stroke-linecap: round; }
  .cire-coeur { fill: none; stroke: var(--cire-trait); stroke-width: 2; stroke-linejoin: round; }
  /* sceau personnalisé : initiales ou date gravées dans la cire */
  .cire-texte { font: italic 500 15.5px var(--u-titre, 'Playfair Display', Georgia, serif); fill: var(--cire-trait); text-anchor: middle; }
  .cire-texte.jour { font-size: 12px; font-style: normal; letter-spacing: .02em; }
  .sceau-attente { display: none; }
  /* ouverture : le sceau cède, le ruban glisse, le rabat se lève, la carte sort (1,25 s en tout) */
  .pli.ouvert .sceau { animation: cede .22s ease-out; }
  @keyframes cede { 45% { transform: scale(.9); } }
  .pli.ouvert .sceau .g { transform: translate(-22%, 12%) rotate(-18deg); opacity: 0; }
  .pli.ouvert .sceau .d { transform: translate(22%, 16%) rotate(20deg); opacity: 0; }
  .pli.ouvert .pli-ruban.h { transform: translateY(-36%); opacity: 0; }
  .pli.ouvert .pli-ruban.b { transform: translateY(36%); opacity: 0; }
  .pli.ouvert .pli-rabat { transform: rotateX(180deg); z-index: 0; }
  .pli.ouvert .pli-carte { transform: translateY(-40%); }
  /* mouvements réduits : un simple fondu */
  .pli.fondu { opacity: 0; transition: opacity .4s ease !important; }
  @media (prefers-reduced-motion: reduce) { #s-home > * { transition-duration: .4s !important; } .pli:not(.ouvert) { animation: none; } }

  /* ---------- Téléphone : zones tactiles plus larges sans rien déplacer, message sous l'encoche ---------- */
  main button.underline { position: relative; }
  main button.underline::after { content: ''; position: absolute; inset: -13px -10px; }
  #q-cal { width: 44px; height: 44px; }
  #toast { top: max(1rem, env(safe-area-inset-top, 0px)); overflow-wrap: anywhere; }
  main h2 { text-wrap: balance; overflow-wrap: anywhere; }
  /* textes longs : un mot interminable se coupe au lieu de sortir de sa carte ; le texte entier reste lisible sur le ticket */
  .vtitle, .vsub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
  .ttitle, .tsub, .tfoot { overflow-wrap: anywhere; }
  /* petits écrans : le titre et le pli se resserrent pour que le bouton reste à portée de pouce */
  #s-home h1 { font-size: clamp(44px, 15.4vw, 60px); }
  @media (max-height: 700px) { #s-home { padding-top: 20px; padding-bottom: 20px; } .pli { --l: min(58vw, 230px); margin-top: 20px; } #s-home .btn-love { margin-top: 22px; } #s-home .resume { margin-top: 14px; } }
  /* pendant le chargement, avant de connaître le décor : fond ivoire, neutre pour tous */
  html:not([data-ambiance]) body, html:not([data-ambiance]) body::before { background: #fbf6ee; }

  /* ---------- frise et surprise finale ---------- */
  /* Couleurs réglées par décor (ambiances.css) : filet, cœur au trait, date écrite à la main, titre, papier des photos. */
  :root { --fr-filet: rgba(190,18,69,.3); --fr-coeur: #be1245; --fr-quand: #be1245; --fr-titre: #4a1d2c; --fr-doux: rgba(143,16,55,.88); --fr-papier: #fffdf9; --fr-bord: rgba(190,18,69,.08); --fr-ombre: rgba(60,10,30,.5); --fr-main: 'Dancing Script', cursive; --fr-corps: 23px; }
  /* La frise : un filet fin à gauche, un petit cœur au trait par moment, la date à la main, le titre, parfois une photo. */
  .frise { list-style: none; margin: 34px 6px 0 10px; padding: 0; }
  .frise li, .frise-suite { position: relative; padding: 0 0 34px 48px; opacity: 0; transform: translateY(18px); transition: opacity .8s ease var(--d, 0s), transform .9s cubic-bezier(.2, .7, .3, 1) var(--d, 0s); }
  .frise li.vu, .frise-suite.vu { opacity: 1; transform: none; }
  .frise li::before { content: ''; position: absolute; left: 13px; top: 32px; bottom: -1px; width: 1px; background: var(--fr-filet); transform: scaleY(0); transform-origin: 50% 0; transition: transform 1.1s ease calc(var(--d, 0s) + .45s); } /* le filet descend de chaque cœur jusqu'au suivant */
  .frise li.vu::before { transform: none; }
  .frise .coeur, .frise-suite .coeur { position: absolute; left: 2px; top: 4px; width: 23px; height: 23px; }
  .frise .coeur svg, .frise-suite .coeur svg, .fin-jours .coeur svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--fr-coeur); stroke-width: 1.3; stroke-linejoin: round; }
  .frise .coeur path { stroke-dasharray: 56; stroke-dashoffset: 56; transition: stroke-dashoffset 1.2s ease calc(var(--d, 0s) + .2s); } /* le cœur se dessine */
  .frise li.vu .coeur path { stroke-dashoffset: 0; }
  .frise .quand, .frise-suite p { font-family: var(--fr-main); font-size: var(--fr-corps); line-height: 1.3; color: var(--fr-quand); overflow-wrap: anywhere; }
  .frise h3 { font-family: 'Playfair Display', serif; font-weight: 500; font-size: 20px; line-height: 1.3; color: var(--fr-titre); overflow-wrap: anywhere; }
  .frise figure { width: min(100%, 236px); margin: 14px 0 2px; padding: 7px 7px 8px; border-radius: 3px; background: var(--fr-papier); box-shadow: 0 0 0 1px var(--fr-bord), 0 16px 30px -18px var(--fr-ombre); transform: rotate(-1.3deg); }
  .frise li:nth-child(even) figure { transform: rotate(1.1deg); }
  .frise figure img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; }
  .frise-suite { margin: 0 6px 0 10px; padding-bottom: 0; } /* le bout du fil : un petit cœur plein et un mot à la main */
  .frise-suite .coeur { left: 5px; top: 7px; width: 17px; height: 17px; }
  .frise-suite .coeur svg { fill: var(--fr-coeur); }
  /* La surprise finale : mosaïque sur papier, jours ensemble, mot de la fin à la main, signature. */
  #s-fin h2 { font-size: clamp(38px, 12.4vw, 48px); line-height: 1.15; }
  .fin > * + * { margin-top: 28px; }
  .mosaique { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; padding: 8px; border-radius: 4px; background: var(--fr-papier); box-shadow: 0 0 0 1px var(--fr-bord), 0 22px 44px -26px var(--fr-ombre); }
  .mosaique[hidden], .fin-jours[hidden] { display: none; }
  .mosaique img { display: block; width: 100%; grid-column: span 2; aspect-ratio: 1; object-fit: cover; border-radius: 2px; }
  .mosaique .r1 { grid-column: span 6; aspect-ratio: 3 / 2; }
  .mosaique .r2 { grid-column: span 3; }
  .reveal .mosaique img { opacity: 0; transform: scale(.96); } /* les photos se posent une à une */
  .reveal.go .mosaique img { animation: pose .7s ease forwards; animation-delay: calc(.7s + var(--d, 0s)); }
  @keyframes pose { to { opacity: 1; transform: none; } }
  .fin-jours { display: grid; justify-items: center; text-align: center; }
  .fin-jours .coeur { position: relative; width: 20px; height: 20px; margin-bottom: 8px; }
  .fin-jours .coeur::before, .fin-jours .coeur::after { content: ''; position: absolute; top: 50%; width: 58px; height: 1px; background: var(--fr-filet); }
  .fin-jours .coeur::before { right: calc(100% + 12px); }
  .fin-jours .coeur::after { left: calc(100% + 12px); }
  .fin-jours strong { font-family: 'Playfair Display', serif; font-weight: 500; font-size: 56px; line-height: 1.05; font-variant-numeric: lining-nums; color: var(--fr-coeur); }
  .fin-jours .mots { margin-top: 6px; font-size: 11px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: var(--fr-doux); }
  .fin-jours small { margin-top: 7px; font-family: 'Playfair Display', serif; font-style: italic; font-size: 15px; color: var(--fr-doux); }
  .fin-mot { max-width: 19em; margin-left: auto; margin-right: auto; text-align: center; white-space: pre-line; overflow-wrap: anywhere; text-wrap: balance; font-family: var(--fr-main); font-size: calc(var(--fr-corps) + 3px); line-height: 1.4; color: var(--fr-titre); }
  .fin > .fin-signe { margin-top: 12px; text-align: center; font-family: 'Great Vibes', cursive; font-size: 32px; line-height: 1.2; color: var(--fr-coeur); overflow-wrap: anywhere; }
  .fin > .liens { margin-top: 36px; }
  .liens > .vers-fin.btn-love, .fin > .liens > .btn-love { flex-basis: 100%; }
  /* mouvements réduits : la frise garde un simple fondu, sans glissement ni tracé */
  @media (prefers-reduced-motion: reduce) {
    .frise li, .frise-suite { transform: none; transition: opacity .7s ease var(--d, 0s) !important; }
    .frise li::before { transform: none; }
    .frise .coeur path { stroke-dashoffset: 0; }
  }
  /* ---------- roue et modèles de lettre ---------- */
  /* Roue « Notre prochaine aventure ». Couleurs par décor : --roue-… (ici le rose d'origine, les autres dans ambiances.css). */
  :root { --roue-1: #fffaf5; --roue-2: #fbd5dc; --roue-3: #be1245; --roue-t1: #8f1037; --roue-t2: #8f1037; --roue-t3: #fff; --roue-or: #cfa565; --roue-or-clair: #f4e2b8;
    --roue-bord: #9f1239; --roue-moyeu: #fffaf5; --roue-coeur: #be1245; --roue-ombre: rgba(143,16,55,.5); --roue-idee: #be1245; --roue-petit: rgba(143,16,55,.88); --roue-doux: rgba(74,29,44,.78); --ruban-lettre: rgba(251,205,214,.88); }
  .roue-zone { --d: max(200px, min(78vw, 304px, 44vh)); position: relative; flex: none; width: var(--d); height: var(--d); margin: 12px auto 0; -webkit-user-select: none; user-select: none; }
  .roue-zone::before { content: ''; position: absolute; inset: 1%; border-radius: 50%; box-shadow: 0 22px 30px -14px var(--roue-ombre), 0 2px 7px rgba(0,0,0,.14); }
  .roue-zone::after { content: ''; position: absolute; inset: 4%; z-index: 2; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 30% 18%, rgba(255,255,255,.16), rgba(255,255,255,0) 42%), radial-gradient(circle at 72% 90%, rgba(0,0,0,.06), rgba(0,0,0,0) 46%); } /* la lumière ne tourne pas avec la roue */
  .roue { position: absolute; inset: 0; z-index: 1; border-radius: 50%; cursor: pointer; transition: transform 3.4s cubic-bezier(.13, .66, .1, 1); will-change: transform; }
  .roue:focus-visible { outline: 3px solid var(--roue-3); outline-offset: 4px; }
  .roue svg { display: block; width: 100%; height: 100%; }
  .roue .jante { fill: none; stroke: var(--roue-bord); stroke-width: 6.6; }
  .roue .filet { fill: none; stroke: var(--roue-or); stroke-width: .8; }
  .roue .perle { fill: var(--roue-or-clair); }
  .roue .part, .roue .mot { transition: opacity .6s ease; }
  .roue .part.p0 { fill: var(--roue-1); } .roue .part.p1 { fill: var(--roue-2); } .roue .part.p2 { fill: var(--roue-3); }
  .roue .mot { font-family: 'Playfair Display', Georgia, serif; font-weight: 500; pointer-events: none; }
  .roue .mot.p0 { fill: var(--roue-t1); } .roue .mot.p1 { fill: var(--roue-t2); } .roue .mot.p2 { fill: var(--roue-t3); }
  .roue.arretee .part:not(.gagne) { opacity: .56; } .roue.arretee .mot:not(.gagne) { opacity: .5; }
  .roue .part.gagne { stroke: var(--roue-or-clair); stroke-width: 1.5; stroke-linejoin: round; } /* la part gagnante reste seule en pleine couleur */
  .roue-moyeu { position: absolute; left: 50%; top: 50%; z-index: 3; width: 16%; height: 16%; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; pointer-events: none;
    background: var(--roue-moyeu); box-shadow: 0 0 0 1px var(--roue-or), 0 0 0 4px var(--roue-moyeu), 0 0 0 5px var(--roue-or), 0 4px 9px 3px rgba(0,0,0,.22); }
  .roue-moyeu svg { width: 58%; fill: var(--roue-coeur); }
  .roue-repere { position: absolute; left: 50%; top: -17px; z-index: 4; width: 30px; height: 40px; margin-left: -15px; transform-origin: 50% 32%; pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,.28)); }
  .roue-repere svg { display: block; width: 100%; height: 100%; }
  .roue-repere .goutte { fill: var(--roue-coeur); stroke: var(--roue-or); stroke-width: 1.5; stroke-linejoin: round; }
  .roue-repere .perle { fill: var(--roue-or-clair); }
  .roue-repere.tic { animation: roue-tic .17s ease-out; }
  @keyframes roue-tic { 0% { transform: rotate(-17deg); } }
  .roue-suite { display: grid; align-items: center; min-height: 100px; margin-top: 14px; padding: 0 6px; text-align: center; } /* au repos : un mot d'invitation ; après le tirage : le résultat, à la même place */
  .roue-suite > * { grid-area: 1 / 1; }
  .roue-note { font: italic 500 16px/1.45 'Playfair Display', Georgia, serif; color: var(--roue-doux); text-wrap: balance; transition: opacity .4s ease; }
  .roue-suite.la .roue-note { opacity: 0; visibility: hidden; }
  .roue-resultat { display: flex; flex-direction: column; align-items: center; gap: 5px; visibility: hidden; opacity: 0; transform: translateY(10px); }
  .roue-suite.la .roue-resultat { visibility: visible; opacity: 1; transform: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2, .9, .3, 1.2); }
  .roue-annonce { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--roue-petit); }
  .roue-annonce::before, .roue-annonce::after { content: ''; width: 18px; height: 1px; background: var(--roue-or); }
  #roue-idee { font: 500 30px/1.18 'Playfair Display', Georgia, serif; color: var(--roue-idee); overflow-wrap: anywhere; text-wrap: balance; }
  .roue-mot { font: italic 500 15px/1.4 'Playfair Display', Georgia, serif; color: var(--roue-doux); text-wrap: balance; }
  #btn-lancer { align-self: center; min-width: 224px; margin-top: 6px; }
  #btn-lancer:disabled { opacity: .5; }
  #btn-lancer.fait { background: none; box-shadow: inset 0 0 0 1.5px var(--roue-idee); color: var(--roue-idee); } /* une fois la roue lancée, la suite devient le bouton principal */
  #btn-roue, #btn-roue-bons { flex-basis: 100%; }
  #btn-roue-bons { transition: opacity .6s ease, transform .2s ease, box-shadow .2s ease; }
  #btn-roue-bons.attend { visibility: hidden; opacity: 0; }
  #s-roue { padding-top: 24px; }
  #s-roue .liens { margin-top: 14px; }
  @media (max-height: 700px) { #s-roue { padding-top: 16px; } #s-roue .mb-5 { margin-bottom: 8px; } .roue-suite { min-height: 92px; margin-top: 10px; } }
  @media (prefers-reduced-motion: reduce) { .roue-repere.tic { animation: none; } }

  /* Lettre « élégante » : papier uni ivoire, filet d'or, Playfair Display italique, signature à la main. (#letter : passe devant les réglages de chaque décor) */
  #letter[data-style=elegante] { padding: 52px 30px 34px; border-radius: 3px; transform: none; background: #fdf9f1; box-shadow: 0 30px 56px -30px rgba(60,10,30,.5), inset 0 0 0 1px rgba(176,141,87,.4); }
  #letter[data-style=elegante]::before { top: 9px; bottom: 9px; left: 9px; right: 9px; width: auto; background: none; border: 1px solid rgba(176,141,87,.8); border-radius: 1px; pointer-events: none; }
  #letter[data-style=elegante] .letter-date { margin-bottom: 20px; font: italic 500 14px/1.4 'Playfair Display', Georgia, serif; letter-spacing: .03em; text-align: center; opacity: .9; }
  #letter[data-style=elegante] .letter-date::after { content: ''; display: block; width: 44px; height: 1px; margin: 12px auto 0; background: #b08d57; }
  #letter[data-style=elegante] .handwriting { font: italic 500 17.5px/1.72 'Playfair Display', Georgia, serif; background-image: none; }
  #letter[data-style=elegante] .handwriting p, #letter[data-style=carnet] .handwriting p { text-indent: 0; }
  #letter[data-style=elegante] .handwriting p + p, #letter[data-style=carnet] .handwriting p + p { margin-top: .8em; }
  #letter[data-style=elegante] .letter-sign { margin-top: 22px; font-size: 34px; line-height: 1.2; }
  /* Lettre « carnet » : page à points, trous de reliure, ruban adhésif, texte droit très lisible (Inter) */
  #letter[data-style=carnet] { padding: 46px 20px 28px 44px; border-radius: 10px; transform: rotate(.4deg);
    background: radial-gradient(circle, rgba(143,16,55,.2) 1px, rgba(143,16,55,0) 1.5px) 8px 6px / 18px 18px, #fffefb; box-shadow: 0 28px 54px -28px rgba(60,10,30,.5), inset 0 0 0 1px rgba(60,10,30,.07); }
  #letter[data-style=carnet]::before { top: 16px; bottom: 16px; left: 11px; width: 14px; background: radial-gradient(circle at 50% 50%, rgba(74,29,44,.07) 0 4.3px, rgba(74,29,44,.3) 4.8px 5.5px, rgba(74,29,44,0) 6.1px) 0 0 / 14px 40px no-repeat space; } /* œillets de reliure, jamais coupés */
  #letter[data-style=carnet] .letter-seal { top: -12px; width: 104px; height: 26px; border-radius: 2px; font-size: 0; transform: translateX(-50%) rotate(-2.5deg);
    background: repeating-linear-gradient(90deg, rgba(255,255,255,.34) 0 4px, rgba(255,255,255,0) 4px 10px), var(--ruban-lettre); box-shadow: 0 1px 3px rgba(60,10,30,.18); }
  #letter[data-style=carnet] .letter-seal::after { display: none; }
  #letter[data-style=carnet] .letter-date { margin-bottom: 14px; font: 600 10.5px/1.4 Inter, system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; text-align: left; opacity: .85; }
  #letter[data-style=carnet] .handwriting { font: 400 16px/1.7 Inter, system-ui, sans-serif; background-image: none; }
  #letter[data-style=carnet] .letter-sign { margin-top: 16px; font: 600 28px/1.2 'Dancing Script', cursive; }

  /* Trois papiers de plus (3 décembre 2026). Chacun garde le sceau, la date, le texte qui s'écrit et la signature ; seules les matières et les polices changent. */
  #letter[data-style=kraft], #letter[data-style=antan], #letter[data-style=aquarelle] { padding: 44px 26px 30px; }
  #letter[data-style=kraft]::before, #letter[data-style=antan]::before, #letter[data-style=aquarelle]::before { display: none; }
  #letter[data-style=kraft] .handwriting, #letter[data-style=antan] .handwriting, #letter[data-style=aquarelle] .handwriting { background-image: none; }
  #letter[data-style=kraft] .handwriting p, #letter[data-style=antan] .handwriting p, #letter[data-style=aquarelle] .handwriting p { text-indent: 0; }
  #letter[data-style=kraft] .handwriting p + p, #letter[data-style=antan] .handwriting p + p, #letter[data-style=aquarelle] .handwriting p + p { margin-top: .7em; }
  /* « Kraft » : papier brun grenu, écrit au feutre */
  #letter[data-style=kraft] { border-radius: 4px; transform: rotate(-.4deg); background: radial-gradient(rgba(255,255,255,.1) .6px, transparent 1.1px) 0 0 / 5px 5px, radial-gradient(rgba(70,40,15,.12) .7px, transparent 1.2px) 2px 3px / 7px 7px, linear-gradient(168deg, #dcc099, #c8a477); box-shadow: 0 26px 50px -26px rgba(60,30,10,.6), inset 0 0 42px rgba(90,55,20,.2); }
  #letter[data-style=kraft] .letter-date { font: 600 16px/1.4 'Dancing Script', cursive; color: #5b3b1f; }
  #letter[data-style=kraft] .handwriting { font: 500 22px/34px 'Dancing Script', cursive; color: #3a2414; }
  #letter[data-style=kraft] .letter-sign { color: #7b1e2e; font-size: 34px; }
  /* « D'antan » : vieux papier aux bords dorés, lettrine à la plume */
  #letter[data-style=antan] { border-radius: 2px; transform: none; background: radial-gradient(ellipse at 50% 42%, #f7ecd3 52%, #ead5aa 88%, #dcc18b 100%); box-shadow: 0 28px 52px -28px rgba(70,40,10,.55), inset 0 0 56px rgba(130,85,30,.3); }
  #letter[data-style=antan] .letter-date { margin-bottom: 18px; font: italic 500 14px/1.4 'Playfair Display', Georgia, serif; color: #6b4a2a; text-align: center; }
  #letter[data-style=antan] .handwriting { font: italic 500 17px/1.75 'Playfair Display', Georgia, serif; color: #3b2717; }
  #letter[data-style=antan] .handwriting p:first-child::first-letter { margin-right: 1px; font: 400 40px/0 'Great Vibes', cursive; color: #7b1e2e; } /* une grande initiale à la plume, dans la ligne (flottante, elle décalait le paragraphe suivant quand la première ligne est courte) */
  #letter[data-style=antan] .letter-sign { color: #6b2a1a; font-size: 36px; }
  /* « Aquarelle » : papier blanc, taches d'aquarelle douces, écriture ronde */
  #letter[data-style=aquarelle] { border-radius: 6px; transform: rotate(.3deg); background: radial-gradient(circle at 10% 8%, rgba(242,168,182,.5), transparent 36%), radial-gradient(circle at 94% 90%, rgba(250,198,160,.55), transparent 40%), radial-gradient(circle at 88% 10%, rgba(190,208,238,.45), transparent 30%), radial-gradient(circle at 6% 92%, rgba(200,226,206,.45), transparent 32%), #fffdfa; box-shadow: 0 26px 50px -26px rgba(60,10,30,.45), inset 0 0 0 1px rgba(60,10,30,.05); }
  #letter[data-style=aquarelle] .letter-date { font: 500 17px/1.4 'Dancing Script', cursive; color: #a3405a; }
  #letter[data-style=aquarelle] .handwriting { font: 500 21px/34px 'Dancing Script', cursive; color: #4c1426; }
  #letter[data-style=aquarelle] .letter-sign { color: #a3123f; font-size: 34px; }

  /* Six papiers de plus (3 décembre 2026, maquettes choisies par la propriétaire). Les dessins (SVG) viennent de papiers.js par des variables --p-… posées sur #letter.
     Le texte reste en Playfair Display italique, très lisible même long ; les ornements vont en haut, en bas et dans les coins, jamais sous le texte. */
  #letter:is([data-style=aerogramme], [data-style=telegramme], [data-style=monogramme], [data-style=promesse], [data-style=nocturne], [data-style=reveillon]) { padding: 50px 26px 34px; transform: none; }
  #letter:is([data-style=aerogramme], [data-style=telegramme], [data-style=monogramme], [data-style=promesse], [data-style=nocturne], [data-style=reveillon])::before { content: ''; position: absolute; inset: 0; width: auto; background: none; pointer-events: none; }
  #letter:is([data-style=aerogramme], [data-style=telegramme], [data-style=monogramme], [data-style=promesse], [data-style=nocturne], [data-style=reveillon]) .handwriting { font: italic 500 17px/1.72 'Playfair Display', Georgia, serif; background-image: none; }
  #letter:is([data-style=aerogramme], [data-style=telegramme], [data-style=monogramme], [data-style=promesse], [data-style=nocturne], [data-style=reveillon]) .handwriting p { text-indent: 0; }
  #letter:is([data-style=aerogramme], [data-style=telegramme], [data-style=monogramme], [data-style=promesse], [data-style=nocturne], [data-style=reveillon]) .handwriting p + p { margin-top: .75em; }
  #letter:is([data-style=aerogramme], [data-style=telegramme], [data-style=monogramme], [data-style=promesse], [data-style=nocturne], [data-style=reveillon]) .letter-date { position: relative; margin-bottom: 14px; font: italic 500 15px/1.4 'Playfair Display', Georgia, serif; text-align: right; opacity: 1; }
  #letter:is([data-style=aerogramme], [data-style=telegramme], [data-style=monogramme], [data-style=promesse], [data-style=nocturne], [data-style=reveillon]) .letter-sign { position: relative; font: 400 38px/1.2 'Great Vibes', cursive; }
  /* le sceau : un dessin à nous à la place du cœur ou du brin de l'univers */
  #letter:is([data-style=aerogramme], [data-style=telegramme], [data-style=promesse], [data-style=nocturne], [data-style=reveillon]) .letter-seal { font-size: 0; background-image: var(--p-sceau), var(--p-cire); background-size: 62% auto, auto; background-position: center; background-repeat: no-repeat; }
  #letter:is([data-style=aerogramme], [data-style=telegramme], [data-style=monogramme], [data-style=promesse], [data-style=nocturne], [data-style=reveillon]) .letter-seal::after { content: none; }
  #letter:is([data-style=aerogramme], [data-style=telegramme], [data-style=promesse], [data-style=nocturne], [data-style=reveillon]) .letter-seal .orn { display: none; }

  /* « Aérogramme » : papier crème, bordure rouge et bleue en biais, le cachet « par avion » et le timbre */
  #letter[data-style=aerogramme] { padding: 104px 28px 34px; border: 9px solid transparent; border-radius: 3px; background: radial-gradient(120% 80% at 50% 30%, #fdf8ee, #f8efdf) padding-box;
    border-image: repeating-linear-gradient(-45deg, #c4523e 0 9px, #fbf4e8 9px 14px, #4f6f8f 14px 23px, #fbf4e8 23px 28px) 9; box-shadow: 0 28px 52px -28px rgba(70,30,20,.5); }
  #letter[data-style=aerogramme]::before { inset: 14px 8px auto; height: 80px; background: var(--p-haut) center top / min(100%, 300px) auto no-repeat; }
  #letter[data-style=aerogramme] { --p-cire: radial-gradient(circle at 35% 30%, #f1dfbd, #d4b27c 78%); }
  #letter[data-style=aerogramme] .letter-seal { top: -26px; }
  #letter[data-style=aerogramme] .letter-date { color: #9a3b2a; }
  #letter[data-style=aerogramme] .handwriting { color: #3a2620; }
  #letter[data-style=aerogramme] .letter-sign { color: #7b1e2e; }

  /* « Télégramme » : papier crème, filet pointillé, l'en-tête « TÉLÉGRAMME » et son numéro, l'antenne sur le sceau */
  #letter[data-style=telegramme] { --p-cire: radial-gradient(circle at 35% 30%, #f1dfbd, #d4b27c 78%); padding-top: 96px; border-radius: 6px; background: #f8efdc; box-shadow: 0 28px 52px -28px rgba(70,40,10,.5), inset 0 0 40px rgba(170,130,70,.12); }
  #letter[data-style=telegramme]::before { inset: 9px; border: 1px dashed rgba(150,110,60,.6); border-radius: 4px; }
  #letter[data-style=telegramme] .letter-date::before { content: 'TÉLÉGRAMME'; position: absolute; left: 0; right: 0; top: -50px; padding: 8px 0 7px; text-align: center; font: 600 17px/1 'Playfair Display', Georgia, serif; letter-spacing: .14em; color: #7b1e2e;
    border-top: 1px solid rgba(123,30,46,.55); border-bottom: 1px solid rgba(123,30,46,.55); background: repeating-linear-gradient(rgba(123,30,46,.55) 0 1px, transparent 1px 4px) right 2px center / 30px 9px no-repeat; }
  #letter[data-style=telegramme] .letter-date::after { content: 'N° ' attr(data-numero); position: absolute; left: 2px; top: -42px; font: 500 10px/1.6 Inter, system-ui, sans-serif; font-style: normal; letter-spacing: .06em; color: #5a4a44; }
  #letter[data-style=telegramme] .letter-date { color: #8a2a2a; }
  #letter[data-style=telegramme] .handwriting { color: #2f2320; }
  #letter[data-style=telegramme] .letter-sign { color: #7b1e2e; }
  #letter[data-style=telegramme] .letter-sign::after, #letter[data-style=monogramme] .letter-sign::after { content: '◇'; display: block; margin-top: 16px; text-align: center; font: 400 11px/1 Inter, system-ui, sans-serif; color: #7b1e2e;
    background: linear-gradient(currentColor, currentColor) left center / calc(50% - 16px) 1px no-repeat, linear-gradient(currentColor, currentColor) right center / calc(50% - 16px) 1px no-repeat; opacity: .7; }

  /* « Initiales » : papier ivoire, cadre doré aux coins ouvragés, le monogramme des deux prénoms entre deux lauriers */
  #letter[data-style=monogramme] { padding: 40px 30px 36px; border-radius: 4px; background: #fdf9f1; box-shadow: 0 30px 56px -30px rgba(60,40,10,.5), inset 0 0 0 1px rgba(176,141,87,.3); }
  #letter[data-style=monogramme]::before { inset: 9px; border: 1px solid rgba(176,141,87,.85);
    background: var(--p-coin-hg) left -1px top -1px / 22px no-repeat, var(--p-coin-hd) right -1px top -1px / 22px no-repeat, var(--p-coin-bg) left -1px bottom -1px / 22px no-repeat, var(--p-coin-bd) right -1px bottom -1px / 22px no-repeat; }
  #letter[data-style=monogramme] .letter-seal { top: -24px; font: 400 17px/1 'Great Vibes', cursive; color: #f6e7c8; background: radial-gradient(circle at 35% 30%, #d9b979, #9a7438 78%); }
  #letter[data-style=monogramme] .letter-seal .orn { display: none; }
  #letter[data-style=monogramme] .letter-date { color: #a07a3f; }
  #letter[data-style=monogramme] .letter-date::before { content: attr(data-ini); display: block; margin: 4px 0 16px; padding: 4px 0 8px; text-align: center; font: 400 50px/1 'Great Vibes', cursive; color: #b08d57;
    background: var(--p-laurier-g) calc(50% - 50px) 50% / 26px auto no-repeat, var(--p-laurier-d) calc(50% + 50px) 50% / 26px auto no-repeat,
      linear-gradient(rgba(176,141,87,.8), rgba(176,141,87,.8)) left center / calc(50% - 82px) 1px no-repeat, linear-gradient(rgba(176,141,87,.8), rgba(176,141,87,.8)) right center / calc(50% - 82px) 1px no-repeat; }
  #letter[data-style=monogramme] .handwriting { color: #2c1b1e; }
  #letter[data-style=monogramme] .letter-sign { color: #7b1e2e; }
  #letter[data-style=monogramme] .letter-sign::after { color: #b08d57; }

  /* « Promesse » : papier crème, cadre doré, le fil rouge et le sceau au cœur en haut, le fil au petit cœur en bas */
  #letter[data-style=promesse] { padding: 58px 28px 62px; border-radius: 14px; background: radial-gradient(120% 90% at 50% 20%, #fdf6e8, #f6e8cf); box-shadow: 0 28px 52px -28px rgba(70,30,20,.5); }
  #letter[data-style=promesse]::before { inset: 10px; border: 1px solid rgba(201,168,106,.85); border-radius: 10px;
    background: var(--p-haut) left top 8px / 100% 26px no-repeat, var(--p-bas) center bottom 8px / min(100%, 300px) auto no-repeat; }
  #letter[data-style=promesse] { --p-cire: radial-gradient(circle at 35% 30%, #c43a52, #8e1b2c 62%, #6a1020); }
  #letter[data-style=promesse] .letter-seal { top: -10px; width: 52px; height: 52px; box-shadow: 0 5px 12px rgba(110,16,32,.45), inset 0 -3px 6px rgba(0,0,0,.25); }
    #letter[data-style=promesse] .letter-date { color: #6b3a2a; }
  #letter[data-style=promesse] .handwriting { color: #2c1b1e; }
  #letter[data-style=promesse] .letter-sign { color: #8e1b2c; }

  /* « Minuit » : papier bleu nuit, encre claire, cadre d'or fin, étoiles en haut, la lune et ses nuages en bas */
  #letter[data-style=nocturne] { --p-cire: radial-gradient(circle at 35% 30%, #f6dfa0, #c99a45 78%); padding: 56px 28px 70px; border-radius: 10px; background: radial-gradient(120% 80% at 30% 10%, #24334f, #172238 70%); box-shadow: 0 30px 56px -26px rgba(10,15,40,.7); }
  #letter[data-style=nocturne]::before { inset: 9px; border: 1px solid rgba(214,178,105,.7); border-radius: 6px;
    background: var(--p-haut) left 6px top 6px / 76px auto no-repeat, var(--p-lune) left 6px bottom 4px / min(62%, 200px) auto no-repeat, var(--p-bas) right 8px bottom 8px / 60px auto no-repeat; }
  #letter[data-style=nocturne] .letter-date { color: #dcb76c; }
  #letter[data-style=nocturne] .handwriting { color: #f3ead8; }
  #letter[data-style=nocturne] .letter-sign { color: #f2aca2; }
  #letter[data-style=nocturne] .caret { background: #f3ead8; }
  #letter[data-style=nocturne] .letter-skip { color: rgba(243,234,216,.75); }

  /* « Réveillon » : papier ivoire, cadre doré, branches de sapin aux baies rouges dans les coins du haut, le sapin doré sur un sceau rouge */
  #letter[data-style=reveillon] { --p-cire: radial-gradient(circle at 35% 30%, #c43a52, #8e1b2c 62%, #6a1020); padding: 74px 28px 40px; border-radius: 8px; background: #fdf8ee; box-shadow: 0 28px 52px -28px rgba(60,30,10,.5); }
  #letter[data-style=reveillon]::before { inset: 9px; border: 1px solid rgba(176,141,87,.8); border-radius: 6px;
    background: var(--p-sapin-g) left -6px top -4px / min(40%, 140px) auto no-repeat, var(--p-sapin-d) right -6px top -4px / min(40%, 140px) auto no-repeat; }
  #letter[data-style=reveillon] .letter-seal { width: 50px; height: 50px; box-shadow: 0 5px 12px rgba(110,16,32,.45), inset 0 -3px 6px rgba(0,0,0,.25); }
  #letter[data-style=reveillon] .letter-date { color: #8a6a3a; }
  #letter[data-style=reveillon] .handwriting { color: #2c1b1e; }
  #letter[data-style=reveillon] .letter-sign { color: #8e1b2c; }
  #letter[data-style=reveillon] .letter-sign::after { content: '✦'; display: block; margin-top: 14px; text-align: center; font: 400 15px/1 Inter, system-ui, sans-serif; color: #b08d57;
    background: linear-gradient(currentColor, currentColor) left center / calc(50% - 18px) 1px no-repeat, linear-gradient(currentColor, currentColor) right center / calc(50% - 18px) 1px no-repeat; }

  /* ---------- Les mots barrés : une phrase sous l'encre, avant la lettre (écran de l'enveloppe) ---------- */
  #s-envelope.barre > :not(#barres) { display: none; }
  .barres { display: flex; flex-direction: column; align-items: center; width: 100%; }
  .barres[hidden] { display: none; }
  .barres-papier { position: relative; width: min(100%, 340px); margin-top: 28px; padding: 30px 22px; border-radius: 18px; overflow: hidden; }
  #barres-mots { margin: 0; font-size: 30px; line-height: 46px; min-height: 92px; overflow-wrap: anywhere; }
  #barres-encre { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: pointer; transition: opacity .9s ease; }
  #barres-encre.efface { opacity: 0; pointer-events: none; }
  #btn-barres { margin-top: 26px; }

  /* ---------- Boule à neige : au tout début, on la secoue et un mot apparaît ---------- */
  #s-home.neige > :not(#neige) { display: none; }
  .neige { display: flex; flex-direction: column; align-items: center; width: 100%; animation: neige-mot .8s ease both; }
  .neige[hidden] { display: none; }
  .boule-zone { position: relative; margin-top: 26px; display: flex; flex-direction: column; align-items: center; }
  .boule { position: relative; width: 240px; height: 240px; border-radius: 50%; padding: 0; border: 0; overflow: hidden; cursor: pointer; touch-action: manipulation;
    background: radial-gradient(circle at 50% 35%, #fdfcf8, #e6edf0 70%, #d3dde2);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9), inset 0 -18px 30px rgba(120, 140, 150, .25), 0 0 0 1px rgba(120, 130, 140, .35), 0 24px 34px -22px rgba(40, 40, 60, .55); }
  .boule svg, .boule canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  .boule-loin { fill: #f1f4f3; } .boule-pres { fill: #fff; }
  .boule-sapin { fill: #2f5f4c; } .boule-sapin.loin { fill: #a9bdae; }
  .boule-etoile { fill: #c9a45c; }
  .boule-reflet { position: absolute; left: 34px; top: 26px; width: 74px; height: 40px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 70%); transform: rotate(-32deg); pointer-events: none; }
  .boule-socle { position: relative; z-index: 1; width: 170px; height: 34px; margin-top: -14px; border-radius: 10px 10px 16px 16px; background: linear-gradient(180deg, var(--cire-1), var(--cire-2)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .18), 0 14px 18px -12px rgba(40, 20, 24, .6); }
  .boule.secoue { animation: secoue .5s ease; }
  @keyframes secoue { 20% { transform: translateX(-7px) rotate(-3deg); } 40% { transform: translateX(7px) rotate(3deg); } 60% { transform: translateX(-5px) rotate(-2deg); } 80% { transform: translateX(5px) rotate(2deg); } }
  .neige-mot { margin: 22px 0 0; max-width: 320px; font-size: 34px; line-height: 1.25; overflow-wrap: anywhere; animation: neige-mot 1.2s ease both; }
  .neige-mot[hidden] { display: none; }
  /* ---------- Bougie à souffler : juste avant la surprise finale ---------- */
  #s-fin.bougie-la > :not(#bougie) { display: none; }
  .bougie { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 72vh; text-align: center; animation: neige-mot .8s ease both; }
  .bougie[hidden] { display: none; }
  #s-fin .bougie h2 { font-size: 30px; line-height: 1.2; }
  .chandelle { position: relative; width: 200px; margin-top: 18px; padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; --souffle: 0; }
  .chandelle svg { position: relative; display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 16px 14px rgba(40, 20, 24, .22)); }
  .bougie-corps { fill: var(--cire-1); }
  .bougie-coulure { fill: var(--cire-1); filter: brightness(1.12); }
  .bougie-lueur { position: absolute; left: 50%; top: 0; width: 170px; height: 170px; margin: -12px 0 0 -85px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 217, 138, .8), rgba(255, 199, 102, .28) 45%, rgba(255, 199, 102, 0) 70%); pointer-events: none; animation: lueur 2.6s ease-in-out infinite; transition: opacity .5s ease; }
  .flamme-vent { transform-origin: 100px 106px; transform: skewX(calc(var(--souffle) * -30deg)) scaleY(calc(1 - var(--souffle) * .45)); transition: transform .12s linear, opacity .35s ease; }
  .flamme-danse { transform-origin: 100px 106px; animation: flamme 1.7s ease-in-out infinite; }
  .bougie-fumee { fill: none; stroke: rgba(120, 110, 110, .55); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; }
  .chandelle.eteinte { cursor: default; }
  .chandelle.eteinte .flamme-vent { transform: skewX(-34deg) scale(.15); opacity: 0; }
  .chandelle.eteinte .bougie-lueur { opacity: 0; animation: none; }
  .chandelle.eteinte .bougie-fumee { animation: fumee 2.4s ease-out both; }
  #btn-souffle { margin-top: 14px; }
  .bougie-note { margin: 12px 0 0; max-width: 300px; text-wrap: balance; }
  .bougie-note[hidden] { display: none; }
  #btn-bougie { margin-top: 22px; }
  @keyframes flamme { 0%, 100% { transform: rotate(-2deg) scale(1); } 30% { transform: rotate(2.500deg) scale(1.03, .97); } 60% { transform: rotate(-1deg) scale(.98, 1.04); } 80% { transform: rotate(1.500deg) scale(1.02, .99); } }
  @keyframes lueur { 0%, 100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
  @keyframes fumee { 0% { opacity: 0; stroke-dashoffset: 100; } 20% { opacity: .9; } 70% { opacity: .6; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dashoffset: 0; transform: translateY(-10px); } }
  @media (prefers-reduced-motion: reduce) { .flamme-danse, .bougie-lueur, .bougie { animation: none; } }

  /* La réponse : le bouton parmi les liens de fin, puis une fenêtre par-dessus l'écran */
  .repondre { padding: 13px 22px; border: 1px solid currentColor; border-radius: 999px; font-weight: 600; }
  .liens > .repondre { flex-basis: 100%; }
  .repondre[hidden] { display: none; }
  .reponse { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: max(24px, 9vh) 18px 24px; overflow-y: auto; background: rgba(38, 20, 28, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: reponse-fond .35s ease both; }
  .reponse[hidden] { display: none; }
  .reponse-carte { width: min(100%, 420px); padding: 30px 22px 24px; border-radius: 28px; text-align: center; animation: reponse-carte .45s cubic-bezier(.2, .8, .2, 1) both; }
  .reponse-carte.glass { background: rgba(255, 255, 255, .94); }
  #reponse-titre { font-size: 38px; line-height: 1.15; overflow-wrap: anywhere; }
  .reponse-aide { display: block; margin: 10px 0 16px; text-wrap: balance; }
  #reponse-mot { display: block; width: 100%; padding: 14px 16px; border-radius: 18px; border: 1px solid rgba(60, 30, 40, .18); background: #fff; color: #3a2230; font: inherit; font-size: 17px; line-height: 1.5; resize: none; }
  #reponse-mot:focus { outline: 2px solid color-mix(in srgb, currentColor 45%, transparent); outline-offset: 2px; }
  .reponse-note { margin: 12px 0 0; }
  .reponse-souci { margin: 12px 0 0; color: #a3123f; font-weight: 600; }
  .reponse-souci[hidden] { display: none; }
  #reponse-ecrire > .btn-love, #reponse-merci > .btn-love { display: block; width: 100%; margin: 18px 0 14px; }
  #reponse-ecrire > .btn-love:disabled { opacity: .6; }
  .reponse-parti { margin: 14px 0 6px; white-space: pre-line; }
  @keyframes reponse-fond { from { opacity: 0; } }
  @keyframes reponse-carte { from { opacity: 0; transform: translateY(18px); } }
  @media (prefers-reduced-motion: reduce) { .reponse, .reponse-carte { animation: none; } }
  @keyframes neige-mot { from { opacity: 0; transform: translateY(8px); } }
  #btn-neige { margin-top: 22px; }
  @media (prefers-reduced-motion: reduce) { .boule.secoue, .neige-mot { animation: none; } }

  /* ---------- L'objet à ouvrir (champ « objet ») : boîte à ruban, écrin ou médaillon à la place de l'enveloppe, à l'accueil (dans le pli) et avant la lettre ----------
     Dessins : objets.js, dans un cadre de 240 × 190 (les longueurs des transformations sont dans cette unité). Couleurs : --ob-…, ici pour la nuit, dans ambiances.css pour le papier.
     --g : avancée du geste, de 0 à 1, posée par le moteur pendant que la main tire ou reste posée. « ouvert » : l'objet est ouvert. */
  :root { --ob-papier: var(--pli-carte); --ob-bord: var(--pli-trait); --ob-creme: var(--pli-cote); --ob-accent: var(--ruban-1); --ob-fonce: var(--ruban-2); --ob-or: #c9a45c; --ob-or-pale: #efe0bd; --ob-halo: rgba(255, 255, 255, .1); --ob-photo: var(--pli-rabat); }
  .objet { --g: 0; --g-dessus: 1; --g-mot: 0; position: relative; flex: none; cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
  .objet[data-objet=medaillon] { touch-action: manipulation; }
  .objet * { pointer-events: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } /* tout geste arrive à l'objet lui-même ; un appui long n'ouvre ni loupe ni menu */
  .pli.objet { height: calc(var(--l) * 190 / 240); perspective: none; }
  #objet { width: min(78vw, 300px); height: calc(min(78vw, 300px) * 190 / 240); margin-top: 30px; border-radius: 14px; outline-offset: 6px; }
  #objet:focus-visible { outline: 2px solid var(--ob-accent); }
  .objet > *, .ob-med > svg, .ob-volet, .ob-volet > svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
  .objet svg { overflow: visible; }
  .ob-halo { fill: var(--ob-halo); } .ob-sol { fill: var(--ob-fonce); opacity: .12; }
  .ob-p { fill: var(--ob-papier); stroke: var(--ob-bord); stroke-width: 1.2; stroke-linejoin: round; }
  .ob-a { fill: var(--ob-accent); } .ob-af { fill: var(--ob-fonce); } .ob-or { fill: var(--ob-or); } .ob-ph { fill: var(--ob-photo); }
  .ob-t { fill: none; stroke: var(--ob-or); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
  .ob-ta { fill: none; stroke: var(--ob-accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
  .ob-rb { fill: none; stroke: var(--ob-accent); stroke-width: 6; stroke-linecap: round; }
  .ob-hl { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; opacity: .3; } .ob-sat { fill: #fff; opacity: .22; }
  .ob-cr { fill: var(--ob-creme); stroke: var(--ob-bord); stroke-width: 1.1; }
  .ob-g { fill: var(--ob-or-pale); stroke: var(--ob-or); stroke-width: 1.5; }
  .ob-pt { fill: none; stroke: var(--ob-or); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 0 7; }
  .ob-eclat { animation: ob-luit 3.6s ease-in-out infinite; }
  @keyframes ob-luit { 50% { opacity: .35; } }
  /* la carte glissée dans l'objet : le signe (cœur ou ornement de l'univers), les initiales du médaillon, le mot avant la lettre */
  .ob-carte { display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; padding: 3%; text-align: center; color: var(--ob-fonce); }
  .objet > .ob-carte, .ob-med > .ob-carte, .ob-photo { position: absolute; }
  .ob-signe { flex: none; width: 36%; overflow: visible; }
  .ob-initiales, .ob-mot { display: none; max-width: 100%; overflow-wrap: anywhere; }
  .ob-carte.grave .ob-signe { display: none; }
  .ob-carte.grave .ob-initiales { display: block; font: italic 500 21px/1.1 var(--u-titre, 'Playfair Display', Georgia, serif); white-space: nowrap; }
  .ob-carte.dit .ob-signe { width: 20%; margin-bottom: 3%; }
  .ob-carte.dit .ob-mot { display: block; font: 400 25px/1.02 var(--u-main, 'Great Vibes', cursive); }
  .ob-carte.dit.long .ob-mot { font-size: 19px; }
  /* la boîte à ruban : on tire le ruban (les pans s'allongent, les boucles se défont), le couvercle se soulève et se pose, la carte monte */
  [data-objet=boite] > .ob-carte { left: 31.67%; top: 11.58%; width: 36.67%; height: 55.79%; justify-content: flex-start; padding-top: 6%; border-radius: 5px; background: var(--ob-creme); box-shadow: inset 0 0 0 1px var(--ob-bord); opacity: 0; transform: translateY(45%); transition: transform .6s cubic-bezier(.3, 1.15, .5, 1), opacity .2s; }
  .ouvert[data-objet=boite] > .ob-carte { opacity: 1; transform: none; transition-delay: .4s, .36s; }
  .ob-pans { transform-origin: 120px 82px; transform: scaleY(calc(1 + var(--g) * .8)); transition: transform .45s ease-in, opacity .3s .12s; }
  .ob-boucles, .ob-noeud { transform-origin: 120px 80px; transition: transform .35s ease-in, opacity .3s; }
  .ob-boucles { transform: scale(calc(1 - var(--g) * .55)); }
  .ob-couvercle { transform-origin: 120px 93px; transform: translateY(calc(var(--g) * -5px)); }
  .objet.geste .ob-pans, .objet.geste .ob-boucles { transition: none; }
  .objet:not(.ouvert):not(.geste) .ob-pans { animation: ob-tire 3.4s ease-in-out 1.2s infinite; } /* au repos, le ruban appelle la main */
  @keyframes ob-tire { 0%, 72%, 100% { transform: scaleY(1); } 82% { transform: scaleY(1.2); } 90% { transform: scaleY(.97); } }
  .objet.ouvert .ob-pans { transform: translateY(64px) scaleY(1.5); opacity: 0; }
  .objet.ouvert .ob-boucles, .objet.ouvert .ob-noeud { transform: scale(.2); opacity: 0; }
  .objet.ouvert .ob-couvercle { transform: translate(-90px, 75px) scale(.56); animation: ob-couvercle .95s cubic-bezier(.4, 0, .3, 1) both; }
  @keyframes ob-couvercle { 0% { transform: none; } 38% { transform: translate(0, -34px) rotate(-8deg); } 100% { transform: translate(-90px, 75px) scale(.56); } }
  .ob-pose { opacity: 0; transition: opacity .3s; } .objet.ouvert .ob-pose { opacity: 1; transition-delay: .75s; }
  /* l'écrin : tant que le doigt reste posé, le couvercle bascule (--g) ; son dessus s'efface vers le haut, l'intérieur et le petit mot se déplient depuis la charnière */
  [data-objet=ecrin] .ob-dedans { transform-origin: 120px 120px; transform: scaleY(calc(.47 + var(--g) * .53)); }
  [data-objet=ecrin] .ob-dessus { transform-origin: 120px 68px; transform: translateY(calc(var(--g) * -53px)) scaleY(calc(1 - var(--g) * 1.6)); opacity: var(--g-dessus); }
  [data-objet=ecrin] .ob-lisere { transform: translateY(calc((1 - var(--g)) * -9px)); }
  [data-objet=ecrin] .ob-fermoir { transform: translateY(calc(var(--g) * 9px)); }
  [data-objet=ecrin] > .ob-carte { left: 31.5%; top: 18.5%; width: 37%; height: 38%; border-radius: 4px; background: var(--ob-papier); box-shadow: inset 0 0 0 1px var(--ob-bord); transform-origin: 50% 117.5%; transform: scaleY(calc(.47 + var(--g) * .53)); opacity: var(--g-mot); }
  .objet:not(.ouvert):not(.geste) .ob-fermoir { animation: ob-fermoir 2.4s ease-in-out infinite; } /* au repos, le fermoir brille */
  @keyframes ob-fermoir { 50% { opacity: .6; } }
  /* le médaillon : dessiné ouvert (deux faces côte à côte) ; fermé, le volet est rabattu sur la face de droite et le tout est agrandi et recentré */
  .ob-med { transform-origin: 0 0; transform: translate(-33.67%, -9.05%) scale(1.154); transition: transform .7s cubic-bezier(.45, 0, .2, 1); }
  .objet.ouvert .ob-med { transform: none; }
  .ob-volet { transform-origin: 50% 58.95%; transform: scaleX(-1); transition: transform .7s cubic-bezier(.45, 0, .55, 1); }
  .objet.ouvert .ob-volet { transform: scaleX(1); }
  .ob-ext, .ob-int, .ob-photo { transition: opacity 0s .35s; } /* les faces du volet s'échangent quand il passe de profil */
  .ob-int, .ob-photo, .objet.ouvert .ob-ext { opacity: 0; } .objet.ouvert .ob-int, .objet.ouvert .ob-photo { opacity: 1; }
  .ob-charniere, [data-objet=medaillon] > .ob-devant { opacity: 0; transition: opacity .25s; } .objet.ouvert .ob-charniere, .ouvert[data-objet=medaillon] > .ob-devant { opacity: 1; transition-delay: .5s; }
  .ob-chaine { transition: opacity .3s; } .objet.ouvert .ob-chaine { opacity: 0; }
  .ob-med > .ob-carte { left: 55%; top: 36.84%; width: 35%; height: 44.21%; padding: 4%; border-radius: 50%; }
  .ob-photo { left: 10%; top: 36.84%; width: 35%; height: 44.21%; border-radius: 50%; overflow: hidden; -webkit-clip-path: circle(50%); clip-path: circle(50%); }
  .ob-photo img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
  /* un autre objet au début et l'enveloppe pour la lettre : le pli de l'accueil n'est plus là, c'est l'enveloppe de la lettre qui porte le sceau de cire, gravé au choix (app.js) */
  #envelope .seal.gravee { width: 62px; height: 62px; border-radius: 0; background: none; box-shadow: none; font-size: 0; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .28)); }
  #envelope .seal.gravee::after { content: none; }
  #envelope .seal.gravee .cire { display: block; width: 100%; height: 100%; }
  /* l'arbre à secouer (objet de la lettre seulement) : il penche avec le doigt (--g, de -1 à 1) et tremble à chaque secousse (data-coup : 1, 2, 3), une poignée de feuilles tombe à chaque fois ;
     à la troisième, l'enveloppe quitte sa branche et tombe au pied de l'arbre (« tombe ») ; un toucher l'ouvre et sa carte vient au milieu (« ouvert »). Sur un fond plein, l'arbre se détache sur un disque clair. */
  .sombre .objet[data-objet=arbre] { --ob-halo: rgba(251, 244, 232, .94); }
  .ob-pl { fill: none; stroke: var(--ob-bord); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
  .ob-arbre { transform-origin: 120px 177px; transform: rotate(calc(var(--g) * 5deg)); }
  [data-objet=arbre]:not(.ouvert):not(.geste):not(.tombe):not([data-coup]) .ob-arbre { animation: ob-balance 3.6s ease-in-out 1.2s infinite; } /* au repos, l'arbre appelle la main */
  @keyframes ob-balance { 0%, 62%, 100% { transform: rotate(0deg); } 72% { transform: rotate(-3deg); } 82% { transform: rotate(3deg); } 91% { transform: rotate(-1.2deg); } }
  [data-coup="1"]:not(.geste) .ob-arbre, [data-coup="3"]:not(.geste) .ob-arbre { animation: ob-secoue-a .5s ease-out; } /* deux noms pour un même tremblement : il repart à chaque secousse */
  [data-coup="2"]:not(.geste) .ob-arbre { animation: ob-secoue-b .5s ease-out; }
  @keyframes ob-secoue-a { 25% { transform: rotate(-5deg); } 55% { transform: rotate(4deg); } 80% { transform: rotate(-2deg); } }
  @keyframes ob-secoue-b { 25% { transform: rotate(5deg); } 55% { transform: rotate(-4deg); } 80% { transform: rotate(2deg); } }
  .ob-pli { transform-origin: 0 0; transform: translate(150px, 92px) rotate(16deg) scale(.82); }
  .objet.tombe .ob-arbre.ob-branche, .objet.ouvert .ob-arbre.ob-branche { transform: none; animation: none; } /* l'enveloppe tombée ne penche plus avec l'arbre */
  .objet.tombe .ob-pli, .objet.ouvert .ob-pli { transform: translate(165px, 159px) rotate(-7deg) scale(1.12); animation: ob-tombe .75s cubic-bezier(.5, 0, .8, .5) both; }
  .objet.tombe:not(.ouvert) .ob-pli { animation: ob-tombe .75s cubic-bezier(.5, 0, .8, .5) both, ob-appel 2.6s ease-in-out 1.5s infinite; } /* posée, elle appelle le doigt */
  @keyframes ob-tombe { 0% { transform: translate(150px, 92px) rotate(16deg) scale(.82); } 62% { transform: translate(163px, 161px) rotate(-12deg) scale(1.12); } 80% { transform: translate(164px, 153px) rotate(-3deg) scale(1.12); } 100% { transform: translate(165px, 159px) rotate(-7deg) scale(1.12); } }
  @keyframes ob-appel { 0%, 68%, 100% { transform: translate(165px, 159px) rotate(-7deg) scale(1.12); } 78% { transform: translate(165px, 153px) rotate(-14deg) scale(1.12); } 88% { transform: translate(165px, 158px) rotate(-1deg) scale(1.12); } }
  .objet.ouvert .ob-pli { opacity: 0; transition: opacity .3s .12s; }
  [data-objet=arbre] > .ob-carte { left: 31.67%; top: 13%; width: 36.67%; height: 55.79%; justify-content: flex-start; padding-top: 6%; border-radius: 5px; background: var(--ob-creme); box-shadow: inset 0 0 0 1px var(--ob-bord), 0 12px 18px -12px rgba(0, 0, 0, .55); opacity: 0; transform: translate(51%, 77%) scale(.3) rotate(-7deg); transition: transform .6s cubic-bezier(.3, 1.15, .5, 1), opacity .2s; }
  .ouvert[data-objet=arbre] > .ob-carte { opacity: 1; transform: none; }
  .ob-brin { opacity: 0; }
  [data-coup="1"] .ob-f1 .ob-brin, [data-coup="2"] .ob-f2 .ob-brin, [data-coup="3"] .ob-f3 .ob-brin { animation: ob-brin 1.25s cubic-bezier(.4, 0, .7, .6) both; }
  .ob-devant > g > :nth-child(2) > .ob-brin { animation-delay: .1s; } .ob-devant > g > :nth-child(3) > .ob-brin { animation-delay: .22s; } .ob-devant > g > :nth-child(4) > .ob-brin { animation-delay: .05s; }
  @keyframes ob-brin { 0% { opacity: 0; transform: translate(0, 0) rotate(0deg); } 12% { opacity: 1; } 50% { transform: translate(9px, 38px) rotate(150deg); } 82% { opacity: 1; } 100% { opacity: 0; transform: translate(-5px, 78px) rotate(320deg); } }
  /* mouvements réduits : aucune animation ; l'objet change d'état d'un coup (à l'accueil, le pli s'efface en fondu) */
  @media (prefers-reduced-motion: reduce) { .objet, .objet * { animation: none !important; } }

/* D'où vient ce cadeau : une ligne discrète tout à la fin. En vitrine ouverte en grand : une bande pour revenir à la boutique ou créer le sien. */
.fin-marque { margin-top: 30px; text-align: center; }
.fin-marque a { text-decoration: underline; text-underline-offset: 3px; color: inherit; }
.vitrine-barre { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px max(14px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 253, 249, .94); border-top: 1px solid rgba(44, 27, 30, .12); font: 600 14px/1.2 Figtree, system-ui, sans-serif; }
.vitrine-barre a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; color: #2c1b1e; text-decoration: none; }
.vitrine-barre .vb-creer { background: #2c1b1e; color: #fffdf9; }
body.en-vitrine { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

/* ---------- La fleur des mots (juste avant la lettre) et le polaroïd qui se révèle (après le pli) ----------
   Deux panneaux facultatifs, chacun dans un écran existant, comme la bougie. Leurs couleurs suivent le décor et l'univers :
   les réglages --u-… sur papier, l'or et le bleu la nuit. Tout est ici : rien dans ambiances.css. Aucune image : des formes en CSS. */
:root { --pet: #fffdf9; --pet-voile: rgba(190, 18, 69, .2); --pet-trait: #be1245; --pet-centre: #b08d57;
  --pola-papier: #fffdf9; --pola-bord: rgba(190, 18, 69, .12); --pola-ombre: rgba(60, 10, 30, .5); --pola-encre: #7b1e2e; --pola-piste: rgba(190, 18, 69, .16); --pola-plein: #be1245; }
[data-papier] { --pet: var(--u-carte); --pet-voile: rgba(var(--u-accent-rgb), .2); --pet-trait: var(--u-accent); --pet-centre: var(--u-or);
  --pola-papier: var(--u-carte); --pola-bord: var(--u-trait); --pola-ombre: rgba(44, 27, 30, .5); --pola-encre: var(--u-accent); --pola-piste: var(--u-trait); --pola-plein: var(--u-accent); }
.sombre { --pet: #2b3a66; --pet-voile: rgba(220, 196, 142, .8); --pet-trait: var(--or); --pet-centre: var(--or);
  --pola-bord: rgba(255, 255, 255, .5); --pola-ombre: rgba(0, 0, 0, .7); --pola-encre: #24365f; --pola-piste: rgba(255, 255, 255, .22); --pola-plein: var(--or); }
/* la fleur : de trois à six pétales, chacun un bouton ; un pétale lu se teinte */
#s-final.fleur-la > :not(#fleur) { display: none; }
#s-final.fleur-la { padding-bottom: 2.5rem; } /* la fleur se tient au milieu de l'écran, comme les panneaux de l'accueil */
.fleur { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 5rem); min-height: calc(100dvh - 5rem); text-align: center; animation: neige-mot .8s ease both; transition: opacity .3s ease; }
.instant-suite { display: flex; flex-direction: column; align-items: center; min-height: 92px; } /* la consigne, puis le bouton, à la même place : rien ne saute quand l'un remplace l'autre */
.fleur[hidden] { display: none; }
.fleur.part { opacity: 0; }
#s-final .fleur h2 { font-size: 29px; line-height: 1.2; }
.fleur-zone { --fl: min(280px, 74vw, 36vh); position: relative; flex: none; width: var(--fl); height: var(--fl); margin-top: 26px; }
.fleur-petales { position: absolute; inset: 0; }
.petale { --pl: 22.86%; position: absolute; left: calc(50% - var(--pl) / 2); top: 5.7%; width: var(--pl); height: 40%; padding: 0; -webkit-appearance: none; appearance: none; border: 1.2px solid var(--pet-trait); border-radius: 50%; background: var(--pet); overflow: hidden;
  transform-origin: 50% 110.75%; transform: rotate(var(--a, 0deg)); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
.petale::before { content: ''; position: absolute; inset: 0; background: var(--pet-voile); opacity: 0; transition: opacity .6s ease; }
.petale.lu::before { opacity: 1; }
.petale.ici { border-width: 2px; }
.petale:focus-visible { outline: 2px solid var(--pet-trait); outline-offset: 3px; }
.fleur-centre { position: absolute; left: 50%; top: 50%; width: 16.5%; height: 16.5%; margin: -8.25% 0 0 -8.25%; border-radius: 50%; border: 1.1px solid var(--pet-centre); background: radial-gradient(circle closest-side, var(--pet-centre) 70%, rgba(255, 255, 255, 0) 74%); pointer-events: none; }
.fleur-carte { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 340px; min-height: 134px; margin-top: 24px; padding: 20px 20px 18px; border-radius: 18px; } /* la place d'un mot et de deux lignes : la carte ne bouge pas d'un pétale à l'autre */
#fleur-mot { margin: 0; font-size: 42px; line-height: 1.1; }
#fleur-mot.long { font-size: 33px; } /* un mot de plus de 14 lettres tient encore sur une ligne */
#fleur-mot[hidden] { display: none; }
#fleur-phrase { margin: 0; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; text-wrap: balance; }
#fleur-phrase[hidden] { display: none; }
.fleur-carte.neuf > * { animation: neige-mot .7s ease both; }
#btn-fleur, #s-home #btn-pola { margin-top: 24px; }
/* le polaroïd : la photo sous un voile de papier qui remonte tant que le doigt reste posé (--r va de 0 à 1, réglé par le moteur) */
#s-home.polaroid-la > :not(#polaroid) { display: none; }
.polaroid { --r: 0; display: flex; flex-direction: column; align-items: center; width: 100%; animation: neige-mot .8s ease both; -webkit-user-select: none; user-select: none; }
.polaroid[hidden] { display: none; }
#s-home .polaroid h2 { font-size: 29px; line-height: 1.2; }
.pola { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(270px, 74vw, 40vh); margin-top: 34px; padding: 16px 16px 18px; border-radius: 3px; background: var(--pola-papier); box-shadow: 0 0 0 1px var(--pola-bord), 0 22px 34px -22px var(--pola-ombre); transform: rotate(-3deg); }
.pola-photo { position: relative; display: block; width: 100%; height: 0; padding: 0 0 100%; border: 0; border-radius: 1px; overflow: hidden; background: #ebe3d8; cursor: pointer;
  touch-action: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
.pola-photo img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; pointer-events: none; -webkit-user-drag: none;
  opacity: calc(.25 + .75 * var(--r)); filter: blur(calc((1 - var(--r)) * 5px)) saturate(calc(.35 + .65 * var(--r))); transform: scale(1.04); }
.pola-voile { position: absolute; left: 0; right: 0; top: 0; height: 180%; background: linear-gradient(180deg, var(--pola-papier) 0%, var(--pola-papier) 49%, rgba(255, 253, 249, 0) 100%); transform: translateY(calc(var(--r) * -100%)); pointer-events: none; }
.pola-photo:focus-visible { outline: 2px solid var(--pola-plein); outline-offset: 3px; }
.pola-photo.revele { cursor: default; }
.pola-photo.revele img { opacity: 1; filter: none; transform: none; transition: transform .8s ease; } /* la fin est écrite en clair : la photo est là, même si un navigateur calcule mal le voile */
.pola-photo.revele .pola-voile { opacity: 0; }
.pola-legende { min-height: 29px; margin: 0; font-family: 'Dancing Script', cursive; font-size: 24px; line-height: 1.2; text-align: center; color: var(--pola-encre); overflow-wrap: anywhere; opacity: 0; transition: opacity .9s ease .2s; }
.polaroid.revele .pola-legende { opacity: 1; }
.pola-barre { position: relative; width: 220px; max-width: 70%; height: 4px; margin-top: 34px; border-radius: 4px; overflow: hidden; background: var(--pola-piste); transition: opacity .6s ease; }
.pola-barre span { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 4px; background: var(--pola-plein); transform-origin: 0 50%; transform: scaleX(var(--r)); }
.polaroid.revele .pola-barre { opacity: 0; }
#pola-aide[hidden], #fleur-aide[hidden] { display: none; }
/* mouvements réduits : ni flou ni voile qui glisse, la photo s'éclaircit simplement */
@media (prefers-reduced-motion: reduce) {
  .fleur, .polaroid, .fleur-carte.neuf > * { animation: none; }
  .pola-photo img { filter: none; transform: none; }
  .pola-voile { height: 100%; background: var(--pola-papier); transform: none; opacity: calc(1 - var(--r)); }
}

  /* La bougie : quand le souffle ne suffit pas, l'aide « touche la flamme » se voit mieux */
  #bougie-aide.appuie { font-weight: 600; opacity: 1; animation: none; color: var(--u-accent, #be1245); }
  .reponse-offrir { margin-top: 18px; font-size: 13.5px; line-height: 1.5; opacity: .85; text-wrap: balance; } .reponse-offrir a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; color: inherit; }

  /* L'écriture choisie par la personne qui offre : elle passe devant celle du papier (règles placées après celles des papiers). Interligne de 36 px : il suit les lignes du papier manuscrit. */
  #letter[data-ecriture] .handwriting { line-height: 36px; }
  #letter[data-ecriture=plume] .handwriting { font: 500 22px/36px 'Dancing Script', cursive; }
  #letter[data-ecriture=calligraphie] .handwriting { font: 400 27px/36px 'Great Vibes', cursive; }
  #letter[data-ecriture=classique] .handwriting { font: italic 500 17.5px/36px 'Playfair Display', Georgia, serif; }
  #letter[data-ecriture=lisible] .handwriting { font: 400 16.5px/36px Inter, system-ui, sans-serif; }
