/* ══════════════════════════════════════════════════════════════════
   Life of Hell — eigenständige Buchseite
   Basis (Reset, Schrift, Fokus) + Kopf/Fuß. Der Buch-Look selbst
   steht weiter unten und ist 1:1 von anyxx.cc übernommen.
   ══════════════════════════════════════════════════════════════════ */
:root {
  --font-sans: ui-sans-serif, "Geist", "Inter", system-ui, -apple-system,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: #0b0b0d;
  color: #ece6d6;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
main { flex: 1; }

h1, h2, h3 { margin: 0; font-weight: 300; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid #c9b183;
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 500;
  padding: 0.6rem 1rem;
  background: #ece6d6; color: #0b0b0d;
  border-radius: 999px;
  font-size: 0.8125rem;
}
.skip:focus { top: 1rem; }

/* ── Kopfzeile: liegt über dem Buch-Bereich ───────────────────────── */
.site-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 70rem;
  margin: 0 auto;
  padding: 1.4rem 1.5rem;
  font-size: 0.6875rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.site-mark { color: #c9b183; }
.site-top a:not(.site-mark) {
  color: rgba(236, 230, 214, 0.75);
  transition: color 0.25s;
}
.site-top a:not(.site-mark):hover { color: #ece6d6; }

/* ── Fußzeile ─────────────────────────────────────────────────────── */
.site-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.5rem 1.5rem;
  padding: 2rem 1.5rem 2.4rem;
  border-top: 1px solid rgba(236, 230, 214, 0.08);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: rgba(236, 230, 214, 0.55);
  text-align: center;
}
.site-foot a { border-bottom: 1px solid rgba(236, 230, 214, 0.2); transition: color 0.25s, border-color 0.25s; }
.site-foot a:hover { color: #ece6d6; border-color: #ece6d6; }

/* ══════════════════════════════════════════════════════════════════
   BUCH-BEREICH — "Life of Hell"
   Eigener Buch-Look, lokal gescoped. Farben aus dem Cover übernommen:
   tiefes Schwarz, Creme-Papier, gedämpftes Gold.
   ══════════════════════════════════════════════════════════════════ */
.book, .reader {
  --paper: #ece6d6;
  --paper-2: rgba(236, 230, 214, 0.82);
  --paper-3: rgba(236, 230, 214, 0.62);
  --gold: #c9b183;
  --ink: #0b0b0d;
  --serif: "EB Garamond", "Cormorant Garamond", Garamond, "Iowan Old Style",
           "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

.book {
  position: relative;
  /* clip statt hidden: schneidet den Glow genauso ab, macht .book aber
     nicht zum Scroll-Container - sonst würde das sticky Cover nie
     mitlaufen. hidden bleibt als Fallback für alte Browser. */
  overflow: hidden;
  overflow: clip;
  background: var(--ink);
  padding: 6rem 1.5rem 5rem;
}
.book-glow {
  position: absolute; inset: -20% -10% -10%;
  pointer-events: none;
  background:
    radial-gradient(42% 46% at 26% 44%, rgba(201, 177, 131, 0.11), transparent 70%),
    radial-gradient(36% 40% at 82% 26%, rgba(196, 19, 64, 0.07), transparent 70%);
}
.book-inner {
  position: relative;
  max-width: 66rem;
  margin: 0 auto;
  display: grid;
  gap: 3.25rem;
  align-items: center;
}

/* ── Cover als 3D-Buch ─────────────────────────────────────────── */
.book-cover {
  position: relative;
  justify-self: center;
  width: min(64vw, 320px);
  padding: 0; border: 0; background: none;
  cursor: pointer;
  transform: perspective(1400px) rotateY(-13deg) rotateX(2deg);
  transform-origin: 35% 50%;
  transition: transform 0.7s var(--ease);
  border-radius: 3px 6px 6px 3px;
}
.book-cover img {
  display: block;
  width: 100%; height: auto;
  border-radius: 3px 6px 6px 3px;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.04),
    18px 28px 48px -12px rgba(0, 0, 0, 0.85),
    6px 10px 18px -6px rgba(0, 0, 0, 0.6);
}
/* Lichtkante am Buchrücken */
.book-cover::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 16px;
  z-index: 2;
  pointer-events: none;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02) 55%, rgba(0, 0, 0, 0.25));
}
/* Seitenschnitt rechts - gibt dem Buch Dicke */
.book-cover::after {
  content: "";
  position: absolute; top: 1.2%; bottom: 1.2%; right: -9px;
  width: 9px;
  border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(180deg, #ddd6c3 0 1px, #b9b19d 1px 3px);
  box-shadow: 4px 6px 14px rgba(0, 0, 0, 0.5);
}
.book-cover:hover,
.book-cover:focus-visible {
  transform: perspective(1400px) rotateY(-4deg) rotateX(0deg) translateY(-6px);
}
.book-cover:focus-visible { outline: 2px solid var(--gold); outline-offset: 8px; }
.book-cover-hint {
  position: absolute; left: 50%; bottom: 7%;
  z-index: 3;
  transform: translate(-50%, 8px);
  opacity: 0;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(236, 230, 214, 0.3);
  border-radius: 999px;
  background: rgba(11, 11, 13, 0.84);
  color: var(--paper);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 0.3s, transform 0.4s var(--ease);
}
.book-cover:hover .book-cover-hint,
.book-cover:focus-visible .book-cover-hint { opacity: 1; transform: translate(-50%, 0); }

/* ── Text ──────────────────────────────────────────────────────── */
.book-copy { text-align: center; }
.book-eyebrow {
  display: inline-flex; align-items: center; gap: 0.8rem;
  font-size: 0.6875rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
}
.book-eyebrow::before,
.book-eyebrow::after {
  content: ""; width: 1.75rem; height: 1px;
  background: currentColor; opacity: 0.6;
}
.book-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 11vw, 6rem);
  line-height: 0.92;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper);
}
.book-title span {
  display: block;
  font-size: 0.4em;
  letter-spacing: 0.34em;
  margin-bottom: 0.45rem;
  color: var(--paper-2);
}
.book-subtitle {
  margin-top: 1.1rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--paper-2);
}
.book-author {
  margin-top: 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}
.book-blurb {
  max-width: 34rem;
  margin: 1.8rem auto 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--paper-2);
}
.book-meta {
  margin-top: 0.9rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--paper-3);
}

.book-actions {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2rem;
}
.book-btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 44px;
  padding: 0.8rem 1.45rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.book-btn svg { width: 1rem; height: 1rem; flex: none; }
.book-btn-primary { background: var(--paper); color: var(--ink); border: 1px solid var(--paper); }
.book-btn-primary:hover { background: #fff; border-color: #fff; transform: translateY(-1px); }
.book-btn-primary:disabled { opacity: 0.6; cursor: progress; transform: none; }
.book-btn-ghost { background: transparent; color: var(--paper); border: 1px solid rgba(236, 230, 214, 0.32); }
.book-btn-ghost:hover { border-color: var(--paper); }
.book-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.book-link {
  font-size: 0.8125rem;
  color: var(--paper-2);
  border-bottom: 1px solid rgba(236, 230, 214, 0.25);
  padding-bottom: 2px;
  transition: color 0.25s, border-color 0.25s;
}
.book-link:hover { color: var(--paper); border-color: var(--paper); }

/* ── Bewertungskarte ───────────────────────────────────────────── */
.book-rate {
  max-width: 34rem;
  margin: 2.6rem auto 0;
  padding: 1.5rem 1.5rem 1.35rem;
  text-align: left;
  border: 1px solid rgba(236, 230, 214, 0.12);
  border-radius: 12px;
  background: rgba(236, 230, 214, 0.03);
}
.rate-head {
  display: flex; flex-wrap: wrap;
  align-items: baseline; justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.9rem;
}
.rate-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--paper);
}
.rate-stats { font-size: 0.8125rem; color: var(--gold); }
.rate-stats[hidden] { display: none; }

.book-rate fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* Sterne: Radios rückwärts im DOM (5→1), sichtbar links→rechts 1→5 */
.rate-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.15rem;
}
.rate-stars legend {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.rate-stars input,
.rate-buy input {
  position: absolute; opacity: 0;
  width: 1px; height: 1px; margin: 0;
}
.rate-stars label {
  font-size: 2rem;
  line-height: 1;
  padding: 0.1rem 0.12rem;
  color: rgba(236, 230, 214, 0.2);
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}
.rate-stars input:checked ~ label,
.rate-stars label:hover,
.rate-stars label:hover ~ label { color: var(--gold); }
.rate-stars label:hover { transform: scale(1.12); }
.rate-stars input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 1px; border-radius: 4px; }

.rate-buy { margin-top: 1.05rem; }
.rate-buy legend {
  display: block;
  padding: 0;
  margin-bottom: 0.55rem;
  font-size: 0.75rem;
  color: var(--paper-3);
}
.rate-buy label {
  display: inline-flex; align-items: center;
  min-height: 36px;
  margin: 0 0.35rem 0.35rem 0;
  padding: 0.4rem 1rem;
  border: 1px solid rgba(236, 230, 214, 0.22);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--paper-2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.rate-buy label:hover { border-color: rgba(236, 230, 214, 0.55); }
.rate-buy input:checked + label { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.rate-buy input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }

.rate-comment-label {
  display: block;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--paper-3);
}
.rate-comment-label span { opacity: 0.75; }
.book-rate textarea {
  display: block;
  width: 100%;
  min-height: 4.6rem;
  margin-top: 0.5rem;
  padding: 0.7rem 0.85rem;
  resize: vertical;
  border: 1px solid rgba(236, 230, 214, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--paper);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.book-rate textarea::placeholder { color: rgba(236, 230, 214, 0.38); }
.book-rate textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }

.rate-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.rate-foot {
  display: flex; flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.15rem;
}
.rate-msg { font-size: 0.8125rem; color: var(--paper-2); }
.rate-msg a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }

/* ── Umfrage "ganzes Buch als PDF?" ───────────────────────────── */
.book-poll {
  max-width: 34rem;
  margin: 2.4rem auto 0;
  padding: 1.25rem 1.5rem 1.1rem;
  text-align: left;
  border: 1px solid rgba(201, 177, 131, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(201, 177, 131, 0.07), rgba(201, 177, 131, 0.02));
}
.book-poll + .book-rate { margin-top: 1rem; }
.poll-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.poll-tag {
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.poll-total { font-size: 0.75rem; color: var(--paper-3); }
.poll-total[hidden] { display: none; }
.poll-q {
  margin-top: 0.45rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.25;
  color: var(--paper);
}
/* Kurze Hinweise (kostenloses PDF / Druckpreis) */
.poll-note, .rate-note {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--paper-3);
}
.poll-note strong, .rate-note strong { font-weight: 500; color: var(--gold); }
.rate-note { margin: -0.35rem 0 1.05rem; }
.poll-opts { display: grid; gap: 0.5rem; margin-top: 0.95rem; }
.poll-opt {
  --pct: 0%;
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 44px;
  padding: 0.6rem 1rem;
  overflow: hidden;
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  color: var(--paper-2);
  background: transparent;
  border: 1px solid rgba(236, 230, 214, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
}
.poll-opt:hover { border-color: rgba(236, 230, 214, 0.55); color: var(--paper); }
.poll-opt:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* Ergebnis-Balken wächst von links, liegt hinter dem Text */
.poll-bar {
  position: absolute; inset: 0 auto 0 0;
  width: var(--pct);
  background: rgba(236, 230, 214, 0.08);
  transition: width 0.7s cubic-bezier(.2, .8, .2, 1);
}
.poll-label, .poll-pct { position: relative; }
.poll-pct { font-variant-numeric: tabular-nums; color: var(--paper-3); }
.poll-opt[aria-pressed="true"] { border-color: var(--gold); color: var(--paper); }
.poll-opt[aria-pressed="true"] .poll-bar { background: rgba(201, 177, 131, 0.24); }
.poll-opt[aria-pressed="true"] .poll-pct { color: var(--gold); }
.poll-opt[aria-pressed="true"] .poll-label::after { content: " ✓"; color: var(--gold); }
.poll-msg { margin-top: 0.6rem; font-size: 0.8125rem; color: var(--paper-2); min-height: 1.2em; }
.poll-msg:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .poll-bar { transition: none; } }

.book-credit {
  margin-top: 1.6rem;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(236, 230, 214, 0.5);
}

/* ── Breite Screens: Cover links, Text rechts ──────────────────── */
@media (min-width: 860px) {
  .book { padding: 7.5rem 2rem 6.5rem; }
  .book-inner { grid-template-columns: minmax(260px, 0.85fr) 1.35fr; gap: 5rem; align-items: start; }
  /* Cover oben ausrichten und beim Scrollen durchs Formular mitlaufen
     lassen, statt gegen die hohe Textspalte nach unten zu rutschen. */
  .book-cover { width: min(100%, 340px); position: sticky; top: 2.5rem; margin-top: 0.5rem; }
  .book-copy { text-align: left; }
  .book-eyebrow::after { display: none; }
  .book-blurb, .book-rate, .book-poll { margin-left: 0; margin-right: 0; }
  .book-actions { justify-content: flex-start; }
}

/* ══════════════════════════════════════════════════════════════════
   BUCH-READER (Overlay)
   ══════════════════════════════════════════════════════════════════ */
.reader {
  position: fixed; inset: 0;
  z-index: 400;
  display: flex; align-items: center; justify-content: center;
}
.reader[hidden] { display: none; }
.reader-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 5, 6, 0.93);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
.reader-shell {
  position: relative;
  width: 100%; height: 100%;
  max-width: 1440px;
  display: flex; flex-direction: column;
  padding: 0 1rem;
}
.reader-bar {
  display: flex; align-items: center;
  gap: 1rem;
  padding: 0.9rem 0.25rem;
  color: var(--paper);
}
.reader-title {
  flex: 1;
  min-width: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reader-title em { font-style: italic; color: var(--paper-3); }
.reader-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--paper-2);
  font-variant-numeric: tabular-nums;
}
.reader-dl {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  border-bottom: 1px solid rgba(201, 177, 131, 0.4);
  padding-bottom: 1px;
}
.reader-close,
.reader-nav {
  display: grid; place-items: center;
  flex: none;
  border: 1px solid rgba(236, 230, 214, 0.22);
  border-radius: 999px;
  background: rgba(11, 11, 13, 0.6);
  color: var(--paper);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}
.reader-close { width: 44px; height: 44px; }
.reader-close svg { width: 18px; height: 18px; }
.reader-nav { width: 52px; height: 52px; }
.reader-nav svg { width: 20px; height: 20px; }
.reader-close:hover, .reader-nav:hover:not(:disabled) { border-color: var(--paper); background: rgba(36, 36, 40, 0.8); }
.reader-nav:disabled { opacity: 0.2; cursor: default; }
.reader-close:focus-visible, .reader-nav:focus-visible, .reader-dl:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.reader-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 1.25rem;
  touch-action: pan-y;
}
.reader-pages {
  flex: 1;
  min-width: 0;
  display: flex; align-items: center; justify-content: center;
}
.reader-pages img {
  display: block;
  width: auto; height: auto;
  max-width: 100%;
  max-height: calc(100svh - 9.5rem);
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  cursor: pointer;
  user-select: none;
  animation: readerIn 0.35s var(--ease);
}
.reader-pages.spread img { max-width: 50%; }
@keyframes readerIn {
  from { opacity: 0; transform: translateX(var(--dir, 10px)); }
  to   { opacity: 1; transform: none; }
}

.reader-progress {
  height: 2px;
  margin: 0.4rem 0.25rem 0.9rem;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(236, 230, 214, 0.1);
}
.reader-progress i {
  display: block; height: 100%; width: 0;
  background: var(--gold);
  transition: width 0.35s var(--ease);
}
.reader-end {
  margin: -0.35rem 0 1rem;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--paper-2);
}
.reader-end[hidden] { display: none; }
.reader-rate-btn {
  padding: 0.25rem;
  border: 0; background: none;
  color: var(--gold);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Schmale Screens: Pfeile über die Seite legen statt daneben */
@media (max-width: 640px) {
  .reader-shell { padding: 0 0.5rem; }
  .reader-nav {
    position: absolute; top: 50%; z-index: 2;
    width: 42px; height: 42px;
    transform: translateY(-50%);
  }
  .reader-prev { left: 0.25rem; }
  .reader-next { right: 0.25rem; }
  .reader-pages img { max-height: calc(100svh - 8.5rem); }
  .reader-dl { display: none; }
}

/* ══════════════════════════════════════════════════════════════════
   READER-WERKZEUGE: Inhaltsverzeichnis, Zoom, Teilen
   ══════════════════════════════════════════════════════════════════ */
.reader-tool {
  display: grid; place-items: center;
  flex: none;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid rgba(236, 230, 214, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--paper-2);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.reader-tool svg { width: 18px; height: 18px; }
.reader-tool:hover { border-color: var(--paper); color: var(--paper); }
.reader-tool[aria-expanded="true"],
.reader-tool[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.reader-tool:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Zoom: Fläche schneidet ab, Seiten werden per transform skaliert */
.reader-stage { overflow: hidden; touch-action: none; }
.reader-pages { transform-origin: 0 0; will-change: transform; }
.reader-pages.anim { transition: transform 0.28s var(--ease); }
.reader-stage.zoomed { cursor: grab; }
.reader-stage.zoomed:active { cursor: grabbing; }
.reader-stage.zoomed .reader-nav { opacity: 0.25; }
.reader-pages.zoomed img { animation: none; cursor: inherit; }

/* Inhaltsverzeichnis als Schublade links */
.reader-toc {
  position: absolute; z-index: 5;
  top: 4.4rem; bottom: 1.4rem; left: 1rem;
  width: min(23rem, calc(100% - 2rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 0.6rem 1.2rem;
  border: 1px solid rgba(236, 230, 214, 0.14);
  border-radius: 12px;
  background: rgba(16, 16, 19, 0.97);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: tocIn 0.25s var(--ease);
}
.reader-toc[hidden] { display: none; }
@keyframes tocIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.reader-toc-head {
  padding: 0 0.6rem 0.6rem;
  font-size: 0.6875rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold);
}
.reader-toc ol { margin: 0; padding: 0; list-style: none; }
.toc-part {
  margin: 0.9rem 0.6rem 0.25rem;
  font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--paper-3);
}
.reader-toc button {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0; border-radius: 8px;
  background: none;
  color: var(--paper-2);
  font-family: var(--serif);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
}
.reader-toc button i { font-style: normal; font-family: var(--font-mono); font-size: 0.75rem; color: var(--paper-3); }
.reader-toc button:hover { background: rgba(236, 230, 214, 0.06); color: var(--paper); }
.reader-toc button[aria-current] { color: var(--gold); background: rgba(201, 177, 131, 0.1); }
.reader-toc button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* Kurzmeldung ("Link kopiert") */
.reader-toast {
  position: absolute; left: 50%; bottom: 2.6rem; z-index: 6;
  transform: translate(-50%, 8px);
  max-width: calc(100% - 2rem);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-size: 0.8125rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.3s var(--ease);
}
.reader-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .reader-bar { gap: 0.45rem; }
  .reader-tool { width: 38px; height: 38px; }
  .reader-title { font-size: 0.95rem; }
  .reader-toc { top: 4rem; left: 0.5rem; width: calc(100% - 1rem); }
}
@media (max-width: 400px) { .reader-title { display: none; } .reader-count { flex: 1; } }

/* ══════════════════════════════════════════════════════════════════
   DRUCK-BENACHRICHTIGUNG
   ══════════════════════════════════════════════════════════════════ */
.book-rate + .book-notify { margin-top: 1rem; }
.book-notify .rate-title { margin-bottom: 0.9rem; }
.notify-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.notify-row input {
  flex: 1 1 13rem;
  min-width: 0;
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(236, 230, 214, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--paper);
  font: inherit; font-size: 0.9375rem;
}
.notify-row input::placeholder { color: rgba(236, 230, 214, 0.38); }
.notify-row input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.notify-consent {
  display: flex; align-items: flex-start; gap: 0.6rem;
  margin-top: 0.9rem;
  font-size: 0.75rem; line-height: 1.5;
  color: var(--paper-3);
  cursor: pointer;
}
.notify-consent input { flex: none; width: 1.05rem; height: 1.05rem; margin: 0.1rem 0 0; accent-color: #c9b183; }
.notify-consent a, .rate-note a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.book-notify .rate-msg { margin-top: 0.8rem; }
.book-notify .rate-msg:empty { display: none; }
.notify-count { margin-top: 0.6rem; font-size: 0.8125rem; color: var(--gold); }
.notify-count[hidden] { display: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (min-width: 860px) { .book-notify { margin-left: 0; margin-right: 0; } }

/* ══════════════════════════════════════════════════════════════════
   RECHTLICHES (legal.html)
   ══════════════════════════════════════════════════════════════════ */
.legal {
  --paper: #ece6d6; --paper-2: rgba(236, 230, 214, 0.82); --paper-3: rgba(236, 230, 214, 0.62);
  --gold: #c9b183; --serif: "EB Garamond", Garamond, "Palatino Linotype", Palatino, Georgia, serif;
  max-width: 44rem;
  margin: 0 auto;
  padding: 6.5rem 1.5rem 4rem;
  color: var(--paper-2);
}
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: 2.4rem; color: var(--paper); }
.legal h2 { margin-top: 2.6rem; font-family: var(--serif); font-weight: 400; font-size: 1.6rem; color: var(--paper); }
.legal h3 { margin-top: 1.6rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; color: var(--gold); }
.legal p, .legal ul { margin-top: 0.7rem; font-size: 0.9375rem; line-height: 1.7; }
.legal ul { padding-left: 1.2rem; }
.legal a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.legal .fill { background: rgba(196, 19, 64, 0.25); color: #fff; padding: 0 0.25rem; border-radius: 3px; }
.legal .legal-back { margin-top: 2.4rem; }

/* ══════════════════════════════════════════════════════════════════
   SUCHE · OFFLINE · LIVE · INSTALLIEREN
   ══════════════════════════════════════════════════════════════════ */
.reader-search { display: flex; flex-direction: column; }
.reader-search[hidden] { display: none; }
.reader-search label.reader-toc-head { display: block; }
.reader-search input {
  margin: 0 0.6rem;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(236, 230, 214, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--paper);
  font: inherit; font-size: 1rem;
}
.reader-search input::placeholder { color: rgba(236, 230, 214, 0.4); }
.reader-search input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.search-info { margin: 0.6rem 0.6rem 0.2rem; font-size: 0.75rem; color: var(--paper-3); min-height: 1.1em; }
.reader-search ol { margin: 0; padding: 0; list-style: none; }
.reader-search button {
  align-items: flex-start;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.reader-search button span { color: var(--paper-3); }
.reader-search mark { background: rgba(201, 177, 131, 0.28); color: var(--paper); border-radius: 2px; padding: 0 1px; }
.reader-search button i { flex: none; padding-top: 0.1rem; }

.offline-box {
  margin: 1.2rem 0.6rem 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(236, 230, 214, 0.1);
}
.offline-box[hidden] { display: none; }
.reader-toc .offline-btn {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(201, 177, 131, 0.4);
  border-radius: 10px;
  background: rgba(201, 177, 131, 0.08);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  display: block;
  text-align: left;
}
.reader-toc .offline-btn span { color: var(--paper-3); }
.reader-toc .offline-btn:disabled { opacity: 0.6; cursor: progress; }
.reader-toc .offline-btn[hidden] { display: none; }
.offline-msg { margin-top: 0.5rem; font-size: 0.75rem; color: var(--gold); }
.offline-msg:empty { display: none; }

/* "4 people here right now · 2 reading" */
.book-live {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 0.7rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--paper-2);
  font-variant-numeric: tabular-nums;
}
.book-live[hidden] { display: none; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3ecf8e;
  animation: livePulse 2.4s infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(62, 207, 142, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.site-top-right { display: inline-flex; align-items: center; gap: 1.1rem; }
.site-install {
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(201, 177, 131, 0.5);
  border-radius: 999px;
  background: transparent;
  color: var(--gold, #c9b183);
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  cursor: pointer;
}
.site-install:hover { background: rgba(201, 177, 131, 0.12); }
.site-install[hidden] { display: none; }
