
:root {
  --bg: #100b08;
  --panel: #1b120d;
  --panel2: #251710;
  --text: #f3e5ca;
  --muted: #c4a77a;
  --gold: #d7a84a;
  --bronze: #9b6034;
  --line: rgba(215, 168, 74, .28);
  --shadow: rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(215,168,74,.13), transparent 38rem),
    radial-gradient(circle at bottom right, rgba(127,69,33,.18), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Georgia, 'Palatino Linotype', serif;
  line-height: 1.78;
  font-size: var(--reader-font-size, 19px);
}
a { color: var(--gold); }
.site-header, .reader-header {
  padding: 2.5rem 1.2rem 1.4rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(37,23,16,.95), rgba(16,11,8,.75));
}
.kicker { color: var(--muted); text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; }
h1 { margin: .4rem 0 .2rem; font-weight: normal; line-height: 1.1; color: #ffd988; font-size: clamp(2.1rem, 7vw, 4rem); }
.subtitle { color: var(--muted); font-style: italic; margin: .3rem auto; max-width: 46rem; }
.container { max-width: 980px; margin: 0 auto; padding: 1.2rem; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 2rem 0; }
.book-card, .toc, .chapter, .note, .controls {
  background: linear-gradient(180deg, rgba(37,23,16,.96), rgba(27,18,13,.96));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 32px var(--shadow);
}
.book-card { padding: 1.4rem; min-height: 15rem; display: flex; flex-direction: column; }
.book-card h2 { color: #ffd988; font-weight: normal; margin: .2rem 0; line-height: 1.15; }
.book-card .short { color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-size: .82rem; }
.book-card p { color: #e5d0aa; }
.button { display: inline-block; margin-top: auto; padding: .72rem 1rem; background: #6e3f22; color: #fff1cf; border: 1px solid var(--gold); border-radius: 999px; text-decoration: none; text-align: center; }
.button:hover { background: #8f562b; }
.note { padding: 1rem 1.2rem; color: #dcc49a; }
.reader-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.top-nav { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }
.top-nav a, .small-button { border: 1px solid var(--line); border-radius: 999px; padding: .42rem .75rem; text-decoration: none; color: #efd49b; background: rgba(0,0,0,.22); }
.controls { position: sticky; top: 0; z-index: 5; padding: .65rem; display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; backdrop-filter: blur(8px); }
.controls button { cursor: pointer; color: #fff1cf; background: #402516; border: 1px solid var(--line); border-radius: 999px; padding: .45rem .75rem; font: inherit; font-size: .9rem; }
.toc { padding: 1.2rem; margin: 1rem 0 2rem; }
.toc h2 { margin-top: 0; color: #ffd988; font-weight: normal; }
.toc ol { columns: 2; padding-left: 1.4rem; }
.toc li { break-inside: avoid; margin: .25rem 0; color: var(--muted); }
.chapter { padding: clamp(1rem, 3vw, 2rem); margin: 0 0 1.4rem; }
.chapter h2 { color: #ffd988; font-weight: normal; line-height: 1.18; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.chapter p { margin: 1.05rem 0; }
.chapter-nav { display: flex; justify-content: space-between; gap: .8rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.footer { text-align: center; color: var(--muted); padding: 2rem 1rem 4rem; border-top: 1px solid var(--line); margin-top: 2rem; }
@media (max-width: 700px) {
  body { font-size: var(--reader-font-size, 18px); }
  .container { padding: .8rem; }
  .toc ol { columns: 1; }
  .chapter { border-radius: 12px; }
  .chapter-nav { flex-direction: column; }
}
