/* Veilleuse — écrans. */

/* ─── Accueil ────────────────────────────────────────────────── */
.home-hero { position: relative; height: clamp(140px, 21vh, 240px); }
.orb-anchor { position: absolute; left: 50%; top: 56%; width: 2px; height: 2px; }
.greeting { text-align: center; position: relative; }
.greeting .caps { margin: 0 0 10px; letter-spacing: .22em; font-size: 11px; color: rgba(154, 160, 184, .85); }
.greeting h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(46px, 13vw, 58px);
  line-height: 1.02;
  letter-spacing: -.012em;
  color: var(--lune);
  font-variation-settings: 'SOFT' 100, 'WONK' 0, 'opsz' 144;
  text-shadow: 0 0 40px rgba(240, 179, 94, .18);
}
.greeting .invite {
  margin: 12px auto 0;
  max-width: 300px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 320;
  font-size: 18.5px;
  line-height: 1.45;
  color: var(--brume);
  font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 24;
}
.home-cta { margin-top: clamp(22px, 3.4vh, 34px); }
.defaults {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 9px;
  margin: 16px auto 0;
  padding: 6px 10px;
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--ardoise);
  text-decoration: none;
  transition: color var(--t-micro);
}
.defaults i { width: 3px; height: 3px; border-radius: 50%; background: rgba(240, 179, 94, .45); }
.defaults:active { color: var(--brume); }
/* Une ligne discrète plutôt qu'un encadré : l'état se lit sans voler la place. */
.notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 4px 0 0;
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--ardoise);
  text-align: center;
}
.notice i { flex: none; width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 0 1.2px var(--crepuscule) inset; }

.resume-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: clamp(16px, 2.6vh, 26px);
  padding: 10px 14px 10px 10px;
  border-radius: 22px;
  text-align: left;
  background: rgba(236, 228, 212, .035);
  box-shadow: 0 0 0 1px var(--line) inset;
  transition: transform var(--t-micro) var(--souffle);
}
.resume-card:active { transform: scale(.985); }
.cover.mini { width: 58px; flex: none; border-radius: 14px; }
.resume-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.resume-main .caps { font-size: 10px; color: var(--flamme); }
.resume-title { font-family: var(--serif); font-size: 18px; color: var(--lune); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variation-settings: 'SOFT' 100, 'opsz' 24; }
.resume-main .filament { margin-top: 6px; }
.resume-play { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--miel); background: rgba(240, 179, 94, .1); }
.resume-play svg { width: 16px; height: 16px; }

.shelf-section { margin-top: 0; }
.shelf-section .section-head { margin-top: clamp(22px, 3.2vh, 34px); }
.shelf {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) 6px;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.shelf::-webkit-scrollbar { display: none; }
.cover-card { flex: none; width: 150px; display: block; color: inherit; text-decoration: none; scroll-snap-align: start; }
.cover-card .cover { transition: transform 600ms var(--souffle), box-shadow 600ms var(--souffle); }
.cover-card:active .cover { transform: scale(.97); }
.cc-title {
  display: block;
  margin-top: 11px;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.22;
  color: var(--lune);
  font-weight: 380;
  font-variation-settings: 'SOFT' 100, 'opsz' 24;
}
.cc-meta { display: block; margin-top: 4px; font-size: 11.5px; letter-spacing: .06em; color: var(--ardoise); }
.badge {
  position: absolute;
  left: 9px;
  top: 9px;
  z-index: 2;
  padding: 4px 9px 5px;
  border-radius: 999px;
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--miel);
  background: rgba(8, 10, 20, .78);
  box-shadow: 0 0 0 1px rgba(250, 219, 168, .16) inset;
}
.badge.live::before { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--flamme); box-shadow: 0 0 8px var(--flamme); animation: flicker 2s infinite; }

/* ─── Ce soir ────────────────────────────────────────────────── */
.screen-setup { padding-bottom: 0; }
.setup-head { margin: 0; }
.setup-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 11vw, 46px);
  line-height: 1.05;
  color: var(--lune);
  font-variation-settings: 'SOFT' 100, 'opsz' 144;
}
.setup-head p { margin: 8px 0 0; font-family: var(--serif); font-style: italic; font-size: 17.5px; color: var(--brume); font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 20; }
.setup-block { margin-top: clamp(18px, 2.4vh, 26px); }
.setup-block h2 { margin: 0 0 9px; }
.setup-block h2 .soft { color: var(--ardoise); letter-spacing: .12em; }
.setup-spacer { height: 146px; }
body.has-now .setup-spacer { height: 230px; }

/* Le détail facultatif : une ligne qui s'ouvre en champ au toucher. */
.detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  color: var(--brume);
  font-size: 14.5px;
  letter-spacing: .01em;
  box-shadow: 0 0 0 1px var(--line) inset;
  background: rgba(236, 228, 212, .02);
  transition: opacity 500ms var(--souffle), transform var(--t-micro) var(--souffle);
}
.detail-toggle:active { transform: scale(.97); }
.detail-toggle svg { width: 17px; height: 17px; color: var(--miel); opacity: .85; }
.detail-toggle .soft { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ardoise); }
.detail-field { display: none; }
.detail-block.open .detail-toggle { display: none; }
.detail-block.open .detail-field { display: block; animation: unfold 700ms var(--souffle) both; }
@keyframes unfold { from { opacity: 0; transform: translate3d(0, 8px, 0); } }
.setup-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  padding: 34px var(--gutter) calc(var(--safe-b) + 16px);
  background: linear-gradient(180deg, rgba(5, 6, 12, 0), rgba(5, 6, 12, .86) 40%, rgba(5, 6, 12, .97));
}
.cta-anchor { position: absolute; left: 50%; top: 65px; width: 2px; height: 2px; }
.cost { margin: 12px 0 0; text-align: center; font-size: 12.5px; letter-spacing: .03em; color: var(--ardoise); }
.cost b { color: var(--brume); font-weight: 500; }
.screen-setup.leaving .setup-cta { opacity: 0; transition: opacity 500ms var(--sortie); }
.setup-cta { transition: opacity 500ms var(--souffle), transform 600ms var(--souffle); }
body.typing .setup-cta { opacity: 0; transform: translate3d(0, 24px, 0); pointer-events: none; }

/* ─── Feuilles d'état (erreurs, plafond, clé) ────────────────── */
.state-sheet { text-align: center; padding-top: 6px; }
.state-sheet .sub { margin-left: auto; margin-right: auto; max-width: 330px; line-height: 1.55; }
.state-art {
  width: 74px; height: 74px; margin: 6px auto 14px;
  display: grid; place-items: center; border-radius: 50%;
  color: var(--miel);
  background: radial-gradient(closest-side, rgba(240, 179, 94, .18), rgba(240, 179, 94, 0));
  box-shadow: 0 0 0 1px rgba(240, 179, 94, .18) inset;
}
.state-art svg { width: 30px; height: 30px; }
.sub.small { font-size: 12.5px; margin-top: 14px; color: var(--ardoise); }
.amb-level { margin-top: 22px; }
.amb-level .caps { margin: 0 0 4px; }

/* ─── Écoute ─────────────────────────────────────────────────── */
#scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: var(--nuit-950);
  pointer-events: none;
  opacity: 0;
  transition: opacity 2600ms var(--souffle);
}
#scene.on { opacity: 1; }
#scene.fading { opacity: .25; transition-duration: 20000ms; }
.scene-art { position: absolute; inset: 0; }
#scene img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  animation: scene-drift 90s var(--lune-ease) infinite alternate;
}
@keyframes scene-drift { from { transform: scale(1.06) translate3d(0, 0, 0); } to { transform: scale(1.1) translate3d(-1.2%, -.8%, 0); } }
.scene-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 6, 12, .55) 0%, rgba(5, 6, 12, 0) 22%),
    linear-gradient(0deg, rgba(5, 6, 12, .96) 0%, rgba(5, 6, 12, .78) 30%, rgba(5, 6, 12, 0) 58%);
}
.scene-light { position: absolute; width: 2px; height: 2px; }

.listen { display: flex; flex-direction: column; padding-bottom: calc(var(--safe-b) + 22px); overflow: hidden; }
/* L'écoute naît d'un bloc, une fois l'écran précédent effacé. */
.screen.listen { opacity: 0; transition: opacity 1100ms var(--souffle) 300ms; }
.screen.listen.in { opacity: 1; }
.screen.listen.leaving { opacity: 0; transition: opacity 420ms var(--sortie); }
#scene.leaving { transition-duration: 800ms; }
.listen-top { position: relative; z-index: 2; }
.part-label { transition: opacity 900ms var(--souffle); }
.phase-intro .part-label { opacity: 0; }
.listen .prep, .listen .play, .listen .end {
  position: absolute;
  left: var(--gutter); right: var(--gutter);
  transition: opacity 1600ms var(--souffle), transform 1800ms var(--souffle);
}
.listen .prep { top: calc(var(--top) + 60px); bottom: calc(var(--safe-b) + 26px); display: flex; flex-direction: column; align-items: center; text-align: center; }
.listen .play { bottom: calc(var(--safe-b) + 20px); }
.listen .end { top: 38%; text-align: center; }

.phase-intro .play, .phase-intro .end { opacity: 0; transform: translate3d(0, 26px, 0); pointer-events: none; }
.phase-story .prep, .phase-end .prep { opacity: 0; transform: translate3d(0, -20px, 0) scale(.98); pointer-events: none; }
.phase-story .end { opacity: 0; pointer-events: none; transform: translate3d(0, 20px, 0); }
.phase-end .play { opacity: 0; transform: translate3d(0, 12px, 0); pointer-events: none; transition-duration: 2200ms; }
.phase-end .end { opacity: 1; transform: none; transition-duration: 3200ms; transition-delay: 1800ms; }
.phase-end .listen-top { opacity: .3; transition: opacity 4000ms; }
.listen.arriving .prep { opacity: .0; transition-duration: 2400ms; }

.prep-title { min-height: 118px; }
.prep-title .caps { margin: 0 0 12px; color: var(--flamme); opacity: .9; }
.prep-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 320;
  font-size: 31px;
  line-height: 1.15;
  color: var(--lune);
  font-variation-settings: 'SOFT' 100, 'opsz' 60;
}
.prep-title .writing { font-style: italic; color: var(--ardoise); font-size: 20px; font-weight: 320; animation: breathe-text 4s var(--lune-ease) infinite; }
@keyframes breathe-text { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.prep-title .reveal { display: inline-block; animation: reveal 2400ms var(--souffle) both; }
@keyframes reveal { from { opacity: 0; transform: translate3d(0, 10px, 0); letter-spacing: .04em; } to { opacity: 1; transform: none; letter-spacing: 0; } }
.prep-lieu { margin: 8px 0 0; font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--brume); min-height: 1.4em; animation: reveal 2400ms var(--souffle) 600ms both; }
.breath-anchor { flex: 1; width: 2px; min-height: 240px; }
.breath-cue {
  min-height: 2.4em;
  max-width: 320px;
  margin: 0 0 36px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 320;
  font-size: 25px;
  line-height: 1.3;
  color: var(--lune);
  font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 36;
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  transition: opacity 1100ms var(--souffle), transform 1400ms var(--souffle);
}
.breath-cue.show { opacity: .92; transform: none; }
.prep-foot { width: 100%; max-width: 280px; }
.prep-step { margin: 14px 0 0; font-size: 13px; letter-spacing: .06em; color: var(--ardoise); transition: opacity 450ms var(--souffle); }
.prep-step.swap { opacity: 0; }

.play-kicker { margin: 0 0 10px; color: rgba(250, 219, 168, .8); }
.play-title {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-weight: 320;
  font-size: 34px;
  line-height: 1.1;
  color: var(--lune);
  font-variation-settings: 'SOFT' 100, 'opsz' 72;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .6);
}
.progress .filament { height: 2px; }
.filament.ticks { background: rgba(236, 228, 212, .12); }
.times { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; letter-spacing: .06em; color: var(--ardoise); font-variant-numeric: tabular-nums; }
.times .waiting { color: var(--miel); font-style: italic; letter-spacing: .02em; animation: breathe-text 3s infinite; }
.controls { display: flex; align-items: center; justify-content: space-between; margin: 22px 8px 0; }
.ctl {
  position: relative;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--lune);
  transition: transform var(--t-micro) var(--souffle), background var(--t-micro);
}
.ctl:active { transform: scale(.92); background: rgba(236, 228, 212, .06); }
.ctl svg { width: 26px; height: 26px; }
.ctl.big {
  width: 84px; height: 84px;
  color: var(--miel);
  background: radial-gradient(circle at 50% 28%, rgba(250, 219, 168, .2), rgba(240, 179, 94, .08) 60%, rgba(10, 12, 22, .6));
  box-shadow: 0 0 0 1px rgba(240, 179, 94, .55) inset, 0 0 34px -4px rgba(240, 179, 94, .35), 0 0 0 9px rgba(240, 179, 94, .05);
}
.ctl.big svg { width: 30px; height: 30px; }
.pills { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px 0 13px;
  border-radius: 999px;
  font-size: 13px; letter-spacing: .02em;
  color: var(--brume);
  background: rgba(8, 10, 20, .62);
  box-shadow: 0 0 0 1px var(--line-strong) inset;
  transition: transform var(--t-micro) var(--souffle);
}
.pill:active { transform: scale(.96); }
.pill svg { width: 17px; height: 17px; color: var(--miel); }

.play-text {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(100% + 18px);
  max-height: 44vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%);
  mask-image: linear-gradient(180deg, transparent, #000 18%);
}
.play-text p {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.62;
  color: var(--lune-92);
  font-variation-settings: 'SOFT' 100, 'opsz' 20;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity 1200ms var(--souffle), transform 1400ms var(--souffle);
  text-shadow: 0 1px 20px rgba(0, 0, 0, .8);
}
.play-text p.show { opacity: 1; transform: none; }
.text-on .play-kicker, .text-on .play-title { opacity: 0; transition: opacity 800ms; }

.end h1 {
  margin: 14px 0 12px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 50px;
  color: var(--lune);
  font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 144;
}
.end-kicker { color: var(--flamme); }
.end-sub { margin: 0; color: var(--brume); font-size: 15px; }
.end-back { display: inline-block; margin-top: 30px; }

/* ─── Bibliothèque ───────────────────────────────────────────── */
.lib-head { position: relative; margin: 6px 0 4px; }
.lib-head h1, .settings > h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 44px;
  line-height: 1.05;
  color: var(--lune);
  font-variation-settings: 'SOFT' 100, 'opsz' 144;
}
.lib-head p { margin: 8px 0 0; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--brume); font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.lib-orb { position: absolute; right: 26px; top: 20px; width: 2px; height: 2px; }
.lib-section { margin-top: 34px; }
.lib-section > h2 { margin: 0 0 14px; }
.shelf.big .cover-card { width: 212px; }
.shelf.big .cc-title { font-size: 19px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 14px; }
.grid .cover-card { width: auto; }
.lib-empty { margin: 40px 0 20px; text-align: center; }
.lib-empty h3 { margin: 22px 0 8px; font-family: var(--serif); font-weight: 340; font-size: 25px; color: var(--lune); }
.lib-empty p { margin: 0 auto 22px; max-width: 290px; color: var(--brume); font-size: 14.5px; }
.lantern { position: relative; width: 70px; height: 96px; margin: 0 auto; }
.lantern::before { content: ''; position: absolute; left: 50%; top: 0; width: 1px; height: 22px; background: var(--ardoise); }
.lantern span {
  position: absolute; left: 50%; top: 22px; width: 42px; height: 58px; margin-left: -21px;
  border-radius: 12px 12px 16px 16px;
  box-shadow: 0 0 0 1px rgba(236, 228, 212, .22) inset;
  background: radial-gradient(closest-side, rgba(250, 219, 168, .7), rgba(240, 179, 94, .15) 70%, rgba(240, 179, 94, 0));
  animation: breathe-halo 10s var(--lune-ease) infinite;
}

/* ─── Fiche ──────────────────────────────────────────────────── */
.detail-cover { margin: 4px auto 0; width: min(100%, 300px, 34vh); }
.detail-cover .cover { border-radius: 24px; box-shadow: 0 0 0 1px rgba(236, 228, 212, .08) inset, 0 40px 80px -40px rgba(0, 0, 0, 1), 0 30px 90px -50px rgba(240, 179, 94, .35); }
.detail-body { text-align: center; margin-top: clamp(18px, 2.6vh, 26px); }
.detail-lieu { margin: 0 0 10px; color: rgba(250, 219, 168, .8); }
.detail-body h1 { margin: 0; font-family: var(--serif); font-weight: 320; font-size: 34px; line-height: 1.12; color: var(--lune); font-variation-settings: 'SOFT' 100, 'opsz' 72; }
.detail-resume { margin: 16px auto 0; max-width: 340px; font-family: var(--serif); font-style: italic; font-size: 17.5px; line-height: 1.55; color: var(--brume); font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 18; }
.detail-meta { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 12px 0 0; font-size: 12.5px; letter-spacing: .06em; color: var(--ardoise); }
.detail-meta i { width: 3px; height: 3px; border-radius: 50%; background: rgba(240, 179, 94, .45); }
/* L'action principale reste sous le pouce, quelle que soit la longueur du résumé. */
.detail-actions {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 40px var(--gutter) calc(var(--safe-b) + 18px);
  background: linear-gradient(180deg, rgba(5, 6, 12, 0), rgba(5, 6, 12, .86) 38%, rgba(5, 6, 12, .97));
}
.detail-actions .restart { grid-column: 1 / -1; justify-self: center; margin-top: -4px; padding: 6px 8px 0; font-size: 13.5px; }
body.has-now .detail-actions { padding-bottom: calc(var(--safe-b) + 90px); }
.detail-spacer { height: 116px; }
.detail-spacer.tall { height: 150px; }
body.has-now .detail-spacer { height: 190px; }
body.has-now .detail-spacer.tall { height: 224px; }
.round-btn {
  width: 62px; height: 62px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--lune);
  background: rgba(236, 228, 212, .05);
  box-shadow: 0 0 0 1px var(--line-strong) inset;
  transition: transform var(--t-micro) var(--souffle), background var(--t-micro) var(--souffle);
}
.round-btn:active { transform: scale(.94); background: rgba(236, 228, 212, .1); }
.round-btn svg { width: 22px; height: 22px; }
.detail-foot { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ardoise); }
.detail-foot b { color: var(--brume); font-weight: 500; }
.text-btn.danger { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; color: rgba(214, 145, 138, .8); }
.text-btn.danger svg { width: 16px; height: 16px; }

/* ─── Lecture ────────────────────────────────────────────────── */
.reader article { max-width: 560px; margin: 0 auto; padding: 10px 4px 40px; }
.reader article > .caps { margin: 8px 0 12px; text-align: center; color: rgba(250, 219, 168, .8); }
.reader h1 { margin: 0 0 34px; text-align: center; font-family: var(--serif); font-weight: 300; font-size: 36px; line-height: 1.12; color: var(--lune); font-variation-settings: 'SOFT' 100, 'opsz' 96; }
.reader-text p {
  margin: 0 0 1.05em;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.72;
  color: rgba(236, 228, 212, .86);
  font-variation-settings: 'SOFT' 100, 'opsz' 16;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-wrap: pretty;
  user-select: text;
  -webkit-user-select: text;
}
.reader-text p.first::first-letter {
  float: left;
  margin: .06em .1em 0 0;
  font-size: 3.6em;
  line-height: .82;
  font-weight: 300;
  color: var(--miel);
  font-variation-settings: 'SOFT' 100, 'opsz' 144;
  text-shadow: 0 0 24px rgba(240, 179, 94, .45);
}
.reader .sep { text-align: center; color: rgba(240, 179, 94, .6); letter-spacing: .6em; margin: 1.6em 0; font-size: 13px; }
.reader .sep.end { margin-top: 2.4em; }

/* ─── Réglages ───────────────────────────────────────────────── */
.settings > h1 { margin: 6px 0 22px; }
.card {
  margin-bottom: 14px;
  padding: 18px 18px 16px;
  border-radius: 24px;
  background: rgba(236, 228, 212, .03);
  box-shadow: 0 0 0 1px var(--line) inset;
}
.card > h2 { margin: 0 0 14px; }
.budget-line { margin: 0 0 14px; color: var(--brume); font-size: 14px; }
.budget-line b { font-family: var(--serif); font-weight: 360; font-size: 28px; color: var(--lune); font-variation-settings: 'SOFT' 100, 'opsz' 40; }
.stepper { display: flex; align-items: center; justify-content: space-between; margin: 12px -8px 0; color: var(--brume); font-size: 14px; }
.hint { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ardoise); }
.hint.center { text-align: center; margin-top: 16px; }
.voice-list { list-style: none; margin: 16px 0 0; padding: 14px 0 0; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.voice-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.vl-name { font-family: var(--serif); font-size: 19px; color: var(--lune); font-variation-settings: 'SOFT' 100, 'opsz' 24; }
.vl-tag { font-family: var(--serif); font-style: italic; font-size: 14.5px; color: var(--brume); text-align: right; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.about .options, .about { display: grid; gap: 8px; }
.about .option { width: 100%; text-align: left; }
.about .option svg:last-child { width: 18px; height: 18px; opacity: .6; }

/* ─── Seuil (code d'accès) et hors connexion ─────────────────── */
.access { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: calc(var(--safe-t) + 40px); }
.access-hero { position: relative; width: 100%; height: 34vh; min-height: 220px; }
.access-hero > div { position: absolute; left: 50%; top: 55%; width: 2px; height: 2px; }
.wordmark.big { font-size: 40px; }
.access h1 { margin: 0; max-width: 320px; font-family: var(--serif); font-weight: 320; font-size: 30px; line-height: 1.15; color: var(--lune); font-variation-settings: 'SOFT' 100, 'opsz' 60; }
.access-sub { margin: 14px auto 28px; max-width: 310px; color: var(--brume); font-size: 14.5px; line-height: 1.55; }
.access-form { width: 100%; max-width: 340px; display: grid; gap: 12px; }
.access-form input { text-align: center; font-style: normal; letter-spacing: .12em; }
.access-err { min-height: 1.4em; margin: 2px 0 0; font-size: 13px; color: var(--crepuscule); }
.shake { animation: shake 520ms var(--souffle); }
@keyframes shake { 20% { transform: translateX(-7px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } 100% { transform: none; } }
.offline .lumen { max-width: 340px; }

/* Lecture du texte : le tableau s'efface derrière les mots. */
.scene-shade::after { content: ''; position: absolute; inset: 0; background: rgba(5, 6, 12, .62); opacity: 0; transition: opacity 1200ms var(--souffle); }
body.reading .scene-shade::after { opacity: 1; }
body.reading #veilleuse { opacity: .35; }
/* Étoiles vivantes sur le tableau */
.scene-stars span {
  position: absolute; width: 2px; height: 2px; margin: -1px; border-radius: 50%;
  background: #fff6e4; box-shadow: 0 0 5px 1px rgba(255, 240, 210, .5);
  animation: twinkle var(--d, 6s) var(--lune-ease) var(--delay, 0s) infinite;
}
@media (prefers-reduced-motion: reduce) { #scene img, .scene-stars span { animation: none; } }
.url-line { margin: 0; font-size: 13.5px; color: var(--miel); word-break: break-all; letter-spacing: .02em; user-select: text; -webkit-user-select: text; }

.settings .lib-head { margin: 6px 0 22px; }
.settings .lib-head h1 { margin: 0; }

.state-line { display: flex; align-items: baseline; gap: 10px; margin: 0; color: var(--lune); font-size: 15px; }
.state-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--crepuscule) inset; transform: translateY(-1px); }
.state-dot.on { background: var(--flamme); box-shadow: 0 0 10px rgba(240, 179, 94, .7); }

/* ─── Barre de progression manipulable ───────────────────────── */
.scrub { position: relative; height: 30px; margin: 0 -2px; touch-action: none; cursor: pointer; --pos: 0; --ready: 1; }
.scrub > span { position: absolute; left: 0; top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; pointer-events: none; }
.s-track { right: 0; background: rgba(236, 228, 212, .12); }
.s-ready { width: calc(var(--ready) * 100%); background: rgba(236, 228, 212, .16); }
.s-fill { width: calc(var(--pos) * 100%); background: linear-gradient(90deg, rgba(240, 179, 94, .4), var(--miel)); box-shadow: 0 0 10px rgba(240, 179, 94, .55); }
.s-thumb {
  left: calc(var(--pos) * 100%) !important;
  width: 12px; height: 12px !important; margin: -6px 0 0 -6px !important; border-radius: 50%;
  background: radial-gradient(closest-side, #fff6e4, var(--miel) 55%, rgba(240, 179, 94, .4));
  box-shadow: 0 0 12px 3px rgba(240, 179, 94, .4);
  transition: transform 300ms var(--souffle);
}
.scrubbing .s-thumb { transform: scale(1.7); }
.s-tip {
  top: -18px !important; height: auto !important; margin: 0 !important;
  transform: translateX(-50%); padding: 3px 8px; border-radius: 8px;
  font-size: 12px; color: var(--lune); background: rgba(10, 13, 24, .9);
  box-shadow: 0 0 0 1px var(--line-strong) inset; opacity: 0; transition: opacity 250ms;
  font-variant-numeric: tabular-nums;
}
.scrubbing .s-tip { opacity: 1; }
.ctl.big.is-playing { box-shadow: 0 0 0 1px rgba(240, 179, 94, .7) inset, 0 0 44px -4px rgba(240, 179, 94, .45), 0 0 0 9px rgba(240, 179, 94, .06); }
.icon-btn.on { color: var(--miel); }
.icon-btn.on::before { opacity: 1; transform: scale(1); background: rgba(240, 179, 94, .12); }

/* ─── Texte déroulant ────────────────────────────────────────── */
.transcript {
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--top) + 54px);
  bottom: calc(var(--safe-b) + 232px);
  z-index: 2;
  overflow-y: auto;
  padding: 0 var(--gutter);
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 82%, transparent 100%);
  opacity: 0;
  transition: opacity 700ms var(--souffle);
}
.transcript::-webkit-scrollbar { display: none; }
.transcript.open { opacity: 1; }
.t-inner { padding-top: 18vh; }
.t-p {
  margin: 0 0 1.05em;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.62;
  /* Nuances par la couleur, jamais par l'opacité : sur Android, des centaines de mots
     semi-transparents dans une zone qui défile scintillent à chaque changement. */
  color: rgba(236, 228, 212, .34);
  font-variation-settings: 'SOFT' 100, 'opsz' 18;
  transition: color 900ms var(--souffle);
  cursor: pointer;
}
.t-p.now { color: rgba(236, 228, 212, .96); }
.t-p.pending { color: rgba(236, 228, 212, .16); font-style: italic; cursor: default; }
.t-sep { text-align: center; color: rgba(240, 179, 94, .5); font-size: 12px; letter-spacing: .6em; margin: .4em 0 1.4em; }
.t-pad { height: 40vh; }
.text-on .play-kicker, .text-on .play-title { display: none; }

/* ─── Mini-lecteur : l'histoire continue ailleurs ────────────── */
#now {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--safe-b) + 12px);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 8px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(14, 17, 31, .97), rgba(8, 10, 19, .98));
  /* Un halo sombre autour de la barre : elle se pose sur la nuit au lieu de trancher sur le ciel. */
  box-shadow: 0 0 0 1px rgba(240, 179, 94, .24) inset, 0 -16px 44px 8px rgba(5, 6, 12, .8), 0 20px 50px -18px #000;
  transform: translate3d(0, 140%, 0);
  opacity: 0;
  transition: transform 700ms var(--souffle), opacity 500ms var(--souffle);
  pointer-events: none;
}
#now.show { transform: none; opacity: 1; pointer-events: auto; transition-delay: 380ms; }
#now .n-cover { width: 46px; height: 46px; flex: none; border-radius: 12px; overflow: hidden; background: var(--nuit-800); }
#now .n-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
#now .n-main { flex: 1; min-width: 0; text-align: left; }
#now .n-title { display: block; font-family: var(--serif); font-size: 16px; color: var(--lune); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variation-settings: 'SOFT' 100, 'opsz' 20; }
#now .n-sub { display: block; font-size: 12px; letter-spacing: .04em; color: var(--brume); }
#now .n-sub i { display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--flamme); box-shadow: 0 0 8px var(--flamme); }
#now .n-toggle { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--miel); background: rgba(240, 179, 94, .1); box-shadow: 0 0 0 1px rgba(240, 179, 94, .35) inset; }
#now .n-toggle svg { width: 18px; height: 18px; }
body.has-now .screen { padding-bottom: calc(var(--safe-b) + 96px); }
body.has-now .setup-cta { bottom: calc(var(--safe-b) + 74px); padding-bottom: 12px; }

/* Le reflet qui suit les mots : le déjà-lu s'éclaire, le mot dit brille à peine. */
.t-p.now .w { color: rgba(236, 228, 212, .5); transition: color 480ms var(--souffle); }
.t-p.now .w.r { color: rgba(236, 228, 212, .95); }
.t-p.now .w.c { color: var(--miel); }
.t-p.now.nowords .w { color: rgba(236, 228, 212, .95); }
