
:root{--navy:#0a1832;--navy2:#102e58;--blue:#1764ae;--yellow:#ffd12c;--red:#e73545;--paper:#f0f6ff;--line:#72c5ff}
*{box-sizing:border-box}
html{background:var(--navy)}
body{margin:0;color:#12213b;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:linear-gradient(180deg,#082347 0,#0c4b84 460px,#d9edff 900px,#edf5ff 100%);min-height:100vh;padding-bottom:calc(85px + env(safe-area-inset-bottom))}
button,input,select{font:inherit}
button{cursor:pointer}
.topbar{padding:calc(env(safe-area-inset-top) + 13px) 18px 12px;color:white;background:#071a35;position:relative;z-index:2;border-bottom:3px solid #2895d7}
.brand{font-weight:1000;font-size:clamp(25px,8vw,36px);line-height:1.1;letter-spacing:-1.5px;font-style:italic;text-shadow:3px 3px #03101f}
.brand em{color:#fff;font-style:italic}.brand-bolt{color:var(--yellow);text-shadow:2px 2px #ec3a41}
.sub{color:#ffe27d;font-weight:900;letter-spacing:1.4px;font-size:10px;margin:7px 0 0}.version{float:right;color:#a8d6ff}
.page{display:none;padding:16px 14px 26px;max-width:780px;margin:auto}.page.active{display:block}
#home{padding-top:0}
.night-hero{height:200px;margin:0 -14px 12px;position:relative;overflow:hidden;background:radial-gradient(circle at 80% 27%,#246aab 0,#0e3d73 37%,#071c3b 83%);border-bottom:4px solid #42a9eb}
.moon{position:absolute;width:116px;height:116px;border-radius:50%;right:8%;top:9px;background:#fff2ae;box-shadow:0 0 33px #ffed9d88}
.cityline{position:absolute;bottom:0;width:100%;height:62px;background:repeating-linear-gradient(90deg,transparent 0 21px,#08192e 21px 48px,transparent 48px 55px,#0a2039 55px 89px);clip-path:polygon(0 36%,6% 36%,6% 9%,12% 9%,12% 54%,20% 54%,20% 0,28% 0,28% 40%,38% 40%,38% 10%,45% 10%,45% 55%,52% 55%,52% 20%,60% 20%,60% 48%,68% 48%,68% 0,76% 0,76% 32%,84% 32%,84% 12%,92% 12%,92% 45%,100% 45%,100% 100%,0 100%);opacity:.9}
.hero-content{position:absolute;z-index:1;left:19px;top:22px;max-width:78%;color:#fff;text-shadow:2px 3px #071329}
.eyebrow{display:inline-block;background:#f9d13a;color:#081b32;font-weight:1000;letter-spacing:.7px;font-size:10px;padding:6px 10px;transform:rotate(-2deg);border:2px solid #0b1729}
.hero-content h1{font-size:clamp(29px,9vw,46px);line-height:.97;font-weight:1000;font-style:italic;letter-spacing:-1.5px;margin:14px 0 9px;color:white}
.hero-content h1 span{color:#ffd132}.hero-content p{font-size:12px;font-weight:800;margin:0;color:#e6f4ff}
.dashboard-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:-5px;position:relative;z-index:1}
.dash-stat{background:linear-gradient(145deg,#153e72,#092448);border:2px solid #91d5ff;border-radius:15px;box-shadow:0 4px 0 #06152d,0 8px 14px #041e4970;color:white;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:10px 3px;min-height:105px}
.dash-icon{font-size:23px;line-height:1}.dash-stat strong{font-size:clamp(23px,8vw,34px);line-height:1.1;margin:5px 0;font-weight:1000}.dash-stat>span:last-child{font-size:9px;font-weight:1000;letter-spacing:.4px;text-align:center}
.mission-progress{background:#082a50;color:white;padding:13px 14px;border:2px solid #62bfff;border-radius:15px;margin:17px 0 13px}
.mission-label{display:flex;justify-content:space-between;font-size:12px;letter-spacing:.5px}.mission-label>span:not(.sr-only):after{content:" REIHEN";font-size:10px}
.progress{height:13px;background:#05142a;border:1px solid #78c8f4;border-radius:15px;overflow:hidden;margin:10px 0}
.progress div{height:100%;background:linear-gradient(90deg,#f9ae19,#ffe33d);width:0;border-radius:12px;transition:width .3s}
.mission-progress p{font-size:11px;color:#c5e6ff;line-height:1.4;margin:0}
button,.filebutton{display:block;width:100%;padding:13px 15px;margin:8px 0;border:2px solid #12375d;border-radius:12px;background:white;color:#102b4b;font-weight:850;box-shadow:0 3px 0 #092544;text-align:center}
button:active{transform:translateY(2px);box-shadow:0 1px 0 #092544}
.primary{background:linear-gradient(180deg,#ffe35a,#ffc21e);color:#101d2e;border:3px solid #0b1e34}
.big-action{font-size:clamp(14px,4.1vw,20px);display:flex;align-items:center;justify-content:space-between;gap:8px;padding:16px 14px;box-shadow:0 5px 0 #06182e;transform:rotate(-.4deg);border-radius:17px}
.section-heading{font-size:16px;letter-spacing:1px;color:white;font-weight:1000;text-shadow:2px 2px #071a34;margin:22px 0 10px}
.action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.action-tile{margin:0;min-height:103px;border:2px solid #8fd6ff;border-radius:15px;background:linear-gradient(140deg,#1b5a9b,#0b2e58);color:#fff;box-shadow:0 4px 0 #061b36;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px}
.action-tile span{font-size:30px}.action-tile strong{font-size:13px;line-height:1.2}
.quick-panel{background:#eaf6ff;border:3px solid #a7d7fa;border-radius:18px;padding:12px;margin-top:23px;box-shadow:0 4px 0 #083c6c}
.quick-head{display:flex;justify-content:space-between;align-items:center;gap:8px}.quick-head h2{font-size:15px;margin:0;font-weight:1000}.quick-head button{width:auto;white-space:nowrap;border:0;background:transparent;box-shadow:none;color:#09549c;font-size:12px;padding:5px;margin:0}
.quick-scroll{display:flex;overflow-x:auto;gap:9px;padding:12px 1px 5px;scroll-snap-type:x mandatory}
.quick-series{min-width:101px;width:101px;min-height:115px;margin:0;border:3px solid #071b33;box-shadow:0 4px 0 #06182c;border-radius:13px;color:white;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;scroll-snap-align:start;text-shadow:1px 2px #071629}
.quick-series span{font-size:32px}.quick-series strong{font-size:12px;line-height:1.1}.quick-series.red{background:linear-gradient(135deg,#ff4a32,#a30026)}.quick-series.blue{background:linear-gradient(135deg,#19a5ef,#0d3b9d)}.quick-series.ice{background:linear-gradient(135deg,#85d9ff,#175c9b)}.quick-series.sun{background:linear-gradient(135deg,#ffd34a,#ff8d16)}.quick-series.dark{background:linear-gradient(135deg,#183455,#060d23)}.quick-series.space{background:linear-gradient(135deg,#5356bc,#0c1748)}
.home-hint{color:#d9ecff;font-size:11px}
.page:not(#home){background:#eef6ff;border-radius:0 0 22px 22px;min-height:70vh;padding-top:20px}
.page h1{font-size:24px;line-height:1.15;font-weight:1000;color:#0c2d54;margin:2px 0 16px}
.page h2{font-size:18px;color:#103c70}
.hint{font-size:12px;line-height:1.5;color:#56718c}
input,select{width:100%;padding:13px 12px;border:2px solid #94b9d7;border-radius:11px;font-size:16px;background:#fff;color:#0c2b4d;margin:7px 0 12px}
.field label{font-weight:850;color:#10365d}
.camera{display:block;padding:20px;border:3px dashed #318ac7;border-radius:16px;background:#d6edff;color:#12385e;text-align:center;font-size:18px;font-weight:900;margin:12px 0}.camera input,.filebutton input{display:none}
.filebutton{background:#d5ecff}.preview{width:100%;max-height:280px;object-fit:contain;border-radius:14px;margin:8px 0}
.book{background:white;border:2px solid #c3dbed;border-radius:13px;padding:10px;margin:9px 0;display:flex;gap:10px;align-items:center;box-shadow:0 2px 0 #b2cde1;min-width:0}
.book>div:nth-child(2){flex:1;min-width:0}.book strong{display:block;font-size:13px;overflow-wrap:anywhere}.book small{display:block;color:#57728c;font-size:12px;line-height:1.4;margin-top:4px}
.cover{width:43px;height:59px;border-radius:6px;background:linear-gradient(135deg,#ffe76c,#f5a817);border:2px solid #0b2b4b;display:grid;place-items:center;font-size:22px;flex-shrink:0}
.book button{width:auto;flex-shrink:0;margin:0;padding:8px 9px;font-size:11px;border-radius:8px;background:#ffdb58}
.panel{background:#fff;border:2px solid #bcd6ec;padding:15px;border-radius:15px;margin:12px 0}.panel h3{margin-top:0}
.empty{padding:24px;text-align:center;color:#52708b;background:white;border-radius:13px}
nav{position:fixed;bottom:0;left:0;right:0;z-index:10;display:flex;justify-content:space-around;gap:0;background:#071c39;border-top:3px solid #5bbaff;padding:6px 3px calc(env(safe-area-inset-bottom) + 6px);box-shadow:0 -3px 16px #00142c88}
nav button{width:16.66%;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;background:transparent;color:#d6eaff;box-shadow:none;border:0;border-radius:8px;padding:7px 1px;margin:0;font-size:21px}
nav button.active{color:#ffd637;background:#113f72}
nav small{font-size:clamp(9px,2.35vw,11px);font-weight:800;white-space:nowrap}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
@media(min-width:700px){.action-grid{grid-template-columns:repeat(4,1fr)}.night-hero{border-radius:0 0 18px 18px}.hero-content h1{font-size:46px}}
@media(max-width:360px){.dash-stat{min-height:95px}.dash-stat>span:last-child{font-size:8px}.book button{font-size:10px;padding:7px 6px}}

/* 4.4: direkt sichtbares Comic-Regal */
.gallery-tools{display:flex;gap:8px;margin:12px 0}.gallery-tools .view-button{width:auto;flex:1;margin:0;padding:10px;border:2px solid #326da2;background:#e2f2ff;color:#123b61;box-shadow:none}.gallery-tools .view-button.active{background:#103b70;color:#fff}
.cover-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px;margin:12px 0 20px}.gallery-book{background:#fff;border:2px solid #bed7ec;border-radius:12px;padding:5px;min-width:0;display:flex;flex-direction:column;box-shadow:0 3px 0 #a6c8df;overflow:hidden}.cover-open{width:100%;padding:0;margin:0;border:0;background:none;box-shadow:none;border-radius:8px}.cover-frame{aspect-ratio:2/3;position:relative;overflow:hidden;border-radius:7px;background:#f3d85e;border:1px solid #152c4e}.cover-frame img{width:100%;height:100%;object-fit:cover;display:block}.cover-frame img[hidden]{display:none}.cover-placeholder{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;background:linear-gradient(145deg,#ffd83e,#ed762a);color:#0d2547;gap:4px}.cover-placeholder span{font-size:30px}.cover-placeholder strong{font-size:17px;font-style:italic}.cover-placeholder b{font-size:27px}.gallery-book.is-missing .cover-frame img{filter:grayscale(1);opacity:.48}.gallery-book.is-missing .cover-placeholder{filter:grayscale(.85);opacity:.65}.ownership-flag{position:absolute;right:4px;top:4px;z-index:2;border-radius:50%;background:#7a8796;color:#fff;width:24px;height:24px;display:grid;place-items:center;font-weight:1000;border:2px solid white}.is-owned .ownership-flag{background:#18994e}.gallery-book-meta{padding:6px 2px 2px;min-height:63px;flex:1}.gallery-book-meta strong{font-size:10px;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.gallery-book-meta small{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:10px;color:#5e7184;margin-top:3px}.gallery-own{margin:4px 0 0;padding:7px 1px;width:100%;border:1px solid #1c4e79;border-radius:7px;box-shadow:none;font-size:10px;background:#ffd54b}.is-owned .gallery-own{background:#d6f5e3;color:#17633c}
.book-detail-overlay:not([hidden]){position:fixed;inset:0;z-index:100;background:#00152bbb;display:flex;align-items:center;justify-content:center;padding:18px}.detail-sheet{background:#f3f8ff;max-width:440px;width:100%;max-height:90vh;overflow:auto;border:3px solid #72c5ff;border-radius:18px;padding:18px;position:relative}.detail-close{position:absolute;right:10px;top:8px;width:42px;margin:0;padding:8px}.detail-sheet h2{padding-right:45px}.detail-image{width:170px;height:230px;margin:10px auto;display:grid;place-items:center;background:#ffda5b;font-size:55px;border-radius:10px;overflow:hidden}.detail-image img{width:100%;height:100%;object-fit:contain}.dialog-open{overflow:hidden}
@media(min-width:600px){.cover-gallery{grid-template-columns:repeat(5,minmax(0,1fr))}}
