/* =====================================================================
   LE GRIMOIRE DES 24 PORTES — feuille de style
   Identité : gravures dorées du pack graphique sur fond espresso,
   pages ivoire, lumière et profondeur.
   Palette : ivoire, espresso, brun, cuivre, or pâle.
   Les animations génériques du pack (float, glow, flip, reveal, dissolve,
   spin, flicker) sont dans css/animations.css. Les animations propres à
   l'application sont préfixées « g- » pour ne jamais les écraser.
   ===================================================================== */

:root {
  --ivory: #F5EDE1;
  --ivory-2: #FBF6EE;
  --brown: #4A3022;
  --brown-2: #5b3a25;
  --espresso: #22160F;
  --espresso-2: #170f0a;
  --copper: #A87443;
  --gold-pale: #E6C79A;
  --gold: #D9B47E;
  --ink: #3a2519;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.6, .05, .3, 1);
  --r: 6px;
  --nav-h: 66px;
  --top-h: 52px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.rm { scroll-behavior: auto; }
body {
  margin: 0; min-height: 100vh; font-family: var(--sans); font-size: 16.5px; line-height: 1.62; color: var(--ivory);
  background-color: var(--espresso);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(217, 180, 126, .14), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(168, 116, 67, .1), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 60%, rgba(74, 48, 34, .55), transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-pale); }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 7vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 5vw, 2.15rem); }
h3 { font-size: 1.35rem; margin-top: 1.2em; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }
.svg-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; }
.center { text-align: center; }
.small { font-size: .875rem; }
.muted { opacity: .72; }
.kicker { font-family: var(--sans); font-size: .72rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--copper); margin: 0 0 .7em; display: block; }
.display { font-size: clamp(2.4rem, 9vw, 4rem); font-weight: 500; color: var(--gold-pale); margin-bottom: .2em; }
.lead { font-family: var(--serif); font-size: 1.3rem; line-height: 1.45; }
.todo { border: 1px dashed var(--copper); color: var(--copper); background: rgba(168, 116, 67, .08); padding: .5em .8em; font-size: .82rem; border-radius: 4px; font-family: var(--sans); }
.appear { animation: g-appear .8s var(--ease) both; scroll-margin-top: calc(var(--top-h) + 16px); }
@keyframes g-appear { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Ornement du pack utilisé comme séparateur */
.divider { display: flex; align-items: center; justify-content: center; gap: 6px; width: 260px; max-width: 80%; margin: 10px auto 18px; }
.divider i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--copper)); }
.divider i:last-child { background: linear-gradient(90deg, var(--copper), transparent); }
.divider__orn { position: relative; width: 70px; height: 30px; overflow: hidden; flex: none; }
.divider__orn img { position: absolute; left: 0; top: -24.4px; width: 70px; }

#ambient { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.rm #ambient { display: none; }

/* ---------------------------------------------------------------
   Gravures (SVG dessinés dans le style du pack)
   --------------------------------------------------------------- */
.eng { overflow: visible; }
.eng .l { fill: none; stroke: var(--gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.eng .lt { fill: none; stroke: var(--gold); stroke-width: .6; stroke-linecap: round; }
.eng .ld { fill: none; stroke: var(--gold); stroke-width: .6; stroke-dasharray: 1 5; stroke-linecap: round; }
.eng .f { fill: var(--brown); stroke: var(--gold); stroke-width: 1.7; stroke-linejoin: round; }
.eng .f2 { fill: var(--brown-2); stroke: var(--gold); stroke-width: 1.7; stroke-linejoin: round; }
.eng .fd { fill: var(--espresso-2); stroke: var(--copper); stroke-width: 1.2; }
.eng .h { fill: url(#ghalo); stroke: none; }
.eng .gf { fill: var(--gold); }
.eng .nd { fill: var(--gold-pale); stroke: var(--gold); stroke-width: .4; }
.eng .paper { fill: var(--ivory); fill-opacity: .1; stroke: var(--gold); stroke-width: 1.2; }
.eng .glass { fill: rgba(245, 237, 225, .06); stroke: var(--gold); stroke-width: 1.7; stroke-linejoin: round; }
.eng .wax { fill: url(#gw); stroke: none; }
.eng .rib { fill: rgba(217, 180, 126, .22); stroke: var(--gold); stroke-width: 1.2; }
.svgtxt { font-family: var(--serif); font-size: 22px; fill: var(--gold-pale); }
.ico { display: block; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; user-select: none; }

/* Médaillon espresso : pour poser une gravure dorée sur une page ivoire */
.medal, .big-ico, .tmodal__ico {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 88px; height: 88px; padding: 8px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #4A3022, var(--espresso) 72%);
  box-shadow: 0 0 0 1px rgba(168, 116, 67, .75), 0 0 0 5px rgba(217, 180, 126, .12), 0 12px 24px -12px rgba(0, 0, 0, .7);
}
.big-ico { display: flex; width: 104px; height: 104px; margin: 0 auto 12px; }
.medal--lg { width: 112px; height: 112px; }
.medal--xl { width: 170px; height: 170px; padding: 6px; display: flex; margin: 0 auto 12px; }
.medal svg { width: 100%; height: 100%; }

/* ---------------------------------------------------------------
   Barre supérieure et navigation
   --------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: calc(var(--top-h) + env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; padding-top: env(safe-area-inset-top);
  background: linear-gradient(rgba(34, 22, 15, .96), rgba(34, 22, 15, .84));
  border-bottom: 1px solid rgba(217, 180, 126, .2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.topbar__brand { text-decoration: none; color: var(--gold-pale); }
.topbar__title { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; letter-spacing: .02em; }
.topbar__title em { font-weight: 400; }
.topbar__link { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: var(--gold); }

main { position: relative; z-index: 1; padding-bottom: calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); outline: none; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: linear-gradient(rgba(34, 22, 15, .92), #170f0a); border-top: 1px solid rgba(217, 180, 126, .28);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: rgba(245, 237, 225, .62); font-size: .64rem; letter-spacing: .04em; text-align: center; line-height: 1.15; padding: 4px 2px; }
.nav a.is-on { color: var(--gold-pale); }
.nav a.is-on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; background: var(--gold); border-radius: 2px; box-shadow: 0 0 10px var(--gold); }
.nav__ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.nav__badge { position: absolute; top: 6px; left: 54%; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--gold); color: var(--espresso); font-size: .62rem; font-weight: 500; line-height: 17px; text-align: center; }
.nav__badge:empty { display: none; }
.nav a.is-ping .nav__ico { animation: g-ping .9s var(--ease); }
@keyframes g-ping { 40% { transform: scale(1.45); color: var(--gold); filter: drop-shadow(0 0 8px var(--gold)); } }
@media (min-width: 900px) {
  .nav { top: 0; bottom: auto; left: auto; right: 16px; height: var(--top-h); width: auto; padding: 0; display: flex; gap: 4px; background: none; border: 0; backdrop-filter: none; }
  .nav a { flex-direction: row; gap: 7px; font-size: .78rem; padding: 0 10px; }
  .nav a.is-on::before { top: auto; bottom: 6px; left: 12px; right: 12px; }
  .nav__ico svg { width: 19px; height: 19px; }
  .nav__badge { top: 7px; left: 22px; }
  .topbar { justify-content: flex-start; }
  .topbar__link { margin-left: 22px; font-size: .7rem; opacity: .8; }
  main { padding-bottom: 60px; }
}

/* ---------------------------------------------------------------
   Pages, feuilles ivoire, boutons, champs
   --------------------------------------------------------------- */
.page { max-width: 760px; margin: 0 auto; padding: 26px 16px 20px; }
.page--wide { max-width: 1120px; }
.cal-head { text-align: center; margin-bottom: 24px; }
.greet { font-family: var(--serif); font-size: 1.4rem; font-style: italic; color: var(--gold-pale); margin-bottom: .3em; }

.sheet {
  position: relative; margin: 0 0 22px; padding: 26px 20px;
  background: var(--ivory-2);
  background-image: radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, .7), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(230, 199, 154, .3), transparent 60%);
  color: var(--ink); border-radius: var(--r);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(168, 116, 67, .35), inset 0 0 0 6px var(--ivory-2), inset 0 0 0 7px rgba(168, 116, 67, .22);
  scroll-margin-top: calc(var(--top-h) + 16px);
}
.sheet a { color: var(--copper); }
.sheet h2, .sheet h3 { color: var(--brown); }
.sheet--quiet { background: rgba(245, 237, 225, .05); color: var(--ivory); box-shadow: inset 0 0 0 1px rgba(217, 180, 126, .25); }
.sheet--quiet h2 { color: var(--gold-pale); font-size: 1.4rem; }
.sheet--quiet a { color: var(--gold); }
.sheet--warn { background: #f1dcc2; }
.letter-sheet { background-color: #fbf6ee; background-image: radial-gradient(ellipse at 0% 0%, rgba(230, 199, 154, .35), transparent 50%), radial-gradient(ellipse at 100% 100%, rgba(168, 116, 67, .15), transparent 50%); }
@media (min-width: 640px) { .sheet { padding: 34px 38px; } }
.result h2 { margin-top: .2em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 22px;
  border-radius: 40px; border: 1px solid transparent; cursor: pointer;
  font-family: var(--sans); font-size: .8rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; text-align: center; line-height: 1.25;
  transition: transform .2s, box-shadow .25s, background .25s, color .25s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn--gold { background: linear-gradient(135deg, #f1dbb0, var(--gold) 45%, var(--copper)); color: var(--espresso); box-shadow: 0 8px 24px -10px rgba(217, 180, 126, .8), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn--gold:hover { color: var(--espresso); box-shadow: 0 10px 30px -8px rgba(217, 180, 126, .95), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn--ghost { background: transparent; border-color: currentColor; color: var(--gold); }
.sheet .btn--ghost, .modal .btn--ghost { color: var(--copper); }
.btn--text { background: none; padding-left: 8px; padding-right: 8px; color: var(--gold); text-transform: none; letter-spacing: .02em; font-size: .95rem; }
.sheet .btn--text { color: var(--copper); }
.btn--danger { background: var(--brown); color: var(--ivory); border-color: var(--copper); }
.btn--danger:hover { background: var(--espresso); color: var(--gold-pale); }
.btn--del { color: #8a4b2a !important; }
.btn--big { min-height: 54px; padding: 14px 30px; font-size: .86rem; }
.btn.is-done { border-style: dashed; opacity: .8; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.row--center { justify-content: center; }

.field { width: 100%; padding: 12px 14px; border-radius: 4px; font: inherit; font-size: 1rem; color: var(--ink); background: rgba(255, 255, 255, .72); border: 1px solid rgba(168, 116, 67, .45); resize: vertical; }
.field:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px rgba(217, 180, 126, .35); background: #fff; }
.field::placeholder { color: #8a7260; opacity: .75; }
.field--inline { flex: 1 1 220px; width: auto; }
.field--script { font-family: var(--serif); font-size: 1.25rem; line-height: 1.5; font-style: italic; }
.field--lines { background-color: transparent; border-color: rgba(168, 116, 67, .3); background-image: linear-gradient(transparent calc(1.875rem - 1px), rgba(168, 116, 67, .25) 0); background-size: 100% 1.875rem; background-position: 0 12px; background-attachment: local; line-height: 1.875rem; }
.field--dark { background: rgba(0, 0, 0, .28); border-color: rgba(217, 180, 126, .45); color: var(--ivory); }
.field--dark:focus { background: rgba(0, 0, 0, .4); border-color: var(--gold); }
.field--dark::placeholder { color: var(--ivory); opacity: .45; }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--copper) 50%), linear-gradient(135deg, var(--copper) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
label { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip { padding: 7px 14px; border-radius: 30px; border: 1px solid rgba(168, 116, 67, .5); background: rgba(255, 255, 255, .5); color: var(--brown); font-size: .88rem; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.chip:hover { border-color: var(--copper); }
.chip.is-on { background: var(--brown); color: var(--gold-pale); border-color: var(--brown); }
.scene .chip { background: rgba(0, 0, 0, .25); color: var(--ivory); border-color: rgba(217, 180, 126, .4); }
.scene .chip.is-on { background: var(--gold-pale); color: var(--espresso); }
.chips--dark { justify-content: center; }
.grid2 { display: grid; gap: 16px; margin-top: 14px; }
@media (min-width: 600px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.intent { margin: .4em 0 1em; padding: .4em 0 .4em 1em; border-left: 2px solid var(--gold); font-family: var(--serif); font-size: 1.45rem; font-style: italic; line-height: 1.35; color: var(--brown); }
.defi { font-weight: 500; }
.q { padding: 14px 16px; background: rgba(217, 180, 126, .18); border-radius: 4px; font-family: var(--serif); font-size: 1.18rem; font-style: italic; }
.q span { display: block; font-family: var(--sans); font-style: normal; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--copper); margin-bottom: 4px; }
.msg { font-family: var(--serif); font-size: 1.3rem; line-height: 1.5; }
.note { margin: 18px 0 6px; padding: 14px 16px; border: 1px solid rgba(168, 116, 67, .4); border-radius: 4px; font-size: .92rem; background: rgba(255, 255, 255, .45); }
.note p:last-child { margin-bottom: 0; }
.scene .note { background: rgba(0, 0, 0, .2); border-color: rgba(217, 180, 126, .35); text-align: left; }
ul.stars, ol.steps, ul.feats { padding: 0; margin: 0 0 1em; list-style: none; }
ul.stars li, ul.feats li { position: relative; padding-left: 26px; margin-bottom: .6em; }
ul.stars li::before, ul.feats li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 10px; height: 10px; background: var(--copper); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
ol.steps { counter-reset: s; }
ol.steps li { counter-increment: s; position: relative; padding-left: 40px; margin-bottom: .8em; }
ol.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--copper); color: var(--copper); font-family: var(--serif); font-size: 1.05rem; font-weight: 600; text-align: center; line-height: 26px; }

/* ---------------------------------------------------------------
   LA SCÈNE : fond espresso, lumière, poussière d'or, cadre gravé
   --------------------------------------------------------------- */
.scene {
  position: relative; isolation: isolate; overflow: hidden; margin: 0 0 22px; padding: 30px 16px 26px; border-radius: 16px;
  background: radial-gradient(ellipse 120% 70% at 50% 0%, #3a2519 0%, var(--espresso) 58%, var(--espresso-2) 100%);
  box-shadow: 0 34px 60px -30px rgba(0, 0, 0, .95), inset 0 0 0 1px rgba(217, 180, 126, .38), inset 0 0 90px rgba(0, 0, 0, .55);
  color: var(--ivory); text-align: center; scroll-margin-top: calc(var(--top-h) + 16px);
}
@media (min-width: 640px) { .scene { padding: 38px 34px 32px; } }
.scene__light {
  position: absolute; left: 50%; top: 40%; z-index: -1; width: 150%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  transform: translate(-50%, -50%) scale(.62); opacity: .8;
  background: radial-gradient(circle, rgba(230, 199, 154, .22), rgba(168, 116, 67, .08) 34%, transparent 62%);
  transition: transform 1.8s var(--ease), opacity 1.8s; animation: g-breathe 7s ease-in-out infinite;
}
@keyframes g-breathe { 50% { opacity: .55; } }
.scene.is-lit .scene__light { transform: translate(-50%, -50%) scale(1); opacity: 1; background: radial-gradient(circle, rgba(255, 240, 210, .4), rgba(230, 199, 154, .16) 30%, transparent 62%); animation: none; }
.scene__frame { position: absolute; inset: 9px; z-index: 0; border: 1px solid rgba(217, 180, 126, .22); border-radius: 10px; pointer-events: none; }
.scene__frame i { position: absolute; width: 16px; height: 16px; background: var(--espresso-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1v14M1 8h14' stroke='%23D9B47E' stroke-width='1.2' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='8' r='2.2' fill='none' stroke='%23D9B47E' stroke-width='.8'/%3E%3C/svg%3E") center / 14px no-repeat; }
.scene__frame i:nth-child(1) { top: -8px; left: -8px; } .scene__frame i:nth-child(2) { top: -8px; right: -8px; }
.scene__frame i:nth-child(3) { bottom: -8px; left: -8px; } .scene__frame i:nth-child(4) { bottom: -8px; right: -8px; }
.scene__body { position: relative; z-index: 1; }
.scene .kicker { color: var(--gold); }
.scene__title { color: var(--gold-pale); font-weight: 500; }
.scene__hint { max-width: 540px; margin: 16px auto 0; font-size: .9rem; color: rgba(245, 237, 225, .74); }
.scene__hint b { color: var(--gold-pale); }
.dust { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.dust i { position: absolute; bottom: -8px; width: 3px; height: 3px; border-radius: 50%; background: #F6E3BC; box-shadow: 0 0 6px #E6C79A; opacity: 0; animation: g-mote var(--d) linear infinite; animation-delay: var(--w); }
@keyframes g-mote { 0% { opacity: 0; transform: translate(0, 0) scale(var(--s)); } 12% { opacity: var(--o); } 85% { opacity: calc(var(--o) * .5); } 100% { opacity: 0; transform: translate(26px, -520px) scale(var(--s)); } }

/* ---------------------------------------------------------------
   Compte à rebours, progression
   --------------------------------------------------------------- */
.countdown { text-align: center; margin: 18px auto; }
.cd { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; }
.cd span { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 10px 6px 8px; border: 1px solid rgba(217, 180, 126, .4); border-radius: 6px; background: rgba(0, 0, 0, .22); }
.cd b { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1; color: var(--gold-pale); }
.cd i { font-style: normal; font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
.progress { max-width: 420px; margin: 16px auto 0; }
.progress__bar { height: 6px; border-radius: 6px; background: rgba(245, 237, 225, .1); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(217, 180, 126, .25); }
.progress__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--copper), var(--gold-pale)); border-radius: 6px; transition: width 1s var(--ease); box-shadow: 0 0 12px rgba(230, 199, 154, .6); }
.progress__txt { margin: 8px 0 0; font-size: .9rem; color: var(--gold-pale); }
.progress__txt b { font-family: var(--serif); font-size: 1.25rem; }

/* ---------------------------------------------------------------
   Les 24 portes (illustrations du pack)
   --------------------------------------------------------------- */
.cabinet {
  position: relative; isolation: isolate; overflow: hidden; padding: 26px 12px 60px; border-radius: 18px;
  background: radial-gradient(ellipse 90% 40% at 50% 0%, rgba(217, 180, 126, .15), transparent 70%), linear-gradient(#2b1b12, #1b120c);
  box-shadow: inset 0 0 0 1px rgba(217, 180, 126, .32), inset 0 0 0 8px var(--espresso), inset 0 0 0 9px rgba(217, 180, 126, .16), inset 0 0 90px rgba(0, 0, 0, .6), 0 40px 80px -40px #000;
}
@media (min-width: 640px) { .cabinet { padding: 36px 30px 56px; } }
.doors { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 10px; }
.door { position: relative; animation: g-doorin .9s var(--ease) both; animation-delay: calc(var(--i) * 35ms); }
.door:nth-child(3n+2) { top: 20px; }
@keyframes g-doorin { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@media (min-width: 640px) {
  .doors { grid-template-columns: repeat(4, 1fr); gap: 40px 22px; }
  .door:nth-child(3n+2) { top: 0; }
  .door:nth-child(even) { top: 26px; }
}
@media (min-width: 1000px) { .doors { grid-template-columns: repeat(6, 1fr); gap: 50px 26px; } }
.door__btn { display: block; width: 100%; padding: 0; background: none; border: 0; cursor: pointer; }
.door__stage { position: relative; display: block; aspect-ratio: 160 / 180; }
.door__stage::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -6%; height: 10%; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .55), transparent 70%); z-index: -1; }
.door__inside {
  position: absolute; left: 8.75%; right: 8.75%; bottom: 3.3%; top: 6.6%; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(circle at 50% 46%, rgba(255, 236, 200, .55) 0, #A87443 26%, #4A3022 62%, #1b120c 100%);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .7);
}
.door--ogive .door__inside { top: 4.4%; clip-path: polygon(0 100%, 0 34%, 12% 18%, 50% 0, 88% 18%, 100% 34%, 100% 100%); }
.door--rect .door__inside { top: 11%; }
.door--arche .door__inside { border-radius: 50% 50% 0 0 / 30% 30% 0 0; }
.door--locked .door__inside { visibility: hidden; }
.door__light { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255, 246, 225, .65), transparent 55%); animation: g-pulse 3s ease-in-out infinite; }
@keyframes g-pulse { 50% { opacity: .45; } }
.door__treasure { position: relative; width: 74%; height: auto; filter: brightness(1.25) drop-shadow(0 0 6px rgba(255, 230, 180, .7)); }
.door__leaf.grimoire-door { position: absolute; inset: 0; display: block; }
.door__img { filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .55)); }
.door--available .door__img { animation: g-doorglow 4s ease-in-out infinite; }
@keyframes g-doorglow { 50% { filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .55)) drop-shadow(0 0 10px rgba(230, 199, 154, .45)); } }
.door--locked .door__img { filter: grayscale(.45) brightness(.5) drop-shadow(0 8px 10px rgba(0, 0, 0, .5)); }
.door__btn:hover .grimoire-door:not(.open) img, .door__btn:focus-visible .grimoire-door:not(.open) img { transform: rotateY(-18deg); }
.door--locked .door__btn:hover .grimoire-door img { transform: rotateY(-3deg); }
.door__seal { position: absolute; right: 2%; bottom: 14%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--espresso); box-shadow: 0 0 0 1px rgba(217, 180, 126, .55); color: var(--gold); }
.door__seal svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.door__tag { display: block; margin-top: 10px; font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); white-space: nowrap; text-align: center; }
.door--locked .door__tag { color: rgba(245, 237, 225, .42); }
.door--today .door__stage::before { content: ""; position: absolute; inset: -16% -18% -8%; z-index: -1; border-radius: 50%; background: radial-gradient(ellipse at 50% 50%, rgba(230, 199, 154, .42), transparent 64%); animation: g-pulse 2.4s ease-in-out infinite; }
.door--today .door__tag { color: var(--gold-pale); font-weight: 500; }
.door--explored .door__tag { color: var(--gold-pale); }
.door.is-opening .door__inside { animation: g-flood 1s ease-in forwards; }
@keyframes g-flood { to { box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 0 60px 24px rgba(255, 236, 200, .75); } }
.door.is-shake .door__stage { animation: g-shake .5s; }
@keyframes g-shake { 20%, 60% { transform: translateX(-5px) rotate(-1deg); } 40%, 80% { transform: translateX(5px) rotate(1deg); } }
.cal-foot { max-width: 560px; margin: 30px auto 0; color: rgba(245, 237, 225, .72); }
.install { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; max-width: 560px; margin: 22px auto 0; padding: 16px 44px 16px 16px; border-radius: 14px; background: linear-gradient(160deg, #3a2519, var(--espresso)); box-shadow: inset 0 0 0 1px rgba(217, 180, 126, .45), 0 20px 40px -24px #000; text-align: left; }
.install img { width: 52px; height: 52px; border-radius: 12px; flex: none; }
.install__txt { flex: 1 1 180px; display: flex; flex-direction: column; }
.install__txt b { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--gold-pale); line-height: 1.2; }
.install__txt span { font-size: .85rem; color: rgba(245, 237, 225, .75); }
.install .btn { min-height: 40px; padding: 8px 18px; }
.install__x { position: absolute; top: 6px; right: 8px; width: 34px; height: 34px; border: 0; background: none; color: var(--gold); font-size: 1.5rem; line-height: 1; cursor: pointer; }

/* ---------------------------------------------------------------
   En-tête d'une porte
   --------------------------------------------------------------- */
.day-head { text-align: center; padding: 6px 0 22px; }
.day-head__seal { width: 96px; height: 108px; margin: 0 auto 10px; filter: drop-shadow(0 0 16px rgba(230, 199, 154, .35)); animation: float 3s ease-in-out infinite; }
.day-head h1 { color: var(--gold-pale); font-weight: 500; }
.day-head .lead { max-width: 600px; margin: 0 auto; color: var(--ivory); }
.got { display: inline-flex; align-items: center; gap: 10px; margin: 16px auto 0; padding: 6px 16px 6px 6px; border-radius: 30px; background: rgba(217, 180, 126, .1); border: 1px solid rgba(217, 180, 126, .35); font-size: .85rem; color: var(--gold-pale); text-align: left; }
.got span { width: 30px; height: 34px; flex: none; }
.day-nav { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 30px; padding-top: 18px; border-top: 1px solid rgba(217, 180, 126, .2); }
.day-nav .btn { padding-left: 10px; padding-right: 10px; font-size: .72rem; }
.day-nav .btn--text { font-size: .9rem; }

/* Offre */
.offer {
  position: relative; margin: 30px 0 26px; padding: 34px 20px 24px; border-radius: var(--r); text-align: left;
  background: linear-gradient(160deg, #3a2519, var(--espresso)); color: var(--ivory);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(217, 180, 126, .55), inset 0 0 0 6px #2b1b12, inset 0 0 0 7px rgba(217, 180, 126, .25);
  scroll-margin-top: calc(var(--top-h) + 16px);
}
@media (min-width: 640px) { .offer { padding: 38px 38px 28px; } }
.offer__seal { position: absolute; top: -30px; right: 20px; width: 60px; height: 66px; padding: 4px; border-radius: 50%; background: var(--espresso); box-shadow: 0 0 0 1px rgba(217, 180, 126, .6), 0 0 20px rgba(230, 199, 154, .2); }
.offer__name { font-size: 1.8rem; color: var(--gold-pale); font-weight: 500; }
.offer__name small { display: block; margin-top: 4px; font-family: var(--sans); font-size: .7rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.offer__short { font-family: var(--serif); font-size: 1.2rem; font-style: italic; color: var(--gold-pale); }
.offer__price { display: inline-block; margin: 4px 0 6px; font-family: var(--serif); font-size: 1.9rem; font-weight: 600; color: var(--gold); }
.offer__price s { opacity: .55; font-size: .7em; margin-right: 6px; }
.offer__price small { font-family: var(--sans); font-size: .78rem; font-weight: 400; color: var(--ivory); opacity: .8; }
.promo { margin: 4px 0 0; padding: 10px 14px; border: 1px dashed rgba(217, 180, 126, .6); border-radius: 4px; font-size: .9rem; }
.promo__code { font-family: var(--sans); letter-spacing: .16em; color: var(--gold-pale); }
.offer .todo, .product .todo { color: var(--gold); border-color: var(--gold); }

/* ---------------------------------------------------------------
   Coffre magique
   --------------------------------------------------------------- */
.chest-wrap { margin: 0 auto 24px; padding: 22px 14px; max-width: 820px; border-radius: 16px; background: linear-gradient(#3a2519, #22160F); box-shadow: var(--shadow), inset 0 0 0 1px rgba(217, 180, 126, .45), inset 0 0 0 8px #2b1b12, inset 0 0 0 9px rgba(217, 180, 126, .22), inset 0 0 60px rgba(0, 0, 0, .55); }
.slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 600px) { .slots { grid-template-columns: repeat(6, 1fr); gap: 14px; } }
.slot { position: relative; width: 100%; aspect-ratio: 160 / 180; padding: 4%; border-radius: 12px; cursor: pointer; background: radial-gradient(circle at 50% 42%, rgba(217, 180, 126, .14), rgba(0, 0, 0, .4)); border: 1px solid rgba(217, 180, 126, .25); box-shadow: inset 0 3px 12px rgba(0, 0, 0, .6); transition: transform .25s, box-shadow .25s; }
.slot__ico { display: block; width: 100%; height: 100%; }
.slot--on .slot__ico { filter: drop-shadow(0 0 6px rgba(230, 199, 154, .45)); }
.slot--on:hover { transform: translateY(-3px); box-shadow: inset 0 3px 12px rgba(0, 0, 0, .6), 0 0 18px rgba(230, 199, 154, .3); }
.slot--off .slot__ico { filter: grayscale(1) brightness(.4) opacity(.35); }
.slot__n { position: absolute; bottom: 3px; right: 8px; font-family: var(--serif); font-size: .82rem; color: var(--gold); opacity: .75; }

/* ---------------------------------------------------------------
   Pages secrètes, données
   --------------------------------------------------------------- */
.spage { position: relative; margin: 0 0 18px; padding: 22px 20px 14px; border-radius: var(--r); background: var(--ivory-2); color: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1px rgba(168, 116, 67, .35); }
.spage::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; background: linear-gradient(var(--gold), var(--copper)); border-radius: 6px 0 0 6px; }
.spage h2 { font-size: 1.45rem; color: var(--brown); }
.spage__text { font-family: var(--serif); font-size: 1.15rem; line-height: 1.5; overflow-wrap: anywhere; }
.spage footer { border-top: 1px solid rgba(168, 116, 67, .2); padding-top: 6px; margin-top: 12px; }
.spage footer .small { margin-left: auto; }
.spage__sealed { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.spage__sealed p { margin: 0; font-style: italic; }
.wax { width: 46px; height: 46px; display: block; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid rgba(168, 116, 67, .5); border-radius: 30px; overflow: hidden; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 9px 16px; font-size: .85rem; }
.seg input:checked + span { background: var(--brown); color: var(--gold-pale); }
.seg input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: -3px; }

/* ---------------------------------------------------------------
   Boutique
   --------------------------------------------------------------- */
.products { display: grid; gap: 22px; }
@media (min-width: 800px) { .products { grid-template-columns: 1fr 1fr; } .product--feat { grid-column: 1 / -1; } }
.product { display: flex; flex-direction: column; gap: 16px; padding: 26px 22px; border-radius: var(--r); background: linear-gradient(160deg, #3a2519, var(--espresso)); box-shadow: var(--shadow), inset 0 0 0 1px rgba(217, 180, 126, .5), inset 0 0 0 6px #2b1b12, inset 0 0 0 7px rgba(217, 180, 126, .2); }
.product__art { width: 92px; height: 104px; flex: none; filter: drop-shadow(0 0 14px rgba(230, 199, 154, .3)); }
.product h2 { color: var(--gold-pale); font-weight: 500; }
.product--feat { background: radial-gradient(ellipse at 20% 0%, rgba(217, 180, 126, .16), transparent 60%), linear-gradient(150deg, #4A3022, var(--espresso) 70%); }
@media (min-width: 640px) { .product { flex-direction: row; padding: 30px 32px; } }

/* Grimoire de mon foyer */
.foyer-book { max-width: 240px; margin: 0 auto 10px; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .6)); animation: float 4s ease-in-out infinite; }
.foyer-book--open { max-width: 380px; }
.book-svg { display: block; width: 100%; height: auto; }
.hints { list-style: none; padding: 0; margin: 10px 0 0; }
.hint { padding: 14px 0; border-top: 1px solid rgba(168, 116, 67, .25); }
.hint__n { display: block; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--copper); }
.hint p { margin: 2px 0 0; font-family: var(--serif); font-size: 1.22rem; font-style: italic; }
.foyer-pres { text-align: center; }
.foyer-pres .feats { text-align: left; max-width: 520px; margin: 0 auto 1em; }
.sheet .offer__price { color: var(--copper); }
.sheet .promo__code { color: var(--brown); }

/* ---------------------------------------------------------------
   Fenêtres, toast, trésor gagné, éclats
   --------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .25s; }
.modal.is-on { opacity: 1; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15, 9, 6, .8); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal__box { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; padding: 30px 22px 22px; border-radius: 8px; background: var(--ivory-2); color: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1px rgba(168, 116, 67, .4); transform: translateY(16px) scale(.98); transition: transform .3s var(--ease); }
.modal.is-on .modal__box { transform: none; }
.modal__title { color: var(--brown); font-size: 1.7rem; padding-right: 30px; }
.modal__x { position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border: 0; background: none; font-size: 1.8rem; line-height: 1; color: var(--copper); cursor: pointer; }
.modal__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal--card .modal__box { max-width: 560px; }
.cardprev img { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); margin-bottom: 6px; }
.modal--treasure .modal__box { text-align: center; }
.tmodal__ico { display: flex; width: 130px; height: 130px; margin: 0 auto 12px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 120; transform: translate(-50%, 20px); max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 30px; background: var(--ivory-2); color: var(--ink); font-size: .92rem; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(168, 116, 67, .4); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

.gain { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(circle at 50% 45%, rgba(58, 37, 25, .9), rgba(15, 9, 6, .95) 65%); opacity: 0; transition: opacity .35s; }
.gain.is-on { opacity: 1; }
.gain__rays { position: absolute; width: 900px; height: 900px; left: 50%; top: 50%; margin: -450px 0 0 -450px; background: repeating-conic-gradient(from 0deg, rgba(230, 199, 154, .13) 0 5deg, transparent 5deg 16deg); -webkit-mask: radial-gradient(circle, #000 10%, transparent 60%); mask: radial-gradient(circle, #000 10%, transparent 60%); animation: g-rot 32s linear infinite; }
@keyframes g-rot { to { transform: rotate(360deg); } }
.gain__box { position: relative; max-width: 380px; text-align: center; transform: scale(.85); transition: transform .5s var(--ease); }
.gain.is-on .gain__box { transform: none; }
.gain__icon { width: 170px; height: 190px; margin: 6px auto 14px; filter: drop-shadow(0 0 26px rgba(230, 199, 154, .6)); animation: float 3s ease-in-out infinite; }
.gain h2 { color: var(--gold-pale); font-weight: 500; font-size: 2.2rem; }
.gain__meaning { font-family: var(--serif); font-size: 1.2rem; font-style: italic; color: var(--ivory); }
.gain.is-leaving .gain__icon { visibility: hidden; }
.gain__fly { position: fixed; z-index: 130; pointer-events: none; transition: transform .8s var(--ease), opacity .8s; }

.burst { position: fixed; z-index: 140; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle, #fff7e6, #E6C79A 50%, transparent 70%); transform: scale(var(--s)); animation: g-dust var(--d) cubic-bezier(.2, .7, .3, 1) forwards; }
.burst i:nth-child(3n) { background: none; width: 12px; height: 12px; left: -6px; top: -6px; border-radius: 0; }
.burst i:nth-child(3n)::before { content: ""; position: absolute; left: 5px; top: 0; width: 1.5px; height: 12px; background: #F6E3BC; }
.burst i:nth-child(3n)::after { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 1.5px; background: #F6E3BC; }
@keyframes g-dust { 0% { opacity: 1; transform: translate(0, 0) scale(var(--s)); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(.2); } }

/* ---------------------------------------------------------------
   Introduction
   --------------------------------------------------------------- */
.intro { position: fixed; inset: 0; z-index: 90; overflow-y: auto; background: radial-gradient(ellipse at 50% 30%, #3a2519, var(--espresso) 70%); transition: opacity .6s; }
.intro.is-leaving { opacity: 0; }
.intro__stage { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 30px 16px; perspective: 1600px; }
.tome { position: relative; width: 100%; max-width: 480px; }
.tome__page { position: relative; padding: 38px 24px 30px; border-radius: 4px 10px 10px 4px; text-align: center; color: var(--ink); background: var(--ivory-2); background-image: radial-gradient(ellipse at 0% 50%, rgba(168, 116, 67, .22), transparent 30%), radial-gradient(ellipse at 50% 0%, #fff, transparent 60%); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(168, 116, 67, .35), inset 0 0 0 7px var(--ivory-2), inset 0 0 0 8px rgba(168, 116, 67, .25); opacity: 0; transition: opacity .9s .4s; }
.tome.is-open .tome__page { opacity: 1; }
@media (min-width: 600px) { .tome__page { padding: 50px 50px 36px; } }
.intro__title { font-size: clamp(2.5rem, 11vw, 3.6rem); font-weight: 500; color: var(--brown); line-height: 1; margin: .1em 0 .2em; }
.intro__title em { font-weight: 400; font-size: .7em; }
.intro__sub { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--copper); }
.intro__txt { font-size: .98rem; }
.intro__form { margin: 20px 0 10px; display: grid; gap: 10px; text-align: left; }
.intro__form label { font-size: .9rem; font-weight: 500; }
.intro__form label span { font-weight: 400; opacity: .7; }
.intro__form .btn { margin-top: 6px; }
.intro__note { font-size: .8rem; opacity: .7; margin: 0; }
.tome__cover { position: absolute; inset: 0; z-index: 2; padding: 0; border: 0; cursor: pointer; border-radius: 4px 12px 12px 4px; transform-origin: 0 50%; background: radial-gradient(ellipse at 50% 35%, #5b3a25, #3a2519 55%, #22160F); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9), inset 0 0 0 2px rgba(217, 180, 126, .6), inset 0 0 0 12px #3a2519, inset 0 0 0 13px rgba(217, 180, 126, .45), inset 8px 0 18px rgba(0, 0, 0, .5); transition: transform 1.6s var(--ease), opacity .5s 1.2s; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.tome.is-open .tome__cover { transform: rotateY(-170deg); opacity: 0; pointer-events: none; }
.tome__coverin { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; height: 100%; padding: 30px; }
.tome__orn { width: 120px; height: 135px; filter: drop-shadow(0 0 18px rgba(230, 199, 154, .55)); animation: float 4s ease-in-out infinite; }
.tome__ctitle { font-family: var(--serif); font-size: clamp(2.4rem, 10vw, 3.2rem); font-weight: 600; line-height: 1; color: transparent; background: linear-gradient(135deg, #F6E3BC, #D9B47E 50%, #A87443); -webkit-background-clip: text; background-clip: text; text-align: center; }
.tome__ctitle em { font-weight: 400; font-size: .7em; }
.tome__hint { font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); opacity: .8; animation: g-pulse 2s ease-in-out infinite; }

/* Barre de prévisualisation (locale uniquement) */
#preview-bar { position: relative; z-index: 200; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 14px; background: var(--copper); color: var(--espresso); font-size: .8rem; }
#preview-bar form { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
#preview-bar input, #preview-bar button { font-size: .78rem; padding: 4px 8px; border-radius: 4px; border: 1px solid rgba(34, 22, 15, .5); background: rgba(255, 255, 255, .25); color: var(--espresso); cursor: pointer; }
@media (min-width: 900px) { #preview-bar { position: fixed; left: 0; right: 0; bottom: 0; } }

/* =================================================================
   SCÈNES DES 24 PORTES
   ================================================================= */

/* PORTE 1 — Serrure et clés */
.d1-lock { position: relative; width: 120px; margin: 0 auto 10px; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .55)); transition: filter 1s; }
.d1-lock svg { display: block; width: 100%; height: auto; }
.d1-hole { position: absolute; left: 50%; top: 47%; width: 4px; height: 4px; }
.scene--keys.is-lit .d1-lock { filter: drop-shadow(0 0 26px rgba(255, 230, 180, .75)); }
.scene--keys.is-lit .d1-lock .fd { fill: #F6E3BC; transition: fill .8s; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.keybtn { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px; background: none; border: 1px solid transparent; border-radius: 12px; cursor: pointer; color: var(--ivory); transition: border-color .3s, background .3s; }
.keybtn:hover { background: rgba(217, 180, 126, .05); }
.keybtn__svg { position: relative; z-index: 3; width: 50px; height: 134px; display: block; transform-origin: 50% 86%; transition: transform .8s var(--ease), filter .4s; animation: g-sway 5s ease-in-out infinite; }
.keybtn:nth-child(2) .keybtn__svg { animation-delay: -1.6s; }
.keybtn:nth-child(3) .keybtn__svg { animation-delay: -3.2s; }
@keyframes g-sway { 50% { transform: rotate(3deg) translateY(-3px); } }
.keybtn__svg svg { width: 100%; height: 100%; }
.keybtn__name { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: var(--gold-pale); line-height: 1.1; }
.keybtn__tag { font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); opacity: .8; }
.keybtn.is-chosen { border-color: rgba(217, 180, 126, .4); background: rgba(217, 180, 126, .06); }
.keybtn.is-going .keybtn__svg { animation: none; transform: translate(var(--tx), var(--ty)) scale(.62); filter: drop-shadow(0 0 10px rgba(255, 230, 180, .8)); }
.keybtn.is-turned .keybtn__svg { transform: translate(var(--tx), var(--ty)) rotate(90deg) scale(.62); }

/* PORTE 2 — Divination */
.game__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.game__top .kicker { margin: 0; }
.pips { display: flex; gap: 6px; }
.pips i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--gold); }
.pips i.hit { background: var(--gold-pale); box-shadow: 0 0 8px var(--gold); }
.pips i.miss { background: rgba(168, 116, 67, .35); }
.game__q { font-family: var(--serif); font-size: 1.45rem; line-height: 1.3; color: var(--gold-pale); }
.mystery { position: relative; width: 104px; height: 104px; margin: 0 auto 18px; perspective: 600px; }
.mystery__seal, .mystery__ans { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .8s var(--ease); }
.mystery__seal { background: radial-gradient(circle at 35% 30%, #C48A52, #6b4429 70%); color: var(--ivory-2); font-family: var(--serif); font-size: 2.6rem; box-shadow: 0 0 0 4px rgba(107, 68, 41, .5), 0 10px 22px -6px rgba(0, 0, 0, .7); animation: g-pulse 2.6s ease-in-out infinite; }
.mystery__ans { transform: rotateY(180deg); background: radial-gradient(circle, #4A3022, var(--espresso)); box-shadow: 0 0 0 1px var(--gold), 0 0 24px rgba(230, 199, 154, .45); padding: 10px; }
.mystery.is-open .mystery__seal { transform: rotateY(-180deg); }
.mystery.is-open .mystery__ans { transform: none; }
.mystery__ans svg, .mystery__ans img { width: 100%; height: 100%; }
.guesses { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .guesses { grid-template-columns: repeat(4, 1fr); } }
.guess { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; background: rgba(0, 0, 0, .22); border: 1px solid rgba(217, 180, 126, .3); border-radius: 12px; cursor: pointer; transition: transform .25s, box-shadow .3s, border-color .3s; perspective: 600px; }
.guess:not([disabled]):hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .8), 0 0 16px rgba(230, 199, 154, .2); }
.guess__art { width: 70px; height: 78px; display: block; transition: transform .7s var(--ease); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.guesses--find .guess__art { height: 96px; }
.guess__art svg { width: 100%; height: 100%; }
.guess__label { font-size: .8rem; color: var(--gold-pale); }
.guess__back { position: absolute; top: 12px; left: 50%; width: 70px; height: 96px; margin-left: -35px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: radial-gradient(circle, #4A3022, var(--espresso)); box-shadow: inset 0 0 0 1px var(--gold); transform: rotateY(180deg); backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .7s var(--ease); padding: 6px; }
.guess__empty { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); opacity: .6; }
.guess.is-flipped .guess__art { transform: rotateY(-180deg); }
.guess.is-flipped .guess__back { transform: none; }
.guess.is-picked { border-color: var(--ivory); }
.guess.is-answer { border-color: var(--gold-pale); box-shadow: 0 0 0 1px var(--gold-pale), 0 0 22px rgba(230, 199, 154, .5); }
.guess[disabled] { cursor: default; }
.game__fb { margin-top: 18px; min-height: 1.6em; font-family: var(--serif); font-size: 1.25rem; color: var(--gold-pale); }
.game__fb .muted { font-size: 1rem; color: var(--ivory); }
.game__fb .btn { margin-top: 12px; font-family: var(--sans); }
.scene .result h2 { color: var(--gold-pale); }

/* PORTE 3 — Cartes d'oracle */
.flipcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 520px; margin: 0 auto; padding: 14px 0 6px; }
.ocard { padding: 0; background: none; border: 0; cursor: pointer; perspective: 1000px; aspect-ratio: 2 / 3; transition: transform .5s var(--ease); }
.ocard:nth-child(1) { transform: rotate(-7deg) translateY(8px); }
.ocard:nth-child(3) { transform: rotate(7deg) translateY(8px); }
.ocard:not(.is-flipped):hover { transform: translateY(-10px); }
.flip__in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1s var(--ease); }
.ocard.is-flipped { transform: none; }
.ocard.is-flipped .flip__in { transform: rotateY(180deg); }
.flip__back, .flip__front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 9px; }
.flip__back svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .6)); }
.flip__front { transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; background: radial-gradient(circle at 50% 40%, #4A3022, var(--espresso) 80%); box-shadow: inset 0 0 0 1.5px var(--gold), inset 0 0 0 6px var(--espresso), inset 0 0 0 7px rgba(217, 180, 126, .45), 0 0 30px rgba(230, 199, 154, .35); }
.flip__ico { width: 78%; height: 62%; }
.flip__t { font-family: var(--serif); font-size: clamp(.95rem, 3.6vw, 1.3rem); font-weight: 600; color: var(--gold-pale); text-align: center; line-height: 1.1; }

/* PORTE 4 — Carte des territoires */
.d4-map { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1; margin: 6px auto 4px; }
.d4-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.d4-svg .l { stroke-width: .7; }
.d4-svg .lt { stroke-width: .3; }
.d4-svg .ld { stroke-width: .3; stroke-dasharray: .5 1.8; opacity: .7; }
.d4-needle { transform-origin: 50px 50px; transition: transform 1.2s cubic-bezier(.3, 1.6, .4, 1); }
.d4-path { fill: none; stroke: var(--gold-pale); stroke-width: .45; stroke-dasharray: 1 1.4; animation: g-march 1.6s linear infinite; }
.d4-link { fill: rgba(217, 180, 126, .07); stroke: var(--gold); stroke-width: .25; stroke-dasharray: .4 1; }
@keyframes g-march { to { stroke-dashoffset: -4.8; } }
.terr__t { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 76px; margin: -28px 0 0 -38px; padding: 0; background: none; border: 0; cursor: pointer; color: var(--gold-pale); }
.terr__m { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: radial-gradient(circle, #4A3022, var(--espresso)); box-shadow: 0 0 0 1px rgba(217, 180, 126, .55), 0 0 0 4px rgba(34, 22, 15, .8), 0 0 0 5px rgba(217, 180, 126, .2); transition: transform .3s var(--ease), box-shadow .4s, background .4s; }
.terr__m svg { width: 26px; height: 26px; fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.terr__t b { font-family: var(--serif); font-size: .98rem; font-weight: 600; line-height: 1; text-shadow: 0 2px 6px #000; }
.terr__t:hover .terr__m { transform: scale(1.08); }
.terr__t.is-on .terr__m { background: radial-gradient(circle, #fff0d2, #D9B47E 55%, #A87443); box-shadow: 0 0 0 1px var(--gold-pale), 0 0 22px rgba(255, 230, 180, .7); transform: scale(1.1); }
.terr__t.is-on .terr__m svg { stroke: var(--espresso); }
@media (min-width: 560px) { .terr__m { width: 58px; height: 58px; } .terr__t { width: 90px; margin: -34px 0 0 -45px; } .terr__t b { font-size: 1.1rem; } }
.d4-legend { min-height: 1.6em; margin: 10px 0 0; font-family: var(--serif); font-size: 1.15rem; color: var(--ivory); }
.d4-legend b { color: var(--gold-pale); }
.qblock { margin: 18px 0; }
.qblock__q { font-family: var(--serif); font-size: 1.22rem; line-height: 1.4; margin-bottom: 8px; color: var(--brown); }
.qnum { display: inline-flex; width: 26px; height: 26px; margin-right: 8px; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--copper); font-size: .95rem; color: var(--copper); vertical-align: 2px; }
.qblock--final { padding-top: 14px; border-top: 1px dashed rgba(168, 116, 67, .4); }

/* PORTE 5 — Bougie */
.candle-scene { position: relative; display: flex; justify-content: center; padding: 20px 0 6px; transition: padding 1s var(--ease); }
.candle { position: relative; width: 150px; }
.candle__svg { position: relative; display: block; width: 100%; height: auto; z-index: 1; filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .6)); }
.candle__svg .wax { fill: rgba(245, 237, 225, .08); stroke: var(--gold); stroke-width: 1.7; }
.candle__halo { position: absolute; left: 50%; top: 4px; width: 340px; height: 340px; margin: -150px 0 0 -170px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 230, 180, .6), rgba(217, 180, 126, .16) 38%, transparent 66%); opacity: 0; transform: scale(.4); transition: opacity 1.4s, transform 1.6s var(--ease); pointer-events: none; }
.candle__flame { position: absolute; z-index: 2; left: 50%; top: 0; width: 20px; height: 40px; margin-left: -10px; transform-origin: 50% 100%; transform: scale(0); transition: transform .8s var(--ease) .2s; }
.candle__flame i, .candle__flame::before { content: ""; position: absolute; inset: 0; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; }
.candle__flame::before { background: radial-gradient(ellipse at 50% 75%, #fff 0, #fbecc8 25%, #E6C79A 52%, rgba(168, 116, 67, 0) 75%); animation: g-flame 1.6s ease-in-out infinite; }
.candle__flame i { inset: 40% 30% 6%; background: radial-gradient(ellipse at 50% 70%, #fff, rgba(255, 255, 255, 0) 70%); animation: g-flame 1.1s ease-in-out infinite reverse; }
@keyframes g-flame { 0%, 100% { transform: scale(1) rotate(-1deg); } 25% { transform: scale(1.05, .95) rotate(1.5deg); } 50% { transform: scale(.96, 1.06) rotate(-2deg); } 75% { transform: scale(1.02, .98) rotate(1deg); } }
.candle__text { position: absolute; left: 50%; top: -14px; z-index: 3; width: min(310px, 78vw); transform: translate(-50%, -100%); margin: 0; font-family: var(--serif); font-size: 1.3rem; font-style: italic; line-height: 1.35; color: var(--gold-pale); text-shadow: 0 0 14px rgba(255, 210, 140, .55); opacity: 0; transition: opacity 1.4s .8s; }
.candle-scene.is-lit { padding-top: 140px; }
.candle-scene.is-lit .candle__flame { transform: scale(1); }
.candle-scene.is-lit .candle__halo { opacity: 1; transform: scale(1); }
.candle-scene.is-lit .candle__text { opacity: 1; }
.d5-form { max-width: 520px; margin: 18px auto 0; text-align: left; }

/* PORTE 6 — Mots cachés */
.d6-quill { width: 80px; height: 90px; margin: -8px auto 6px; filter: drop-shadow(0 0 14px rgba(230, 199, 154, .45)); }
.ws-board { padding: 16px 10px 10px; border-radius: 8px; background: var(--ivory-2); background-image: radial-gradient(ellipse at 0% 0%, rgba(230, 199, 154, .4), transparent 50%), radial-gradient(ellipse at 100% 100%, rgba(168, 116, 67, .2), transparent 50%); color: var(--ink); box-shadow: 0 20px 40px -20px #000, inset 0 0 0 1px rgba(168, 116, 67, .45), inset 0 0 0 5px var(--ivory-2), inset 0 0 0 6px rgba(168, 116, 67, .25); }
.ws { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 1px; max-width: 470px; margin: 0 auto 10px; user-select: none; -webkit-user-select: none; touch-action: none; }
.ws.is-miss { animation: g-shake .4s; }
.ws__c { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; font-family: var(--serif); font-size: clamp(.95rem, 4vw, 1.3rem); font-weight: 600; color: var(--brown); border-radius: 50%; cursor: pointer; transition: background .15s, color .15s; }
.ws__c.is-sel { background: var(--brown); color: var(--gold-pale); }
.ws__c.is-found { color: var(--espresso); }
.ws__c.f0 { background: #E6C79A; } .ws__c.f1 { background: #e9d6b8; } .ws__c.f2 { background: #d8b98f; } .ws__c.f3 { background: #f0dfc4; } .ws__c.f4 { background: #d1a978; } .ws__c.f5 { background: #ecd2a8; }
.ws__c.is-hint { box-shadow: 0 0 0 2px var(--copper); animation: g-pulse 1s ease-in-out infinite; }
.ws-board .small { color: var(--ink); opacity: .7; }
.ws__list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-family: var(--serif); font-size: 1.1rem; }
.ws__list li.is-found { text-decoration: line-through; text-decoration-color: var(--copper); opacity: .5; }
.ws-board .btn--text { color: var(--copper); }
.mean { border-left: 4px solid var(--gold); }
.mean h3 { margin-top: 0; font-size: 1.7rem; }

/* PORTE 7 — Coffret */
.giftbox-scene { display: flex; justify-content: center; padding: 10px 0 6px; }
.giftbox { position: relative; width: 250px; padding: 0; background: none; border: 0; cursor: pointer; }
.giftbox svg { position: relative; z-index: 1; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .6)); }
.gb-lid { transition: transform 1.1s var(--ease) .1s; transform-origin: 120px 104px; }
.gb-ribbon, .gb-lid .rib, .gb-base .rib { transition: opacity .8s; }
.giftbox__bow { position: absolute; z-index: 2; left: 50%; top: 10%; width: 108px; height: 122px; margin-left: -54px; filter: drop-shadow(0 0 10px rgba(230, 199, 154, .5)); animation: g-bow 2.4s ease-in-out infinite; }
@keyframes g-bow { 50% { transform: scale(1.06) rotate(-2deg); } }
.giftbox__light { position: absolute; left: 50%; top: 46%; width: 10px; height: 10px; border-radius: 50%; z-index: 0; transition: box-shadow 1.4s; }
.giftbox__hint { display: block; margin-top: 8px; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); animation: g-pulse 2s ease-in-out infinite; }
.giftbox.is-untie .giftbox__bow.dissolve { animation: dissolve 1s ease forwards; }
.giftbox.is-untie .rib, .giftbox.is-untie .gb-ribbon { opacity: 0; }
.giftbox.is-untie .giftbox__hint { opacity: 0; }
.giftbox.is-open .gb-lid { transform: translate(44px, -84px) rotate(24deg); }
.giftbox.is-open .giftbox__light { box-shadow: 0 0 90px 80px rgba(255, 232, 190, .5); }
.d7-gifts:not(:empty) { margin-top: 16px; }
.gifts { display: grid; gap: 10px; margin: 14px 0 0; text-align: left; }
@media (min-width: 560px) { .gifts { grid-template-columns: 1fr 1fr; } }
.gift { display: block; padding: 14px 16px 14px 44px; position: relative; border-radius: 6px; border: 1px solid rgba(217, 180, 126, .35); background: linear-gradient(160deg, rgba(74, 48, 34, .7), rgba(34, 22, 15, .7)); color: var(--ivory); text-align: left; cursor: pointer; animation: g-appear .8s var(--ease) both; animation-delay: var(--d); transition: border-color .25s, box-shadow .25s, background .25s; }
.gift::before { content: ""; position: absolute; left: 14px; top: 18px; width: 16px; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1v14M1 8h14' stroke='%23D9B47E' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.gift b { display: block; font-family: var(--serif); font-size: 1.22rem; color: var(--gold-pale); }
.gift span { font-size: .88rem; color: rgba(245, 237, 225, .8); }
.gift:hover { border-color: var(--gold); }
.gift.is-on { border-color: var(--gold-pale); background: linear-gradient(160deg, rgba(168, 116, 67, .55), rgba(74, 48, 34, .8)); box-shadow: 0 0 22px rgba(230, 199, 154, .3); }

/* PORTE 8 — Domaines, enveloppe */
.domains { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 560px; margin: 0 auto; }
@media (min-width: 600px) { .domains { grid-template-columns: repeat(4, 1fr); } }
.domain { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 0 6px; background: none; border: 0; cursor: pointer; color: var(--gold-pale); }
.domain__arch { display: block; width: 100%; max-width: 120px; aspect-ratio: 160 / 180; padding: 4px; border-radius: 60px 60px 8px 8px; background: radial-gradient(circle at 50% 40%, rgba(217, 180, 126, .16), rgba(0, 0, 0, .3)); box-shadow: inset 0 0 0 1px rgba(217, 180, 126, .4); transition: transform .3s var(--ease), box-shadow .4s, background .4s; }
.domain b { font-family: var(--serif); font-size: 1.12rem; line-height: 1.15; text-align: center; }
.domain:hover .domain__arch { transform: translateY(-4px); }
.domain.is-on .domain__arch { background: radial-gradient(circle at 50% 45%, rgba(255, 236, 200, .35), rgba(168, 116, 67, .3) 50%, rgba(0, 0, 0, .3)); box-shadow: inset 0 0 0 1px var(--gold-pale), 0 0 26px rgba(230, 199, 154, .4); }
.envelope-anim { width: 240px; margin: 0 auto; }
.envelope-anim svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .6)); }
.env-paper { animation: g-slidein 1s var(--ease) both; }
@keyframes g-slidein { from { transform: translateY(-40px); } to { transform: translateY(40px); } }
.env-flap { transform-origin: 110px 46px; animation: g-flap .9s var(--ease) .9s both; }
@keyframes g-flap { from { transform: scaleY(-1); } to { transform: none; } }
.env-seal { transform-origin: 110px 114px; animation: g-stamp .7s var(--ease) 1.7s both; }
@keyframes g-stamp { 0% { transform: scale(2.4); opacity: 0; } 70% { transform: scale(.92); opacity: 1; } 100% { transform: none; } }

/* PORTE 9 — Parchemin et allumette */
.d9 { position: relative; max-width: 560px; margin: 0 auto; }
.parch { filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .6)); }
.parch__roll { height: 24px; border-radius: 12px; margin: 0 -8px; background: linear-gradient(#5b3a25, #3a2519 45%, #22160F 55%, #4A3022); box-shadow: inset 0 0 0 1px rgba(217, 180, 126, .55); }
.parch__sheet { position: relative; padding: 22px 20px; text-align: left; background: #f1e3c8; background-image: radial-gradient(ellipse at 20% 30%, rgba(168, 116, 67, .18), transparent 50%), radial-gradient(ellipse at 80% 80%, rgba(168, 116, 67, .2), transparent 50%); color: var(--ink); }
.parch__ta { min-height: 150px; background: transparent; border: 0; border-bottom: 1px dashed rgba(168, 116, 67, .5); border-radius: 0; }
.parch__ta:focus { background: rgba(255, 255, 255, .3); box-shadow: none; }
.parch__dust { position: absolute; left: 20px; right: 20px; top: 58px; pointer-events: none; font-family: var(--serif); font-size: 1.25rem; font-style: italic; line-height: 1.5; color: var(--brown); white-space: pre-wrap; overflow-wrap: anywhere; }
.parch__dust span { display: inline-block; white-space: pre; }
.parch__dust.is-on span { animation: g-vanish 1.6s ease-in forwards; animation-delay: var(--t); }
@keyframes g-vanish { 0% { color: var(--brown); } 30% { color: var(--copper); text-shadow: 0 0 6px #f6d79a; } 100% { color: #F6E3BC; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(.3); opacity: 0; filter: blur(2px); } }
.d9-match { position: absolute; right: -6px; bottom: -44px; z-index: 3; width: 66px; height: 74px; padding: 0; border: 0; background: none; cursor: pointer; transform: rotate(18deg); transform-origin: 50% 90%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); transition: transform .6s var(--ease); }
.d9-match:hover { transform: rotate(8deg) translateY(-4px); }
.d9-flame { position: absolute; left: 60%; top: -2%; width: 14px; height: 24px; transform: scale(0); transform-origin: 50% 100%; transition: transform .4s; }
.d9-flame::before, .d9-flame i { content: ""; position: absolute; inset: 0; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: radial-gradient(ellipse at 50% 75%, #fff, #fbecc8 30%, #E6C79A 55%, transparent 75%); animation: g-flame 1s ease-in-out infinite; }
.scene--parch.is-strike .d9-match { transform: rotate(-24deg) translate(-40px, -50px); }
.scene--parch.is-strike .d9-flame { transform: scale(1.3); }
.scene--parch .row { margin-top: 52px; }

/* PORTE 10 — Étagère d'apothicaire */
.ings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 6px; }
.ing { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px 16px; border: 0; background: none; cursor: pointer; color: var(--gold-pale); }
.ing::after { content: ""; position: absolute; left: -6px; right: -6px; bottom: 4px; height: 7px; background: linear-gradient(#5b3a25, #2b1b12); box-shadow: 0 6px 10px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(217, 180, 126, .6); }
.ing__jar { width: 74px; height: 102px; transition: transform .4s var(--ease), filter .4s; }
.ing__jar svg { width: 100%; height: 100%; overflow: visible; }
.jar__lid { transition: transform .5s var(--ease); transform-origin: 40px 12px; }
.ing b { font-family: var(--serif); font-size: 1.05rem; }
.ing:hover .ing__jar { transform: translateY(-5px) rotate(-3deg); }
.ing.is-seen .ing__jar { filter: drop-shadow(0 0 8px rgba(230, 199, 154, .35)); }
.ing.is-on .ing__jar { transform: translateY(-10px) scale(1.05); filter: drop-shadow(0 0 16px rgba(255, 230, 180, .7)); }
.ing.is-on .jar__lid { transform: translate(14px, -14px) rotate(24deg); }
.ingcard { display: grid; gap: 10px 22px; }
.ingcard__art { display: flex; justify-content: center; }
@media (min-width: 600px) { .ingcard { grid-template-columns: 120px 1fr; align-items: start; } }
.ingcard h2 { margin-bottom: .3em; }

/* PORTE 11 — Lettre et étoile */
.scene--letter { padding-top: 70px; }
.envelope-letter { position: relative; }
.el__env { position: relative; z-index: 2; width: min(300px, 88%); margin: 0 auto; transition: transform 1s var(--ease); }
.el__env svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .6)); }
.el__flap { transform-origin: 160px 32px; transition: transform .8s var(--ease) .6s; transform: scaleY(-1); }
.el__paper { position: relative; z-index: 1; margin-top: -54px; padding-top: 72px; text-align: left; transition: transform 1s var(--ease), opacity .8s; animation: g-rise 1.2s var(--ease) both; }
@keyframes g-rise { from { transform: translateY(-80px) scaleY(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.envelope-letter.is-closed .el__paper { transform: translateY(-120px) scaleY(.15); opacity: 0; max-height: 0; overflow: hidden; padding: 0; margin: 0; }
.envelope-letter.is-closed .el__flap { transform: none; }
.envelope-letter.is-closed .el__env::after { content: ""; position: absolute; left: 50%; top: 58%; width: 44px; height: 44px; margin: -22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #C48A52, #6b4429); animation: g-stamp .7s var(--ease) 1.2s both; box-shadow: 0 4px 8px rgba(0, 0, 0, .4); }
.d11-star { position: absolute; left: 50%; top: -60px; z-index: 3; width: 70px; height: 78px; margin-left: -35px; opacity: 0; transform: translateY(160px) scale(.4); transition: transform 2.2s var(--ease), opacity 1.4s; filter: drop-shadow(0 0 18px rgba(255, 230, 180, .8)); }
.scene--letter.is-star .d11-star { opacity: 1; transform: translateY(0) scale(1); }
.gentle { text-align: center; }

/* PORTE 12 — Grimoire verrouillé */
.lockbook { position: relative; display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 6px 0 4px; }
.lockbook__book { position: relative; width: 220px; height: 275px; perspective: 1400px; }
.lockbook__pages { position: absolute; inset: 36px -64px 36px -64px; opacity: 0; transition: opacity 1s .6s; display: flex; align-items: center; }
.lockbook__cover { position: absolute; inset: 0; transform-origin: 9% 50%; transition: transform 1.5s var(--ease), opacity .6s 1.1s; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .65)); }
.lockbook__cover svg { width: 100%; height: 100%; display: block; }
.lockbook__lock { position: absolute; right: -16px; top: 104px; width: 52px; transition: transform .8s var(--ease), opacity .6s; z-index: 3; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .6)); }
.lockbook__lock svg { width: 100%; height: auto; display: block; overflow: visible; }
.lockbook__lock .l.shackle { stroke-width: 4; }
.shackle { transition: transform .5s var(--ease); }
.lockbook__key { position: absolute; right: -112px; top: 96px; width: 70px; height: 80px; z-index: 4; transition: transform .9s var(--ease), opacity .5s; filter: drop-shadow(0 0 12px rgba(230, 199, 154, .7)); animation: float 3s ease-in-out infinite; }
.lockbook.is-key .lockbook__key { animation: none; transform: translate(-80px, 4px) rotate(-90deg) scale(.7); }
.lockbook.is-unlock .lockbook__key { transform: translate(-80px, 4px) rotate(0deg) scale(.7); opacity: 0; transition-delay: 0s, .35s; }
.lockbook.is-unlock .shackle { transform: translateY(-10px); }
.lockbook.is-unlock .lockbook__lock { transform: translateY(60px) rotate(25deg); opacity: 0; transition-delay: .35s; }
.lockbook.is-open .lockbook__cover { transform: rotateY(-170deg); opacity: 0; }
.lockbook.is-open .lockbook__pages { opacity: 1; }
@media (max-width: 420px) { .lockbook__book { width: 180px; height: 225px; } .lockbook__lock { top: 82px; right: -14px; width: 44px; } .lockbook__key { right: -88px; top: 74px; width: 56px; height: 64px; } .lockbook.is-key .lockbook__key, .lockbook.is-unlock .lockbook__key { translate: 16px 0; } .lockbook__pages { inset: 30px -50px; } }

/* PORTE 13 — Bulle intérieure */
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
@media (min-width: 600px) { .swatches { grid-template-columns: repeat(6, 1fr); } }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px; border: 0; background: none; cursor: pointer; color: var(--brown); }
.swatch i { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--c) 55%, #4A3022 120%); box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(74, 48, 34, .2); transition: transform .25s, box-shadow .25s; }
.swatch b { font-size: .78rem; font-weight: 500; }
.swatch.is-on i { transform: scale(1.12); box-shadow: 0 0 0 3px var(--ivory-2), 0 0 0 5px var(--copper), 0 0 18px var(--c); }
.chips--pick { margin-bottom: 22px; }
.bubble-scene { display: flex; justify-content: center; padding: 44px 0 40px; }
.bubble { position: relative; width: min(250px, 64vw); aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; animation: g-breathe2 6s ease-in-out infinite; }
@keyframes g-breathe2 { 50% { transform: scale(1.04); } }
.bubble__rings { position: absolute; inset: -12%; width: 124%; height: 124%; max-width: none; animation: g-rot 60s linear infinite; }
.bubble__core { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 36% 30%, rgba(255, 255, 255, .95), var(--c) 45%, rgba(34, 22, 15, .1) 78%); box-shadow: 0 0 70px 14px var(--c), inset 0 0 40px rgba(255, 255, 255, .35); opacity: .9; }
.bubble__core::after { content: ""; position: absolute; left: 20%; top: 14%; width: 30%; height: 16%; border-radius: 50%; background: rgba(255, 255, 255, .6); transform: rotate(-30deg); filter: blur(2px); }
.bubble__txt { position: relative; z-index: 2; max-width: 68%; margin: 0; font-family: var(--serif); font-size: 1.3rem; font-style: italic; font-weight: 600; line-height: 1.25; color: var(--espresso); text-shadow: 0 0 10px rgba(255, 255, 255, .8); }
.bubble__orb { position: absolute; left: 50%; top: 50%; z-index: 3; padding: 4px 10px; border-radius: 20px; white-space: nowrap; font-size: .74rem; font-weight: 500; background: rgba(34, 22, 15, .85); color: var(--gold-pale); border: 1px solid rgba(217, 180, 126, .5); transform: rotate(var(--a)) translateY(calc(min(250px, 64vw) / -2 - 8px)) rotate(calc(-1 * var(--a))) translate(-50%, -50%); animation: g-orbit 32s linear infinite; }
@keyframes g-orbit { from { transform: rotate(var(--a)) translateY(calc(min(250px, 64vw) / -2 - 8px)) rotate(calc(-1 * var(--a))) translate(-50%, -50%); } to { transform: rotate(calc(var(--a) + 360deg)) translateY(calc(min(250px, 64vw) / -2 - 8px)) rotate(calc(-1 * var(--a) - 360deg)) translate(-50%, -50%); } }

/* PORTE 14 — Roue magique */
.wheel-scene { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 8px 0 4px; }
.wheel { width: min(320px, 80vw); aspect-ratio: 1; border-radius: 50%; transition: transform 4.2s cubic-bezier(.12, .7, .14, 1); filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .7)) drop-shadow(0 0 20px rgba(230, 199, 154, .15)); }
.wheel svg { width: 100%; height: 100%; display: block; }
.wheel__t { font-family: var(--serif); font-size: 9.6px; font-weight: 600; fill: var(--gold-pale); letter-spacing: .02em; }
.wheel__pointer { position: absolute; top: -4px; left: 50%; z-index: 2; width: 32px; margin-left: -16px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); }
.wheel__pointer svg { width: 100%; height: auto; display: block; }

/* PORTE 15 — Atelier des potions */
.potion { display: grid; gap: 14px; }
@media (min-width: 680px) { .potion { grid-template-columns: 1.4fr 1fr; align-items: center; } }
.potion__shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 4px; }
.pjar { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px 14px; border: 0; background: none; cursor: pointer; color: var(--gold-pale); transition: opacity .3s; }
.pjar::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: 4px; height: 6px; background: linear-gradient(#5b3a25, #2b1b12); box-shadow: 0 5px 8px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(217, 180, 126, .6); }
.pjar span { width: 52px; height: 65px; display: block; transition: transform .3s var(--ease); }
.pjar span svg { width: 100%; height: 100%; overflow: visible; }
.pjar b { font-size: .68rem; font-weight: 500; line-height: 1.2; text-align: center; min-height: 2.4em; }
.pjar:hover span { transform: translateY(-5px) rotate(-6deg); }
.pjar.is-used { opacity: .3; }
.pjar__fly { position: fixed; z-index: 150; width: 52px; height: 65px; pointer-events: none; transition: transform .7s cubic-bezier(.5, -.3, .6, 1), opacity .7s; }
.pjar__fly svg { width: 100%; height: 100%; }
.flask { position: relative; width: 170px; margin: 0 auto 4px; }
.flask svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .5)); }
.flask__liq { transform-origin: 80px 148px; transform: scaleY(calc(var(--lvl, 0) / 3)); transition: transform .6s var(--ease), fill .6s; }
.flask__bubbles i { position: absolute; bottom: 24%; left: 50%; width: 7px; height: 7px; border-radius: 50%; border: 1px solid rgba(251, 246, 238, .8); opacity: 0; }
.flask.is-brewing { animation: g-brew .45s ease-in-out 3; }
.flask.is-brewing .flask__bubbles i { animation: g-bubble 1.2s ease-in infinite; }
.flask__bubbles i:nth-child(2) { margin-left: -16px; animation-delay: .3s !important; }
.flask__bubbles i:nth-child(3) { margin-left: 12px; animation-delay: .6s !important; }
.flask__bubbles i:nth-child(4) { margin-left: -4px; animation-delay: .9s !important; }
@keyframes g-brew { 50% { transform: rotate(-6deg) scale(1.03); } }
@keyframes g-bubble { 0% { opacity: 0; transform: translateY(0) scale(.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-80px) scale(1.2); } }
.flask-big { animation: float 3.4s ease-in-out infinite; }
.flask-big svg { width: 100%; height: 100%; }

/* PORTE 16 — Sortilèges */
.spells { display: grid; gap: 12px; }
@media (min-width: 640px) { .spells { grid-template-columns: 1fr 1fr; } }
.spell { position: relative; display: block; min-height: 132px; padding: 20px 18px 40px; border-radius: 10px; border: 1px solid rgba(217, 180, 126, .35); background: linear-gradient(160deg, rgba(74, 48, 34, .65), rgba(23, 15, 10, .8)); color: var(--ivory); text-align: left; cursor: pointer; overflow: hidden; transition: background .8s, border-color .6s, box-shadow .6s; }
.spell__old, .spell__new { display: block; font-family: var(--serif); font-size: 1.25rem; line-height: 1.35; transition: opacity .6s, transform .8s var(--ease), filter .6s; }
.spell__old { font-style: italic; }
.spell__new { position: absolute; left: 18px; right: 18px; top: 20px; opacity: 0; transform: translateY(14px); color: var(--brown); font-size: 1.12rem; }
.spell__cta { position: absolute; left: 18px; bottom: 12px; font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); transition: opacity .4s; }
.spell__fly { position: absolute; right: 10px; bottom: 6px; width: 38px; height: 42px; opacity: .55; transition: opacity .4s; }
.spell:hover { border-color: var(--gold); }
.spell.is-turning .spell__old { opacity: 0; filter: blur(6px); transform: translateY(-20px) scale(.95); letter-spacing: .3em; }
.spell.is-turning .spell__fly { animation: g-flutter 1s var(--ease) forwards; opacity: 1; }
@keyframes g-flutter { 0% { transform: none; } 30% { transform: translate(-60px, -40px) rotate(-20deg) scale(1.6); } 60% { transform: translate(-140px, -10px) rotate(15deg) scale(1.3); } 100% { transform: translate(-220px, -60px) scale(.4); opacity: 0; } }
.spell.is-done { background: var(--ivory-2); border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 10px 26px -10px rgba(230, 199, 154, .6); cursor: default; }
.spell.is-done .spell__old { opacity: 0; position: absolute; }
.spell.is-done .spell__new { position: static; opacity: 1; transform: none; }
.spell.is-done .spell__cta { opacity: 0; }
.spell.is-done .spell__fly { opacity: 1; background: radial-gradient(circle, #4A3022, var(--espresso)); border-radius: 50%; }

/* Quiz (portes 17, 19, 20) et pupitre (18) */
.quiz__obj { width: 96px; height: 108px; margin: -6px auto 10px; filter: drop-shadow(0 0 18px rgba(230, 199, 154, .45)); }
.quiz { max-width: 600px; margin: 0 auto; }
.quiz__top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.quiz__top .kicker { margin: 0; white-space: nowrap; }
.quiz__bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(217, 180, 126, .18); overflow: hidden; }
.quiz__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--copper), var(--gold-pale)); transition: width .5s var(--ease); box-shadow: 0 0 8px var(--gold); }
.quiz__q { font-size: clamp(1.45rem, 5vw, 1.85rem); color: var(--gold-pale); font-weight: 500; }
.answers { display: grid; gap: 10px; margin: 18px 0 8px; }
.answer { display: block; width: 100%; padding: 14px 18px; text-align: left; border-radius: 10px; border: 1px solid rgba(217, 180, 126, .35); background: rgba(0, 0, 0, .25); color: var(--ivory); cursor: pointer; font-size: 1rem; line-height: 1.4; transition: background .2s, border-color .2s, transform .15s; }
.answer:hover { border-color: var(--gold); transform: translateX(3px); }
.answer.is-on { background: linear-gradient(135deg, #f1dbb0, var(--gold) 45%, var(--copper)); color: var(--espresso); border-color: transparent; }
.scene--mini { padding: 24px 16px 20px; }
.witch__dl { margin: 18px 0; display: grid; gap: 4px 18px; }
.witch__dl dt { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--copper); margin-top: 10px; }
.witch__dl dd { margin: 0; font-family: var(--serif); font-size: 1.18rem; }
.bars { display: grid; gap: 8px; margin-bottom: 16px; }
.bars__row { display: grid; grid-template-columns: 96px 1fr 18px; align-items: center; gap: 10px; font-size: .88rem; }
.bars__row i { height: 8px; border-radius: 4px; background: rgba(168, 116, 67, .18); overflow: hidden; }
.bars__row b { display: block; height: 100%; background: linear-gradient(90deg, var(--copper), var(--gold)); border-radius: 4px; animation: g-grow 1s var(--ease) both; transform-origin: left; }
@keyframes g-grow { from { transform: scaleX(0); } }
.bars__row em { font-style: normal; font-family: var(--serif); font-weight: 600; }
.bars__row span:first-letter { text-transform: uppercase; }
.gpage { padding: 10px; margin-bottom: 10px; background: #e9d5b2; border-radius: 4px; box-shadow: var(--shadow); }
.gpage__in { padding: 30px 22px; background: #f6ecd9; background-image: radial-gradient(ellipse at 10% 10%, rgba(168, 116, 67, .2), transparent 40%), radial-gradient(ellipse at 90% 90%, rgba(168, 116, 67, .18), transparent 40%); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(168, 116, 67, .5), inset 0 0 40px rgba(168, 116, 67, .15); }
.gpage h2 { color: var(--brown); font-size: 2.2rem; }
.gpage h3 { font-size: .74rem; font-family: var(--sans); font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--copper); margin: 18px 0 4px; }
.gpage section p { font-family: var(--serif); font-size: 1.22rem; line-height: 1.45; margin: 0; }
.gpage section:first-of-type p::first-letter { float: left; font-size: 3.4em; line-height: .85; padding: 4px 8px 0 0; color: var(--copper); font-weight: 600; }
.gpage__end { margin: 26px 0 0; text-align: center; font-family: var(--serif); font-style: italic; color: var(--copper); }

/* PORTE 21 — Ciel du solstice */
.night { position: relative; isolation: isolate; width: 100%; aspect-ratio: 4 / 3.4; border-radius: 16px; overflow: hidden; box-shadow: 0 34px 60px -30px #000, inset 0 0 0 1px rgba(217, 180, 126, .38); margin-bottom: 18px; }
@media (min-width: 700px) { .night { aspect-ratio: 16 / 9; } }
.night__sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.night__dawn { opacity: 0; transition: opacity 3s; }
.night__sun { transform: translateY(40px); transition: transform 3.6s var(--ease) .4s; }
.night__line { opacity: 0; transition: opacity 1.2s; }
.night .hill { stroke: var(--gold); stroke-width: .22; }
.night .hill-l { stroke: var(--gold); stroke-width: .15; stroke-dasharray: .4 .8; fill: none; }
.night .tree { fill: #1b120c; stroke: var(--gold); stroke-width: .15; }
.night__win rect { fill: #3a2519; transition: fill 1s; }
.night__sunimg { position: absolute; left: 50%; bottom: -34%; z-index: 1; width: 30%; max-width: 170px; aspect-ratio: 160 / 180; transform: translateX(-50%); opacity: 0; transition: bottom 3.6s var(--ease) .5s, opacity 2s .5s; filter: drop-shadow(0 0 26px rgba(255, 230, 180, .9)); }
.night.is-const .night__line { opacity: 1; }
.night.is-dawn .night__dawn { opacity: 1; }
.night.is-dawn .night__sun { transform: translateY(-14px); }
.night.is-dawn .night__sunimg { bottom: 12%; opacity: 1; }
.night.is-dawn .night__win rect { fill: #F6E3BC; }
.nstar { position: absolute; z-index: 2; width: 48px; height: 48px; margin: -24px 0 0 -24px; padding: 6px; border: 0; background: none; cursor: pointer; opacity: .6; transition: opacity .6s, transform .3s, filter .6s; animation: g-twinkle 3s ease-in-out infinite; }
.nstar:nth-of-type(2n) { animation-delay: -1.2s; }
.nstar svg { width: 100%; height: 100%; display: block; }
.nstar .nstar__halo { opacity: 0; transition: opacity .6s; }
@keyframes g-twinkle { 50% { transform: scale(.86); } }
.nstar:hover { opacity: 1; }
.nstar.is-cur { opacity: 1; transform: scale(1.25); }
.nstar.is-lit { opacity: 1; filter: drop-shadow(0 0 8px #F6E3BC) drop-shadow(0 0 16px rgba(230, 199, 154, .8)); }
.nstar.is-lit .nstar__p { fill: var(--gold-pale); }
.nstar.is-lit .nstar__halo { opacity: 1; }
.night__count { position: absolute; right: 14px; bottom: 8px; z-index: 2; margin: 0; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-pale); }
.night__count b { font-family: var(--serif); font-size: 1.1rem; }
.starpanel label { font-family: var(--serif); font-size: 1.2rem; color: var(--brown); margin-bottom: 4px; }
.starpanel .row { flex-wrap: nowrap; margin-top: 6px; }
.starpanel .field { flex: 1; min-width: 0; }

/* PORTE 22 — Trois portes de demain */
.tdoors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 520px; margin: 0 auto; }
.tdoor { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0; background: none; border: 0; cursor: pointer; color: var(--gold-pale); }
.tdoor b { font-family: var(--serif); font-size: clamp(.95rem, 3.6vw, 1.25rem); font-weight: 600; }
.tdoor__frame { position: relative; display: block; width: 100%; aspect-ratio: 100 / 160; perspective: 800px; }
.tdoor__in { position: absolute; inset: 2% 2% 0; border-radius: 50% 50% 3px 3px / 31% 31% 3px 3px; background: radial-gradient(ellipse at 50% 55%, rgba(255, 236, 200, .6), #A87443 38%, #4A3022 72%, #1b120c); display: flex; align-items: center; justify-content: center; padding: 18%; box-shadow: inset 0 0 18px rgba(0, 0, 0, .6); }
.tdoor__in .ico { filter: brightness(1.2) drop-shadow(0 0 6px rgba(255, 230, 180, .7)); }
.tdoor__leaf { position: absolute; inset: 0; transform-origin: 2% 50%; transition: transform 1.1s var(--ease); filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .55)); }
.tdoor__leaf svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tdoor:hover .tdoor__leaf { transform: rotateY(-18deg); }
.tdoor.is-open .tdoor__leaf { transform: rotateY(-100deg); }

/* PORTE 23 — Cachet de cire */
.seals { display: flex; gap: 10px; }
.sealpick { width: 54px; height: 54px; padding: 6px; border-radius: 50%; border: 0; cursor: pointer; background: radial-gradient(circle at 35% 30%, #C48A52, #6b4429 75%); box-shadow: 0 4px 8px -2px rgba(0, 0, 0, .4); transition: transform .2s, box-shadow .2s; }
.sealpick .ico { filter: brightness(1.4); }
.sealpick.is-on { transform: scale(1.12); box-shadow: 0 0 0 3px var(--ivory-2), 0 0 0 5px var(--copper); }
.waxscene { display: flex; justify-content: center; padding: 6px 0 4px; }
.waxenv { position: relative; width: min(320px, 86%); }
.waxenv svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .6)); }
.waxenv__flap { transform-origin: 160px 22px; animation: g-flap 1s var(--ease) both; }
.waxseal { position: absolute; left: 50%; top: 62%; width: 84px; height: 84px; margin: -42px; animation: g-stamp .8s var(--ease) 1s both; }
.waxseal svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.waxseal__ico { position: absolute; inset: 16%; filter: brightness(1.5) drop-shadow(0 1px 0 rgba(0, 0, 0, .4)); }
.waxglass { position: absolute; right: -14%; bottom: -12%; width: 60px; height: 68px; filter: drop-shadow(0 0 12px rgba(230, 199, 154, .5)); }

/* PORTE 24 — Grand coffre */
.bigchest { position: relative; display: flex; justify-content: center; align-items: center; min-height: 340px; }
.bigchest__rays { position: absolute; left: 50%; top: 50%; width: 760px; height: 760px; margin: -380px; background: repeating-conic-gradient(from 0deg, rgba(230, 199, 154, .18) 0 5deg, transparent 5deg 15deg); -webkit-mask: radial-gradient(circle, #000 8%, transparent 58%); mask: radial-gradient(circle, #000 8%, transparent 58%); opacity: 0; transform: scale(.3); transition: opacity 1.2s, transform 1.6s var(--ease); pointer-events: none; }
.bigchest.is-open .bigchest__rays { opacity: 1; transform: none; animation: g-rot 40s linear infinite; }
.bigchest__btn { position: relative; z-index: 2; width: 230px; padding: 0; border: 0; background: none; cursor: pointer; }
.bigchest__btn svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 22px 30px rgba(0, 0, 0, .7)); }
.bc-lid { transform-origin: 20px 92px; transition: transform 1.2s var(--ease); }
.bigchest.is-open .bc-lid { transform: rotate(-28deg) translate(-6px, -30px); }
.bigchest__hint { display: block; margin-top: 10px; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); animation: g-pulse 2s ease-in-out infinite; }
.bigchest.is-open .bigchest__hint { opacity: 0; }
.bigchest__btn::before { content: ""; position: absolute; left: 50%; top: 45%; width: 10px; height: 10px; border-radius: 50%; transition: box-shadow 1.4s; }
.bigchest.is-open .bigchest__btn::before { box-shadow: 0 0 120px 80px rgba(255, 232, 186, .6); }
.bigchest:not(.is-open) .bigchest__btn { animation: g-rumble 3s ease-in-out infinite; }
@keyframes g-rumble { 0%, 86%, 100% { transform: none; } 88% { transform: rotate(-2deg); } 92% { transform: rotate(2deg); } 96% { transform: rotate(-1deg); } }
.bigchest__orbit { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.orb { position: absolute; left: 50%; top: 50%; width: 38px; height: 43px; margin: -21px -19px; opacity: 0; filter: drop-shadow(0 0 8px rgba(230, 199, 154, .8)); animation: g-orb 1.2s var(--ease) forwards; animation-delay: var(--d); }
.orb--ghost { filter: grayscale(1) brightness(.4) opacity(.35); }
@keyframes g-orb { from { opacity: 0; transform: translate(0, 0) scale(.2); } to { opacity: 1; transform: translate(calc(var(--x) * var(--R, 1.38px)), calc(var(--y) * var(--R, 1.38px))) scale(1); } }
@media (min-width: 600px) { .orb { width: 48px; height: 54px; margin: -27px -24px; --R: 1.8px; } }
.final-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-width: 440px; margin: 12px auto; }
.final-grid span { aspect-ratio: 160 / 180; padding: 3px; border-radius: 8px; background: radial-gradient(circle at 50% 40%, #4A3022, var(--espresso)); }
.final-grid span.ghost .ico { filter: grayscale(1) brightness(.5) opacity(.4); }
.xmas { text-align: left; }
.xmas > .center { display: flex; justify-content: center; }
.xmas > .center > .ico { width: 80px; height: 90px; padding: 6px; border-radius: 40px; background: var(--espresso); }
.xmas h2 { font-size: 2.6rem; font-weight: 500; }
.xmas p { font-family: var(--serif); font-size: 1.25rem; line-height: 1.5; }
.sign { text-align: right; font-style: italic; }

/* ---------------------------------------------------------------
   Mouvement réduit
   --------------------------------------------------------------- */
.rm *, .rm *::before, .rm *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
.rm .burst, .rm .gain__rays, .rm .dust { display: none; }
@media print { .nav, .topbar, #ambient { display: none; } body { background: #fff; color: #000; } }

/* Correctifs : les indices disparaissent vraiment une fois l'action faite */
.giftbox.is-untie .giftbox__hint, .bigchest.is-open .bigchest__hint { animation: none; visibility: hidden; }
.flask-big .flask__liq { transform: none; }
.scene--parch .scene__hint { margin-top: 60px; padding-right: 40px; }
.scene--parch .row { margin-top: 14px; }
