/* =============================================================================
   „Meine Bücher" (v509) — Regal und Leser. Eine eigene Welt: warme Bibliothek, Papier, Holz.
   ========================================================================== */
.bu, .bu-leser, .bu-dialog {
  --holz: #2a1a10; --holz2: #3b2516; --brett: #5a3a22; --papier: #fbf6ec; --papier2: #f1e8d6; --tinte: #2b2118;
  --text: #f6eee2; --matt: #c3ae95; --gold: #e8b65a; --rot: #c8463c; --linie: rgba(232, 182, 90, .18); --glas: rgba(30, 19, 12, .82);
}
.bu {
  position: relative; border-radius: 18px; overflow: hidden; min-height: calc(100vh - 120px); color: var(--text);
  font-family: 'Archivo', system-ui, sans-serif; padding: 28px clamp(14px, 3vw, 40px) 48px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(232, 182, 90, .16), transparent 60%),
    linear-gradient(180deg, #24160d 0%, #1a100a 100%);
}
body.view-buecher main.content { max-width: none; padding: 10px 12px; }
.bu * , .bu-leser *, .bu-dialog * { box-sizing: border-box; }
.bu button, .bu-leser button, .bu-dialog button { font: inherit; color: inherit; }
.bu [hidden], .bu-leser [hidden] { display: none !important; }

.bu-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.bu-oben { font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.bu-titel { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: clamp(36px, 5.5vw, 60px); letter-spacing: -.035em; line-height: .95; margin: 8px 0 8px;
  background: linear-gradient(100deg, #fff8ec, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: buHoch .8s cubic-bezier(.16, 1, .3, 1) both; }
.bu-satz { color: var(--matt); margin: 0; font-size: 15px; }
.bu-neu {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 14px; cursor: pointer; font-weight: 800;
  border: 1px solid rgba(232, 182, 90, .5); background: linear-gradient(100deg, var(--gold), #d99a3c); color: #2a1706 !important;
  box-shadow: 0 10px 26px rgba(232, 182, 90, .25); transition: transform .15s, box-shadow .2s;
}
.bu-neu:hover { box-shadow: 0 12px 32px rgba(232, 182, 90, .4); }
.bu-neu:active { transform: scale(.97); }

/* ---------- Regal ---------- */
.bu-regal { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 44px 26px; position: relative; padding-bottom: 20px; }
.bu-regal::before { content: ''; }
.bu-buch { position: relative; cursor: pointer; perspective: 900px; animation: buHoch .6s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
.bu-buch .einband {
  position: relative; aspect-ratio: 3 / 4.2; border-radius: 3px 8px 8px 3px; overflow: hidden; background: linear-gradient(135deg, #6b4428, #3a2414);
  box-shadow: 0 18px 30px rgba(0, 0, 0, .55), inset 6px 0 10px rgba(0, 0, 0, .35); transform-origin: left center;
  transition: transform .45s cubic-bezier(.16, 1, .3, 1), box-shadow .3s;
}
.bu-buch .einband canvas, .bu-buch .einband img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bu-buch .einband::after { /* Buchrücken-Schatten und Glanz */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .45) 0, rgba(255, 255, 255, .18) 3%, rgba(0, 0, 0, .12) 6%, transparent 12%, transparent 85%, rgba(255, 255, 255, .08));
}
.bu-buch .platzhalter { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; text-align: center; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; color: #f3dfb8; font-size: 15px; }
.bu-buch:hover .einband { transform: rotateY(-14deg) translateY(-6px); box-shadow: 18px 26px 36px rgba(0, 0, 0, .6), inset 6px 0 10px rgba(0, 0, 0, .35); }
.bu-buch .info { margin-top: 12px; }
.bu-buch .info b { display: block; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bu-buch .info small { color: var(--matt); font-size: 12px; }
.bu-fortschritt { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .1); margin-top: 7px; overflow: hidden; }
.bu-fortschritt i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #fff1cf); border-radius: 3px; }
.bu-marken { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; z-index: 2; }
.bu-marken span { font-size: 11px; padding: 2px 6px; border-radius: 99px; background: rgba(20, 12, 6, .78); color: #fff3dc; font-weight: 700; }
.bu-mehr { position: absolute; top: 8px; left: 10px; z-index: 3; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(20, 12, 6, .7); cursor: pointer; opacity: 0; transition: opacity .2s; }
.bu-buch:hover .bu-mehr, .bu-buch:focus-within .bu-mehr { opacity: 1; }
.bu-brett { grid-column: 1 / -1; height: 16px; margin: -26px -12px 0; border-radius: 4px; background: linear-gradient(180deg, #7a5233, var(--brett) 40%, #3a2414); box-shadow: 0 12px 20px rgba(0, 0, 0, .55); }
.bu-leer { text-align: center; padding: 60px 20px; color: var(--matt); }
.bu-leer b { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: 22px; color: var(--text); margin-bottom: 8px; }
.bu-lade { margin-top: 16px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bu-lade i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }

/* ---------- Leser ---------- */
.bu-leser {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; color: var(--text); font-family: 'Archivo', system-ui, sans-serif;
  background: radial-gradient(90% 70% at 50% 40%, #3a2617 0%, #1b110a 70%, #120b06 100%); animation: buEin .35s ease both;
}
.bu-lkopf { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.bu-lkopf .t { flex: 1; min-width: 0; }
.bu-lkopf b { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bu-lkopf small { color: var(--matt); font-size: 12.5px; }
.bu-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--linie); background: rgba(255, 255, 255, .05); cursor: pointer; font-weight: 650; font-size: 14px; transition: background .2s, transform .15s;
}
.bu-knopf:hover { background: rgba(255, 255, 255, .1); }
.bu-knopf:active { transform: scale(.96); }
.bu-knopf.an { background: rgba(232, 182, 90, .2); border-color: var(--gold); color: #ffe7b6; }
.bu-buehne { flex: 1; min-height: 0; display: flex; gap: 16px; padding: 4px 16px 10px; }
.bu-tisch { flex: 1; min-width: 0; position: relative; display: grid; place-items: center; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.bu-aufgeschlagen { position: relative; display: flex; perspective: 2400px; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .6)); animation: buAuf .7s cubic-bezier(.16, 1, .3, 1) both; }
.bu-seite { position: relative; background: var(--papier); overflow: hidden; cursor: pointer; }
.bu-seite canvas { display: block; width: 100%; height: 100%; }
.bu-seite.links { border-radius: 6px 0 0 6px; }
.bu-seite.rechts { border-radius: 0 6px 6px 0; }
.bu-seite.einzeln { border-radius: 6px; }
.bu-seite.leer { background: linear-gradient(90deg, var(--papier2), var(--papier)); cursor: default; }
.bu-seite.links::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(270deg, rgba(0, 0, 0, .22) 0, rgba(0, 0, 0, .06) 4%, transparent 10%); }
.bu-seite.rechts::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .25) 0, rgba(0, 0, 0, .06) 4%, transparent 10%, transparent 94%, rgba(0, 0, 0, .05)); }
.bu-seite.aktiv { box-shadow: inset 0 0 0 3px rgba(232, 182, 90, .55); }
.bu-seitenzahl { position: absolute; bottom: 6px; font-size: 11px; color: #8a7a66; font-variant-numeric: tabular-nums; pointer-events: none; }
.bu-seite.links .bu-seitenzahl { left: 10px; } .bu-seite.rechts .bu-seitenzahl, .bu-seite.einzeln .bu-seitenzahl { right: 10px; }
.bu-band { position: absolute; top: -4px; right: 18px; width: 16px; height: 46px; background: linear-gradient(90deg, #a82f27, var(--rot), #a82f27); z-index: 3;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); box-shadow: 0 4px 6px rgba(0, 0, 0, .3); animation: buBand .5s cubic-bezier(.2, 1.4, .4, 1) both; pointer-events: none; }
.bu-reiter { position: absolute; right: -2px; top: 60px; display: grid; gap: 4px; z-index: 3; pointer-events: none; }
.bu-reiter span { font-size: 11px; padding: 3px 7px 3px 8px; border-radius: 8px 0 0 8px; background: #ffe58a; color: #4a3500; font-weight: 800; box-shadow: -2px 2px 5px rgba(0, 0, 0, .25); }
.bu-reiter span.ton { background: #b8e3ff; color: #08324d; }
.bu-blatt { position: absolute; top: 0; z-index: 5; transform-style: preserve-3d; pointer-events: none; }
.bu-blatt > div { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--papier); overflow: hidden; }
.bu-blatt > div canvas { width: 100%; height: 100%; display: block; }
.bu-blatt .rueck { transform: rotateY(180deg); }
.bu-blatt .schatten { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .0), rgba(0, 0, 0, .25)); opacity: 0; backface-visibility: visible; }
.bu-laden { color: var(--matt); font-size: 14px; }

/* Notizen-Seite */
.bu-notizen {
  width: 360px; flex: none; border-radius: 18px; background: var(--glas); border: 1px solid var(--linie); padding: 16px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px; animation: buRein .4s cubic-bezier(.16, 1, .3, 1) both; backdrop-filter: blur(8px);
}
.bu-notizen h3 { margin: 0; font-family: 'Bricolage Grotesque', sans-serif; font-size: 20px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bu-notizen h3 small { font-family: 'Archivo', sans-serif; font-size: 12px; color: var(--matt); font-weight: 500; }
.bu-seitenwahl { display: flex; gap: 6px; }
.bu-notiz { position: relative; padding: 12px 14px 10px; border-radius: 4px 14px 14px 14px; background: #fff3c4; color: #3d2f12; font-size: 14.5px; line-height: 1.5;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .25); white-space: pre-wrap; overflow-wrap: anywhere; animation: buHoch .35s cubic-bezier(.16, 1, .3, 1) both; transform: rotate(-.4deg); }
.bu-notiz:nth-child(even) { transform: rotate(.5deg); background: #ffeab8; }
.bu-notiz small { display: block; margin-top: 6px; font-size: 11px; color: #7a6634; }
.bu-notiz .x { position: absolute; top: 6px; right: 8px; border: 0; background: none; cursor: pointer; color: #7a6634; font-size: 16px; opacity: .6; }
.bu-notiz .x:hover { opacity: 1; color: var(--rot); }
.bu-feld { width: 100%; min-height: 92px; resize: vertical; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--linie); background: rgba(0, 0, 0, .3); color: var(--text); font: inherit; font-size: 14.5px; line-height: 1.5; outline: none; }
.bu-feld:focus { border-color: rgba(232, 182, 90, .6); box-shadow: 0 0 0 3px rgba(232, 182, 90, .12); }
.bu-zeile { display: flex; gap: 8px; flex-wrap: wrap; }
.bu-ton { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(184, 227, 255, .08); border: 1px solid rgba(184, 227, 255, .2); animation: buHoch .35s both; }
.bu-ton audio { flex: 1; min-width: 0; height: 34px; }
.bu-ton button { border: 0; background: none; color: var(--matt); cursor: pointer; font-size: 16px; }
.bu-knopf.nimmt { background: rgba(200, 70, 60, .25); border-color: var(--rot); color: #ffd9d4; }
.bu-knopf.nimmt::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #ff6b5e; animation: buPuls 1s ease-in-out infinite; }
.bu-leer-notiz { color: var(--matt); font-size: 13.5px; }

/* Fußleiste */
.bu-fuss { display: flex; align-items: center; gap: 12px; padding: 10px 16px 14px; }
.bu-fuss input[type=range] { flex: 1; accent-color: var(--gold); }
.bu-fuss .nr { min-width: 112px; text-align: center; font-variant-numeric: tabular-nums; color: var(--matt); font-size: 13.5px; }
.bu-fuss .nr b { color: var(--text); }
.bu-lesezeichen-menue { position: absolute; bottom: 64px; left: 16px; z-index: 6; min-width: 200px; max-height: 50vh; overflow-y: auto; padding: 6px; border-radius: 14px; background: #2a1a10; border: 1px solid var(--linie); box-shadow: 0 18px 40px rgba(0, 0, 0, .5); animation: buHoch .25s both; }
.bu-lesezeichen-menue button { display: flex; justify-content: space-between; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: none; cursor: pointer; text-align: left; }
.bu-lesezeichen-menue button:hover { background: rgba(255, 255, 255, .07); }

.bu-dialog { position: fixed; z-index: 95; inset: 0; display: grid; place-items: center; background: rgba(10, 6, 3, .6); backdrop-filter: blur(3px); animation: buEin .2s both; font-family: 'Archivo', system-ui, sans-serif; }
.bu-dialog > div { width: min(420px, calc(100vw - 24px)); padding: 22px; border-radius: 18px; background: linear-gradient(180deg, #34210f, #22150b); border: 1px solid var(--linie); color: var(--text); box-shadow: 0 30px 70px rgba(0, 0, 0, .6); animation: buZoom .3s cubic-bezier(.16, 1, .3, 1) both; }
.bu-dialog h2 { margin: 0 0 14px; font-family: 'Bricolage Grotesque', sans-serif; }
.bu-dialog label { display: grid; gap: 6px; font-size: 12px; color: var(--matt); margin-bottom: 12px; }
.bu-dialog input { padding: 11px 12px; border-radius: 11px; border: 1px solid var(--linie); background: rgba(0, 0, 0, .3); color: var(--text); font: inherit; font-size: 15px; }
.bu-dialog .fuss { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.bu-dialog .fehler { flex: 1; color: #ff9b8f; font-size: 12.5px; }

@keyframes buHoch { from { opacity: 0; transform: translateY(12px); } }
@keyframes buEin { from { opacity: 0; } }
@keyframes buZoom { from { opacity: 0; transform: scale(.92); } }
@keyframes buRein { from { opacity: 0; transform: translateX(24px); } }
@keyframes buAuf { from { opacity: 0; transform: scale(.88) rotateX(8deg); } }
@keyframes buBand { from { transform: translateY(-60%); } }
@keyframes buPuls { 50% { transform: scale(1.3); opacity: .6; } }

@media (max-width: 900px) {
  .bu-buehne { flex-direction: column; padding: 0 8px 6px; gap: 10px; }
  .bu-notizen { width: auto; max-height: 46vh; border-radius: 16px 16px 0 0; animation-name: buHoch; }
  .bu-regal { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 36px 16px; }
  .bu-lkopf { padding: 8px 10px; }
  .bu-fuss { padding: 6px 10px 10px; gap: 8px; }
  .bu-fuss .nr { min-width: 80px; }
  .bu-feld { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .bu *, .bu-leser, .bu-leser * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
