*{box-sizing:border-box}html,body{margin:0;height:100%;background:#15100d;color:#f5eadb;font-family:Georgia,"Times New Roman",serif}
body{display:flex;flex-direction:column;background:radial-gradient(circle at 50% 20%,#3c2c25 0,#17110e 55%,#090706 100%);overflow:hidden}
header{min-height:54px;display:flex;align-items:center;justify-content:space-between;padding:7px 12px;background:rgba(25,14,11,.94);border-bottom:1px solid #604231;z-index:20}
.brand{display:flex;gap:10px;align-items:baseline}.brand b{font-size:19px;color:#e7b76a}.brand span{font-size:13px;opacity:.72}
nav{display:flex;gap:6px}button{border:1px solid #6e4d38;background:#291b15;color:#f8ead7;border-radius:7px;padding:7px 10px;font:inherit;cursor:pointer}
button:hover{background:#422b20}#prev,#next{font-size:22px;line-height:16px}
main{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center}
#viewer{width:100%;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:28px 54px 18px;overflow:hidden}
#book{filter:drop-shadow(0 20px 28px rgba(0,0,0,.48))}
#book .page{background:#2b1c16}
#book img{display:block}
#counter{height:27px;font-size:13px;opacity:.7}
dialog{width:min(1050px,94vw);height:min(760px,88vh);background:#201611;color:#f5eadb;border:1px solid #75523d;border-radius:12px;padding:0}
dialog::backdrop{background:#000b}.toc-head{position:sticky;top:0;display:flex;justify-content:space-between;align-items:center;padding:10px 15px;background:#201611;border-bottom:1px solid #5d4232;z-index:2}
#tocGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:12px;padding:14px}.toc-item{border:1px solid #5d4232;background:#2a1c16;padding:7px;border-radius:8px;cursor:pointer}
.toc-item img{width:100%;aspect-ratio:3/4;object-fit:cover;display:block}.toc-item p{font-size:12px;margin:6px 2px 1px}
@media(max-width:760px){header{padding:7px 9px}.brand span{display:none}.brand b{font-size:17px}button{padding:7px;font-size:12px}#viewer{padding:7px}}


/* v7 – nativer StPageFlip-Covermodus ohne Canvas.
   StPageFlip CanvasRender löscht seinen Canvas intern weiß; deshalb HTML-Seiten.
   Die leere Hälfte beim Cover ist nun wirklich transparent und zeigt den
   vorhandenen radialen Seitenhintergrund. Die Buchgeometrie bleibt unverändert. */
#book, #book .stf__parent, #book .stf__wrapper, #book .stf__block{
  background:transparent !important;
}
.mag-page{
  margin:0;
  padding:0;
  overflow:hidden;
  background:transparent;
}
.mag-page img{
  display:block;
  width:100%;
  height:100%;
  object-fit:fill;
  user-select:none;
  -webkit-user-drag:none;
}

/* v8.1 – sehr dezente Magazin-Haptik.
   Keine gestaffelten Seitenkopien, keine Änderung an PageFlip-Geometrie. */

/* Weicher Schatten des gesamten Magazins auf der Unterlage. */
#book .stf__parent{
  filter:
    drop-shadow(0 3px 2px rgba(0,0,0,.16))
    drop-shadow(0 15px 18px rgba(0,0,0,.26))
    drop-shadow(0 28px 34px rgba(0,0,0,.16));
}

/* Nur eine hauchdünne neutrale Papierkante. */
.mag-page{
  box-shadow:
    inset 0 0 0 .55px rgba(238,229,213,.28);
}

/* Sehr leichte Abdunklung zur Bindung hin.
   Kein sichtbarer Seitenfächer an den Außenkanten. */
#book .stf__item.--left::after,
#book .stf__item.--right::after{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  width:18px;
  pointer-events:none;
  z-index:5;
}
#book .stf__item.--left::after{
  right:0;
  background:linear-gradient(to left,
    rgba(32,18,12,.17) 0%,
    rgba(45,26,17,.08) 30%,
    rgba(45,26,17,.025) 62%,
    transparent 100%);
}
#book .stf__item.--right::after{
  left:0;
  background:linear-gradient(to right,
    rgba(32,18,12,.17) 0%,
    rgba(45,26,17,.08) 30%,
    rgba(45,26,17,.025) 62%,
    transparent 100%);
}

/* Eine sehr schmale Schattenlinie direkt in der Falz. */
#book .stf__item.--left{
  box-shadow: inset -1px 0 rgba(45,28,19,.22);
}
#book .stf__item.--right{
  box-shadow: inset 1px 0 rgba(45,28,19,.22);
}

/* v9 – elegante, zurückhaltende Bedienoberfläche.
   Viewer, PageFlip-Geometrie und Haptik aus v8.1 bleiben unangetastet. */
header#toolbar{
  min-height:46px;
  height:46px;
  padding:0 16px 0 18px;
  background:linear-gradient(180deg,rgba(28,16,12,.82),rgba(19,12,9,.68));
  border-bottom:1px solid rgba(193,139,79,.20);
  box-shadow:0 5px 20px rgba(0,0,0,.13);
  backdrop-filter:blur(9px);
  -webkit-backdrop-filter:blur(9px);
}
#toolbar .brand{
  gap:9px;
  letter-spacing:.02em;
}
#toolbar .brand b{
  font-size:16px;
  font-weight:600;
  color:#dfb16e;
  text-shadow:0 1px 4px rgba(0,0,0,.28);
}
#toolbar .brand span{
  font-size:11px;
  color:#eadbc7;
  opacity:.58;
  letter-spacing:.08em;
}
#toolbar nav{
  display:flex;
  align-items:center;
  gap:5px;
}
#toolbar button{
  height:30px;
  min-width:30px;
  padding:0 8px;
  display:grid;
  place-items:center;
  border:1px solid rgba(199,148,91,.23);
  border-radius:8px;
  background:rgba(78,48,34,.18);
  color:rgba(248,234,215,.84);
  box-shadow:none;
  transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease;
}
#toolbar button:hover{
  background:rgba(116,72,48,.34);
  border-color:rgba(218,169,107,.44);
  color:#fff4e5;
  transform:translateY(-1px);
}
#toolbar button:active{transform:translateY(0)}
#toolbar .iconbtn{
  font-family:Arial,sans-serif;
  font-size:20px;
  line-height:1;
}
#toolbar #fullscreen{font-size:17px}
#toolbar .textbtn{
  font-size:11px;
  letter-spacing:.035em;
  padding:0 11px;
}

/* Seitenzähler wie eine dezente Bildunterschrift statt Statusanzeige. */
#counter{
  height:24px;
  padding-top:1px;
  font-size:11px;
  letter-spacing:.06em;
  color:#d9c5ab;
  opacity:.58;
}

/* Übersicht passend zum Magazin statt technischer Dialog. */
dialog#toc{
  background:rgba(27,18,14,.97);
  border:1px solid rgba(193,139,79,.30);
  box-shadow:0 24px 70px rgba(0,0,0,.55);
  backdrop-filter:blur(12px);
}
#toc .toc-head{
  background:rgba(27,18,14,.96);
  border-bottom:1px solid rgba(193,139,79,.22);
  padding:12px 15px;
}
#toc .toc-head h2{
  margin:0;
  font-size:17px;
  font-weight:500;
  color:#e4bb7b;
  letter-spacing:.03em;
}
#closeToc{
  width:30px;height:30px;padding:0;
  font-size:19px;
  border-radius:50%;
}
#tocGrid{gap:14px;padding:16px}
.toc-item{
  padding:6px;
  background:rgba(54,35,27,.55);
  border:1px solid rgba(193,139,79,.19);
  border-radius:7px;
  transition:transform .16s ease,border-color .16s ease,background .16s ease;
}
.toc-item:hover{
  transform:translateY(-2px);
  border-color:rgba(218,169,107,.42);
  background:rgba(72,45,33,.70);
}
.toc-item img{
  border-radius:2px;
  box-shadow:0 6px 15px rgba(0,0,0,.25);
}
.toc-item p{
  text-align:center;
  color:#ddcbb5;
  opacity:.72;
  letter-spacing:.04em;
}

/* Im Vollbild verschwindet die Leiste nach oben; Maus am oberen Rand holt sie zurück. */
:fullscreen #toolbar{
  position:fixed;
  top:0;left:0;right:0;
  z-index:100;
  opacity:.16;
  transform:translateY(-31px);
  transition:opacity .22s ease,transform .22s ease;
}
:fullscreen #toolbar:hover{
  opacity:1;
  transform:translateY(0);
}
:fullscreen #counter{opacity:.35}

@media(max-width:760px){
  header#toolbar{height:43px;min-height:43px;padding:0 8px 0 11px}
  #toolbar .brand span{display:none}
  #toolbar .brand b{font-size:14px}
  #toolbar button{height:29px;min-width:29px;padding:0 7px}
  #toolbar .textbtn{font-size:10px;padding:0 8px}
}

/* v10 – zusätzliche Navigation, ohne Eingriff in Buchgeometrie/PageFlip. */
#viewer{position:relative}

/* Glasartige Pfeile links/rechts neben dem Magazin. */
.side-arrow{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  z-index:30;
  width:48px;
  height:72px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid rgba(255,235,207,.22);
  border-radius:16px;
  background:linear-gradient(145deg,rgba(255,255,255,.105),rgba(255,255,255,.025));
  color:rgba(255,244,229,.82);
  font:300 38px/1 Arial,sans-serif;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.13),
    0 8px 26px rgba(0,0,0,.20);
  backdrop-filter:blur(11px) saturate(115%);
  -webkit-backdrop-filter:blur(11px) saturate(115%);
  cursor:pointer;
  opacity:.68;
  transition:opacity .18s ease,background .18s ease,border-color .18s ease,transform .18s ease;
}
.side-arrow:hover{
  opacity:1;
  background:linear-gradient(145deg,rgba(255,255,255,.16),rgba(138,88,54,.07));
  border-color:rgba(231,185,124,.42);
  transform:translateY(-50%) scale(1.035);
}
.side-arrow:active{transform:translateY(-50%) scale(.98)}
.side-prev{left:clamp(10px,2.1vw,34px)}
.side-next{right:clamp(10px,2.1vw,34px)}

/* Untere schwebende Bedienleiste. */
.bottom-controls{
  height:42px;
  min-height:42px;
  margin:0 0 8px;
  padding:5px 7px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  border:1px solid rgba(199,148,91,.20);
  border-radius:12px;
  background:linear-gradient(180deg,rgba(48,30,23,.56),rgba(24,16,12,.46));
  box-shadow:0 8px 24px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter:blur(9px);
  -webkit-backdrop-filter:blur(9px);
}
.bottom-controls button{
  height:30px;
  min-width:31px;
  padding:0 8px;
  display:grid;
  place-items:center;
  border:1px solid rgba(199,148,91,.20);
  border-radius:8px;
  background:rgba(78,48,34,.17);
  color:rgba(248,234,215,.82);
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease;
}
.bottom-controls button:hover{
  background:rgba(116,72,48,.32);
  border-color:rgba(218,169,107,.40);
  color:#fff4e5;
  transform:translateY(-1px);
}
.bottom-icon{font:20px/1 Arial,sans-serif}
#bottomFullscreen{font-size:17px}
.bottom-text{font:11px Georgia,"Times New Roman",serif;letter-spacing:.035em}
.bottom-controls #counter{
  min-width:112px;
  height:auto;
  padding:0 9px;
  text-align:center;
  line-height:30px;
  color:#d9c5ab;
  opacity:.66;
}

/* Deaktivierte Pfeile an Anfang/Ende zurücknehmen. */
.side-arrow:disabled,.bottom-controls button:disabled{
  opacity:.18;
  cursor:default;
  transform:translateY(-50%);
}
.bottom-controls button:disabled{transform:none}

/* Im Vollbild bleiben Seitenpfeile und untere Leiste sichtbar, aber sehr dezent. */
:fullscreen .side-arrow{opacity:.42}
:fullscreen .side-arrow:hover{opacity:1}
:fullscreen .bottom-controls{opacity:.48;transition:opacity .2s ease}
:fullscreen .bottom-controls:hover{opacity:1}

@media(max-width:900px){
  .side-arrow{width:40px;height:60px;font-size:32px;border-radius:13px}
  .side-prev{left:7px}.side-next{right:7px}
}
@media(max-width:760px){
  .side-arrow{display:none}
  .bottom-controls{height:40px;min-height:40px;margin-bottom:4px}
  .bottom-controls #counter{min-width:92px;padding:0 4px;font-size:10px}
}
