/* ==========================================================
   Y’mine 💋 — Le rendez-vous de ce soir
   Direction : une soirée en six lumières.
   ========================================================== */

:root {
  --bord-950: #1c0910;
  --bord-900: #2a0c16;
  --bord-800: #3f1121;
  --bord-700: #5c1628;
  --bord-600: #761f31;
  --bord-500: #93303f;
  --ivory-50: #fcf8ef;
  --ivory-100: #f6eedd;
  --ivory-200: #ede1c8;
  --ivory-300: #dfcca7;
  --gold-200: #f1dfae;
  --gold-300: #e2c68a;
  --gold-400: #cdaa66;
  --gold-500: #ad8a48;
  --gold-600: #86672f;
  --ink: #2b1b18;
  --ink-2: #57443c;
  --ink-3: #8a7466;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fade: 1300ms;
  --rv: 1200ms;
  --door: 1850ms;
  --stamp: 1200ms;
  --crown: 2800ms;
  --flip: 1300ms;
  --ease: cubic-bezier(.22, .7, .2, 1);
  --ease-io: cubic-bezier(.6, .05, .25, 1);
  --gutter: 20px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bord-950); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bord-950);
  color: var(--ivory-100);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
p { margin: 0; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }

/* ---------- Ciel : les lumières successives ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.sky-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 1.9s ease; }
.sky-layer.is-on { opacity: 1; }
.sky-layer[data-mood="dusk"] {
  background:
    radial-gradient(130% 60% at 50% 112%, rgba(222, 142, 92, .55) 0%, rgba(222, 142, 92, 0) 62%),
    radial-gradient(70% 40% at 85% 8%, rgba(147, 48, 63, .35), transparent 70%),
    linear-gradient(180deg, #1c0910 0%, #331020 38%, #561a2b 74%, #7c3433 100%);
}
.sky-layer[data-mood="paper"] {
  background:
    radial-gradient(120% 80% at 50% 0%, #f8f1e2 0%, #efe3cb 60%, #e1cfac 100%);
}
.sky-layer[data-mood="night"] {
  background:
    radial-gradient(90% 50% at 80% 0%, rgba(205, 170, 102, .14), transparent 70%),
    linear-gradient(180deg, #120c17 0%, #1b1120 55%, #2a1220 100%);
}
.sky-layer[data-mood="warm"] {
  background:
    radial-gradient(80% 45% at 50% 30%, rgba(232, 160, 90, .30), transparent 70%),
    linear-gradient(180deg, #24110b 0%, #3a1c11 55%, #1d0d07 100%);
}
.sky-layer[data-mood="candle"] {
  background:
    radial-gradient(90% 55% at 50% 20%, rgba(236, 178, 104, .26), transparent 72%),
    linear-gradient(180deg, #2a140d 0%, #3a1d12 50%, #251009 100%);
}
.sky-layer[data-mood="gold"] {
  background:
    radial-gradient(60% 38% at 50% 34%, rgba(255, 226, 160, .55) 0%, rgba(214, 160, 80, .28) 38%, rgba(90, 44, 18, 0) 75%),
    linear-gradient(180deg, #2b150a 0%, #4a2714 50%, #22100a 100%);
}
.sky-layer[data-mood="ivory"] {
  background:
    radial-gradient(90% 60% at 50% 38%, #fbf5e8 0%, #efe2c8 70%, #dcc6a0 100%);
}
.grain {
  position: absolute; inset: 0; opacity: .08; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Scènes ---------- */
main { position: relative; z-index: 1; }
.scene {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px;
  padding:
    calc(68px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right))
    calc(108px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--fade) var(--ease), transform var(--fade) var(--ease);
}
.scene.is-active { opacity: 1; transform: none; }
.scene.is-leaving { opacity: 0; transform: translateY(-6px); transition-duration: 620ms; }
.scene > * { width: 100%; max-width: 30rem; }
.scene-long { justify-content: flex-start; }
.scene[data-mood="paper"], .scene[data-mood="ivory"] { color: var(--ink); }

/* Révélations progressives */
.rv {
  opacity: 0; transform: translateY(14px); visibility: hidden;
  transition: opacity var(--rv) var(--ease), transform var(--rv) var(--ease), visibility 0s linear var(--rv);
}
.rv.is-in { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.is-gone { display: none !important; }
.instant, .instant * { transition: none !important; }

/* ---------- Typo & éléments communs ---------- */
.smallcaps, .doc-type, .court-name, .invite-for, .pcard-kicker, dt {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: .16em; font-size: 11.5px; font-weight: 600;
}
.hint { font-size: 14px; color: rgba(246, 238, 221, .72); text-align: center; letter-spacing: .02em; }
.rule { display: block; width: 56px; height: 1px; margin: 0 auto; background: linear-gradient(90deg, transparent, var(--gold-400), transparent); }
.actions { display: flex; justify-content: center; }
.caption {
  font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.5; text-align: center;
  color: var(--gold-200); font-variation-settings: "opsz" 24;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 50px; padding: 0 1.6em; border-radius: 999px; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 15.5px; letter-spacing: .015em; text-align: center;
  border: 1px solid transparent;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .35s, opacity var(--rv) var(--ease), visibility 0s linear var(--rv);
  touch-action: manipulation;
}
.btn.rv.is-in { transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .35s, opacity var(--rv) var(--ease); }
.btn:active { transform: scale(.97); }
.btn-light {
  background: var(--ivory-100); color: var(--bord-700); border-color: rgba(205, 170, 102, .7);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .55), inset 0 0 0 3px rgba(252, 248, 239, .9), inset 0 0 0 4px rgba(205, 170, 102, .35);
}
.btn-ink {
  background: var(--bord-700); color: var(--ivory-100); border-color: var(--bord-800);
  box-shadow: 0 10px 26px -14px rgba(60, 10, 20, .8), inset 0 0 0 3px var(--bord-700), inset 0 0 0 4px rgba(226, 198, 138, .4);
}
.btn-gold {
  background: linear-gradient(180deg, #f3dfa6, #d2ab60); color: #3a1d0c; border-color: #a6823e;
  box-shadow: 0 12px 30px -14px rgba(60, 30, 5, .9), inset 0 1px 0 rgba(255, 255, 255, .55);
}
:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 3px; }
.scene[data-mood="paper"] :focus-visible, .scene[data-mood="ivory"] :focus-visible { outline-color: var(--bord-600); }

/* ---------- Réglages du son ---------- */
.sound { position: fixed; z-index: 30; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); }
.sound-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(28, 9, 16, .32); border: 1px solid rgba(226, 198, 138, .35); color: var(--ivory-100);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color .6s, color .6s, border-color .6s;
}
.sound-btn svg { width: 20px; height: 20px; }
.sound.is-muted .sound-btn .wave { opacity: .2; }
body[data-tone="light"] .sound-btn { background: rgba(252, 248, 239, .6); color: var(--bord-700); border-color: rgba(118, 31, 49, .3); }
.sound-panel {
  position: absolute; right: 0; top: 52px; width: 196px; padding: 14px 16px 8px;
  background: rgba(252, 248, 239, .97); color: var(--ink); border-radius: 16px;
  border: 1px solid rgba(173, 138, 72, .45);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
}
.sound-title { font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; }
.toggle { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; font-size: 15px; position: relative; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle i { width: 40px; height: 24px; border-radius: 12px; background: #d8cbb4; position: relative; transition: background-color .3s; }
.toggle i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .3s var(--ease); }
.toggle input:checked + i { background: var(--bord-600); }
.toggle input:checked + i::after { transform: translateX(16px); }
.toggle input:focus-visible + i { outline: 2px solid var(--bord-600); outline-offset: 2px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px max(14px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  pointer-events: none;
  transition: opacity 1s var(--ease);
}
.nav.is-hidden { opacity: 0; }
.nav.is-hidden .nav-btn { visibility: hidden; }
.nav-btn {
  pointer-events: auto; min-height: 44px; min-width: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 500; letter-spacing: .01em;
  background: rgba(28, 9, 16, .34); color: var(--ivory-100); border: 1px solid rgba(226, 198, 138, .28);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: opacity .5s, background-color .6s, color .6s, border-color .6s;
}
.nav-btn:disabled { opacity: 0; pointer-events: none; }
body[data-tone="light"] .nav-btn { background: rgba(252, 248, 239, .66); color: var(--bord-700); border-color: rgba(118, 31, 49, .22); }

/* ==========================================================
   0 · Ouverture
   ========================================================== */
.cover { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.cover-title {
  margin: 0; font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: clamp(54px, 17vw, 84px); line-height: 1; letter-spacing: -.01em; color: var(--ivory-50);
  font-variation-settings: "opsz" 144;
  --rv: 1600ms;
}
.cover-sub { font-family: var(--serif); font-size: clamp(19px, 5.4vw, 23px); color: var(--gold-200); font-variation-settings: "opsz" 30; }
.cover .btn { margin-top: 12px; }

/* ==========================================================
   1 · Conversation
   ========================================================== */
.chat { display: flex; flex-direction: column; gap: 18px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid rgba(226, 198, 138, .18); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--gold-200);
  background: radial-gradient(circle at 35% 30%, #7a2536, #3f1121); border: 1px solid rgba(226, 198, 138, .5);
}
.chat-who { display: flex; flex-direction: column; line-height: 1.25; }
.chat-who strong { font-weight: 600; font-size: 16px; }
.chat-who small { font-size: 12.5px; color: rgba(246, 238, 221, .6); letter-spacing: .02em; }

.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 84%; }
.msg p {
  padding: 11px 15px; font-size: 16px; line-height: 1.42; border-radius: 20px;
  overflow-wrap: anywhere;
}
.msg.him { align-self: flex-start; }
.msg.her { align-self: flex-end; }
.msg.him p { background: rgba(252, 248, 239, .95); color: var(--ink); border-bottom-left-radius: 6px; box-shadow: 0 8px 22px -16px rgba(0, 0, 0, .7); }
.msg.her p { background: linear-gradient(180deg, #93303f, #761f31); color: var(--ivory-50); border-bottom-right-radius: 6px; box-shadow: 0 8px 22px -16px rgba(0, 0, 0, .7); }
.msg.him + .msg.her, .msg.her + .msg.him { margin-top: 8px; }
.msg-new { margin-top: 14px; --rv: 1500ms; }
.msg-new.rv { transform: translateY(18px) scale(.96); transform-origin: left bottom; }
.msg-new.rv.is-in { transform: none; }
.msg-new p { box-shadow: 0 0 0 1px rgba(226, 198, 138, .5), 0 14px 34px -14px rgba(226, 160, 100, .55); }

.typing { align-self: flex-start; display: flex; gap: 5px; padding: 13px 16px; border-radius: 20px; border-bottom-left-radius: 6px; background: rgba(252, 248, 239, .16); margin-top: 14px; --rv: 600ms; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: rgba(252, 248, 239, .75); animation: typing 1.3s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
.typing.is-done { display: none; }
@keyframes typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ==========================================================
   2 · Enveloppe
   ========================================================== */
.env-zone { display: flex; justify-content: center; padding-top: 128px; }
.envelope {
  position: relative; width: min(84vw, 330px); aspect-ratio: 3 / 2; perspective: 900px;
  --rv: 1400ms;
}
.envelope > * { position: absolute; }
.env-back { inset: 0; border-radius: 6px; background: linear-gradient(180deg, #d9c6a2, #e6d6b7); box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .7); }
.env-letter {
  left: 6%; right: 6%; top: 6%; height: 88%; z-index: 2;
  background: var(--ivory-50); color: var(--ink); border-radius: 3px;
  padding: 18px 16px; text-align: center;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 10px 22px -16px rgba(0, 0, 0, .5);
  transition: transform 1500ms var(--ease-io);
}
.env-letter .smallcaps { color: var(--bord-600); font-size: 10.5px; }
.env-letter .addr { font-family: var(--serif); font-size: clamp(19px, 5.6vw, 23px); line-height: 1.15; margin-top: 8px; font-variation-settings: "opsz" 40; }
.env-letter .addr-sub { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.envelope.is-out .env-letter { transform: translateY(-64%); }
.env-front {
  inset: 0; z-index: 3; border-radius: 6px;
  background: linear-gradient(180deg, #efe3c9 0%, #f4ead6 100%);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 9%;
}
.env-front::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top right, rgba(120, 90, 50, .10), transparent 50%), linear-gradient(to top left, rgba(120, 90, 50, .10), transparent 50%);
}
.env-name { position: relative; font-family: var(--serif); font-style: italic; font-size: clamp(19px, 5.4vw, 22px); color: var(--bord-700); }
.env-flap {
  left: 0; right: 0; top: 0; height: 58%; z-index: 4; transform-origin: 50% 0;
  filter: drop-shadow(0 3px 3px rgba(80, 50, 20, .22));
  transition: transform 1000ms var(--ease-io);
}
.flap-shape { position: absolute; inset: 0; background: linear-gradient(180deg, #e8d9bb, #ddc9a3); clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 6px 6px 0 0; }
.envelope.is-open .env-flap { transform: rotateX(180deg); }
.envelope.is-flapped .env-flap { z-index: 1; }
.seal {
  left: 50%; top: 56%; z-index: 5; width: 66px; height: 66px; margin: -33px 0 0 -33px; padding: 0; cursor: pointer;
  border: 0; border-radius: 47% 53% 50% 50% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 36% 30%, #b0434f 0%, #7d1f30 45%, #521122 100%);
  box-shadow: 0 6px 14px -4px rgba(40, 5, 10, .7), inset 0 0 0 5px rgba(70, 10, 22, .35), inset 0 2px 2px rgba(255, 190, 190, .25);
  display: grid; place-items: center;
  transition: transform .18s var(--ease), opacity .7s var(--ease);
}
.seal span { font-family: var(--serif); font-style: italic; font-size: 30px; color: #3f0b18; text-shadow: 0 1px 0 rgba(255, 170, 170, .35), 0 -1px 0 rgba(0, 0, 0, .3); line-height: 1; }
.seal::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 1px solid rgba(255, 190, 190, .18); }
.seal.is-pressed { transform: scale(.9); }
.seal.is-broken { opacity: 0; transform: translateY(14px) rotate(16deg) scale(.86); pointer-events: none; }
.envelope.is-open .seal { pointer-events: none; }
.seal-hint.is-out { opacity: 0; }

/* ==========================================================
   3–5 · Tribunal
   ========================================================== */
.dossier {
  position: relative; background: var(--ivory-50); color: var(--ink);
  padding: 30px 24px 30px; border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 26px 50px -30px rgba(70, 40, 20, .55), 0 0 0 1px rgba(150, 120, 80, .14);
  font-size: 16.5px; line-height: 1.65;
  --rv: 1400ms;
}
.dossier::before { /* chemise du dossier */
  content: ""; position: absolute; inset: 8px -6px -8px 6px; z-index: -1; border-radius: 4px;
  background: linear-gradient(180deg, #d7c09a, #cbb187); transform: rotate(1.2deg);
  box-shadow: 0 18px 30px -24px rgba(70, 40, 20, .6);
}
.dossier::after { /* filet bordeaux de marge */
  content: ""; position: absolute; top: 18px; bottom: 18px; left: 10px; width: 1px; background: rgba(118, 31, 49, .25);
}
.dossier > * + * { margin-top: 1em; }
.doc-head { text-align: center; padding-bottom: 18px; border-bottom: 1px solid rgba(118, 31, 49, .18); margin-bottom: 4px; }
.doc-head.compact { padding-bottom: 14px; }
.court-seal { display: block; width: 64px; height: 64px; margin: 0 auto 12px; color: var(--bord-700); }
.court-seal.small { width: 74px; height: 74px; margin: 0; color: var(--bord-600); }
.court-name { margin: 0; color: var(--bord-700); font-size: 12px; letter-spacing: .2em; line-height: 1.6; }
.doc-type { margin: 6px 0 0; color: var(--ink-3); font-weight: 500; font-size: 11px; }
h2.doc-type { font-family: var(--serif); text-transform: none; letter-spacing: .01em; color: var(--ink); font-size: 26px; font-weight: 500; }
.doc-sub { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--bord-700); margin-top: 4px; }
.lead { font-family: var(--serif); font-size: clamp(20px, 5.8vw, 23px); line-height: 1.35; font-variation-settings: "opsz" 36; color: var(--ink); padding-top: 6px; }
.facts { margin: 1.2em 0; border-top: 1px solid rgba(118, 31, 49, .14); }
.facts > div { padding: 10px 0; border-bottom: 1px solid rgba(118, 31, 49, .14); }
.facts dt { color: var(--ink-3); font-size: 10.5px; }
.facts dd { margin: 2px 0 0; font-family: var(--serif); font-size: 19px; color: var(--bord-700); line-height: 1.3; }
.note { font-style: italic; color: var(--ink-2); font-family: var(--serif); font-size: 16.5px; }

.court-seal.seal-press { opacity: 0; }
.court-seal.seal-press.is-pressing { animation: seal-press 900ms var(--ease) forwards; }
.court-seal.seal-press.is-set { opacity: 1; }
@keyframes seal-press {
  0% { opacity: 0; transform: scale(1.6) rotate(-14deg); }
  60% { opacity: 1; transform: scale(.94) rotate(0deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Carte de l’avocat (retournement) */
.ask-wrap { margin-top: -4px; }
.lawyer { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.flip { perspective: 1200px; width: 100%; }
.flip-inner { display: grid; transform-style: preserve-3d; transition: transform var(--flip) var(--ease-io); }
.flip-face { grid-area: 1 / 1; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 14px; }
.face-front { transform: rotateY(180deg); }
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }
.lawyer-card .face-back {
  display: grid; place-items: center; min-height: 190px;
  background: radial-gradient(circle at 50% 40%, #7a2536, #3f1121); border: 1px solid rgba(226, 198, 138, .5);
  box-shadow: inset 0 0 0 6px #4a1426, inset 0 0 0 7px rgba(226, 198, 138, .35), 0 20px 40px -24px rgba(60, 10, 20, .8);
}
.lawyer-card .face-back .court-seal { color: #8f2a3a; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)); }
.lawyer-card .face-front {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; text-align: center;
  min-height: 190px; padding: 24px 22px; background: var(--ivory-50); color: var(--ink);
  border: 1px solid rgba(173, 138, 72, .55); box-shadow: inset 0 0 0 6px var(--ivory-50), inset 0 0 0 7px rgba(173, 138, 72, .35), 0 20px 40px -24px rgba(70, 40, 20, .6);
}
.lawyer-card .smallcaps { color: var(--ink-3); font-size: 10.5px; }
.lawyer-line { font-family: var(--serif); font-size: clamp(21px, 6vw, 25px); line-height: 1.3; font-variation-settings: "opsz" 40; }
.lawyer-line strong { font-weight: 600; color: var(--bord-700); }
.aside { font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 17px; }

/* Plaidoirie */
.plea { font-family: var(--serif); font-size: 17.5px; line-height: 1.66; font-variation-settings: "opsz" 16; }
.plea .doc-type { font-family: var(--sans); }
.salutation { font-style: italic; font-size: 1.08em; }
.exhibit { font-style: italic; color: var(--bord-700); background: linear-gradient(transparent 62%, rgba(226, 198, 138, .45) 62%); padding: 0 .1em; }
.closing { font-weight: 500; }
.floor { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.greffe { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-family: var(--sans); font-size: 11.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--bord-700); font-weight: 600; padding-top: 6px; }
.greffe::before { content: ""; width: 40px; height: 1px; background: var(--gold-500); }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  min-height: 54px; padding: 12px 18px; border-radius: 14px; cursor: pointer; text-align: center;
  font-family: var(--serif); font-size: 18.5px; font-style: italic; color: var(--bord-700);
  background: rgba(252, 248, 239, .75); border: 1px solid rgba(118, 31, 49, .35);
  transition: background-color .6s, color .6s, opacity .8s, border-color .6s, transform .3s var(--ease);
}
.choice:active { transform: scale(.98); }
.choice.is-chosen { background: var(--bord-700); color: var(--ivory-50); border-color: var(--bord-800); }
.choice.is-dim { opacity: .38; }
.choice[aria-disabled="true"] { cursor: default; }
.reply { text-align: center; padding: 6px 8px; }
.reply-text { font-family: var(--serif); font-size: 18.5px; line-height: 1.5; color: var(--ink); font-variation-settings: "opsz" 24; }
.reply-text::before { content: "Le greffe"; display: block; font-family: var(--sans); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; font-weight: 600; }

/* Verdict et tampon */
.verdict-line { text-align: center; font-family: var(--serif); font-size: 20px; font-style: italic; padding-top: 8px; }
.stamp-zone { position: relative; height: 150px; display: grid; place-items: center; }
.stamp {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-9deg);
  color: #8c1f33; opacity: 0;
  padding: .3em .55em .26em; border: 4px solid currentColor; border-radius: 8px;
  outline: 1.5px solid currentColor; outline-offset: 4px;
  font-family: var(--serif); font-weight: 650; font-size: clamp(25px, 8vw, 40px); line-height: 1; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  font-variation-settings: "opsz" 72;
  mix-blend-mode: multiply; filter: url(#ink);
  pointer-events: none;
}
.stamp.is-stamping { animation: stamp-fall var(--stamp) forwards; }
.stamp.is-set { opacity: .92; }
@keyframes stamp-fall {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-15deg) scale(2.3); animation-timing-function: cubic-bezier(.55, 0, .85, .35); }
  72% { opacity: .95; transform: translate(-50%, -50%) rotate(-9deg) scale(.95); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  84% { transform: translate(-50%, -50%) rotate(-9deg) scale(1.025); }
  100% { opacity: .92; transform: translate(-50%, -50%) rotate(-9deg) scale(1); }
}
.dossier.is-jolt { animation: jolt 420ms var(--ease); }
@keyframes jolt { 0% { transform: none; } 30% { transform: translateY(3px) scale(.994); } 100% { transform: none; } }

/* ==========================================================
   6 · Itinéraire
   ========================================================== */
.thread-night .msg.him p { background: rgba(246, 238, 221, .94); }
.map-area { position: relative; --rv: 1400ms; }
.map { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 26px 60px -30px rgba(0, 0, 0, .9); }
.map .ring { transform-box: fill-box; transform-origin: center; opacity: 0; }
.map-area.is-ready .ring { animation: ring 2.4s infinite ease-out; }
.map-area.is-ready .ring.r2 { animation-delay: 1.2s; }
@keyframes ring { 0% { opacity: .8; transform: scale(.7); } 100% { opacity: 0; transform: scale(3.2); } }
.map .dest-label { opacity: 0; transition: opacity 1.2s var(--ease); }
.map-area.is-reached .dest-label { opacity: 1; }
.map .dest-glow { opacity: .35; transition: opacity 1.4s; }
.map-area.is-ready .dest-glow { opacity: .8; }
.map .route-marker { filter: drop-shadow(0 0 4px rgba(255, 230, 180, .9)); }
.map-area.is-reached .map { filter: brightness(.6) saturate(.9); transition: filter 1.4s var(--ease); }
.dest-btn {
  position: absolute; left: 78.75%; top: 22%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  border-radius: 50%; border: 0; background: transparent; cursor: pointer; padding: 0;
}
.dest-btn:focus-visible { outline-offset: -8px; }
.map-area.is-reached .dest-btn { pointer-events: none; }
.invite { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; pointer-events: none; }
.invite.rv { transform: scale(.4); transform-origin: 78.75% 22%; --rv: 1500ms; }
.invite.rv.is-in { transform: none; pointer-events: auto; }
.invite-card {
  width: 100%; max-width: 300px; text-align: center; color: var(--ink);
  background: var(--ivory-50); border-radius: 10px; padding: 30px 22px 28px;
  border: 1px solid rgba(173, 138, 72, .7);
  box-shadow: inset 0 0 0 6px var(--ivory-50), inset 0 0 0 7px rgba(173, 138, 72, .4), 0 30px 60px -20px rgba(0, 0, 0, .85);
}
.invite-for { color: var(--bord-600); font-size: 10.5px; letter-spacing: .14em; }
.invite-title { margin: 14px 0 14px; font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 10vw, 42px); letter-spacing: .08em; text-transform: uppercase; color: var(--bord-700); line-height: 1; font-variation-settings: "opsz" 96; }
.invite-line { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.45; color: var(--ink-2); }
.arrive-hint.is-out { opacity: 0; }

/* ==========================================================
   7 · La porte du Royaume
   ========================================================== */
.facade { position: relative; width: min(100%, 340px); aspect-ratio: 340 / 460; margin: 0 auto; --rv: 1500ms; }
.facade > * { position: absolute; }
.wall {
  inset: 0; border-radius: 20px; overflow: hidden;
  background:
    radial-gradient(60% 34% at 50% 22%, rgba(255, 196, 128, .20), transparent 70%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .10) 0 1px, transparent 1px 38px),
    linear-gradient(180deg, #55301e 0%, #43231a 55%, #2e160d 100%);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .5), 0 30px 70px -30px rgba(0, 0, 0, .9);
}
.wall::after { /* lueur sur le mur quand la porte s’ouvre */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(55% 45% at 50% 62%, rgba(255, 196, 120, .45), transparent 70%);
  opacity: 0; transition: opacity var(--door) var(--ease);
}
.facade.is-open .wall::after { opacity: 1; }
.lamp { left: 8%; top: 24%; width: 30px; height: 60px; }
.lamp-glow { position: absolute; left: 50%; top: 40%; width: 170px; height: 170px; margin: -85px 0 0 -85px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 200, 120, .42), rgba(255, 200, 120, 0) 65%); animation: flicker 5s infinite ease-in-out; }
.lamp-arm { position: absolute; left: 0; top: 4px; width: 14px; height: 2px; background: #1e0e08; }
.lamp-body { position: absolute; left: 7px; top: 6px; width: 18px; height: 30px; border-radius: 4px 4px 6px 6px; background: linear-gradient(180deg, #ffe0a0, #f0a850); box-shadow: 0 0 0 2px #1e0e08, 0 0 18px 4px rgba(255, 190, 110, .55); }
.lamp-body::before { content: ""; position: absolute; left: -3px; right: -3px; top: -5px; height: 5px; border-radius: 3px 3px 0 0; background: #1e0e08; }
@keyframes flicker { 0%, 100% { opacity: .9; } 40% { opacity: 1; } 55% { opacity: .82; } 70% { opacity: .96; } }

.frame {
  left: 23%; width: 54%; top: 8%; bottom: 9%;
  border-radius: 50% 50% 3px 3px / 24% 24% 3px 3px;
  background: linear-gradient(90deg, #8a6440, #b8926a 30%, #a07a52 70%, #7a5636);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), inset 0 4px 10px rgba(255, 230, 190, .12), 0 8px 24px -8px rgba(0, 0, 0, .7);
}
.doorway {
  left: 27.5%; width: 45%; top: 11%; bottom: 9%;
  border-radius: 50% 50% 0 0 / 23% 23% 0 0;
  overflow: hidden; perspective: 900px;
  background: #1a0b05;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6);
}
.interior {
  position: absolute; inset: 0;
  background: radial-gradient(90% 60% at 50% 55%, #fff1c8 0%, #f5c97c 32%, #d98c43 62%, #8a4a1e 100%);
  opacity: .92; transition: opacity var(--door) var(--ease), filter var(--door) var(--ease);
  filter: brightness(.95);
}
.facade.is-open .interior { opacity: 1; filter: brightness(1.08); }
.interior-glow { position: absolute; left: 50%; top: 58%; width: 140%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 248, 220, .8), rgba(255, 248, 220, 0) 60%); opacity: 0; transition: opacity calc(var(--door) * 1.4) var(--ease); }
.facade.is-open .interior-glow { opacity: 1; }
.fan {
  left: 0; right: 0; top: 0; height: 23.5%; position: absolute; z-index: 2;
  border-radius: 999px 999px 0 0;
  background:
    radial-gradient(circle at 50% 100%, #3c1a0c 0 14%, transparent 14.5%),
    radial-gradient(circle at 50% 100%, transparent 0 15.5%, rgba(255, 228, 170, .12) 16%, transparent 70%),
    repeating-conic-gradient(from -90deg at 50% 100%, #3c1a0c 0deg 2deg, transparent 2deg 30deg);
  -webkit-mask: radial-gradient(circle at 50% 100%, #000 0 70.7%, transparent 71%);
  mask: radial-gradient(circle at 50% 100%, #000 0 70.7%, transparent 71%);
  box-shadow: inset 0 0 0 2px #3c1a0c;
}
.transom { left: 0; right: 0; top: 22%; height: 3%; z-index: 3; background: linear-gradient(180deg, #5e2a18, #3c1a0c); box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.leaf {
  position: absolute; z-index: 3; left: 2.8%; right: 2.8%; top: 26%; bottom: 1.3%;
  transform-origin: 0 50%;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 7px, rgba(255, 255, 255, .025) 7px 8px, transparent 8px 13px),
    linear-gradient(90deg, #4a1913 0%, #632519 45%, #57201a 70%, #43170f 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45), inset 3px 0 6px rgba(0, 0, 0, .35);
  transition: transform var(--door) cubic-bezier(.5, .04, .28, 1), filter var(--door) var(--ease);
  pointer-events: none;
}
.facade.is-open .leaf { transform: rotateY(82deg); filter: brightness(.55); }
.panel {
  position: absolute; border-radius: 3px;
  background: linear-gradient(135deg, rgba(255, 220, 190, .05), rgba(0, 0, 0, .12));
  box-shadow: inset 2px 2px 0 rgba(255, 210, 170, .10), inset -2px -2px 0 rgba(0, 0, 0, .35), inset 0 0 0 4px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .25), 1px 1px 0 1px rgba(255, 210, 170, .06);
}
.panel.p1 { left: 11%; width: 33%; top: 6%; height: 46%; }
.panel.p2 { right: 11%; width: 33%; top: 6%; height: 46%; }
.panel.p3 { left: 11%; width: 33%; top: 58%; height: 35%; }
.panel.p4 { right: 11%; width: 33%; top: 58%; height: 35%; }
.knob { position: absolute; right: 7%; top: 53%; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff0c0, #c99a48 55%, #6e4a18); box-shadow: 0 2px 3px rgba(0, 0, 0, .6); }
.keyhole { position: absolute; right: calc(7% + 3px); top: calc(53% + 18px); width: 6px; height: 10px; border-radius: 3px 3px 1px 1px; background: #ffd890; box-shadow: 0 0 6px 2px rgba(255, 200, 120, .55); opacity: .85; }
.facade.is-open .keyhole { opacity: 0; }
.step { left: 21%; width: 58%; bottom: 6.6%; height: 2.8%; border-radius: 2px; background: linear-gradient(180deg, #a98560, #6f4e30); box-shadow: 0 4px 8px rgba(0, 0, 0, .5); }
.step::before { /* lumière qui filtre sous la porte */
  content: ""; position: absolute; left: 14%; right: 14%; top: -3px; height: 4px; border-radius: 50%;
  background: rgba(255, 214, 140, .85); filter: blur(2px);
  box-shadow: 0 0 14px 4px rgba(255, 190, 110, .45);
}
.spill {
  left: 14%; width: 72%; top: 93.4%; height: 6.6%; border-radius: 0 0 20px 20px;
  background: linear-gradient(180deg, rgba(255, 210, 140, .6), rgba(255, 210, 140, 0));
  clip-path: polygon(19% 0, 81% 0, 100% 100%, 0 100%);
  opacity: .25; transition: opacity var(--door) var(--ease);
}
.facade.is-open .spill { opacity: 1; }
.bell { left: 79%; top: 47%; width: 50px; height: 70px; margin-left: -6px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; border-radius: 12px; z-index: 5; }
.bell-plate {
  width: 26px; height: 50px; border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly;
  background: linear-gradient(160deg, #f0d59a, #b98d44 55%, #7d5a22); color: #5a3d12;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 245, 210, .6), inset 0 0 0 1px rgba(90, 60, 20, .4);
}
.bell-icon { width: 13px; height: 13px; }
.bell-push {
  width: 15px; height: 15px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fffaf0, #e8d8b8 60%, #b9a582);
  box-shadow: 0 0 0 2px #7d5a22, inset 0 -1px 2px rgba(0, 0, 0, .25);
  transition: background .25s, box-shadow .4s, transform .15s;
}
.bell:active .bell-push { transform: scale(.88); }
.bell.is-lit .bell-push {
  background: radial-gradient(circle at 40% 35%, #fff, #ffe39a 55%, #ffb84a);
  box-shadow: 0 0 0 2px #7d5a22, 0 0 10px 4px rgba(255, 210, 120, .85), 0 0 26px 10px rgba(255, 170, 70, .45);
  transform: scale(.9);
}
.env-mini {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%);
  width: 74%; padding: 8px 6px 10px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.env-mini.rv { transform: translate(-50%, -40%); --rv: 1400ms; }
.env-mini.rv.is-in { transform: translate(-50%, -50%); }
.env-mini-shape {
  position: relative; width: 100%; aspect-ratio: 3 / 2; border-radius: 3px;
  background: linear-gradient(180deg, #fbf4e4, #efe1c4);
  box-shadow: 0 10px 18px -8px rgba(110, 50, 10, .6);
}
.env-mini-shape::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #e9d8b5, #e2cfa8); clip-path: polygon(0 0, 100% 0, 50% 56%); }
.env-mini-seal { position: absolute; left: 50%; top: 52%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: radial-gradient(circle at 36% 30%, #b0434f, #6a1728); }
.env-mini-label { font-family: var(--serif); font-style: italic; font-size: 16px; color: #4a1b10; text-shadow: 0 1px 0 rgba(255, 240, 210, .6); white-space: nowrap; }
.door-caption { min-height: 3em; }

/* ==========================================================
   8 · La lettre
   ========================================================== */
.letter {
  position: relative; background: var(--ivory-50); color: var(--ink);
  padding: clamp(28px, 7vw, 40px) clamp(22px, 6vw, 36px) clamp(30px, 7vw, 40px);
  border-radius: 3px;
  font-family: var(--serif); font-size: clamp(17.5px, 4.8vw, 19px); line-height: 1.7; font-variation-settings: "opsz" 14;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 34px 70px -34px rgba(0, 0, 0, .9), 0 0 0 1px rgba(150, 120, 80, .2);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(240, 225, 195, .35));
  --rv: 1500ms;
}
.letter.rv { transform: translateY(18px) scaleY(.97); transform-origin: top center; }
.letter.rv.is-in { transform: none; }
.letter > * + * { margin-top: 1.05em; }
.letter .salutation { font-size: 1.15em; }
.sign { font-family: var(--serif); font-style: italic; font-size: 1.35em; color: var(--bord-700); text-align: right; font-variation-settings: "opsz" 48; }

/* ==========================================================
   9 · Ce soir — le couronnement
   ========================================================== */
.scene-crown { gap: 30px; }
.crown-stage { display: grid; place-items: center; min-height: 46svh; }
.crown-stage > * { grid-area: 1 / 1; }
.echo { display: flex; flex-direction: column; gap: 12px; width: min(100%, 21rem); transition: opacity 1400ms var(--ease), transform 1400ms var(--ease), filter 1400ms var(--ease); }
.echo .msg p { font-size: 17px; }
.echo .msg.him p { background: rgba(252, 248, 239, .96); }
.echo.is-out { opacity: 0; transform: translateY(-12px); filter: blur(2px); visibility: hidden; transition: opacity 1400ms var(--ease), transform 1400ms var(--ease), filter 1400ms var(--ease), visibility 0s linear 1400ms; }
.crowned { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.name-wrap { position: relative; padding-top: 42px; transition: transform 1900ms var(--ease-io); }
.halo { position: absolute; left: 50%; top: 58%; width: 360px; height: 260px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 230, 170, .55), rgba(255, 230, 170, 0)); opacity: 0; transition: opacity 2.2s var(--ease); pointer-events: none; }
.halo.is-lit { opacity: 1; }
.name {
  position: relative; margin: 0; font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: clamp(58px, 19vw, 96px); line-height: 1; color: #fff6df; letter-spacing: -.005em;
  font-variation-settings: "opsz" 144;
  text-shadow: 0 2px 30px rgba(255, 200, 110, .45);
  --rv: 1600ms;
}
.name.rv { transform: none; filter: blur(8px); transition: opacity var(--rv) var(--ease), filter var(--rv) var(--ease), visibility 0s linear var(--rv); }
.name.rv.is-in { filter: none; transition-delay: 0s; }
.y { position: relative; display: inline-block; }
.crown {
  position: absolute; left: 62%; bottom: 88%; width: .56em; height: auto;
  transform: translateX(-50%) rotate(-10deg); opacity: 0;
  filter: drop-shadow(0 3px 6px rgba(80, 40, 5, .5));
}
.crown.is-landing { animation: crown-down var(--crown) forwards; }
.crown.is-set { opacity: 1; }
@keyframes crown-down {
  0% { opacity: 0; transform: translateX(-50%) translateY(-120px) rotate(-22deg); animation-timing-function: cubic-bezier(.25, .6, .3, 1); }
  12% { opacity: 1; }
  88% { transform: translateX(-50%) translateY(4px) rotate(-9deg); animation-timing-function: ease-in-out; }
  100% { opacity: 1; transform: translateX(-50%) rotate(-10deg); }
}
.welcome { font-family: var(--serif); font-size: clamp(21px, 6vw, 26px); line-height: 1.3; color: var(--gold-200); font-variation-settings: "opsz" 40; margin-top: 4px; }
.told { font-size: 16px; line-height: 1.55; color: rgba(252, 244, 225, .86); max-width: 22rem; }
.crowned .sign { text-align: center; color: var(--gold-200); font-size: 24px; }
.listen { margin-top: 6px; }
.listen-icon { display: inline-flex; gap: 2px; align-items: center; height: 16px; }
.listen-icon i { width: 3px; height: 6px; border-radius: 2px; background: currentColor; }
.listen-icon i:nth-child(2) { height: 12px; } .listen-icon i:nth-child(3) { height: 16px; } .listen-icon i:nth-child(4) { height: 9px; }
.listen.is-playing .listen-icon i { animation: eq .9s infinite ease-in-out; }
.listen.is-playing .listen-icon i:nth-child(2) { animation-delay: .15s; } .listen.is-playing .listen-icon i:nth-child(3) { animation-delay: .3s; } .listen.is-playing .listen-icon i:nth-child(4) { animation-delay: .45s; }
@keyframes eq { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
.voice-caption { font-size: 17px; }

.coupon {
  display: flex; max-width: 22rem; color: var(--ink); transform: rotate(-1.5deg);
  filter: drop-shadow(0 18px 24px rgba(30, 10, 0, .55));
  --rv: 1400ms;
}
.coupon.rv { transform: rotate(-1.5deg) translateY(14px); }
.coupon.rv.is-in { transform: rotate(-1.5deg); }
.coupon > div { background: #fbf3df; }
.coupon-stub {
  display: grid; place-items: center; width: 64px; flex: none; font-size: 26px;
  border-radius: 10px 0 0 10px; border-right: 2px dashed rgba(118, 31, 49, .35);
  -webkit-mask: radial-gradient(circle 7px at 100% 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 7px at 100% 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle 7px at 100% 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 7px at 100% 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.coupon-body {
  flex: 1; padding: 16px 18px 16px 16px; border-radius: 0 10px 10px 0; font-size: 14px; line-height: 1.45;
  -webkit-mask: radial-gradient(circle 7px at 0 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 7px at 0 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle 7px at 0 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 7px at 0 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.coupon-title { font-family: var(--serif); font-weight: 600; font-size: 16.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--bord-700); margin-bottom: 6px; line-height: 1.25; }
.coupon-fine { font-size: 12.5px; color: var(--ink-3); font-style: italic; margin-top: 2px; }

/* ==========================================================
   10 · Carte de Princesse
   ========================================================== */
.scene-card { gap: 28px; }
.pcard { width: min(100%, 350px); perspective: 1600px; --rv: 1500ms; }
.pcard-inner { display: grid; transform-style: preserve-3d; transition: transform var(--flip) var(--ease-io); }
.pcard[data-side="verso"] .pcard-inner { transform: rotateY(180deg); }
.pface {
  grid-area: 1 / 1; position: relative; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: linear-gradient(160deg, #fdf9ef 0%, #f7eedb 60%, #f1e4c8 100%);
  border-radius: 16px; color: var(--ink);
  padding: 38px 30px 34px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 40px 70px -36px rgba(90, 60, 20, .75), 0 0 0 1px rgba(173, 138, 72, .3);
}
.pface::before, .pface::after { content: ""; position: absolute; pointer-events: none; border-radius: 10px; }
.pface::before { inset: 10px; border: 1px solid rgba(173, 138, 72, .75); }
.pface::after { inset: 14px; border: .5px solid rgba(173, 138, 72, .45); border-radius: 7px; }
.verso { transform: rotateY(180deg); font-family: var(--serif); font-size: 16.5px; line-height: 1.6; font-variation-settings: "opsz" 14; }
.verso > * + * { margin-top: .9em; }
.verso .sign { font-size: 1.4em; }
.verso .ps { font-size: 15px; color: var(--ink-2); font-style: italic; border-top: 1px solid rgba(173, 138, 72, .4); padding-top: .9em; }
.recto { text-align: center; display: flex; flex-direction: column; align-items: center; }
.pcard-crown { width: 34px; height: auto; margin-bottom: 14px; }
.pcard-kicker { color: var(--gold-600); font-size: 11px; letter-spacing: .26em; }
.pcard-name { font-family: var(--serif); font-style: italic; font-size: clamp(52px, 16vw, 66px); line-height: 1.05; color: var(--bord-700); margin: 10px 0 18px; font-variation-settings: "opsz" 144; }
.pcard-fields { margin: 0; width: 100%; border-top: 1px solid rgba(173, 138, 72, .45); }
.pcard-fields > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 2px; border-bottom: 1px solid rgba(173, 138, 72, .3); }
.pcard-fields dt { color: var(--ink-3); font-size: 10.5px; }
.pcard-fields dd { margin: 0; font-family: var(--serif); font-size: 18px; color: var(--ink); text-align: right; }
.pcard-foot { margin-top: 20px; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--gold-600); }

/* ==========================================================
   Petits écrans
   ========================================================== */
@media (max-width: 360px) {
  :root { --gutter: 16px; }
  .dossier { padding: 26px 18px; font-size: 16px; }
  .plea { font-size: 16.5px; }
  .pface { padding: 32px 24px 28px; }
  .verso { font-size: 15.5px; }
  .btn { padding: 0 1.25em; font-size: 15px; }
  .nav-btn { padding: 0 13px; font-size: 13.5px; }
  .env-zone { padding-top: 112px; }
}
@media (min-height: 760px) { .crown-stage { min-height: 50svh; } }

/* ==========================================================
   Mouvements réduits : fondus seulement
   ========================================================== */
.rm .scene, .rm .scene.is-leaving { transform: none; }
.rm .rv, .rm .msg-new.rv, .rm .letter.rv, .rm .env-mini.rv, .rm .invite.rv, .rm .coupon.rv { transform: none; }
.rm .env-mini.rv, .rm .env-mini.rv.is-in { transform: translate(-50%, -50%); }
.rm .coupon.rv, .rm .coupon.rv.is-in { transform: rotate(-1.5deg); }
.rm .name.rv { filter: none; }
.rm .typing span, .rm .lamp-glow, .rm .map-area.is-ready .ring, .rm .listen.is-playing .listen-icon i { animation: none; }
.rm .map-area.is-ready .ring.r1 { opacity: .6; transform: scale(1.6); }
.rm .env-flap { transition: opacity 900ms var(--ease); }
.rm .envelope.is-open .env-flap { transform: none; opacity: 0; }
.rm .env-letter { transition: opacity 1200ms var(--ease); }
.rm .envelope.is-out .env-letter { transform: translateY(-64%); }
.rm .envelope .env-letter { opacity: 0; }
.rm .envelope.is-out .env-letter { opacity: 1; }
.rm .seal.is-broken { transform: none; }
.rm .court-seal.seal-press.is-pressing { animation: rm-fade 700ms ease forwards; }
.rm .stamp.is-stamping { animation: rm-fade 450ms ease forwards; }
.rm .crown.is-landing { animation: rm-fade 1400ms ease forwards; }
.rm .dossier.is-jolt { animation: none; }
@keyframes rm-fade { from { opacity: 0; } to { opacity: 1; } }
.rm .leaf { transition: opacity var(--door) var(--ease); }
.rm .facade.is-open .leaf { transform: none; filter: none; opacity: 0; }
.rm .flip-inner, .rm .pcard-inner { transform: none !important; transition: none; }
.rm .flip-face, .rm .pface { transform: none; transition: opacity 900ms var(--ease); -webkit-backface-visibility: visible; backface-visibility: visible; }
.rm .flip .face-front { opacity: 0; }
.rm .flip.is-flipped .face-front { opacity: 1; }
.rm .flip.is-flipped .face-back { opacity: 0; }
.rm .pcard .verso { opacity: 0; }
.rm .pcard[data-side="verso"] .verso { opacity: 1; }
.rm .pcard[data-side="verso"] .recto { opacity: 0; }
.rm .echo.is-out { transform: none; filter: none; }

/* ==========================================================
   11 · La fête au Royaume, à la tombée de la nuit
   ========================================================== */
.sky-layer[data-mood="fete"] {
  background:
    radial-gradient(120% 45% at 50% 108%, rgba(222, 130, 86, .55), rgba(222, 130, 86, 0) 62%),
    radial-gradient(70% 30% at 50% 0%, rgba(255, 214, 150, .10), transparent 70%),
    linear-gradient(180deg, #140c22 0%, #2a1232 38%, #4c1a33 72%, #77303a 100%);
}
.actions-col { flex-direction: column; align-items: center; gap: 12px; }
.btn-outline {
  background: rgba(252, 248, 239, .55); color: var(--bord-700); border-color: rgba(118, 31, 49, .45);
  font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 17px; letter-spacing: 0;
}
.btn-ghost { background: rgba(28, 9, 16, .28); color: var(--ivory-100); border-color: rgba(226, 198, 138, .45); }

.scene-fete {
  justify-content: flex-start; gap: 30px; overflow: hidden;
  padding-top: calc(128px + env(safe-area-inset-top));
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}
.fete-deco { position: absolute; inset: 0; max-width: none; width: auto; pointer-events: none; }
.garland { position: absolute; left: 0; right: 0; top: env(safe-area-inset-top); height: 80px; }
.garland .wire { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.garland .wire path { fill: none; stroke: #2a160e; stroke-width: 1.4; vector-effect: non-scaling-stroke; opacity: .9; }
.bulb {
  position: absolute; width: 9px; height: 13px; margin-left: -4.5px; border-radius: 50% 50% 46% 46% / 42% 42% 58% 58%;
  background: radial-gradient(circle at 45% 60%, #fffbe8 0%, var(--c) 55%, var(--c2) 100%);
  box-shadow: 0 0 8px 2px var(--g), 0 0 22px 6px var(--g2);
  transform: rotate(var(--tilt));
  transform-origin: 50% -3px;
  animation: twinkle 3.6s ease-in-out infinite alternate; animation-delay: var(--d);
}
.bulb::before { content: ""; position: absolute; left: 2px; right: 2px; top: -4px; height: 5px; border-radius: 1px; background: #3a2214; }
@keyframes twinkle { 0% { opacity: .72; filter: brightness(.88); } 100% { opacity: 1; filter: brightness(1.12); } }
.star { position: absolute; fill: var(--gold-300); opacity: .75; filter: drop-shadow(0 0 4px rgba(242, 210, 140, .7)); animation: twinkle 4.2s ease-in-out infinite alternate; }
.star.s1 { width: 12px; left: 7%; top: 132px; animation-delay: -1s; }
.star.s2 { width: 9px; right: 9%; top: 182px; animation-delay: -2.4s; }
.star.s3 { width: 14px; right: 6%; top: 44%; animation-delay: -.6s; }
.star.s4 { width: 8px; left: 5%; top: 48%; animation-delay: -3s; }
.star.s5 { width: 10px; left: 9%; top: 74%; animation-delay: -1.7s; }
.star.s6 { width: 8px; right: 12%; top: 79%; animation-delay: -2.9s; }
.candy { position: absolute; width: 58px; height: auto; filter: drop-shadow(0 6px 10px rgba(20, 5, 10, .5)); }
.candy-a { right: 8px; top: calc(84px + env(safe-area-inset-top)); transform: rotate(16deg); }
.candy-b { left: 10px; bottom: calc(18px + env(safe-area-inset-bottom)); transform: rotate(-14deg); }

.fete-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.nicks { display: flex; flex-wrap: wrap; justify-content: space-around; align-items: center; gap: 12px 22px; width: 100%; }
.nick { font-family: "Caveat", "Segoe Script", "Bradley Hand", cursive; font-weight: 500; line-height: 1.1; --rv: 1500ms; }
.nick.rv { transform: translateY(8px) scale(.9); }
.nick.rv.is-in { transform: none; }
.ink { display: inline-block; transform: rotate(var(--r, 0deg)) scale(var(--s, 1)); font-size: clamp(23px, 6.6vw, 28px); color: var(--ivory-100); text-shadow: 0 2px 10px rgba(20, 5, 15, .45); white-space: nowrap; }
.ink-rose { color: #f4c3c9; }
.ink-gold { color: var(--gold-200); }
.nick-main { margin: 4px 0 -4px; }
.nick-main .ink { font-size: clamp(42px, 13vw, 56px); font-weight: 600; color: var(--gold-200); text-shadow: 0 2px 18px rgba(255, 200, 120, .35); }
.fete-title {
  margin: 0; font-family: var(--serif); font-weight: 450; font-size: clamp(31px, 9.6vw, 50px); line-height: 1.08;
  color: #fff6df; letter-spacing: -.005em; font-variation-settings: "opsz" 120; text-wrap: balance;
  text-shadow: 0 2px 26px rgba(255, 196, 110, .35);
  --rv: 1600ms;
}
.fete-word { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-family: var(--serif); font-size: clamp(18px, 5vw, 20px); line-height: 1.5; color: rgba(252, 244, 225, .92); font-variation-settings: "opsz" 18; max-width: 24rem; }
.fete-word .rule { margin-bottom: 6px; }
.fete-night { font-style: italic; font-size: 1.1em; color: var(--gold-200); }
.much { margin-top: 10px; font-style: italic; font-size: 14px; color: rgba(252, 244, 225, .7); letter-spacing: .02em; }
.fete-sign { font-style: italic; font-size: 1.35em; color: var(--gold-200); margin-top: -4px; font-variation-settings: "opsz" 48; }
.fete-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding-top: 4px; }

@media (max-width: 360px) {
  .nicks { gap: 10px 14px; }
  .candy { width: 48px; }
  .scene-fete { padding-top: calc(124px + env(safe-area-inset-top)); }
}
.rm .bulb, .rm .star { animation: none; }
.rm .nick.rv, .rm .nick.rv.is-in { transform: none; }

/* ==========================================================
   Accueil sonore (seulement si le son automatique est bloqué)
   ========================================================== */
.gate {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) var(--gutter) calc(24px + env(safe-area-inset-bottom));
  opacity: 0; visibility: hidden;
  transition: opacity .9s var(--ease), visibility 0s linear .9s;
}
.gate.is-shown { opacity: 1; visibility: visible; transition-delay: 0s; }
.gate.is-leaving { opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), visibility 0s linear .6s; }
.gate-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.gate-crown { width: 58px; height: 42px; filter: drop-shadow(0 6px 18px rgba(255, 200, 110, .35)); }
.gate-hint { font-size: 13.5px; color: rgba(246, 238, 221, .6); letter-spacing: .02em; }
.gate-crown { animation: gate-glow 3.2s ease-in-out infinite; }
@keyframes gate-glow { 50% { transform: translateY(-3px); filter: drop-shadow(0 8px 22px rgba(255, 200, 110, .55)); } }
.rm .gate-crown { animation: none; }
body.gated .sound, body.gated .nav { visibility: hidden; }
