:root{color-scheme:light;--ink:#3b291d;--deep:#20140e;--paper:#f3e6cd;--white:#fff6e5;--gold:#b9893b;--muted:#75614d;--line:#d6bea0;--focus:#ad6b00;font-family:'DM Sans',system-ui,sans-serif;background:var(--deep);color:var(--ink);line-height:1.65;font-size:16px}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 15% 0,#5a3820 0,transparent 55%),var(--deep);min-height:100vh}a{color:inherit}button,input,select{font:inherit}button,a,input,select,summary{touch-action:manipulation}button,a.button{min-height:52px}button,.button{display:inline-flex;align-items:center;justify-content:center;padding:.8rem 1.35rem;border:1px solid var(--gold);background:var(--gold);color:#2d1c0f;border-radius:5px;font-weight:700;text-decoration:none;line-height:1.4;text-align:center;cursor:pointer;transition:background .15s}button:hover,.button:hover{background:#e8b940;border-color:#e8b940}button:disabled{opacity:.55;cursor:default}.secondary{background:transparent;color:var(--ink);border-color:#907454;font-weight:600}.secondary:hover{background:#e9e3d5;border-color:var(--ink)}:focus-visible{outline:3px solid var(--focus);outline-offset:4px}h1,h2,h3,p{overflow-wrap:anywhere}h1,h2{font-family:'Libre Baskerville',Georgia,serif;line-height:1.25;font-weight:400;margin:0 0 1.2rem}h1{font-size:clamp(1.85rem,3.6vw,3rem);letter-spacing:-.04em;max-width:22ch}h2{font-size:1.45rem}p{margin:0 0 1.15rem}header{max-width:1040px;margin:auto;min-height:88px;padding:1.4rem 28px;display:flex;align-items:center;justify-content:space-between;gap:20px;color:var(--paper)}.brand{font-weight:800;letter-spacing:.04em;font-size:1.65rem;text-decoration:none}.brand span{color:var(--gold)}.badge{font-size:.75rem;letter-spacing:.14em;border:1px solid #9a7850;padding:.38rem .75rem;white-space:nowrap}main{position:relative;background:var(--paper);border-top:4px solid var(--gold);border-radius:8px 8px 0 0;max-width:980px;margin:0 auto;padding:clamp(26px,5vw,58px);min-height:calc(100vh - 220px);box-shadow:0 12px 50px #10080480}main>h1+ .meta{order:-1}.meta,.eyebrow{font-size:.9rem;color:var(--muted)}.eyebrow{letter-spacing:.14em;font-weight:700}.lead{font-size:1.15rem;max-width:52ch;color:#664b34;line-height:1.7}.actions{display:flex;flex-wrap:wrap;gap:12px;margin:1.6rem 0}.actions>.button,.actions>button{flex:0 1 auto}.page-callout{padding:.85rem 1rem;border-left:3px solid var(--gold);background:#e7e4d7;font-weight:600}.notice{background:#e8e4d7;border:1px solid #d2c9b3;padding:1rem 1.2rem;border-radius:4px;color:#58402c}.player{margin:1.8rem 0;padding:1.4rem;background:var(--white);border:1px solid var(--line);border-radius:6px}.player>.meta{margin-bottom:1rem}audio{display:block;width:100%;margin:.6rem 0 1rem}details{border-top:1px solid var(--line);padding:.9rem 0}summary{cursor:pointer;font-size:1rem;font-weight:600;min-height:38px;list-style-position:outside;margin-left:1.2rem;padding-left:.2rem}details[open]>summary{margin-bottom:1.2rem}.audio-tools .actions{margin:0 0 1rem}.audio-tools button{min-height:44px;font-size:.9rem}.transcript p{display:block;margin:0 0 1.4rem;line-height:1.85;max-width:65ch}.speaker{display:block;font-size:.875rem;font-weight:700;color:#75614d;margin-bottom:.2rem}.utility{margin-top:2.5rem;color:var(--muted)}.utility .panel{margin-bottom:0}.panel{padding:1.4rem;margin:1.4rem 0;border:1px solid var(--line);border-radius:6px;background:var(--white)}label{display:flex;flex-direction:column;font-weight:600;gap:.45rem;margin-bottom:1rem;max-width:560px}input:not([type=checkbox]):not([type=range]),select{width:100%;min-height:52px;padding:.75rem;border:1px solid #a58c6c;background:var(--white);border-radius:4px;color:var(--ink);font-weight:400}input[type=range]{width:100%;min-height:44px}.toggle{flex-direction:row;align-items:center;gap:.8rem}.toggle input{width:24px;height:24px}.status{margin:1rem 0 0;color:#7b390f;font-weight:600}.status:empty{display:none}.book-grid{margin:2.5rem 0}.book-card{display:grid;grid-template-columns:200px 1fr;gap:40px;align-items:center;background:var(--white);padding:32px;border:1px solid var(--line);border-radius:6px;box-shadow:0 5px 15px #29180d20}.book-cover{display:block;position:relative;overflow:hidden;aspect-ratio:694/1060;border-radius:2px;box-shadow:7px 9px 17px #29180d50;background:#302a20}.book-cover img{position:absolute;height:100%;width:auto;max-width:none;right:0;top:0}.book-copy h2{font-size:clamp(1.5rem,3vw,2.2rem);max-width:18ch}.book-copy .button{display:flex;margin:1rem 0 0;max-width:280px}.welcome-art{height:245px;border-radius:5px;margin:2rem 0;background-image:url('../media/art/section-01-original.jpeg');background-size:cover;background-position:center 70%;border:1px solid #a38b60;box-shadow:inset 0 0 35px #2820073b}.step-track{display:flex;align-items:center;gap:12px;margin:1.7rem 0 2rem}.step-track span{width:38px;height:38px;display:grid;place-items:center;border:1px solid #a58c6c;border-radius:50%;color:#75614d}.step-track .active{background:var(--ink);color:var(--paper);border-color:var(--ink)}.step-track .done{border-color:#907454;background:#e9d7b8}.prep-list{margin:1.5rem 0;padding-left:1.4rem;max-width:60ch}.prep-list li{padding:.55rem 0 .55rem .3rem}.mode-choice{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:2rem 0}.mode{display:block;text-align:left;padding:1.4rem;white-space:normal;font-size:1.15rem}.mode[aria-pressed=true]{background:var(--ink);color:var(--paper);border-color:var(--ink)}.mode[aria-pressed=true]:hover{background:#65432a}.mode-description{display:block;font-size:1rem;line-height:1.6;font-weight:400;margin-top:.6rem}.branch-choice{display:flex;flex-direction:column;gap:1rem;max-width:550px;margin:1.5rem 0}.branch-choice button{justify-content:flex-start;text-align:left}.reward-card{background:var(--white);border:1px solid var(--line);border-left:4px solid var(--gold);padding:1.5rem;margin:1.5rem 0}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:2rem 0}.card{padding:1.5rem;border:1px solid var(--line);background:var(--white);border-radius:5px}.card h2{font-size:1.25rem}.sections{display:flex;flex-wrap:wrap;gap:12px}.sections .button{font-size:.9rem}.probe-stage{display:none}.probe-note{padding:1rem;background:#e7e4d7}nav{max-width:980px;margin:auto;background:#352317;display:flex;justify-content:center;gap:8px;padding:12px 20px;border-radius:0 0 8px 8px;color:var(--paper)}nav:empty{display:none}nav a{font-size:.9rem;display:block;text-decoration:none;padding:.55rem 1rem;min-height:44px;border-radius:4px}nav a[aria-current=page]{background:#67472c;color:#ffda75}footer{max-width:980px;margin:0 auto;padding:24px 20px 32px;color:#d6c2a3;text-align:center;font-size:.875rem}footer a{display:inline-block;padding:8px}footer p{margin:.5rem 0}.skip{position:fixed;left:12px;top:-80px;background:var(--paper);color:var(--ink);padding:12px;z-index:99}.skip:focus{top:12px}h1:focus{outline:none}
@media(max-width:640px){header{padding:18px 20px;min-height:75px}.brand{font-size:1.4rem}.badge{font-size:.75rem;letter-spacing:.08em;padding:.3rem .5rem}main{border-radius:0;padding:28px 22px;min-height:calc(100vh - 190px);border-top-width:3px}.lead{font-size:1.08rem}h1{font-size:1.95rem}.book-card{padding:22px 18px;gap:20px;grid-template-columns:115px minmax(0,1fr)}.book-copy h2{font-size:1.3rem;letter-spacing:-.025em}.book-copy p:not(.eyebrow){font-size:.875rem}.book-copy .eyebrow{font-size:.8rem}.book-copy .button{padding:.7rem .7rem;font-size:.95rem;min-height:48px}.book-grid{margin:1.8rem 0}.actions{flex-direction:column}.actions>.button,.actions>button{width:100%}.welcome-art{height:180px;background-position:center 70%;margin:1.5rem 0}.player{padding:1.15rem;margin:1.5rem 0}.mode-choice{grid-template-columns:1fr;gap:12px;margin:1.5rem 0}.mode{padding:1.2rem}.mode-description{margin-top:.3rem}.grid{grid-template-columns:1fr}.panel{padding:1.2rem}nav{border-radius:0;padding:9px 8px;gap:0}nav a{padding:.65rem .8rem}.prep-list li{padding:.4rem 0 .4rem .2rem}.audio-tools .actions{flex-direction:row}.audio-tools button{flex:1}footer{padding-bottom:24px}}
@media(max-width:350px){.book-card{grid-template-columns:90px 1fr;gap:15px;padding:18px 12px}.badge{letter-spacing:0}.book-copy h2{font-size:1.2rem}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

/* Only this book enters the dimly lit Amt; the catalog keeps its own theme. */
body.amt-theme{color-scheme:dark;--ink:#f1dfbf;--paper:#241b14;--white:#30251b;--gold:#c69b57;--muted:#ccb693;--line:#6c5438;--focus:#ffe0a1;background:radial-gradient(ellipse at 65% 10%,#bb822330,transparent 55%),linear-gradient(#130c08a8,#130c08e8),url("../media/art/section-01-original.jpeg") center/cover fixed;background-color:#130c08;color:var(--ink)}
body.amt-theme header{color:#f1dfbf}
body.amt-theme .badge{border-color:#876644;color:#d9be91}
body.amt-theme main{background:radial-gradient(ellipse at 80% 0,#5a3c2360,transparent 55%),linear-gradient(145deg,#281e16f5,#17120ff5);border:1px solid #80603c;border-top:2px solid var(--gold);border-radius:2px;box-shadow:0 24px 90px #000b,inset 0 1px #e3bc7020;min-height:calc(100vh - 220px)}
body.amt-theme h1,body.amt-theme h2{color:#f6e7cb}
body.amt-theme h1{letter-spacing:-.025em;text-shadow:0 2px 18px #c88a1920}
body.amt-theme .eyebrow{color:#d5b47e;letter-spacing:.16em}
body.amt-theme .lead{color:#e0c9a8}
body.amt-theme .player{background:linear-gradient(130deg,#3b2c1ee8,#211911f5);border-color:#866742;border-radius:2px;box-shadow:0 8px 25px #0005,inset 0 1px #e3bc7015}
body.amt-theme .panel,body.amt-theme .reward-card,body.amt-theme .card{background:#2d2219;border-radius:2px;box-shadow:0 5px 18px #0004}
body.amt-theme .page-callout,body.amt-theme .notice,body.amt-theme .probe-note{background:#38291c;color:#f0d8b2;border-color:#957044}
body.amt-theme .secondary{color:#f1dfbf;border-color:#a4865d}
body.amt-theme .secondary:hover{background:#4c3725;border-color:#d2af75}
body.amt-theme button:hover,body.amt-theme .button:hover{background:#dbb776;border-color:#dbb776}
body.amt-theme .secondary:hover{background:#4c3725}
body.amt-theme .speaker{color:#d5b47e}
body.amt-theme .status{color:#ffcf92}
body.amt-theme .step-track span{color:#e0c9a8;border-color:#957044}
body.amt-theme .step-track .active,body.amt-theme .step-track .done{background:#c69b57;color:#25180d;border-color:#c69b57}
body.amt-theme .mode[aria-pressed=true]{background:#4b3420;color:#fff0d5;border-color:#d5b47e}
body.amt-theme .welcome-art{height:280px;border-radius:2px;border-color:#866742;background-image:linear-gradient(#170d0010,#170d0050),url('../media/art/section-01-original.jpeg');box-shadow:inset 0 0 45px #0005}
body.amt-theme nav{background:#1a130e;border:1px solid #584028;border-top:0;border-radius:0;color:#ddc6a2}
body.amt-theme nav a[aria-current=page]{background:#46311d;color:#ffdf9d}
body.amt-theme .skip{background:#f1dfbf;color:#241b14}
body.amt-theme footer{color:#ddc6a2}
@media(max-width:640px){body.amt-theme{background-attachment:scroll}body.amt-theme main{border-left:0;border-right:0}}
@media(max-width:640px){body.amt-theme .welcome-art{height:200px}body.amt-theme main{border-radius:0}body.amt-theme .eyebrow{letter-spacing:.1em}}

/* Complete original book corners and continuous original edge strips. */
body.amt-theme main{padding:140px clamp(40px,7vw,80px) 160px;isolation:isolate}
.book-ornaments{position:absolute;inset:12px;pointer-events:none;z-index:-1;mix-blend-mode:screen}
.book-ornament{position:absolute;display:block;filter:grayscale(1) invert(1) contrast(2.8) sepia(1);mix-blend-mode:screen;opacity:.72;pointer-events:none;background-repeat:no-repeat;background-size:100% 100%}
.book-ornament.top-left{top:0;left:0;width:155px;height:110px;background-image:url('../media/art/frame/top-left.png')}
.book-ornament.top-right{top:0;right:0;width:155px;height:110px;background-image:url('../media/art/frame/top-right.png')}
.book-ornament.bottom-left{bottom:0;left:0;width:92px;height:126px;background-image:url('../media/art/frame/bottom-left.png')}
.book-ornament.bottom-right{bottom:0;right:0;width:92px;height:126px;background-image:url('../media/art/frame/bottom-right.png')}
.book-ornament.top{top:0;left:155px;right:155px;height:18px;background-image:url('../media/art/frame/top.png');background-size:100px 18px;background-repeat:repeat-x}
.book-ornament.bottom{bottom:0;left:92px;right:92px;height:26px;background-image:url('../media/art/frame/bottom.png');background-size:120px 26px;background-repeat:repeat-x}
.book-ornament.left{left:0;top:110px;bottom:126px;width:28px;background-image:url('../media/art/frame/left.png');background-size:28px 140px;background-repeat:repeat-y}
.book-ornament.right{right:0;top:110px;bottom:126px;width:28px;background-image:url('../media/art/frame/right.png');background-size:28px 140px;background-repeat:repeat-y}
body.amt-theme{background-size:auto,auto,auto max(260vh,150vw);background-position:center,center,center 68%;background-repeat:no-repeat}
@media(max-width:640px){
 body.amt-theme main{padding:108px 36px 122px}
 .book-ornaments{inset:10px}
 .book-ornament.top-left,.book-ornament.top-right{width:112px;height:80px}
 .book-ornament.bottom-left,.book-ornament.bottom-right{width:67px;height:92px}
 .book-ornament.top{left:112px;right:112px;height:13px;background-size:73px 13px}
 .book-ornament.bottom{left:67px;right:67px;height:19px;background-size:87px 19px}
 .book-ornament.left,.book-ornament.right{top:80px;bottom:92px;width:20px;background-size:20px 102px}
}

/* Knack it! shelf: berry outside; each book keeps its own atmosphere. */
body:not(.amt-theme){--ink:#fff1f6;--paper:#4d1234;--white:#621b43;--gold:#f4b943;--muted:#ebc8d9;--line:#a1527b;--focus:#ffe0a0;background:radial-gradient(ellipse at 12% 0,#a52868 0,transparent 55%),#230c1b;color:var(--ink)}
body:not(.amt-theme) main{background:linear-gradient(145deg,#631944,#3a0f29);border-color:#efb448;box-shadow:0 24px 70px #10030b80}
body:not(.amt-theme) h1{font-family:'DM Sans',system-ui,sans-serif;font-weight:750;letter-spacing:-.04em;max-width:25ch}
body:not(.amt-theme) .lead,body:not(.amt-theme) .speaker{color:#f2d7e4}
body:not(.amt-theme) .book-card{background:linear-gradient(120deg,#77224f,#55183b);border-color:#a9577c;border-radius:12px;box-shadow:0 16px 40px #16061250}
body:not(.amt-theme) .secondary{color:#fff1f6;border-color:#c484a5}
body:not(.amt-theme) .secondary:hover{background:#842e5b;border-color:#f1c8dd}
body:not(.amt-theme) footer{color:#edcadc}
body:not(.amt-theme) nav{background:#360f28;color:#f7dce9}
body:not(.amt-theme) nav a[aria-current=page]{background:#77224f;color:#ffe4ac}
.catalog-logo{width:210px;max-width:100%;aspect-ratio:768/1024;background:url('../media/art/knack-it-logo-varianten.png') left center/200% 100% no-repeat;margin:-35px auto -35px;pointer-events:none}
.library>h1{font-size:clamp(1.75rem,4vw,2.6rem)}
.library>.eyebrow{margin-top:1rem}
.book-grid{display:grid;gap:24px}
@media(max-width:640px){.catalog-logo{width:150px;margin:-20px auto -22px}.badge{white-space:normal;font-size:.875rem;letter-spacing:.04em}.book-card{grid-template-columns:110px minmax(0,1fr)}.book-copy h2{font-size:1.35rem}.book-copy p:not(.eyebrow){font-size:1rem}.book-copy .eyebrow{font-size:.875rem}.book-cover{min-width:0}}
@media(max-width:350px){.book-card{grid-template-columns:1fr}.book-cover{width:145px;justify-self:center}.book-copy .button{max-width:none}.book-copy h2{max-width:none}.book-copy{text-align:center}.book-card .button{width:100%}}

header{flex-wrap:wrap}.brand{display:inline-flex;align-items:center;gap:12px}.catalog-logo{width:62px;aspect-ratio:768/1024;flex:none;margin:-12px 0;background-size:200% 100%}.library>.eyebrow{margin-top:0}
@media(max-width:640px){.catalog-logo{width:48px;margin:-10px 0}.brand{gap:9px;font-size:1.3rem}header{gap:8px}}

/* Header contrast and original logo without a black display rectangle. */
header .brand{color:#fff1e2}
header .badge{color:#fff1e2;border-color:#bc9560;max-width:100%;white-space:normal;line-height:1.4}
body:not(.amt-theme) header .badge{color:#fff1f6;border-color:#d796b7}
.catalog-logo{mix-blend-mode:screen}
.case-label{display:block;font-size:.75rem;letter-spacing:.14em;color:#e5bd7c}
.case-title{display:block;font-size:1rem;font-weight:600;letter-spacing:0;margin-top:.2rem}
/* Blend each ornament with the book panel instead of an isolated black group. */
.book-ornaments{z-index:0;mix-blend-mode:normal}
body.amt-theme main>*:not(.book-ornaments){position:relative;z-index:1}
/* One row for listening and progressing; native audio controls remain available. */
.listening-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin:0 0 1rem}
.listening-controls>button{width:100%;padding:.8rem .7rem}
@media(max-width:640px){
 header{align-items:center}
 header .badge{flex:1;min-width:0;text-align:right}
 .case-title{font-size:.9rem}
 body.has-listening-controls{padding-bottom:calc(92px + env(safe-area-inset-bottom,0px))}
 body.has-listening-controls .listening-controls{position:fixed;z-index:30;left:0;right:0;bottom:0;margin:0;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));background:#241b14;border-top:1px solid #a4865d;box-shadow:0 -6px 24px #0005;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .listening-controls>button{font-size:.95rem;min-height:52px}
}

.frame-filter-defs{position:absolute;pointer-events:none;overflow:hidden}
.book-ornament{filter:url(#frame-ink);mix-blend-mode:normal}

/* Optional per-book stopwatch, kept separate from chapter navigation. */
.play-timer{display:flex;align-items:center;gap:10px;padding:7px 10px;border:1px solid #987343;border-radius:6px;background:#21160ed9;color:#f6e7cb;line-height:1.2}
.timer-label{font-size:.8rem;color:#d9be91}.timer-time{font-variant-numeric:tabular-nums;font-size:1rem;letter-spacing:.04em;white-space:nowrap}
.play-timer button{min-height:36px;padding:.35rem .65rem;font-size:.8rem;color:#f6e7cb;border-color:#a4865d}.play-timer button:hover{background:#4c3725}.timer-reset{font-size:1.15rem!important;min-width:36px}.play-timer.running .timer-time{color:#ffe0a1}
@media(max-width:760px){header .play-timer{order:3;flex:0 0 100%;justify-content:center;padding:6px 10px;gap:12px}.play-timer button{min-height:40px}.play-timer .timer-toggle{min-width:65px}}

.atmosphere-control{display:flex;align-items:center;gap:12px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:1rem;margin-top:.2rem}.atmosphere-control button{min-height:44px;font-size:.9rem;padding:.6rem 1rem}.atmosphere-control .meta{margin:0;flex:1 1 180px;font-size:.85rem}

.play-timer{flex-wrap:wrap}.play-timer .music-toggle{font-size:.8rem;white-space:nowrap}@media(max-width:760px){header .play-timer{gap:8px}.play-timer .music-toggle{padding:.35rem .5rem}}

@media(max-width:760px){.play-timer .timer-label{display:none}.play-timer .timer-time{font-size:.9rem}.play-timer .timer-toggle{min-width:60px}.play-timer .music-toggle{padding:.35rem .4rem}}

/* Privater Autorenbereich: nur der Link ist öffentlich. */
.developer-link{display:block;font-size:.72rem;opacity:.65;margin-top:1rem;text-decoration:none}.developer-link:hover,.developer-link:focus-visible{opacity:1;text-decoration:underline}

/* Direct book-section selection; no scene titles or puzzle answers. */
.section-buttons{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:10px;margin:1rem 0 1.5rem}
.section-buttons button{width:100%;padding:.7rem .5rem;min-height:48px}
.section-buttons button[aria-current=location]{border:2px solid var(--gold);background:#4b3420;color:#fff0d5}
.section-buttons button.visited::after{content:' ✓';margin-left:.35em}
