/* ============================================================
   TITRES & EYEBROW
   ============================================================ */
.eyebrow {
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.5rem);
  line-height: 1;
  letter-spacing: 0;
}

/* ============================================================
   MODALE DU MODE DE LECTURE (carte + choix de personnage)
   ============================================================ */
.reading-mode-modal {
  width: min(94vw, 50rem);
  max-height: min(90vh, 44rem);
  overflow: auto;
  border: 1px solid rgba(226, 180, 93, 0.34);
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(226, 180, 93, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 10rem),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 14px),
    rgba(13, 15, 18, 0.98);
  box-shadow:
    0 2rem 5rem rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.reading-mode-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

.reading-mode-dialog {
  position: relative;
  display: grid;
  gap: 1.15rem;
  overflow: hidden;
  padding: clamp(1rem, 3vw, 1.65rem);
}

.reading-mode-dialog > * {
  position: relative;
  z-index: 1;
}

body[data-reader-character] .reading-mode-dialog::after {
  content: "";
  position: absolute;
  top: 0.45rem;
  right: 3.4rem;
  width: min(7.4rem, 24vw);
  aspect-ratio: 1;
  background: var(--reader-prop-image) center / contain no-repeat;
  filter: drop-shadow(0 1rem 1.2rem rgba(0, 0, 0, 0.58));
  opacity: 0.2;
  pointer-events: none;
  transform: rotate(var(--reader-prop-rotate, 0deg)) scale(var(--reader-prop-scale, 1));
  transform-origin: 50% 55%;
}

.reading-mode-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.reading-mode-header h2,
.reading-mode-choice-panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.reading-mode-title-block {
  display: grid;
  gap: 0.3rem;
  max-width: 28rem;
}

.reading-mode-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.2rem;
  aspect-ratio: 1;
  border: 1px solid rgba(226, 180, 93, 0.38);
  border-radius: 8px;
  color: var(--accent-strong);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 48%),
    rgba(226, 180, 93, 0.08);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.reading-mode-close:focus-visible {
  border-color: rgba(226, 180, 93, 0.78);
  outline: none;
  background: rgba(226, 180, 93, 0.13);
}

@media (hover: hover) {
  .reading-mode-close:hover {
    border-color: rgba(226, 180, 93, 0.78);
    background: rgba(226, 180, 93, 0.13);
    transform: translateY(-1px);
  }
}

.reading-mode-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(13rem, 0.82fr);
  gap: 0.82rem;
}

.reading-mode-choice-panel,
.reading-mode-choice {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(150deg, rgba(226, 180, 93, 0.1), transparent 34%),
    rgba(16, 20, 26, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.reading-mode-choice-panel::before,
.reading-mode-choice::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 2px solid rgba(226, 180, 93, 0.36);
  pointer-events: none;
}

.reading-mode-choice-panel {
  display: grid;
  gap: 0.95rem;
  padding: 0.95rem;
}

.reading-mode-choice-intro {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 2.65rem minmax(0, 1fr);
  align-items: center;
  gap: 0.12rem 0.75rem;
}

.reading-mode-choice-intro p {
  grid-column: 2;
}

.reading-mode-choice-panel p,
.reading-mode-choice-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.reading-character-list {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.2rem, 1fr));
  gap: 0.52rem;
}

.reading-character-choice,
.reading-mode-choice {
  cursor: pointer;
}

.reading-character-choice {
  position: relative;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  min-height: 2.7rem;
  border: 1px solid rgba(226, 180, 93, 0.24);
  border-radius: 8px;
  padding: 0.38rem 0.46rem;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.045), transparent 48%),
    rgba(255, 255, 255, 0.025);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.reading-character-choice:focus-visible,
.reading-mode-choice:focus-visible {
  border-color: rgba(226, 180, 93, 0.78);
  outline: none;
  background: rgba(226, 180, 93, 0.11);
}

.reading-character-choice:focus-visible {
  transform: translateY(-1px);
}

@media (hover: hover) {
  .reading-character-choice:hover,
  .reading-mode-choice:hover {
    border-color: rgba(226, 180, 93, 0.78);
    background: rgba(226, 180, 93, 0.11);
  }

  .reading-character-choice:hover {
    transform: translateY(-1px);
  }
}

.reading-character-choice[data-selected],
.reading-mode-choice[data-selected] {
  border-color: rgba(241, 198, 109, 0.9);
  background:
    linear-gradient(135deg, rgba(226, 180, 93, 0.18), rgba(226, 180, 93, 0.055) 48%, rgba(255, 255, 255, 0.035)),
    rgba(19, 22, 27, 0.95);
  box-shadow:
    0 0 0 1px rgba(226, 180, 93, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.reading-character-avatar-wrap,
.reading-character-avatar,
.reading-character-avatar img {
  display: block;
  width: 100%;
  height: 100%;
}

.reading-character-avatar {
  overflow: hidden;
  border: 1px solid rgba(226, 180, 93, 0.46);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.reading-character-avatar img {
  object-fit: cover;
  object-position: 50% 28%;
  transform: scale(var(--avatar-zoom, 1));
}

.reading-mode-choice {
  display: grid;
  align-content: center;
  gap: 0.48rem;
  padding: 1rem;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.reading-mode-choice:focus-visible {
  transform: translateY(-1px);
}

@media (hover: hover) {
  .reading-mode-choice:hover {
    transform: translateY(-1px);
  }
}

.reading-mode-choice > span {
  position: relative;
  z-index: 1;
}

.reading-mode-choice-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.55rem;
  aspect-ratio: 1;
  border: 1px solid rgba(226, 180, 93, 0.38);
  border-radius: 8px;
  color: var(--accent-strong);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 48%),
    rgba(226, 180, 93, 0.09);
}

.reading-mode-choice-mark-private::before {
  content: "";
  width: 1.22rem;
  height: 1.48rem;
  border: 2px solid currentColor;
  border-radius: 4px;
  transform: rotate(-5deg);
  background:
    linear-gradient(180deg, transparent 58%, rgba(226, 180, 93, 0.24) 59% 68%, transparent 69%),
    rgba(226, 180, 93, 0.04);
}

.reading-mode-choice-mark-private::after {
  content: "";
  position: absolute;
  right: 0.52rem;
  bottom: 0.46rem;
  width: 0.42rem;
  aspect-ratio: 1;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: rgba(13, 15, 18, 0.98);
}

.reading-mode-choice-mark-eye::before {
  content: "";
  width: 1.42rem;
  aspect-ratio: 1;
  background: currentColor;
  -webkit-mask: var(--icon-eye) center / contain no-repeat;
  mask: var(--icon-eye) center / contain no-repeat;
}

.reading-mode-choice-mark-eye::after {
  display: none;
}

.reading-mode-choice-title {
  color: var(--accent-strong);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* ============================================================
   MODALE DE CHOIX DE NAVIGATION
   ============================================================ */
.navigation-choice-dialog {
  gap: 0.9rem;
}

.navigation-choice-intro {
  max-width: 36rem;
  margin: -0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.navigation-choice-list {
  display: grid;
  gap: 0.58rem;
}

.navigation-choice-list .route-choice {
  border-color: rgba(226, 180, 93, 0.24);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.045), transparent 48%),
    rgba(226, 180, 93, 0.08);
}

.navigation-choice-list .route-choice:focus-visible {
  border-color: rgba(226, 180, 93, 0.86);
  background: rgba(226, 180, 93, 0.15);
}

@media (hover: hover) {
  .navigation-choice-list .route-choice:hover:not(:disabled) {
    border-color: rgba(226, 180, 93, 0.86);
    background: rgba(226, 180, 93, 0.15);
  }
}

/* ============================================================
   SCENE & PLANCHES
   ============================================================ */
.reader-stage {
  display: grid;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.single-spread {
  grid-template-columns: minmax(0, 1fr);
}

.reader-page-unit {
  display: grid;
  grid-template-areas: "story page";
  grid-template-columns: minmax(16rem, 23rem) minmax(0, var(--page-width));
  gap: clamp(0.8rem, 1.6vw, 1.4rem);
  align-items: center;
  justify-content: center;
  min-width: 0;
}

/* ============================================================
   LIVRE & IMAGE DE PLANCHE
   ============================================================ */
.book-wrap {
  grid-area: page;
  display: grid;
  place-items: center;
  min-height: 0;
}

.book {
  position: relative;
  width: var(--page-width);
  max-width: 100%;
  aspect-ratio: var(--page-ratio);
  border-radius: 8px;
  background: #080a0d;
  box-shadow: 0 1.8rem 3.8rem var(--shadow);
}

.book::before,
.book::after {
  display: none;
}

.comic-page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #f6edd4;
}

.current-page {
  z-index: 2;
}

.page-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0b0d10;
}

/* ============================================================
   OBJETS NARRATIFS (.story-object-*)
   ============================================================ */
.story-object-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.story-object-marker {
  position: absolute;
  left: calc(var(--object-x) * 1%);
  top: calc(var(--object-y) * 1%);
  display: grid;
  place-items: center;
  width: var(--object-size);
  min-width: 2.3rem;
  max-width: 5.2rem;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  filter:
    drop-shadow(0 0.44rem 0.35rem rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 0.26rem color-mix(in srgb, var(--object-accent) 54%, transparent));
  pointer-events: auto;
  transform:
    translate(-50%, -50%)
    rotate(var(--object-rotate, 0deg))
    perspective(28rem)
    rotateX(8deg)
    rotateY(-9deg);
  transform-style: preserve-3d;
  transition: filter 160ms ease, transform 160ms ease;
}

.story-object-marker::before {
  content: "";
  position: absolute;
  inset: -0.42rem;
  border: 1px solid color-mix(in srgb, var(--object-accent) 42%, transparent);
  border-radius: 999px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--object-accent) 18%, transparent), transparent 62%);
  opacity: 0.64;
  transform: scale(0.92);
  animation: story-object-highlight 1800ms ease-in-out infinite alternate;
  transition: opacity 160ms ease, transform 160ms ease;
}

.story-object-marker:focus-visible {
  outline: none;
  filter:
    drop-shadow(0 0.52rem 0.38rem rgba(0, 0, 0, 0.46))
    drop-shadow(0 0 0.55rem color-mix(in srgb, var(--object-accent) 72%, transparent));
  transform:
    translate(-50%, -54%)
    rotate(var(--object-rotate, 0deg))
    perspective(28rem)
    rotateX(10deg)
    rotateY(-12deg)
    scale(1.06);
}

.story-object-marker:focus-visible::before {
  opacity: 1;
  transform: scale(1);
}

@media (hover: hover) {
  .story-object-marker:hover {
    outline: none;
    filter:
      drop-shadow(0 0.52rem 0.38rem rgba(0, 0, 0, 0.46))
      drop-shadow(0 0 0.55rem color-mix(in srgb, var(--object-accent) 72%, transparent));
    transform:
      translate(-50%, -54%)
      rotate(var(--object-rotate, 0deg))
      perspective(28rem)
      rotateX(10deg)
      rotateY(-12deg)
      scale(1.06);
  }

  .story-object-marker:hover::before {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes story-object-highlight {
  from {
    opacity: 0.36;
    transform: scale(0.9);
  }

  to {
    opacity: 0.72;
    transform: scale(1.03);
  }
}

.story-object-visual {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 2.2rem;
  min-height: 2.2rem;
  transform: translateZ(0.18rem);
}

.story-object-visual::before,
.story-object-visual::after {
  content: "";
  position: absolute;
  display: block;
}

.story-object-visual-asset::before,
.story-object-visual-asset::after {
  display: none;
}

.story-object-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: translateZ(0.2rem);
}

.story-object-visual[data-variant="gem"] {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.78) 0 7%, rgba(178, 162, 255, 0.5) 8% 18%, transparent 19%),
    radial-gradient(circle at 58% 62%, rgba(122, 96, 198, 0.32), transparent 52%),
    radial-gradient(circle at 45% 42%, #201d36 0 36%, #0c0b14 72%, #020204 100%);
  box-shadow:
    inset -0.44rem -0.42rem 0.76rem rgba(0, 0, 0, 0.78),
    inset 0.2rem 0.16rem 0.42rem rgba(255, 255, 255, 0.16);
}

.story-object-visual[data-variant="gem"]::before {
  inset: 18% 19% 48% 26%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transform: rotate(-24deg);
}

.story-object-visual[data-variant="crimson-cards"]::before,
.story-object-visual[data-variant="crimson-cards"]::after {
  inset: 16% 24% 14% 24%;
  border: 1px solid rgba(255, 218, 184, 0.22);
  border-radius: 6px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(180deg, #a92c39, #53161f);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 0.38rem 0.42rem rgba(0, 0, 0, 0.28);
}

.story-object-visual[data-variant="crimson-cards"]::before {
  transform: translate(-17%, 6%) rotate(-13deg);
}

.story-object-visual[data-variant="crimson-cards"]::after {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(180deg, #c2454e, #671923);
  transform: translate(15%, -5%) rotate(9deg);
}

.story-object-visual[data-variant="cross"]::before {
  inset: 10% 28% 8%;
  border: 1px solid rgba(255, 231, 176, 0.24);
  border-radius: 5px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(180deg, #ddbf73, #6d4d1e);
  clip-path: polygon(37% 0, 63% 0, 63% 32%, 100% 32%, 100% 56%, 63% 56%, 63% 100%, 37% 100%, 37% 56%, 0 56%, 0 32%, 37% 32%);
  box-shadow:
    inset -0.18rem -0.18rem 0.34rem rgba(0, 0, 0, 0.38),
    0 0.36rem 0.4rem rgba(0, 0, 0, 0.34);
}

.story-object-visual[data-variant="cross"]::after {
  inset: 41% 33% 46%;
  border-radius: 999px;
  background: rgba(34, 24, 12, 0.34);
  box-shadow: 0 0 0 1px rgba(255, 236, 190, 0.16);
}

.story-object-visual[data-variant="prosthetic-hand"]::before {
  inset: 28% 22% 15% 21%;
  border: 1px solid rgba(206, 255, 248, 0.2);
  border-radius: 36% 34% 30% 34%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(180deg, #7fcfc8, #2c6f75 54%, #19373e);
  box-shadow:
    inset -0.22rem -0.26rem 0.36rem rgba(0, 0, 0, 0.36),
    0 0.38rem 0.45rem rgba(0, 0, 0, 0.34);
}

.story-object-visual[data-variant="prosthetic-hand"]::after {
  inset: 8% 19% 52% 17%;
  border-radius: 999px 999px 7px 7px;
  background:
    linear-gradient(90deg,
      #9fe3de 0 15%,
      transparent 16% 20%,
      #78c9c5 21% 37%,
      transparent 38% 43%,
      #64b6ba 44% 60%,
      transparent 61% 66%,
      #4d989f 67% 83%,
      transparent 84%);
  box-shadow:
    inset 0 -0.24rem 0.28rem rgba(0, 0, 0, 0.24),
    0 0.22rem 0.24rem rgba(0, 0, 0, 0.28);
}

.story-object-visual.story-object-visual-asset {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.story-object-modal {
  width: min(94vw, 48rem);
  max-height: min(90vh, 42rem);
  overflow: auto;
  border: 1px solid rgba(226, 180, 93, 0.34);
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, transparent), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 10rem),
    rgba(13, 15, 18, 0.98);
  box-shadow:
    0 2rem 5rem rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.story-object-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

.story-object-dialog {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.55rem);
}

.story-object-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.story-object-title-block {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.story-object-title-block h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.story-object-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.2rem;
  aspect-ratio: 1;
  border: 1px solid rgba(226, 180, 93, 0.38);
  border-radius: 8px;
  color: var(--accent-strong);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 48%),
    rgba(226, 180, 93, 0.08);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.story-object-close:focus-visible {
  border-color: rgba(226, 180, 93, 0.78);
  outline: none;
  background: rgba(226, 180, 93, 0.13);
}

@media (hover: hover) {
  .story-object-close:hover {
    border-color: rgba(226, 180, 93, 0.78);
    background: rgba(226, 180, 93, 0.13);
  }
}

.story-object-layout {
  display: grid;
  grid-template-columns: minmax(10rem, 0.62fr) minmax(0, 1.38fr);
  gap: 1rem;
  align-items: stretch;
}

.story-object-media {
  display: grid;
  place-items: center;
  min-height: 15rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--object-accent, var(--accent)) 16%, transparent), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 50%),
    rgba(16, 20, 26, 0.9);
  perspective: 38rem;
}

.story-object-media .story-object-visual {
  width: min(10.6rem, 42vw);
  height: auto;
  aspect-ratio: 1;
  filter:
    drop-shadow(0 1rem 0.65rem rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 0.62rem color-mix(in srgb, var(--object-accent) 34%, transparent));
  transform: rotate(-7deg) rotateX(9deg) rotateY(-11deg);
  transform-style: preserve-3d;
}

.story-object-body {
  display: grid;
  align-content: start;
  gap: 0.82rem;
  min-width: 0;
}

.story-object-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.36rem 0.62rem;
  margin: 0;
  padding: 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.story-object-meta dt {
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-object-meta dd {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.84rem;
  line-height: 1.25;
}

.story-object-description {
  display: grid;
  gap: 0.62rem;
}

.story-object-description p,
.story-object-details li {
  color: rgba(244, 240, 232, 0.88);
  font-size: 0.9rem;
  line-height: 1.48;
}

.story-object-description p {
  margin: 0;
}

.story-object-note {
  border-left: 2px solid color-mix(in srgb, var(--object-accent, var(--accent)) 62%, transparent);
  padding-left: 0.72rem;
  color: var(--muted-strong);
}

.story-object-details {
  display: grid;
  gap: 0.44rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-object-details li {
  position: relative;
  padding-left: 1rem;
}

.story-object-details li::before {
  content: "";
  position: absolute;
  top: 0.58em;
  left: 0;
  width: 0.36rem;
  aspect-ratio: 1;
  border-radius: 999px;
  background: color-mix(in srgb, var(--object-accent, var(--accent)) 78%, white 8%);
  box-shadow: 0 0 0.45rem color-mix(in srgb, var(--object-accent, var(--accent)) 42%, transparent);
}

/* ============================================================
   ZONES DE CLIC & COMPTEUR MOBILE
   ============================================================ */
.page-click-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 50%;
  border: 0;
  padding: 0;
  background: transparent;
  /* Empêche le zoom au double-tap (deux clics rapides pour tourner les pages)
     sans bloquer le pinch-zoom ni le défilement. */
  touch-action: manipulation;
}

.page-click-zone[hidden] {
  display: none;
}

.page-click-zone-prev {
  left: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M20 7 11 16l9 9' fill='none' stroke='%23080a0d' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M20 7 11 16l9 9' fill='none' stroke='%23f4f0e8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 8 16, w-resize;
}

.page-click-zone-next {
  right: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='m12 7 9 9-9 9' fill='none' stroke='%23080a0d' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='m12 7 9 9-9 9' fill='none' stroke='%23f4f0e8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 24 16, e-resize;
}

/* Embranchement : la moitié droite ne permet pas d'avancer sans choisir. */
.page-click-zone-locked {
  cursor: not-allowed;
}

.page-click-zone:focus-visible {
  outline: 2px solid rgba(226, 180, 93, 0.8);
  outline-offset: -0.35rem;
}

.mobile-page-counter {
  display: none;
}

/* ============================================================
   FEUILLE VIDE (.empty-sheet)
   ============================================================ */
.empty-sheet {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(37, 28, 18, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(37, 28, 18, 0.05) 1px, transparent 1px),
    #f6edd4;
  background-size: 36px 36px;
}

.empty-sheet::before {
  content: "";
  position: absolute;
  inset: 6%;
  border: 2px dashed rgba(37, 28, 18, 0.22);
}

.empty-sheet::after {
  content: "";
  position: absolute;
  inset: 10% 12%;
  border: 1px solid rgba(37, 28, 18, 0.16);
}

/* ============================================================
   PANNEAU NARRATIF (.story-panel, .panel-card, .story-text)
   ============================================================ */
.story-panel {
  grid-area: story;
  min-width: 0;
}

.story-panel-close {
  display: none;
}

.panel-card,
.thumbnail-dock {
  border-radius: 8px;
  background: rgba(21, 25, 31, 0.9);
  box-shadow: 0 1.1rem 2.5rem rgba(0, 0, 0, 0.22);
}

.panel-card {
  position: relative;
  display: grid;
  gap: 0.85rem;
  border-radius: 18px;
  padding: 1.05rem 1.1rem;
  color: #1a1712;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.24)),
    #f4ecd9;
  box-shadow:
    0 0.9rem 2rem rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.panel-card::before,
.panel-card::after {
  content: "";
  position: absolute;
  top: 42%;
  pointer-events: none;
}

.panel-card::before {
  right: -0.78rem;
  width: 1.25rem;
  height: 1.25rem;
  border-right: 1px solid rgba(28, 23, 18, 0.2);
  border-bottom: 1px solid rgba(28, 23, 18, 0.2);
  background: #f4ecd9;
  transform: rotate(-18deg) skew(16deg);
  transform-origin: center;
  box-shadow: 0.35rem 0.4rem 0.65rem rgba(0, 0, 0, 0.12);
}

.panel-card::after {
  right: 0;
  width: 1rem;
  height: 1.6rem;
  background: #f4ecd9;
}

.panel-card h2 {
  margin: -0.2rem 0 -0.2rem;
  color: #1a1712;
  font-size: clamp(1.1rem, 1.5vw, 1.45rem);
  line-height: 1.08;
}

.panel-card .eyebrow {
  color: #8c6120;
}

.story-text {
  display: grid;
  gap: 0.62rem;
}

.story-text p {
  margin: 0;
  color: #3d372d;
  font-size: clamp(0.86rem, 0.92vw, 1rem);
  line-height: 1.48;
}

/* ============================================================
   PANNEAU DE CHOIX DE ROUTE (.route-follow-panel, .route-choice)
   ============================================================ */
.route-follow-panel {
  position: relative;
  display: grid;
  gap: 0.5rem;
  padding: 0.82rem;
}

#side-route-choices:not([hidden]) .route-follow-panel {
  border-color: rgba(226, 180, 93, 0.7);
  background:
    linear-gradient(180deg, rgba(226, 180, 93, 0.16), rgba(21, 25, 31, 0.9) 42%),
    rgba(21, 25, 31, 0.9);
  box-shadow:
    0 0 0 1px rgba(226, 180, 93, 0.18),
    0 0 1.6rem rgba(226, 180, 93, 0.22),
    0 1.1rem 2.5rem rgba(0, 0, 0, 0.22);
  animation: route-choice-glow 1800ms ease-in-out infinite alternate;
}

@keyframes route-choice-glow {
  from {
    box-shadow:
      0 0 0 1px rgba(226, 180, 93, 0.14),
      0 0 1rem rgba(226, 180, 93, 0.16),
      0 1.1rem 2.5rem rgba(0, 0, 0, 0.22);
  }

  to {
    box-shadow:
      0 0 0 1px rgba(226, 180, 93, 0.28),
      0 0 2rem rgba(226, 180, 93, 0.28),
      0 1.1rem 2.5rem rgba(0, 0, 0, 0.22);
  }
}

.route-follow-panel h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.route-follow-grid {
  display: grid;
  gap: 0.58rem;
}

.route-choice {
  display: flex;
  align-items: center;
  gap: 0.66rem;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.58rem 0.66rem;
  color: var(--text);
  text-align: left;
  background: rgba(226, 180, 93, 0.08);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.route-choice:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(226, 180, 93, 0.9);
  background: rgba(226, 180, 93, 0.16);
  outline: none;
}

@media (hover: hover) {
  .route-choice:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(226, 180, 93, 0.9);
    background: rgba(226, 180, 93, 0.16);
  }
}

.route-choice:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.route-follow-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.route-choice-label {
  font-weight: 750;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.route-choice-detail {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.18;
}

/* Carré fixe : les avatars d'un choix tiennent toujours dans la même surface,
   quel que soit le nombre de joueurs. Pour plusieurs, ils sont superposés en
   diagonale et redimensionnés pour rester dans le carré. */
.route-choice-avatars {
  position: relative;
  flex: 0 0 2.6rem;
  width: 2.6rem;
  height: 2.6rem;
}

.route-choice-avatar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(226, 180, 93, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0.2rem 0.55rem rgba(0, 0, 0, 0.22);
}

/* 2 joueurs */
.route-choice-avatars[data-count="2"] .route-choice-avatar {
  width: 68%;
  height: 68%;
}

.route-choice-avatars[data-count="2"] .route-choice-avatar:nth-child(2) {
  top: 32%;
  left: 32%;
}

/* 3 joueurs */
.route-choice-avatars[data-count="3"] .route-choice-avatar {
  width: 56%;
  height: 56%;
}

.route-choice-avatars[data-count="3"] .route-choice-avatar:nth-child(2) {
  top: 22%;
  left: 22%;
}

.route-choice-avatars[data-count="3"] .route-choice-avatar:nth-child(3) {
  top: 44%;
  left: 44%;
}

/* 4 joueurs */
.route-choice-avatars[data-count="4"] .route-choice-avatar {
  width: 48%;
  height: 48%;
}

.route-choice-avatars[data-count="4"] .route-choice-avatar:nth-child(2) {
  top: 17.3%;
  left: 17.3%;
}

.route-choice-avatars[data-count="4"] .route-choice-avatar:nth-child(3) {
  top: 34.6%;
  left: 34.6%;
}

.route-choice-avatars[data-count="4"] .route-choice-avatar:nth-child(4) {
  top: 52%;
  left: 52%;
}

/* 5 joueurs */
.route-choice-avatars[data-count="5"] .route-choice-avatar {
  width: 42%;
  height: 42%;
}

.route-choice-avatars[data-count="5"] .route-choice-avatar:nth-child(2) {
  top: 14.5%;
  left: 14.5%;
}

.route-choice-avatars[data-count="5"] .route-choice-avatar:nth-child(3) {
  top: 29%;
  left: 29%;
}

.route-choice-avatars[data-count="5"] .route-choice-avatar:nth-child(4) {
  top: 43.5%;
  left: 43.5%;
}

.route-choice-avatars[data-count="5"] .route-choice-avatar:nth-child(5) {
  top: 58%;
  left: 58%;
}

.route-choice-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  transform: scale(var(--avatar-zoom, 1));
}

/* ============================================================
   FEUILLE DE CHAPITRE (.chapter-sheet)
   ============================================================ */
.chapter-sheet {
  display: grid;
  place-content: center;
  height: 100%;
  padding: 12%;
  color: #19130d;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(226, 180, 93, 0.25), transparent 52%),
    #f6edd4;
}

.chapter-sheet h2 {
  margin: 0.4rem 0 0.7rem;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 0.92;
}

.chapter-sheet p {
  max-width: 18rem;
  margin: 0 auto;
  color: rgba(25, 19, 13, 0.72);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.42;
}

/* ============================================================
   NAVIGATION DES PLANCHES (.reader-nav, .page-arrow, .page-counter)
   ============================================================ */
.reader-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 0;
}

.page-arrow {
  display: grid;
  place-items: center;
  width: 2.45rem;
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.page-arrow span {
  font-size: 1.2rem;
  line-height: 1;
}

.page-arrow:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(226, 180, 93, 0.74);
  background: var(--surface-strong);
  outline: none;
}

@media (hover: hover) {
  .page-arrow:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(226, 180, 93, 0.74);
    background: var(--surface-strong);
  }
}

.page-arrow:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.page-counter {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.44rem 0.8rem;
  color: var(--muted-strong);
  background: rgba(21, 25, 31, 0.84);
  font-size: 0.9rem;
  font-weight: 700;
}

/* ============================================================
   DOCK DES MINIATURES (.thumbnail-dock, .adjacent-thumb-*)
   ============================================================ */
.thumbnail-dock {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0.74rem 0.42rem 0.5rem;
  margin: 0;
  background: rgba(14, 17, 21, 0.88);
}

.thumb-strip {
  max-width: 100%;
  display: grid;
  gap: 0.55rem;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 0.16rem 0.12rem 0.24rem;
  scrollbar-color: rgba(226, 180, 93, 0.65) rgba(255, 255, 255, 0.08);
}

.timeline-dock-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-width: 0;
}

.adjacent-thumbs {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 0.88rem;
  min-width: 0;
}

.adjacent-thumb-item {
  display: grid;
  justify-items: center;
  gap: 0.68rem;
  opacity: 0.58;
  filter: saturate(0.65) brightness(0.78);
  transition: filter 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.adjacent-thumb-item:has(.thumb-button[aria-current="true"]) {
  opacity: 1;
  filter: none;
  transform: translateY(-0.06rem);
}

.adjacent-thumb-label {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1;
}

.adjacent-thumb-item:has(.thumb-button[aria-current="true"]) .adjacent-thumb-label {
  color: var(--text);
}

.adjacent-thumb-item .thumb-button {
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.adjacent-thumb-item .thumb-button[aria-current="true"] {
  width: 3rem;
  flex-basis: 3rem;
  transform: scale(1.08);
}

/* ============================================================
