.reader-shell {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 70px;
}

.reader-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(5, 9, 17, 0.76);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.reader-intro-copy h1 {
  margin: 3px 0 8px;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 0.92;
  text-shadow: var(--glow-strong);
}

.reader-intro-copy p:last-child {
  max-width: 740px;
  margin: 0;
  color: var(--text-dim);
  line-height: 1.65;
}

.reader-card {
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.book-spread {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.38fr);
  gap: 18px;
}

.reader-card.turning .book-spread {
  animation: pageTurn 0.32s ease;
}

@keyframes pageTurn {
  0% { transform: translateX(18px); opacity: 0.52; }
  100% { transform: translateX(0); opacity: 1; }
}

.left-page,
.right-page {
  height: clamp(680px, 80vh, 820px);
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.left-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.14), transparent 24%),
    radial-gradient(circle at 78% 74%, rgba(138, 125, 255, 0.2), transparent 32%),
    rgba(0, 0, 0, 0.24);
}

.chapter-visuals {
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.right-page {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
}

.chapter-kicker {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.left-page h2 {
  margin: 10px 0 12px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

.left-page p {
  color: var(--text-dim);
  line-height: 1.7;
}

.chapter-artwork {
  width: 100%;
  height: clamp(250px, 29vw, 360px);
  margin: 18px 0 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
}

.chapter-artwork[hidden] {
  display: none;
}

.chapter-artwork img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

#chapter-visual {
  margin: 0;
}

.audio-block {
  display: grid;
  flex: 0 0 auto;
  gap: 12px;
  margin-top: auto;
}

audio {
  width: 100%;
}

.chapter-text {
  min-height: 0;
  overflow-y: auto;
  padding: 4px 18px 4px 4px;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.chapter-text p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.05rem;
  line-height: 1.92;
}

.chapter-text p:last-child {
  margin-bottom: 0;
}

.reader-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.chapter-count {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 800;
}

.book-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.book-button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #1f6feb, #00a6ff);
}

.book-button:hover {
  transform: translateY(-3px);
  opacity: 1;
}

.book-button:focus-visible {
  transform: translateY(-1px);
  opacity: 1;
  outline: 3px solid #d8ff63;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(216, 255, 99, 0.16);
}

.book-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

footer {
  margin-top: 54px;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 900px) {
  .reader-shell {
    width: min(100% - 24px, 1280px);
    padding: 34px 0 54px;
  }

  .reader-intro {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .reader-intro > .book-button {
    width: fit-content;
  }

  .book-spread {
    grid-template-columns: 1fr;
  }

  .left-page {
    height: auto;
    min-height: 0;
  }

  .right-page {
    height: min(68vh, 620px);
    min-height: 480px;
  }

  .chapter-artwork {
    height: min(440px, 82vw);
  }
}

@media (max-width: 580px) {
  .reader-card {
    padding: 10px;
  }

  .left-page,
  .right-page {
    padding: 18px;
  }

  .reader-controls .book-button {
    flex: 1;
  }

  .chapter-count {
    width: 100%;
    margin-left: 0;
    text-align: right;
  }
}
