:root {
  --night: #050d24;
  --metal-1: #5a667f;
  --metal-2: #232c42;
  --gold: #e8c26a;
  --pink: #ff5d8f;
  --ok: #3ddc84;
  --ko: #ff4d4d;
  --serif: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0; min-height: 100vh;
  background: radial-gradient(ellipse at 50% 35%, #2260c4 0%, #123374 45%, var(--night) 90%) fixed;
  color: #f5eef8; font-family: Georgia, serif; overflow-x: hidden;
}

.hearts { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.heart { position: absolute; bottom: -40px; animation: float linear forwards; opacity: .8; }
@keyframes float { to { transform: translateY(-110vh) rotate(25deg); opacity: 0; } }

.flash { position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #fff 0%, #ffd6e6 45%, #ff9fc2 100%); transition: opacity 1.8s ease; }
.flash.on { opacity: 1; }

/* ---------- Le coffre, seul ---------- */
.scene {
  position: relative; z-index: 2; min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 24px 16px;
}
.safe {
  position: relative; width: min(380px, 92vw); aspect-ratio: 380 / 560; perspective: 1500px;
  filter: drop-shadow(0 0 50px rgba(70,130,255,.35));
}

.inside {
  position: absolute; inset: 0; border-radius: 20px;
  background: radial-gradient(circle, #fff0f5, #ffb3cc 45%, #c2406f);
  display: grid; place-items: center; box-shadow: inset 0 0 60px rgba(0,0,0,.45);
}
.inside span { font-size: 110px; filter: drop-shadow(0 0 20px #fff); }
.safe.open .inside span { animation: pulse .9s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }

.door {
  position: absolute; inset: 0; border-radius: 20px; border: 8px solid #141a2b;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 2px, transparent 2px 5px),
    linear-gradient(150deg, var(--metal-1), var(--metal-2));
  box-shadow: 0 25px 60px rgba(0,0,0,.65), inset 0 0 0 3px rgba(255,255,255,.08), inset 0 0 40px rgba(0,0,0,.35);
  transform-origin: left center;
  transition: transform 2.2s cubic-bezier(.5,.05,.25,1) .9s;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 26px 16px 18px; backface-visibility: hidden;
}
.safe.open .door { transform: rotateY(-118deg); }

.bolt { position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #b4bfd8, #2a3144); box-shadow: 0 0 0 1px #000; }
.b1 { top: 10px; left: 10px; } .b2 { top: 10px; right: 10px; }
.b3 { bottom: 10px; left: 10px; } .b4 { bottom: 10px; right: 10px; }

.led { position: absolute; top: 20px; right: 28px; width: 12px; height: 12px; border-radius: 50%;
  background: #5a2a2a; box-shadow: inset 0 0 4px #000; transition: .3s; }
.led.ok { background: var(--ok); box-shadow: 0 0 14px var(--ok); }
.led.ko { background: var(--ko); box-shadow: 0 0 14px var(--ko); }

/* cadran + écran */
.dial { position: relative; width: 270px; height: 270px; display: grid; place-items: center;
  touch-action: none; cursor: grab; margin-top: 6px; }
.dial:active { cursor: grabbing; }
.dial::before { content: ""; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-top: 14px solid var(--pink); z-index: 2;
  filter: drop-shadow(0 0 6px var(--pink)); }
.ring {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-conic-gradient(from -1.5deg, var(--pink) 0 3deg, transparent 3deg 36deg),
    repeating-conic-gradient(from 0deg, var(--gold) 0 1.2deg, transparent 1.2deg 7.2deg),
    radial-gradient(circle, transparent 60%, rgba(0,0,0,.45) 61%, #1b2234 100%);
  -webkit-mask: radial-gradient(circle, transparent 0 59%, #000 60% 100%);
          mask: radial-gradient(circle, transparent 0 59%, #000 60% 100%);
  transition: transform .45s cubic-bezier(.3,1.4,.5,1);
  filter: drop-shadow(0 0 4px rgba(232,194,106,.4));
}
.ring::before { content: "♥"; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  color: var(--pink); font-size: 18px; text-shadow: 0 0 8px var(--pink); }
.ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 6px solid #1b2234; }

.lcd {
  position: relative; z-index: 1; width: 150px; display: flex; flex-direction: column; align-items: center;
  background: #070a12; border: 2px solid #000; border-radius: 14px; padding: 6px 6px 8px;
  box-shadow: inset 0 0 14px #000, 0 0 0 3px #3a4460; cursor: default;
}
.lcd-label { font: 700 11px "Courier New", monospace; letter-spacing: 3px; text-transform: uppercase;
  color: var(--pink); text-shadow: 0 0 8px var(--pink); }
.arrow { background: none; border: 0; color: var(--gold); font-size: 14px; cursor: pointer; padding: 2px 16px; opacity: .75; }
.arrow:hover { opacity: 1; }
.arrow:disabled { visibility: hidden; }
.num { font: 700 44px "Courier New", monospace; color: #ffe9a8; text-shadow: 0 0 12px rgba(255,210,100,.8); line-height: 1.05; }
.num.wide { font-size: 36px; }
.num.tick { animation: tick .18s ease; }
@keyframes tick { from { transform: translateY(6px); opacity: .5; } }
.lcd-sub { font: italic 13px Georgia, serif; color: var(--pink); height: 17px; }
.dots { display: flex; gap: 6px; margin-top: 2px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #2a3146; transition: .3s; }
.dots i.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.validate {
  background: linear-gradient(#f1d58a, #c99a3a); color: #3a2a08; font: 700 15px Georgia, serif;
  border: 0; border-radius: 20px; padding: 9px 26px; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.45);
}
.validate:active { transform: translateY(1px); }

/* poignée */
.handle { position: relative; width: 78px; height: 78px; border-radius: 50%;
  border: 4px solid var(--gold); background: radial-gradient(#5d6477, #262c3d); cursor: pointer;
  transition: transform 1.1s cubic-bezier(.5,0,.3,1); box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.handle .spoke { position: absolute; left: 50%; top: 50%; width: 6px; height: 118%; background: var(--gold);
  border-radius: 3px; transform: translate(-50%, -50%) rotate(var(--r)); }
.handle .spoke:nth-child(1) { --r: 0deg; }
.handle .spoke:nth-child(2) { --r: 60deg; }
.handle .spoke:nth-child(3) { --r: 120deg; }
.handle .hub { position: absolute; inset: 23px; border-radius: 50%; background: var(--gold); color: #a3274f;
  font-size: 14px; display: grid; place-items: center; box-shadow: 0 0 6px #000; }
.handle.spin { transform: rotate(-540deg); }
.handle:disabled { opacity: .35; cursor: not-allowed; filter: grayscale(.6); }
.handle.ready { animation: ready 1.2s ease-in-out infinite alternate; }
@keyframes ready { to { box-shadow: 0 0 22px 6px rgba(232,194,106,.7); } }

.msg { margin: 0; font-size: 13px; color: #c9ddf7; min-height: 2.6em; text-align: center; line-height: 1.3; padding: 0 6px; }

.shake { animation: shake .55s; }
@keyframes shake { 20%,60% { transform: translateX(-9px); } 40%,80% { transform: translateX(9px); } }

/* ---------- Lettre ---------- */
.letter-scene { position: relative; z-index: 2; min-height: 100vh; padding: 40px 16px 80px; display: flex; justify-content: center; }
.letter {
  width: min(700px, 100%); padding: 40px 32px; border-radius: 8px;
  background: linear-gradient(#fffaf3, #fdf1e4); color: #3b2a30;
  box-shadow: 0 20px 60px rgba(0,10,40,.7), 0 0 70px rgba(90,150,255,.3);
  font-size: 22px; line-height: 1.6; font-family: var(--serif); animation: rise 1.6s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(40px) scale(.96); } }
.letter h1 { margin-top: 0; color: #c2406f; font-size: 38px; font-weight: 600; }
.letter p { margin: 0 0 1.1em; white-space: pre-line; opacity: 0; transform: translateY(10px); animation: reveal .9s forwards; }
@keyframes reveal { to { opacity: 1; transform: none; } }
.letter .stamp { text-align: center; font-size: 16px; color: #a88; letter-spacing: 2px;
  border-top: 1px dashed #d9b9b9; border-bottom: 1px dashed #d9b9b9; padding: 6px 0; }
.letter .key { font-weight: 600; color: #c2406f; font-size: 1.15em; }
.sign { text-align: right; font-style: italic; color: #c2406f; opacity: 0; animation: reveal 1s forwards; }

@media (max-width: 480px) { .letter { padding: 28px 20px; font-size: 20px; } }

/* =====================  v2 : coffre-fort réaliste  ===================== */
.safe { aspect-ratio: 380 / 600; filter: drop-shadow(0 0 60px rgba(70,130,255,.4)); margin: 20px 0 34px; }

.cabinet {
  position: absolute; inset: -16px; border-radius: 30px;
  background:
    linear-gradient(160deg, rgba(255,255,255,.18), rgba(255,255,255,0) 30%),
    linear-gradient(145deg, #46506c, #1a2033 70%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.35), inset 0 -5px 12px rgba(0,0,0,.7),
    inset 0 0 0 2px #0c101b, 0 30px 60px rgba(0,0,0,.65);
}
.safe::after { /* pieds */
  content: ""; position: absolute; left: -2%; right: -2%; bottom: -34px; height: 18px;
  background: linear-gradient(90deg, #0d111c 0 16%, transparent 16% 84%, #0d111c 84%);
  border-radius: 0 0 10px 10px; z-index: -1;
}
.hinge {
  position: absolute; left: -26px; width: 26px; height: 64px; border-radius: 6px 0 0 6px; z-index: 3;
  background: linear-gradient(90deg, #272f45, #8591ad 45%, #3a4360);
  box-shadow: 0 3px 8px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.4);
}
.hinge::before, .hinge::after {
  content: ""; position: absolute; left: 7px; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d6deef, #3a4360); box-shadow: 0 0 0 1px #0c101b;
}
.hinge::before { top: 9px; } .hinge::after { bottom: 9px; }
.h1 { top: 12%; } .h2 { bottom: 12%; }

.inside { border-radius: 16px; }

.door {
  border: 0; border-radius: 16px;
  background:
    linear-gradient(115deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 28%, rgba(255,255,255,.07) 52%, rgba(255,255,255,0) 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, rgba(0,0,0,.05) 1px 3px),
    linear-gradient(160deg, #6a7692, #2b3550 55%, #1e2740);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.4), inset 0 -3px 0 rgba(0,0,0,.5),
    inset 0 0 0 2px #0c101b, 0 10px 30px rgba(0,0,0,.5);
  padding: 30px 16px 20px;
}
.door::before { /* panneau intérieur en relief */
  content: ""; position: absolute; inset: 12px; border-radius: 10px; pointer-events: none;
  border: 2px solid rgba(0,0,0,.35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 0 0 1px rgba(255,255,255,.1);
}
.bolt {
  width: 16px; height: 16px; z-index: 2;
  background: radial-gradient(circle at 32% 28%, #f0f4ff, #7d89a6 40%, #232b42);
  box-shadow: 0 0 0 2px #0c101b, 0 2px 3px rgba(0,0,0,.6);
}
.bolt::after { content: ""; position: absolute; left: 3px; right: 3px; top: 7px; height: 2px; background: #1a2033; transform: rotate(35deg); }
.b1 { top: 18px; left: 18px; } .b2 { top: 18px; right: 18px; }
.b3 { bottom: 18px; left: 18px; } .b4 { bottom: 18px; right: 18px; }

.plate {
  z-index: 1; padding: 5px 20px; border-radius: 4px;
  font: 600 15px var(--serif); letter-spacing: 6px; text-transform: uppercase; color: #3b2a0a;
  background: linear-gradient(#f4dc98, #b98c33 55%, #e2c273);
  box-shadow: 0 2px 4px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.7), inset 0 -1px 0 rgba(0,0,0,.35);
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.plate span { color: #a3274f; font-size: 12px; letter-spacing: 0; }

.led-wrap { position: absolute; top: 26px; right: 44px; width: 22px; height: 22px; border-radius: 50%; z-index: 2;
  background: linear-gradient(145deg, #0c101b, #4a5470); display: grid; place-items: center;
  box-shadow: 0 1px 0 rgba(255,255,255,.25); }
.led { position: static; width: 14px; height: 14px; }

/* cadran en relief */
.dial {
  z-index: 1; border-radius: 50%; margin-top: 4px;
  background: radial-gradient(circle, #05070d 0 60%, #1a2033 61% 100%);
  box-shadow: 0 0 0 6px #4b5675, 0 0 0 9px #0c101b, 0 10px 18px rgba(0,0,0,.65), inset 0 6px 16px #000;
}
.knurl { position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(255,255,255,.14) 0 1deg, rgba(0,0,0,.25) 1deg 3deg);
  -webkit-mask: radial-gradient(circle, transparent 0 96%, #000 97% 100%);
          mask: radial-gradient(circle, transparent 0 96%, #000 97% 100%); }
.dial::before { top: -16px; z-index: 3; }

.lcd {
  width: 156px; border-radius: 12px; overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 0%, #0f1a33, #05070d 70%);
  box-shadow: inset 0 0 18px #000, 0 0 0 3px #0c101b, 0 0 0 5px #5a6685, 0 0 18px rgba(255,200,90,.12);
}
.lcd::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,0) 40%); }
.arrow { width: 34px; height: 22px; padding: 0; font-size: 12px; border-radius: 11px;
  border: 1px solid rgba(232,194,106,.35); background: rgba(232,194,106,.08); transition: .2s; }
.arrow:hover { background: rgba(232,194,106,.25); box-shadow: 0 0 10px rgba(232,194,106,.4); }
.arrow:active { transform: scale(.94); }

/* bouton Valider : vrai bouton en relief */
.validate {
  position: relative; z-index: 1; min-width: 210px; padding: 12px 28px; border-radius: 30px; overflow: hidden;
  font: 700 16px var(--serif); letter-spacing: 2px; text-transform: uppercase; color: #3d2a05;
  text-shadow: 0 1px 0 rgba(255,255,255,.55);
  background: linear-gradient(#fbeab0 0%, #e4bd5c 45%, #c3912f 55%, #e9c76e 100%);
  box-shadow: 0 5px 0 #7d5918, 0 9px 14px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.8), inset 0 -2px 3px rgba(120,80,10,.4);
  transition: transform .08s, box-shadow .08s;
}
.validate::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent);
  animation: sweep 3.6s ease-in-out infinite; }
@keyframes sweep { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.validate:hover { filter: brightness(1.07); }
.validate:active { transform: translateY(4px); box-shadow: 0 1px 0 #7d5918, 0 3px 6px rgba(0,0,0,.5), inset 0 2px 4px rgba(120,80,10,.5); }

/* poignée massive */
.handle {
  z-index: 1; width: 98px; height: 98px; border: 0;
  background: radial-gradient(circle at 35% 30%, #7c88a5, #232b42 70%);
  box-shadow: 0 0 0 4px #0c101b, 0 0 0 7px #4b5675, 0 10px 18px rgba(0,0,0,.65), inset 0 2px 0 rgba(255,255,255,.3);
}
.handle .spoke {
  width: 10px; height: 108%; border-radius: 5px;
  background: linear-gradient(90deg, #8a6420, #f6dd9c 45%, #a3772a);
  box-shadow: 0 2px 4px rgba(0,0,0,.5);
}
.handle .spoke::before, .handle .spoke::after {
  content: ""; position: absolute; left: 50%; width: 20px; height: 20px; border-radius: 50%; transform: translateX(-50%);
  background: radial-gradient(circle at 35% 30%, #fff3c4, #c3912f 60%, #6e4d12); box-shadow: 0 2px 4px rgba(0,0,0,.6);
}
.handle .spoke::before { top: -8px; } .handle .spoke::after { bottom: -8px; }
.handle .hub {
  inset: 30px; z-index: 2; color: #8e1f45; font-size: 18px;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #d4a23f 55%, #7a5514);
  box-shadow: 0 3px 8px rgba(0,0,0,.7), inset 0 -2px 3px rgba(90,50,0,.5);
}
.handle:disabled { opacity: .45; filter: grayscale(.5) brightness(.85); }
.handle.ready { box-shadow: 0 0 0 4px #0c101b, 0 0 0 7px #e8c26a, 0 0 30px 8px rgba(232,194,106,.65), 0 10px 18px rgba(0,0,0,.65); animation: none; }

.msg { z-index: 1; font: italic 15px var(--serif); color: #d9e6fb; text-shadow: 0 1px 2px #000; min-height: 2.8em; }

/* ===== animations d'arrière-plan ===== */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.glow { position: absolute; width: 80vmax; height: 80vmax; border-radius: 50%; filter: blur(90px); }
.g1 { background: #2d6bff; opacity: .28; top: -40vmax; left: -25vmax; animation: drift 20s ease-in-out infinite alternate; }
.g2 { background: #b04a9e; opacity: .16; bottom: -45vmax; right: -30vmax; animation: drift 26s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(10vmax, 7vmax) scale(1.12); } }

.bg-star { position: absolute; border-radius: 50%; background: #fff; animation: twinkle 3s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .1; transform: scale(.8); } to { opacity: 1; transform: scale(1.3); box-shadow: 0 0 6px #fff; } }

.orb { position: absolute; bottom: -60px; border-radius: 50%;
  background: radial-gradient(circle, rgba(170,210,255,.55), rgba(170,210,255,0) 70%);
  animation: orbRise linear infinite; }
@keyframes orbRise {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx), -115vh); opacity: 0; }
}

.shoot { position: absolute; width: 130px; height: 2px; opacity: 0; top: 10%; left: 75%;
  background: linear-gradient(90deg, #fff, transparent); transform: rotate(-35deg); }
.s1 { animation: shoot 9s linear 2s infinite; }
.s2 { top: 28%; left: 45%; animation: shoot 14s linear 7s infinite; }
.s3 { top: 6%; left: 25%; animation: shoot 19s linear 12s infinite; }
@keyframes shoot {
  0% { opacity: 0; transform: translate(0,0) rotate(-35deg); }
  3% { opacity: 1; }
  10% { opacity: 0; transform: translate(-280px, 195px) rotate(-35deg); }
  100% { opacity: 0; }
}

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

/* ===== écran réduit + éléments plus espacés ===== */
.safe { aspect-ratio: 380 / 660; }
.door { padding: 34px 16px 28px; justify-content: space-evenly; }
.lcd { width: 124px; padding: 6px 4px 8px; gap: 3px; border-radius: 10px; }
.lcd-label { font-size: 10px; margin-top: 2px; }
.num { font-size: 34px; }
.num.wide { font-size: 28px; }
.arrow { width: 28px; height: 18px; font-size: 10px; }
.lcd-sub { font-size: 12px; height: 15px; }
.dots i { width: 6px; height: 6px; }
.msg { margin-top: 4px; }
.safe { aspect-ratio: 380 / 730; }
.handle { margin: 6px 0; }

/* ===== écran sans bordure : seul le cercle reste ===== */
.lcd { background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
.lcd::after { display: none; }

/* pas de sélection de texte en tournant le cadran */
.safe, .safe * { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

/* coffre plus compact */
.safe { zoom: .78; }
@media (max-height: 760px) { .safe { zoom: .66; } }

/* pas de zoom au pincement ni au double-tap */
html, body { touch-action: pan-y; overscroll-behavior: none; }

/* ===== couronne d'écrous (31 jours, 12 mois) ===== */
.nuts { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  transition: transform .45s cubic-bezier(.3,1.4,.5,1); }
.dial:not(.nut-mode) .nuts { display: none; }
.nuts i {
  position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
  background: linear-gradient(145deg, #f7e2a0, #b98c33 60%, #7a5514);
  transition: background .25s, scale .25s;
}
.nuts i::after { content: ""; position: absolute; inset: 4px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #2a3146, #05070d); }
.nuts i.on { scale: 1.45; background: linear-gradient(145deg, #ffd1e0, #ff5d8f 60%, #a3274f); }
.nuts i.on::after { background: radial-gradient(circle, #fff, #ffb3cc); }
.dial.nut-mode .ring {
  background: radial-gradient(circle, transparent 60%, rgba(0,0,0,.45) 61%, #1b2234 100%);
}
.dial.nut-mode .ring::before { display: none; }
.dial.nut-mode::after { /* halo fixe sur l'écrou actif, en haut */
  content: ""; position: absolute; top: 14px; left: 50%; width: 30px; height: 30px; margin-left: -15px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,93,143,.7), transparent 70%); pointer-events: none; z-index: 1;
}

/* ===== indice, retour arrière ===== */
.hint-btn {
  position: absolute; top: 22px; left: 44px; z-index: 2; width: 26px; height: 26px; border-radius: 50%;
  border: 0; cursor: pointer; font: 700 15px Georgia, serif; color: #3d2a05;
  background: linear-gradient(#fbeab0, #c3912f);
  box-shadow: 0 2px 0 #7d5918, 0 4px 8px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.7);
}
.hint-btn:active { transform: translateY(2px); box-shadow: 0 0 0 #7d5918; }
.actions { display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 1; min-height: 76px; justify-content: center; }
.back {
  background: none; border: 0; cursor: pointer; color: #b9d2f5; font: italic 14px Georgia, serif;
  text-decoration: underline; text-underline-offset: 3px; opacity: .85;
}
.back:hover { opacity: 1; color: #fff; }

/* ===== la lettre, une page à la fois ===== */
.letter-scene { align-items: center; padding: 24px 16px; min-height: 100vh; min-height: 100dvh; }
.story { width: min(700px, 100%); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.progress { display: flex; gap: 4px; width: 100%; }
.progress i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.16); transition: .5s; }
.progress i.done { background: var(--pink); box-shadow: 0 0 8px rgba(255,93,143,.7); }

.page {
  width: 100%; min-height: min(54vh, 440px); display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 38px 30px; border-radius: 24px; cursor: pointer;
  font: 400 28px/1.55 var(--serif); color: #f3f7ff; white-space: pre-line;
  background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 24px 70px rgba(0,10,40,.55), inset 0 0 50px rgba(120,170,255,.1), 0 0 60px rgba(90,150,255,.18);
  animation: pageIn .8s ease both;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.page.long { font-size: 23px; line-height: 1.6; }
.w { display: inline-block; opacity: 0; transform: translateY(10px); filter: blur(5px);
  animation: wordIn .7s ease forwards; }
@keyframes wordIn { to { opacity: 1; transform: none; filter: none; } }
.w.key { color: #ff9ab9; font-weight: 600; font-size: 1.12em; text-shadow: 0 0 20px rgba(255,93,143,.8); }
.page.title { font-size: 52px; font-weight: 600; text-shadow: 0 0 30px rgba(154,208,255,.8); }
.page.stamp { font: 600 22px "Courier New", monospace; letter-spacing: 5px; color: #9ad0ff; text-shadow: 0 0 14px rgba(154,208,255,.7); }
.page.sign { font-style: italic; font-size: 34px; color: #ffc2d6; text-shadow: 0 0 24px rgba(255,93,143,.7); }

.story-nav { display: flex; align-items: center; gap: 14px; }
.nav { cursor: pointer; font-family: var(--serif); color: #fff; border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1); backdrop-filter: blur(6px); transition: .3s; }
.nav.ghost { width: 46px; height: 46px; border-radius: 50%; font-size: 26px; line-height: 1; }
.nav.main { padding: 12px 34px; border-radius: 30px; font-size: 21px; letter-spacing: 1px; opacity: .55; }
.nav.main.ready { opacity: 1; border-color: rgba(255,154,185,.8); background: rgba(255,93,143,.22);
  box-shadow: 0 0 26px rgba(255,93,143,.45); animation: glowBtn 1.8s ease-in-out infinite alternate; }
@keyframes glowBtn { to { box-shadow: 0 0 40px rgba(255,93,143,.75); } }
.nav:hover { background: rgba(255,255,255,.2); }

@media (max-width: 480px) {
  .page { font-size: 23px; padding: 28px 20px; min-height: 48vh; }
  .page.long { font-size: 19px; }
  .page.title { font-size: 40px; }
  .page.sign { font-size: 27px; }
}

.page .txt { width: 100%; }

/* traits simples à la place des écrous */
.nuts i {
  width: 3px; height: 18px; margin: -9px 0 0 -1.5px; border-radius: 2px; clip-path: none;
  background: var(--gold); box-shadow: 0 0 4px rgba(232,194,106,.5);
}
.nuts i::after { display: none; }
.nuts i.on { scale: 1.6 1.35; background: var(--pink); box-shadow: 0 0 10px var(--pink); }
.nuts i.on { scale: none; width: 5px; height: 24px; margin: -12px 0 0 -2.5px; }

/* plus de rebond : la roue tourne de façon fluide, sans dépassement */
.ring, .nuts { transition: transform .18s ease-out; }

/* trait et repère du cadran en bleu */
.nuts i.on { background: #6fc3ff; box-shadow: 0 0 10px #6fc3ff; }
.dial::before { border-top-color: #6fc3ff; filter: drop-shadow(0 0 6px #6fc3ff); }
.dial.nut-mode::after { background: radial-gradient(circle, rgba(111,195,255,.7), transparent 70%); }
.ring {
  background:
    repeating-conic-gradient(from -1.5deg, #6fc3ff 0 3deg, transparent 3deg 36deg),
    repeating-conic-gradient(from 0deg, var(--gold) 0 1.2deg, transparent 1.2deg 7.2deg),
    radial-gradient(circle, transparent 60%, rgba(0,0,0,.45) 61%, #1b2234 100%);
}
.dial.nut-mode .ring { background: radial-gradient(circle, transparent 60%, rgba(0,0,0,.45) 61%, #1b2234 100%); }

/* indice plus visible */
.hint-btn { width: 36px; height: 36px; top: 16px; left: 38px; font-size: 20px;
  animation: hintPulse 2.2s ease-out infinite; }
.hint-btn::after { content: "Indice"; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 3px; font: 700 10px Georgia, serif; letter-spacing: 1px; text-transform: uppercase;
  color: #ffe9a8; text-shadow: 0 1px 2px #000; }
@keyframes hintPulse {
  0% { box-shadow: 0 2px 0 #7d5918, 0 0 0 0 rgba(255,214,110,.75); }
  70%, 100% { box-shadow: 0 2px 0 #7d5918, 0 0 0 14px rgba(255,214,110,0); }
}
.hint-btn.urgent { animation-duration: 1.1s; }
.msg.hint-on {
  font: italic 700 17px Georgia, serif; color: #fff3c4; padding: 8px 14px; border-radius: 12px;
  background: rgba(232,194,106,.16); border: 1px solid rgba(232,194,106,.55);
  text-shadow: 0 0 12px rgba(255,214,110,.8); box-shadow: 0 0 22px rgba(232,194,106,.35);
  animation: hintIn .5s ease both;
}
@keyframes hintIn { from { opacity: 0; transform: scale(.9); } }

/* contenu centré dans la porte */
.door { justify-content: center; gap: 22px; padding: 28px 16px; }
.dial { margin-top: 0; }
.msg { margin-top: 0; }

/* bouton indice : pastille en bas de la porte */
.hint-btn {
  top: auto; bottom: 30px; left: 50%; transform: translateX(-50%);
  width: auto; height: auto; padding: 7px 18px; border-radius: 20px;
  font: 700 13px Georgia, serif; letter-spacing: 1px; white-space: nowrap;
}
.hint-btn::after { display: none; }
.hint-btn:active { transform: translateX(-50%) translateY(2px); }

/* barres du navigateur (iPhone) : même couleur en haut et en bas */
html { background-color: #081633; }
body {
  background: radial-gradient(ellipse 120% 70% at 50% 42%, #1b4fa8 0%, #0d2557 55%, #081633 100%) fixed #081633;
}
.scene, .letter-scene { min-height: 100vh; min-height: 100dvh; }

/* ===== réponse à Jordan ===== */
.page.reply { cursor: default; font-size: 22px; }
.reply-title { margin: 0 0 18px; font-size: 28px; color: #fff; text-shadow: 0 0 20px rgba(154,208,255,.7); }
.opts { display: flex; flex-direction: column; gap: 12px; }
.opt {
  font: 400 20px/1.35 var(--serif); color: #eaf3ff; text-align: center; cursor: pointer;
  padding: 14px 18px; border-radius: 16px; border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.08); transition: .25s;
}
.opt:hover { background: rgba(255,255,255,.16); }
.opt.selected { border-color: #6fc3ff; background: rgba(111,195,255,.2); box-shadow: 0 0 24px rgba(111,195,255,.45); color: #fff; }
.reassure {
  margin: 18px 0 0; font-style: italic; font-size: 21px; color: #cfe6ff; text-shadow: 0 0 16px rgba(111,195,255,.7);
  animation: pageIn .7s ease both;
}
.send {
  margin-top: 16px; padding: 13px 30px; border: 0; border-radius: 30px; cursor: pointer;
  font: 700 17px Georgia, serif; color: #06210f; letter-spacing: .5px;
  background: linear-gradient(#7af0a8, #25d366 60%, #1aa150);
  box-shadow: 0 5px 0 #11703a, 0 10px 18px rgba(0,0,0,.4), 0 0 26px rgba(37,211,102,.4);
  animation: pageIn .7s ease both;
}
.send:active { transform: translateY(4px); box-shadow: 0 1px 0 #11703a; }
@media (max-width: 480px) { .opt { font-size: 18px; } .reply-title { font-size: 24px; } .reassure { font-size: 19px; } }

/* bouton WhatsApp refait */
.send {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 14px;
  margin-top: 20px; padding: 10px 22px 10px 12px; border-radius: 40px; cursor: pointer; text-align: left;
  color: #fff; font-family: var(--serif);
  background: linear-gradient(135deg, rgba(52,224,120,.95), rgba(14,128,110,.95));
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -3px 8px rgba(0,60,40,.35),
              0 10px 26px rgba(0,0,0,.4), 0 0 34px rgba(37,211,102,.5);
  transition: transform .15s, box-shadow .25s;
}
.send::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; left: -50%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  animation: sweep 3.4s ease-in-out infinite; }
.send:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -3px 8px rgba(0,60,40,.35),
              0 14px 30px rgba(0,0,0,.45), 0 0 46px rgba(37,211,102,.75); }
.send:active { transform: translateY(1px) scale(.98); }
.send-ico { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.send-ico svg { width: 26px; height: 26px; }
.send-txt { display: flex; flex-direction: column; line-height: 1.1; }
.send-txt small { font-size: 13px; opacity: .9; letter-spacing: .5px; }
.send-txt b { font-size: 24px; font-weight: 700; letter-spacing: .5px; text-shadow: 0 1px 2px rgba(0,60,40,.5); }
.send-arrow { font-size: 22px; margin-left: 2px; transition: transform .2s; }
.send:hover .send-arrow { transform: translateX(4px); }
