.tome-wrap {
  position: relative;
  z-index: 2;
  width: min(42rem, 100%);
  margin: 0 auto;
  padding: 2rem 1rem 5rem;
}

.tome-nav-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.tome-nav-top a {
  font-family: var(--display);
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  color: var(--gold);
  text-decoration: none;
}

.tome-nav-top a:hover {
  text-decoration: underline;
}

.tome-progress {
  font-family: var(--display);
  letter-spacing: 0.12em;
  font-size: 0.9rem;
  color: var(--gold);
}

.tome-bar {
  height: 6px;
  background: #2a1520;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 0 0 1px #6a4a1e;
}

.tome-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--velvet), var(--gold));
  width: 2.5%;
  transition: width 0.35s ease;
}

.tome-card {
  background: #1a0c10;
  border-radius: 12px;
  padding: 1.5rem 1.35rem 1.6rem;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.4),
    inset 0 0 0 2px #6a4a1e;
  min-height: 14rem;
}

.tome-card h2 {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  letter-spacing: 0.06em;
  color: var(--cream);
  line-height: 1.1;
}

.tome-card p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.55;
  color: #eadcc8;
}

.tome-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.35rem;
}

.tome-controls button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tome-index-toggle {
  display: block;
  width: 100%;
  margin-top: 1rem;
  background: transparent;
  color: var(--gold);
  box-shadow: inset 0 0 0 1.5px var(--gold);
}

.tome-index {
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(26, 12, 16, 0.92);
  border-radius: 10px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.45s ease, opacity 0.35s ease;
}

.tome-index.open {
  max-height: 28rem;
  opacity: 1;
  overflow-y: auto;
}

.tome-index ol {
  margin: 0;
  padding-left: 1.2rem;
  columns: 1;
}

@media (min-width: 520px) {
  .tome-index ol {
    columns: 2;
    column-gap: 1.5rem;
  }
}

.tome-index li {
  margin: 0.2rem 0;
  break-inside: avoid;
}

.tome-index button {
  background: none;
  border: 0;
  color: #eadcc8;
  font-family: var(--text);
  font-size: 0.88rem;
  padding: 0.15rem 0;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0;
}

.tome-index button:hover {
  color: var(--gold);
}

.tome-stamp {
  text-align: center;
  margin-top: 2rem;
  font-family: var(--display);
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: #8a6a50;
}
