/* Bookhain – Gestaltung. Farben: Moosgrün, warmes Gold, dezentes Lila */
:root {
  --gold: #d9a83e; --gold-l: #f3d99a; --gold-d: #9a6e22;
  --moss: #5f8a3a; --moss-d: #2f4d1e;
  --lila: #7a4f8e; --lila-d: #553468; --lila-l: #b79ad0;
  --ink: #3a2a1f; --ink-soft: #6b5646;
  --parch: #f7eedd; --parch-2: #efe2c8; --line: #d9c29a;
  --sky: #2a1520; --glow: 255,196,120; --accent: #7a4f8e; --plaque: #e9d6a6;
  --serif: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Noto Serif', Georgia, serif;
  --r: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font-family: var(--serif); color: var(--ink); background: var(--sky); overscroll-behavior-y: contain; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { -webkit-user-drag: none; user-select: none; }

/* ---------- Welt-Hintergrund (fest, eigene Ebene) */
#world-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--sky); }
#world-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; transition: opacity .6s; }
.world-glow { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(var(--glow), .16), transparent 60%), linear-gradient(to bottom, rgba(0,0,0,.25), transparent 18%, transparent 75%, rgba(0,0,0,.35)); pointer-events: none; }

/* ---------- Pergament-Flächen */
.parchment {
  background: radial-gradient(ellipse at 50% 0%, #fffaf0, transparent 60%), linear-gradient(180deg, var(--parch), var(--parch-2));
  border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 0 0 4px rgba(255, 244, 220, .35), 0 0 0 5px rgba(201, 162, 76, .55), 0 18px 50px rgba(20, 8, 10, .55);
}
.brand { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; color: #fbe9bf; text-shadow: 0 2px 8px rgba(0,0,0,.5), 0 0 18px rgba(var(--glow), .35); }

/* ---------- Anmeldung */
#gate { position: relative; z-index: 2; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: min(380px, 100%); padding: 28px 26px 24px; text-align: center; }
.gate-logo { width: 120px; height: 120px; margin: -70px auto 0; display: block; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.gate-card .brand { color: var(--moss-d); text-shadow: none; font-size: 2.2rem; margin: 4px 0 0; }
.gate-sub { margin: 0 0 18px; color: var(--ink-soft); font-style: italic; }
.gate-card label { display: block; text-align: left; margin: 10px 0; font-size: .95rem; color: var(--ink-soft); }
.gate-card input { display: block; width: 100%; margin-top: 4px; }
.err { color: #9a2a26; min-height: 1.2em; margin: 8px 0; font-size: .95rem; }
.hint { color: var(--ink-soft); font-size: .88rem; margin: 4px 0; }

/* ---------- Eingaben & Knöpfe */
input, select, textarea { background: #fffaf0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 44px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid rgba(122, 79, 142, .35); outline-offset: 1px; }
input[type=color] { padding: 2px; width: 48px; min-height: 40px; }
input[type=range] { padding: 0; min-height: 30px; border: 0; background: none; accent-color: var(--lila); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); background: linear-gradient(#fffaf0, #f0e3c8); color: var(--ink); box-shadow: 0 2px 0 rgba(154, 110, 34, .25); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(#8e62a4, var(--lila-d)); color: #fff6e6; border-color: #4a2a5c; box-shadow: 0 3px 0 #3a1f4a, inset 0 1px 0 rgba(255,255,255,.25); }
.btn.gold { background: linear-gradient(var(--gold-l), var(--gold)); border-color: var(--gold-d); color: #3a2410; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.danger { color: #8a1e2a; border-color: #d8a2a2; }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: .9rem; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.seg { display: flex; background: #eadcc0; border-radius: 999px; padding: 3px; gap: 2px; border: 1px solid var(--line); }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 8px 6px; min-height: 40px; font-size: .92rem; color: var(--ink-soft); }
.seg button.on { background: linear-gradient(#8e62a4, var(--lila-d)); color: #fff6e6; box-shadow: 0 2px 6px rgba(60, 20, 70, .3); }

/* ---------- Kopfleiste */
#app { position: relative; z-index: 1; padding-bottom: calc(90px + var(--safe-b)); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: linear-gradient(to bottom, rgba(20, 10, 18, .78), rgba(20, 10, 18, .35)); backdrop-filter: blur(6px); }
.brand-mini { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-mini img { width: 44px; height: 44px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.brand-mini .brand { font-size: 1.7rem; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 16px; border-radius: 999px; border: 1px solid rgba(233, 196, 106, .7); background: linear-gradient(rgba(70, 40, 70, .85), rgba(40, 20, 40, .85)); color: #fbe9bf; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 10px rgba(0,0,0,.3); }
.pill.icon { width: 44px; padding: 0; justify-content: center; font-size: 1.2rem; }
.pill .chev { opacity: .8; font-size: .8rem; }
.chips { position: sticky; top: 64px; z-index: 19; display: flex; gap: 8px; padding: 4px 16px 10px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(233, 196, 106, .55); background: rgba(40, 22, 40, .72); color: #f6e3b8; white-space: nowrap; }
.chip.on { background: linear-gradient(#8e62a4, var(--lila-d)); border-color: var(--gold-l); color: #fff; box-shadow: 0 0 0 2px rgba(243, 217, 154, .35); }
.chip.import { background: linear-gradient(#fff6e2, #efdfc0); color: var(--ink); border-color: var(--gold); }
.chip-info { align-self: center; color: #f6e3b8; font-size: .85rem; white-space: nowrap; text-shadow: 0 1px 3px #000; }

/* ---------- Bühne & Regale */
#stage { padding: 6px 8px 40px; }
#shelves { display: flex; flex-direction: column; align-items: center; gap: 46px; }
.empty { max-width: 520px; padding: 24px; text-align: center; margin-top: 40px; }
.shelf { position: relative; max-width: 100%; }
.plaque { position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 auto -6px; width: max-content; max-width: 90%; padding: 4px 18px; border-radius: 10px; background: linear-gradient(var(--gold-l), #c99a45); color: #3a2410; border: 1px solid #8a6420; box-shadow: 0 3px 8px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.5); font-size: .95rem; letter-spacing: .03em; }
.pl-btn { border: 0; background: rgba(255,255,255,.35); border-radius: 50%; width: 30px; height: 30px; font-size: .9rem; color: #3a2410; }
.shelf-body { position: relative; padding: calc(var(--side) * 1.1) var(--side) calc(var(--side) * .9); border-radius: 10px;
  background: linear-gradient(var(--tint), var(--tint)), var(--grain), linear-gradient(90deg, var(--wood2), var(--wood) 12%, var(--wood) 88%, var(--wood2));
  background-blend-mode: soft-light, multiply, normal; background-size: auto, 240px auto, auto;
  box-shadow: 0 30px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.4), inset 0 0 0 2px var(--trim), inset 0 2px 0 rgba(255,255,255,.12); }
.crown { position: absolute; left: -10px; right: -10px; top: -14px; height: calc(22px * var(--s) + 10px); border-radius: 8px 8px 4px 4px; background: var(--grain), linear-gradient(var(--wood), var(--wood2)); background-blend-mode: multiply; background-size: 240px auto, auto; box-shadow: 0 6px 10px rgba(0,0,0,.45), inset 0 2px 0 rgba(255,255,255,.18), inset 0 -3px 0 var(--trim); }
.board { position: relative; display: flex; flex-direction: column; }
.items { position: relative; display: flex; align-items: flex-end; padding: 0 2px; overflow: visible;
  background: radial-gradient(ellipse at 50% 0%, rgba(var(--glow), .22), transparent 70%), var(--grain), linear-gradient(var(--back), color-mix(in srgb, var(--back) 70%, #000));
  background-blend-mode: normal, multiply, normal; background-size: auto, 240px auto, auto;
  box-shadow: inset 0 14px 18px -8px rgba(0,0,0,.75), inset 10px 0 14px -10px rgba(0,0,0,.7), inset -10px 0 14px -10px rgba(0,0,0,.7); }
.board.al-center .items { justify-content: center; }
.plank { position: relative; z-index: 2; background: var(--grain), linear-gradient(color-mix(in srgb, var(--wood) 80%, #fff), var(--wood) 30%, var(--wood2)); background-blend-mode: multiply; background-size: 240px auto, auto; box-shadow: 0 6px 8px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.25), inset 0 -2px 0 var(--trim); margin: 0 -4px; border-radius: 2px; }
.amb-lights { position: absolute; z-index: 4; left: 4%; width: 92%; top: calc(var(--side) * .55); height: calc(44px * var(--s)); pointer-events: none; filter: drop-shadow(0 0 calc(6px * var(--lamp)) rgba(255, 200, 110, calc(.6 * var(--lamp)))) brightness(calc(.85 + var(--lamp) * .15)); }

/* Rahmen „Baum“: Regal in einem alten Baum */
.fr-baum .shelf-body { border-radius: 46% 46% 14% 14% / 9% 9% 3% 3%; padding-top: calc(var(--side) * 2.4); background: var(--grain), linear-gradient(90deg, var(--wood2), var(--wood) 30%, color-mix(in srgb, var(--wood) 85%, #fff) 50%, var(--wood) 70%, var(--wood2)); background-blend-mode: multiply; background-size: 160px auto, auto; }
.fr-baum .crown { display: none; }
.fr-baum .shelf-body::before { content: ''; position: absolute; z-index: 0; left: 6%; right: 6%; bottom: -26px; height: 40px; background: radial-gradient(ellipse at 20% 0, var(--root) 30%, transparent 31%), radial-gradient(ellipse at 80% 0, var(--root) 30%, transparent 31%), radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--root) 70%, #000) 40%, transparent 41%); }
.fr-baum .items { border-radius: 6px; background: radial-gradient(ellipse at 50% 10%, rgba(var(--glow), .28), transparent 70%), linear-gradient(#24160d, #120a06); }
.fr-baum .plank { background: url('catalog/art/moos.svg') 0 0/120px 100% repeat-x, var(--grain), linear-gradient(color-mix(in srgb, var(--wood) 80%, #fff), var(--wood2)); background-blend-mode: normal, multiply, normal; background-size: calc(120px * var(--s)) 70%, 160px auto, auto; background-position: 0 -2px, 0 0, 0 0; }
.amb-vines { position: absolute; z-index: 4; left: 0; width: 100%; top: -6px; height: calc(150px * var(--s)); pointer-events: none; }
.fireflies { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.fireflies i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fff3a6; box-shadow: 0 0 10px 3px rgba(255, 236, 140, .7); animation: fly 9s ease-in-out infinite; }
.fireflies i:nth-child(1) { left: 8%; top: 20%; } .fireflies i:nth-child(2) { left: 70%; top: 35%; animation-delay: -3s; } .fireflies i:nth-child(3) { left: 40%; top: 60%; animation-delay: -5s; } .fireflies i:nth-child(4) { left: 88%; top: 75%; animation-delay: -1s; } .fireflies i:nth-child(5) { left: 20%; top: 85%; animation-delay: -7s; }
@keyframes fly { 0%, 100% { transform: translate(0, 0); opacity: .2; } 30% { opacity: 1; } 50% { transform: translate(24px, -18px); opacity: .8; } 80% { transform: translate(-12px, 10px); opacity: .3; } }

/* ---------- Bücher im Regal */
.it { position: relative; flex: none; touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; transition: transform .18s ease, filter .2s, opacity .2s; }
.bk { cursor: pointer; margin-right: 0; }
.bk .face { position: absolute; inset: 0; overflow: hidden; border-radius: 2px 2px 1px 1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 2px 0 3px rgba(0,0,0,.35); display: flex; flex-direction: column; align-items: center; justify-content: center; }
/* Leder: Struktur + runder Rücken + Licht von oben */
.bk.o-s .face, .b3 .sp3 { background-blend-mode: overlay, normal, normal; background-image: url('catalog/art/textur-leder.webp'), linear-gradient(180deg, rgba(255,226,170,.22), rgba(255,226,170,0) 22%, rgba(0,0,0,0) 70%, rgba(0,0,0,.3)), linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.08) 12%, rgba(255,240,210,.2) 30%, rgba(255,255,255,.04) 48%, rgba(0,0,0,.12) 72%, rgba(0,0,0,.5)); background-size: 120px auto, auto, auto; }
.bk.o-c .face, .b3 .front, .b3 .back { background-blend-mode: overlay, normal, normal; background-image: url('catalog/art/textur-leder.webp'), radial-gradient(ellipse at 40% 25%, rgba(255,230,180,.22), transparent 60%), linear-gradient(160deg, rgba(255,255,255,.06), rgba(0,0,0,.35)); background-size: 140px auto, auto, auto; }
.bk .face.lightbook, .b3 .f.face.lightbook { background-blend-mode: overlay, normal, normal; background-image: url('catalog/art/textur-leder.webp'), linear-gradient(180deg, rgba(255,240,210,.25), rgba(255,255,255,0) 22%, rgba(0,0,0,0) 70%, rgba(60,30,10,.22)), linear-gradient(90deg, rgba(60,30,10,.4), rgba(60,30,10,.05) 12%, rgba(255,255,255,.3) 30%, rgba(255,255,255,.05) 50%, rgba(60,30,10,.1) 72%, rgba(60,30,10,.38)); background-size: 140px auto, auto, auto; }
.bk .sheen { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.3), transparent 18%, rgba(255,255,255,.14) 38%, transparent 58%, rgba(0,0,0,.28)); pointer-events: none; }
.bk .sheen.soft { background: linear-gradient(90deg, rgba(0,0,0,.25), transparent 30%, transparent 70%, rgba(0,0,0,.25)); }
.bk .band { position: absolute; left: 0; right: 0; height: 6%; border-top: 1.5px solid rgba(233, 196, 106, .85); border-bottom: 1.5px solid rgba(233, 196, 106, .85); }
.bk .band.top { top: 5%; } .bk .band.bot { bottom: 5%; }
.sp-title, .sp-author { position: relative; z-index: 1; text-align: center; line-height: 1.05; overflow: hidden; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.sp-title.h { padding: 0 6%; word-break: break-word; hyphens: auto; max-height: 52%; }
.sp-author:not(.v) { position: absolute; top: 14%; left: 0; right: 0; padding: 0 6%; opacity: .9; }
.sp-title.v, .sp-author.v { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; text-overflow: ellipsis; }
.sp-title.v { max-height: 58%; }
.sp-author.v { max-height: 24%; margin-bottom: 8%; opacity: .85; }
.sp-orn { position: absolute; bottom: 14%; width: 40%; aspect-ratio: 1; background: url('catalog/art/muster-sterne.svg') center/contain no-repeat; opacity: .9; }
.bk.o-c .face { box-shadow: inset 0 0 0 1px rgba(0,0,0,.3), 4px 2px 8px rgba(0,0,0,.45); border-radius: 2px 5px 5px 2px; }
.cv-frame { position: absolute; inset: 7%; border: 1.5px solid rgba(233, 196, 106, .85); outline: 1px solid rgba(233, 196, 106, .45); outline-offset: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6%; padding: 8%; text-align: center; }
.cv-title { font-weight: 600; line-height: 1.1; text-shadow: 0 1px 2px rgba(0,0,0,.4); word-break: break-word; hyphens: auto; }
.cv-author { opacity: .9; font-style: italic; }
.cv-orn { width: 34%; aspect-ratio: 3/1; background: url('catalog/art/muster-ranken.svg') center/contain no-repeat; }
.cover-sheen { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(255,255,255,.12) 6%, transparent 14%), linear-gradient(160deg, rgba(255,255,255,.12), transparent 40%); pointer-events: none; }
.bk-back { position: absolute; inset: 10%; display: flex; flex-direction: column; gap: 8px; text-align: center; opacity: .9; }
.bk-isbn { margin-top: auto; font-family: monospace; font-size: .8em; background: rgba(255,255,255,.85); color: #222; padding: 4px; border-radius: 2px; }
.ribbon { position: absolute; left: 30%; top: -8px; width: 6px; height: 18px; background: linear-gradient(#b48ad6, #6b3f8a); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); z-index: 2; }
@media (hover: hover) { .bk:hover { transform: translateY(-6px); filter: brightness(1.12); } .dc:hover { transform: translateY(-3px); } }
.bk.out { visibility: hidden; }
.bk.dim { opacity: .22; filter: grayscale(.6); }
.bk.glow { transform: translateY(-10px); filter: brightness(1.2) drop-shadow(0 0 10px rgba(255, 220, 140, .95)); z-index: 3; }
.dc-art { position: absolute; bottom: 0; left: 0; isolation: isolate; }
.dc-art img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; filter: drop-shadow(3px 4px 4px rgba(0,0,0,.5)); }
.dc-art .tint { position: absolute; inset: 0; mix-blend-mode: color; pointer-events: none; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center bottom; mask-position: center bottom; }
.dc.glowing .dc-art img { filter: drop-shadow(0 0 calc(10px * var(--lamp)) rgba(255, 210, 120, calc(.45 * var(--lamp)))) drop-shadow(3px 4px 4px rgba(0,0,0,.5)) brightness(calc(.9 + var(--lamp) * .1)); }
.dc.top { align-self: stretch; } .dc.top .dc-art { bottom: auto; top: 2px; }
.dc .missing { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.3); border-radius: 8px; }
.it.dragging { opacity: .3; }
.it.sel { transform: translateY(-8px); filter: drop-shadow(0 0 6px rgba(183,154,208,.95)) drop-shadow(0 0 2px #fff); z-index: 3; }
.it.sel::after { content: '✓'; position: absolute; left: 50%; top: -18px; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--lila); color: #fff; font-size: 11px; line-height: 16px; text-align: center; z-index: 4; }
body.selecting .bk:hover { transform: translateY(-4px); }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; opacity: .95; filter: drop-shadow(0 16px 18px rgba(0,0,0,.55)); }
.ins-marker { position: absolute; bottom: 0; top: 4%; width: 4px; border-radius: 4px; background: linear-gradient(var(--gold-l), var(--gold)); box-shadow: 0 0 12px 3px rgba(255, 214, 130, .85); z-index: 6; pointer-events: none; }
body.moving .board { cursor: copy; }
body.moving .items { outline: 1px dashed rgba(243, 217, 154, .35); outline-offset: -3px; }

#movebar, #selbar { position: sticky; top: 112px; z-index: 25; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 0 auto; width: min(760px, calc(100% - 16px)); padding: 10px 14px; border-radius: 16px; background: linear-gradient(#fff6e2, #efdfc0); border: 1px solid var(--gold); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.actionbar select { min-height: 36px; padding: 4px 8px; }

/* ---------- Seitenfeld / Blatt */
#panel { position: fixed; z-index: 40; right: 18px; top: 74px; bottom: 18px; width: min(420px, calc(100vw - 36px)); display: flex; pointer-events: none; }
.panel-card { pointer-events: auto; width: 100%; display: flex; flex-direction: column; overflow: hidden; }
.panel-head { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 48px 8px; }
.panel-head h2 { margin: 0; font-size: 1.45rem; font-weight: 600; color: var(--ink); text-align: center; }
.flourish { width: 38px; height: 14px; background: url('catalog/art/muster-ranken.svg') center/contain no-repeat; opacity: .8; }
.flourish.r { transform: scaleX(-1); }
.x { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fffaf0; }
#panel-body { overflow-y: auto; padding: 6px 20px 20px; overscroll-behavior: contain; flex: 1; }
.sec-title { font-size: 1.05rem; margin: 16px 0 8px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.sec-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.badge { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: #efe2c8; border: 1px solid var(--line); color: var(--ink-soft); }
.badge.ph { background: #fff1d6; border-color: #e0b866; color: #7a5410; }
.badge.new { background: var(--lila); color: #fff; border-color: var(--lila-d); }
.field { display: grid; gap: 4px; margin: 8px 0; font-size: .9rem; color: var(--ink-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid rgba(217, 194, 154, .6); }
.list li button.link { all: unset; cursor: pointer; flex: 1; min-height: 40px; display: flex; flex-direction: column; justify-content: center; }
.list .sub { font-size: .85rem; color: var(--ink-soft); }
.mini-spine { flex: none; width: 14px; height: 40px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.bar { height: 8px; border-radius: 99px; background: #e6d6b8; overflow: hidden; } .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--moss), var(--gold)); border-radius: 99px; }

/* ---------- 3D-Buch */
.b3-stage { position: relative; height: 330px; display: grid; place-items: center; perspective: 1100px; touch-action: none; cursor: grab; margin: 4px 0 6px; background: radial-gradient(ellipse at 50% 85%, rgba(122, 79, 142, .18), transparent 60%); }
.b3-stage:active { cursor: grabbing; }
.b3 { position: relative; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2, .8, .2, 1); }
.b3.dragging { transition: none; }
.b3 .f { position: absolute; left: 0; top: 0; overflow: hidden; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.b3 .f.front, .b3 .f.back { width: var(--w); height: var(--h); }
.b3 .f.front { transform: translateZ(calc(var(--d) / 2)); border-radius: 2px 6px 6px 2px; }
.b3 .f.back { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); border-radius: 6px 2px 2px 6px; }
.b3 .f.spine, .b3 .f.fore { width: var(--d); height: var(--h); left: calc((var(--w) - var(--d)) / 2); }
.b3 .f.spine { transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); }
.b3 .f.fore { transform: rotateY(90deg) translateZ(calc(var(--w) / 2 - 2px)); height: calc(var(--h) - 6px); top: 3px; }
.b3 .f.top, .b3 .f.bottom { width: calc(var(--w) - 4px); height: var(--d); top: calc((var(--h) - var(--d)) / 2); }
.b3 .f.top { transform: rotateX(90deg) translateZ(calc(var(--h) / 2 - 3px)); }
.b3 .f.bottom { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2 - 3px)); }
.b3 .f.spine { box-shadow: inset 0 0 0 1px rgba(0,0,0,.3); }
.b3-shadow { position: absolute; bottom: 18px; left: 50%; width: 180px; height: 22px; transform: translateX(-50%); background: radial-gradient(ellipse, rgba(0,0,0,.35), transparent 70%); }
.b3-views { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.b3-views button { min-height: 34px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fffaf0; font-size: .85rem; }
.b3-views button.on { background: var(--lila); color: #fff; border-color: var(--lila-d); }
.bv-title { text-align: center; margin: 2px 0 0; font-size: 1.25rem; }
.bv-author { text-align: center; margin: 2px 0 8px; color: var(--ink-soft); font-style: italic; }
.prog-row { display: flex; align-items: center; gap: 6px; justify-content: center; margin: 10px 0 4px; }
.prog-row input { width: 84px; text-align: center; }
.prog-pct { text-align: center; font-size: .9rem; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Gestalten: Farbfelder, Muster, Zuschnitt */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 10px; overflow-x: auto; }
.tabs button { flex: none; border: 1px solid transparent; border-bottom: 0; background: transparent; padding: 10px 14px; border-radius: 12px 12px 0 0; min-height: 44px; color: var(--ink-soft); }
.tabs button.on { background: linear-gradient(#8e62a4, var(--lila-d)); color: #fff; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line), 0 2px 4px rgba(0,0,0,.2); }
.sw.on { box-shadow: 0 0 0 3px var(--lila), 0 2px 6px rgba(0,0,0,.3); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 10px; }
.tile { aspect-ratio: 1; border-radius: 12px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line), 0 2px 5px rgba(0,0,0,.2); background-size: 50%; }
.tile.on { box-shadow: 0 0 0 3px var(--lila); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot { border: 1px dashed var(--line); border-radius: 12px; padding: 8px; text-align: center; font-size: .85rem; background: #fffaf0; }
.slot .thumb { height: 90px; margin: 4px auto 6px; border-radius: 4px; background: #eadcc0 center/contain no-repeat; display: grid; place-items: center; color: var(--ink-soft); font-size: .8rem; }
.deco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.deco-card { position: relative; border: 1px solid var(--line); background: #fffaf0; border-radius: 14px; padding: 8px 6px; text-align: center; font-size: .85rem; min-height: 120px; }
.deco-card img { height: 70px; max-width: 100%; object-fit: contain; display: block; margin: 0 auto 6px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.25)); }
.deco-card .badge { position: absolute; top: 6px; right: 6px; }
.deco-preview { position: relative; margin: 4px auto 6px; }
.sw-orig { background: conic-gradient(#f4efe6 0 25%, #e8c46a 0 50%, #c0504d 0 75%, #7fcfc4 0); }
.series-box, .dice-box { margin: 6px 0 10px; padding: 10px 12px; border-radius: 14px; background: #fffaf0; border: 1px solid var(--line); text-align: center; font-size: .92rem; }
.series-box .btn { margin-top: 8px; }
.dice-box { background: linear-gradient(#fff6e0, #f3e2bd); border-color: var(--gold); }
.dice-box .row { justify-content: center; margin-top: 8px; }
#rd-dice { margin-bottom: 10px; }
.world-wrap { position: relative; }
.world-wrap .world-edit { position: absolute; right: 8px; top: 8px; left: auto; width: auto; display: inline-flex; z-index: 2; background: rgba(255,250,240,.92); }
.world-card span em { font-size: .8em; opacity: .8; }
.world-card { position: relative; display: block; width: 100%; border-radius: 16px; overflow: hidden; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; background: #222; margin-bottom: 12px; }
.world-card img { display: block; width: 100%; height: 120px; object-fit: cover; }
.world-card span { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; color: #fbe9bf; background: linear-gradient(transparent, rgba(0,0,0,.75)); text-align: left; font-size: 1.05rem; }
.world-card.on { box-shadow: 0 0 0 3px var(--gold); }
.shelf-row { border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; background: #fffaf0; }
.map-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.map-table td { padding: 4px; border-bottom: 1px solid rgba(217, 194, 154, .5); vertical-align: top; }
.map-table select { min-height: 36px; padding: 4px 6px; width: 100%; }
.map-table .ex { color: var(--ink-soft); font-size: .8rem; word-break: break-word; }
.imp-sum { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.imp-sum div { background: #fffaf0; border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; }
.imp-sum b { display: block; font-size: 1.4rem; }
.warnbox { background: #fff1d6; border: 1px solid #e0b866; border-radius: 12px; padding: 10px; font-size: .9rem; }
.okbox { background: #e9f3dc; border: 1px solid #9fc27a; border-radius: 12px; padding: 10px; font-size: .9rem; }
.progress { height: 12px; border-radius: 99px; background: #e6d6b8; overflow: hidden; } .progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--moss), var(--gold)); transition: width .2s; }

/* Zuschneiden */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(15, 6, 12, .65); backdrop-filter: blur(3px); }
.modal-card { width: min(440px, 100%); padding: 20px; }
.cropper { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; background: #150c12; color: #fbe9bf; }
.crop-area { position: relative; flex: 1; overflow: hidden; touch-action: none; display: grid; place-items: center; }
.crop-area canvas { max-width: 100%; max-height: 100%; }
.crop-tools { padding: 12px 16px calc(14px + var(--safe-b)); background: #24161f; display: grid; gap: 10px; }
.crop-tools label { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; font-size: .9rem; }

/* ---------- Buchgestaltung: Goldprägung, Bünde, Etiketten, Motive */
.face .band { height: 4.5%; border-top: 1.5px solid #d8b25e; border-bottom: 1px solid #b8862e; background: linear-gradient(rgba(255,230,160,.12), rgba(0,0,0,.15)); }
.face .rib { position: absolute; left: -1px; right: -1px; height: 3.2%; border-radius: 40%; background: linear-gradient(180deg, rgba(255,240,210,.35), rgba(0,0,0,0) 45%, rgba(0,0,0,.55)); box-shadow: 0 1px 0 rgba(0,0,0,.4), 0 -1px 0 rgba(255,220,150,.25); border-top: 1px solid rgba(226,180,83,.8); border-bottom: 1px solid rgba(226,180,83,.6); }
.sp-vine { position: absolute; inset: 7% 8%; background-size: 100% auto; background-repeat: repeat-y; opacity: .55; }
.sp-label { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; max-width: 88%; max-height: 54%; overflow: hidden; }
.sp-label.framed { padding: 6% 6%; border: 1px solid rgba(226,180,83,.85); outline: 1px solid rgba(226,180,83,.4); outline-offset: 2px; border-radius: 3px; box-shadow: inset 0 0 8px rgba(0,0,0,.45); background: rgba(0,0,0,.18); }
.sp-label.v { max-height: 60%; }
.sp-label.v.framed { padding: 6% 1px; max-width: 76%; }
.face:not(.lightbook) .sp-title, .face:not(.lightbook) .sp-author, .face:not(.lightbook) .cv-title, .face:not(.lightbook) .cv-author { color: #efd38e; text-shadow: 0 1px 0 rgba(0,0,0,.65), 0 0 3px rgba(255,200,110,.25); }
.face.lightbook .sp-title, .face.lightbook .sp-author, .face.lightbook .cv-title, .face.lightbook .cv-author { color: #4a3420; text-shadow: 0 1px 0 rgba(255,250,235,.55); }
.sp-title.h { padding: 0; max-height: none; letter-spacing: .01em; word-break: normal; overflow-wrap: break-word; }
.sp-motif { position: absolute; z-index: 1; bottom: 11%; left: 50%; transform: translateX(-50%); background: center/contain no-repeat; filter: drop-shadow(0 1px 0 rgba(0,0,0,.5)); }
.st-baender .sp-motif, .st-schlicht .sp-motif { display: none; }
.sp-orn { display: none; }
.bk .cap { position: absolute; left: 1px; right: 1px; top: -1px; height: 3px; border-radius: 2px 2px 0 0; background: linear-gradient(90deg, rgba(0,0,0,.4), rgba(255,236,200,.35), rgba(0,0,0,.35)); pointer-events: none; }
.bk .cap.tinted { height: 4px; top: -2px; background: linear-gradient(90deg, rgba(0,0,0,.45), transparent 20%, rgba(255,255,255,.35) 45%, transparent 70%, rgba(0,0,0,.4)), var(--cap); }
.bk.o-e .face { border-radius: 1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), inset 2.5px 0 0 var(--board, #3a2a1f), inset -2.5px 0 0 var(--board, #3a2a1f), inset 3.5px 0 0 rgba(0,0,0,.4), inset -3.5px 0 0 rgba(0,0,0,.4), 1px 0 2px rgba(0,0,0,.5); }
.bk .cast { position: absolute; left: 0; right: -6px; bottom: -2px; height: 10px; background: radial-gradient(ellipse at 40% 0, rgba(0,0,0,.55), transparent 70%); z-index: -1; pointer-events: none; }
.bk.o-s .face { box-shadow: inset 0 0 0 1px rgba(0,0,0,.45), 1px 0 2px rgba(0,0,0,.55), -1px 0 1px rgba(0,0,0,.3); }
.cv-light { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(255,230,170,.18), transparent 65%); pointer-events: none; }
.cv-frame { inset: 6%; border: 1.5px solid rgba(226,180,83,.9); outline: 1px solid rgba(226,180,83,.5); outline-offset: -6px; box-shadow: inset 0 0 14px rgba(0,0,0,.35); }
.cv-frame.thin { inset: 8%; }
.cv-motif { display: block; background: center/contain no-repeat; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.cv-orn { display: none; }
.cv-title { font-weight: 600; }
.bk-back { inset: 6%; align-items: center; }

/* ---------- Regal: Schnitzwerk, Licht, Schatten */
.fr-schrank .crown { left: -16px; right: -16px; top: -20px; height: calc(26px * var(--s) + 16px); border-radius: 6px 6px 2px 2px;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.35) 0 3px, transparent 3px 14px) 0 100%/100% 34% no-repeat, linear-gradient(rgba(255,230,180,.25), transparent 30%), var(--grain), linear-gradient(var(--wood), var(--wood2));
  background-blend-mode: normal, normal, multiply, normal; box-shadow: 0 10px 14px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.22), inset 0 -4px 0 rgba(0,0,0,.35), inset 0 -6px 0 var(--trim); }
.fr-schrank .shelf-body::before, .fr-schrank .shelf-body::after { content: ''; position: absolute; top: 0; bottom: 0; width: calc(var(--side) * .78); z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.28) 0 2px, rgba(255,230,180,.08) 2px 4px, transparent 4px 9px), linear-gradient(90deg, rgba(0,0,0,.25), rgba(255,230,180,.12), rgba(0,0,0,.3)); border-radius: 3px; }
.fr-schrank .shelf-body::before { left: calc(var(--side) * .1); } .fr-schrank .shelf-body::after { right: calc(var(--side) * .1); }
.fr-schrank .shelf-body { border-radius: 4px; padding-bottom: calc(var(--side) * 1.6); }
/* Tageszeit: --dim = Dunkelheit (0 = Tag), --lamp = Leuchtkraft von Laternen, Kerzen, Lichterketten */
:root { --dim: 0; --lamp: 1; --tzc: 12,10,34; }
body[data-tz="morgen"] { --dim: .06; --lamp: .8; --tzc: 255,190,150; }
body[data-tz="tag"] { --dim: 0; --lamp: .7; }
body[data-tz="abend"] { --dim: .22; --lamp: 1.3; --tzc: 40,14,40; }
body[data-tz="nacht"] { --dim: .46; --lamp: 1.8; --tzc: 8,8,30; }
.items::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 80%, rgba(0,0,0,.35)), linear-gradient(rgba(var(--tzc), var(--dim)), rgba(var(--tzc), var(--dim))); pointer-events: none; transition: background 2s; }
.dc.glowing { z-index: 3; }
.shelf-body, .crown { transition: box-shadow 2s; }
body[data-tz] .shelf-body { box-shadow: 0 30px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.4), inset 0 0 0 2px var(--trim), inset 0 0 0 4000px rgba(var(--tzc), var(--dim)); }
body[data-tz] .crown { box-shadow: 0 10px 14px rgba(0,0,0,.5), inset 0 0 0 400px rgba(var(--tzc), var(--dim)); }
#world-tint { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgba(var(--tzc), calc(var(--dim) * .55)), rgba(var(--tzc), calc(var(--dim) * 1.25))); transition: background 2s; }
.items::before { content: ''; position: absolute; left: 20%; right: 20%; top: 0; height: 60%; background: radial-gradient(ellipse at 50% 0, rgba(var(--glow), .2), transparent 70%); pointer-events: none; }
.plank { box-shadow: 0 8px 10px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,240,210,.3), inset 0 -3px 0 rgba(0,0,0,.35), inset 0 -4px 0 var(--trim), inset 0 0 0 200px rgba(var(--tzc), var(--dim)); }

/* ---------- Welt: Tiefenschärfe, Licht, Vignette */
#world-bg img { filter: saturate(1.05) brightness(.95); }
.world-glow { background: radial-gradient(ellipse at 50% 35%, rgba(var(--glow), .18), transparent 55%), radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(10, 4, 10, .55) 100%), linear-gradient(to bottom, rgba(0,0,0,.25), transparent 18%, transparent 75%, rgba(0,0,0,.35)); }
.world-glow::before { content: ''; position: absolute; inset: -10% 20% 30% 20%; background: repeating-linear-gradient(100deg, rgba(var(--glow), .07) 0 30px, transparent 30px 90px); filter: blur(12px); opacity: .7; }
.world-glow::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(var(--glow), .5) 0 2px, transparent 3px), radial-gradient(circle, rgba(var(--glow), .35) 0 1.5px, transparent 2.5px); background-size: 230px 190px, 150px 260px; background-position: 30px 40px, 90px 10px; opacity: .55; animation: drift 40s linear infinite; }
@keyframes drift { to { background-position: 30px -150px, 90px -250px; } }

/* ---------- Leisten unten */
.dockbar { position: fixed; z-index: 30; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 8px 10px 8px 18px; border-radius: 22px; background: linear-gradient(rgba(70, 40, 70, .92), rgba(36, 18, 36, .95)); border: 1px solid rgba(233, 196, 106, .7); box-shadow: 0 10px 30px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12); }
.dockbar button { border: 0; background: transparent; color: #fbe9bf; padding: 8px 18px; min-height: 44px; font-size: 1.05rem; border-radius: 14px; }
.dockbar button:hover { background: rgba(255,255,255,.08); }
.dockbar .sep { width: 1px; height: 26px; background: rgba(233, 196, 106, .4); }
.dockbar .plus { width: 46px; height: 46px; padding: 0; margin-left: 8px; border-radius: 12px; border: 1px solid var(--gold-l); background: linear-gradient(#8e62a4, var(--lila-d)); font-size: 1.6rem; }
.bottomnav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + var(--safe-b)); background: linear-gradient(rgba(60, 34, 60, .96), rgba(30, 15, 30, .98)); border-top: 1px solid rgba(233, 196, 106, .55); }
.bottomnav button { border: 0; background: transparent; color: #f0dcb0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .78rem; min-height: 54px; border-radius: 14px; }
.bottomnav button span { font-size: 1.35rem; line-height: 1; }
.bottomnav button.on { background: rgba(183, 154, 208, .22); color: #fff; }

/* ---------- Status */
.savestate { position: fixed; z-index: 60; left: 14px; bottom: 18px; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(30, 16, 28, .85); color: #f0dcb0; font-size: .82rem; border: 1px solid rgba(233, 196, 106, .4); transition: opacity .4s; }
.savestate i { width: 8px; height: 8px; border-radius: 50%; background: #7fbf5a; }
.savestate.busy i { background: var(--gold); animation: pulse 1s infinite; }
.savestate.err { background: #8a1e2a; color: #fff; } .savestate.err i { background: #fff; }
.savestate.ok { opacity: .75; }
@keyframes pulse { 50% { opacity: .3; } }
.savefail { position: fixed; z-index: 80; left: 50%; top: 12px; transform: translateX(-50%); width: min(640px, calc(100% - 20px)); display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: #fff1ef; border: 2px solid #b8323a; color: #5a1018; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.toast { position: fixed; z-index: 85; left: 50%; bottom: 100px; transform: translate(-50%, 30px); opacity: 0; max-width: min(520px, calc(100% - 30px)); padding: 12px 18px; border-radius: 14px; background: #2a1824; color: #fbe9bf; border: 1px solid var(--gold); box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: all .3s; pointer-events: none; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #6e1620; color: #fff; }

/* ---------- Handy */
.m-only { display: none; }
@media (max-width: 860px) {
  .d-only { display: none !important; }
  .m-only { display: grid; }
  .brand-mini img { width: 36px; height: 36px; } .brand-mini .brand { font-size: 1.35rem; }
  .topbar { padding: 8px 10px; } .pill { min-height: 40px; padding: 4px 12px; font-size: .92rem; }
  .chips { top: 56px; padding: 2px 10px 8px; }
  #movebar, #selbar { top: 104px; }
  #panel { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 90vh; height: 88vh; }
  .panel-card { border-radius: 24px 24px 0 0; padding-bottom: var(--safe-b); }
  .panel-card::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 9px; background: #cdb38a; margin: 8px auto 0; }
  .savestate { bottom: calc(76px + var(--safe-b)); left: 10px; }
  .toast { bottom: calc(140px + var(--safe-b)); }
  .b3-stage { height: 250px; }
  .b3-views button { min-height: 32px; padding: 2px 9px; font-size: .8rem; }
  .world-pill { max-width: 46vw; } .world-pill #world-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .wp-ico { display: none; }
  body:has(#panel:not([hidden])) .savestate.ok { opacity: 0; }
  #shelves { gap: 34px; }
  .slots { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
