#chapterRoot{position:fixed;inset:0;z-index:40;background:#172724;color:#f3e6c9;overflow:hidden;font-family:var(--sans)}
#chapterRoot[hidden]{display:none!important}
#chapterScene{position:absolute;inset:0;background:#152a2d}#chapterScene canvas{display:block;touch-action:none;width:100%;height:100%;outline-offset:-4px}
.chapter-vignette{position:absolute;inset:0;pointer-events:none;background:linear-gradient(#1424278c,transparent 19%,transparent 68%,#0c1c2290);z-index:1}
.chapter-topbar{position:absolute;z-index:5;inset:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:20px 4%;gap:18px;pointer-events:none}
.chapter-topbar>*{pointer-events:auto}.chapter-brand{display:flex;gap:13px;align-items:center;color:#ffebc2;font-family:var(--serif);font-size:24px;letter-spacing:4px;text-shadow:0 2px 10px #132525}
.chapter-brand>span:first-child{background:#8a4f3b;border:1px solid #dbbd84;padding:5px 6px;outline:1px solid #d5b98450;outline-offset:3px;font-size:29px}
.chapter-brand small{display:block;font:9px var(--sans);letter-spacing:3px;margin-top:5px;color:#e6d2ac}
.chapter-nav{display:flex;align-items:center;gap:5px;padding:5px;background:#263835e8;border:1px solid #bea37375;border-radius:3px;backdrop-filter:blur(10px)}
.chapter-nav button{min-height:40px;padding:8px 12px;font-size:12px;color:#ecdfc2;border-radius:2px;white-space:nowrap}.chapter-nav button:hover{background:#d5bb8522}.chapter-nav button:disabled{opacity:.35}
.chapter-nav #chapterSkip{background:#894f3c;border:1px solid #d8b4807a}.chapter-nav #chapterSkip[aria-pressed=true]{background:#d4b880;color:#352a1c}
.chapter-objective{position:absolute;left:4%;top:113px;z-index:3;padding:15px 20px;max-width:min(330px,64vw);background:linear-gradient(100deg,#273b36ed,#253831e0);border:1px solid #c5ac7380;border-left:3px solid #d3b47a;box-shadow:0 5px 28px #101c2226;border-radius:2px;pointer-events:none}
.chapter-objective small{font-size:9px;letter-spacing:3px;color:#c5b188}.chapter-objective h2{font-family:var(--serif);font-size:23px;letter-spacing:3px;font-weight:400;margin:8px 0;color:#fae9c6}.chapter-objective p{font-size:11px;color:#d4d9c8;margin:0;line-height:1.7}
.chapter-wayfinding{position:absolute;right:4%;top:116px;z-index:3;text-align:right}.chapter-wayfinding p{font-size:13px;color:#ffedc3;text-shadow:0 1px 5px #253122}.chapter-wayfinding button{background:#283b33d9;color:#f2deb5;border:1px solid #ccb37b87;padding:9px 13px;font-size:11px;min-height:40px}.chapter-direction{display:inline-block;color:#f3c977;font-size:22px;margin-right:8px}
.chapter-walk-hint{position:absolute;bottom:25px;left:50%;transform:translateX(-50%);z-index:3;font-size:11px;letter-spacing:2px;padding:12px 18px;background:#263931d4;border:1px solid #b29b667d;color:#f3e3c2;white-space:nowrap}
.chapter-dialogue{position:absolute;z-index:6;bottom:40px;left:8%;right:8%;padding-top:30px}
.chapter-dialogue:before{content:'';position:fixed;z-index:-1;inset:55% 0 0;pointer-events:none;background:linear-gradient(transparent,#0b181eda 40%,#0b171cf7)}
.chapter-dialogue-meta{display:flex;justify-content:flex-end;gap:10px;margin-bottom:12px}.chapter-dialogue-meta button{background:#263c37dc;border:1px solid #c0a7798c;color:#eddfc2;padding:8px 13px;font-size:11px;min-height:38px}
#chapterDialogueButton{width:100%;display:block;text-align:left;min-height:167px;padding:0 16px 15px;background:none;color:#fff6e5;text-shadow:0 2px 6px #07151e}
#chapterSpeaker{display:block;font-family:var(--serif);font-size:26px;letter-spacing:4px;color:#f2c991;margin-bottom:16px}
#chapterText{display:block;font-family:var(--serif);font-size:clamp(20px,1.7vw,25px);line-height:1.85;letter-spacing:1.4px;min-height:62px}
.chapter-dialogue-bottom{border-bottom:1px solid #d5bd784f;display:flex;justify-content:space-between;margin-top:20px;padding-bottom:15px;color:#c5cabb;font-size:10px;letter-spacing:2px}
.chapter-lesson{position:absolute;z-index:4;bottom:24px;left:50%;transform:translateX(-50%);width:min(780px,92%);background:linear-gradient(115deg,#203633f5,#172d2cf5);border:1px solid #b9a072a8;box-shadow:0 12px 35px #07191a50;padding:15px 20px 14px;border-radius:3px}
.lesson-head{display:flex;align-items:center;gap:12px}.lesson-head>span{font-family:var(--serif);font-size:21px;color:#e6c88c;border-right:1px solid #c6aa7254;padding-right:15px}.lesson-head>p{margin:0;font-size:13px;line-height:1.7;color:#f2e7d0;flex:1}.lesson-head button{font-size:12px;min-height:38px;min-width:48px;border:1px solid #c8b48170;color:#d9c49e}
.lesson-progress{height:2px;background:#d3bb7930;margin:13px 0}.lesson-progress>i{display:block;height:100%;background:#e0c58b;width:0;transition:width .15s}
.tea-actions{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}.tea-actions button{min-height:44px;min-width:130px;padding:9px 17px;border:1px solid #dbc4909c;color:#eedeae;background:#67765e40;border-radius:2px;font-size:13px;letter-spacing:1px;touch-action:none;user-select:none;-webkit-user-select:none}.tea-actions button:hover,.tea-actions button:active{background:#e1c386;color:#293b33}.tea-actions button[data-hold]{background:#8b543a80}.tea-actions button:focus-visible{outline:2px solid #e8d0a0}
.lesson-smallprint{font-size:10px;color:#b4c1b4;text-align:center;margin:10px 0 0;letter-spacing:1px}
#teaPins{position:absolute;inset:0;z-index:3;pointer-events:none}.tea-pin{position:absolute;transform:translate(-50%,-100%);font-size:11px;color:#f9e8bf;background:#25382fe8;border:1px solid #d7bd859c;padding:5px 10px;white-space:nowrap;pointer-events:auto;min-height:36px;box-shadow:0 5px 12px #1b2c2233;touch-action:none}.tea-pin:after{content:'';position:absolute;top:100%;left:50%;height:17px;border-left:1px solid #e8c9829c}
#chapterToast{position:absolute;z-index:12;top:40%;left:50%;transform:translateX(-50%);max-width:86%;padding:12px 22px;background:#f0e4cadf;color:#634e31;border:1px solid #c2a26d;box-shadow:0 4px 28px #1b261d3d;font-size:14px;text-align:center}
.chapter-stick{position:absolute;z-index:4;bottom:125px;left:25px;width:108px;height:108px;border:1px solid #ecce9280;border-radius:50%;background:#26383170;touch-action:none;display:none}.chapter-stick>i{position:absolute;left:34px;top:34px;width:40px;height:40px;border-radius:50%;background:#e2c89480;border:1px solid #eedab1;pointer-events:none}
.chapter-loading{position:absolute;z-index:20;inset:0;background-size:cover;background-position:center;display:flex;align-items:center;justify-content:flex-end;flex-direction:column;padding:0 20px 11svh;text-align:center}
.chapter-loading:before{content:'';position:absolute;inset:0;background:linear-gradient(#132e324d,#102c3140 40%,#0c222eea);z-index:-1}.chapter-loading:after{content:'';position:absolute;inset:22px;border:1px solid #d8bd794d;pointer-events:none}
.chapter-loading small{font-size:11px;letter-spacing:5px;color:#e1c998}.chapter-loading h1{font-family:var(--serif);font-size:43px;font-weight:400;letter-spacing:6px;margin:20px 0 14px;color:#f4e7ca;text-shadow:0 2px 12px #16343a}.chapter-loading p{color:#d4d5c0;font-size:13px;letter-spacing:2px;line-height:1.8}
.chapter-loading-brand{position:absolute;top:42px;left:4%;display:flex;gap:17px;align-items:center;font:26px var(--serif);letter-spacing:5px;color:#f6e5c0;text-shadow:0 2px 8px #122a2b}.chapter-loading-brand>span{font-size:31px;background:#874d38;border:1px solid #d7ba82;padding:6px 8px;outline:1px solid #b99b6260;outline-offset:4px}
.chapter-load-track{width:min(480px,76vw);height:2px;margin:25px 0 18px;background:#cab48150}.chapter-load-track>i{display:block;height:2px;background:#e6c98c;position:relative;width:0;transition:width .2s}.chapter-load-track>i:after{content:'';position:absolute;right:-4px;top:-3px;width:8px;height:8px;transform:rotate(45deg);background:#e6c98c}
.chapter-loading button{margin:16px 7px 0;border:1px solid #ddc79590;color:#eddfbf;padding:10px 18px;background:#273f36c9;min-height:42px;font-size:12px}
.chapter-ending{position:absolute;inset:0;z-index:7;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#122f2cbb;backdrop-filter:blur(6px);text-align:center;padding:25px}.chapter-ending small{font-size:11px;letter-spacing:4px;color:#d1b57b}.chapter-ending h2{font-family:var(--serif);font-size:60px;font-weight:400;letter-spacing:10px;margin:25px 0;color:#f0dcae}.chapter-ending p{font-family:var(--serif);font-size:21px;line-height:1.9;letter-spacing:2px;color:#e5e5cc}.chapter-ending button{min-height:45px;padding:12px 22px;border:1px solid #cbb684;background:#2c4435;color:#f2deb6;margin:8px;font-size:14px}.chapter-ending button:first-child{background:#e5ce9e;color:#3b4536}
#chapterModal{z-index:60;max-width:740px}.chapter-notes-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.chapter-note-card{border:1px solid #ad906c55;background:#fff8e440;padding:13px}.chapter-note-card small{color:#987149;font-size:10px;letter-spacing:2px}.chapter-note-card h3{font-family:var(--serif);font-size:20px;margin:6px 0;color:#714b33}.chapter-note-card p{font-size:12px;line-height:1.9;margin:0;color:#615341}
.chapter-map{display:block;width:min(100%,380px);max-height:58svh;margin:auto;background:#e8dcc2;border:1px solid #bda580}
.chapter-rest{position:absolute;z-index:8;bottom:40px;left:8%;right:8%;padding:24px;background:#17312feb;border-top:1px solid #ccb888;text-align:center}.chapter-rest small{letter-spacing:4px;color:#d0b889}.chapter-rest h2{font:28px var(--serif);letter-spacing:4px}.chapter-rest p{font-size:13px;line-height:1.8}.chapter-rest button{min-height:44px;padding:12px 24px;background:#d8bf8b;color:#2b3c33;margin-top:8px}
@media(pointer:coarse){.chapter-stick:not([hidden]){display:block}.tea-pin{min-height:44px;min-width:44px}}
@media(max-width:799px){.chapter-topbar{padding:16px 4%;gap:6px}.chapter-brand{font-size:18px;letter-spacing:2px;gap:9px}.chapter-brand>span:first-child{font-size:22px;padding:3px}.chapter-brand small{font-size:8px;letter-spacing:1px}.chapter-nav{gap:0;padding:3px}.chapter-nav button{font-size:10px;padding:7px;min-height:35px}.chapter-nav .optional-label{display:none}.chapter-objective{top:94px;padding:11px 14px;max-width:66vw}.chapter-objective h2{font-size:20px;letter-spacing:2px}.chapter-objective p{font-size:10px}.chapter-objective small{font-size:8px;letter-spacing:2px}.chapter-wayfinding{top:auto;bottom:64px;right:5%}.chapter-walk-hint{bottom:20px;font-size:9px;letter-spacing:0;padding:10px 15px}.chapter-dialogue{left:4%;right:4%;bottom:23px}.chapter-dialogue:before{top:49%}#chapterDialogueButton{padding:0 14px 12px;min-height:200px}#chapterSpeaker{font-size:23px;margin-bottom:13px}#chapterText{font-size:20px;line-height:1.75;min-height:108px;letter-spacing:1px}.chapter-dialogue-bottom{font-size:9px;margin-top:14px}.chapter-lesson{bottom:13px;padding:13px 14px;width:94%}.lesson-head>span{font-size:19px;padding-right:10px}.lesson-head>p{font-size:11px}.lesson-head button{font-size:11px;min-width:40px}.tea-actions button{font-size:12px;min-width:120px;padding:9px 12px}.lesson-smallprint{font-size:9px;letter-spacing:0}.tea-pin{font-size:10px;padding:4px 8px}.chapter-loading h1{font-size:28px;letter-spacing:3px}.chapter-loading p{font-size:11px;letter-spacing:1px}.chapter-loading{padding-bottom:14svh}.chapter-ending h2{font-size:44px;letter-spacing:7px}.chapter-ending p{font-size:18px}.chapter-notes-grid{grid-template-columns:1fr}}
@media(max-height:650px){.chapter-objective{top:86px;padding:8px 13px}.chapter-objective p{display:none}.chapter-objective h2{font-size:18px;margin:5px 0}.chapter-dialogue{bottom:13px}#chapterText{font-size:18px;min-height:62px}#chapterDialogueButton{min-height:134px}#chapterSpeaker{font-size:21px;margin-bottom:8px}.chapter-dialogue-meta{margin-bottom:8px}.chapter-lesson{padding:10px 14px;bottom:12px}.lesson-smallprint{display:none}.lesson-progress{margin:8px 0}.chapter-loading h1{font-size:30px}}
@media(max-width:599px){.chapter-topbar{align-items:flex-start}.chapter-brand{font-size:16px}.chapter-brand small{display:none}.chapter-brand>span:first-child{font-size:21px}.chapter-nav{max-width:228px;flex-wrap:wrap;justify-content:flex-end}.chapter-nav button{min-height:44px;padding:6px 9px}.chapter-nav #chapterVisitChen{order:5}.chapter-objective{top:126px;max-width:84vw;padding:8px 12px}.chapter-objective p{display:none}.chapter-objective h2{font-size:18px;margin:5px 0}.lesson-head button{min-height:44px;min-width:44px}.chapter-rest{left:4%;right:4%;bottom:20px}.chapter-rest h2{font-size:24px}}
@media(max-width:599px){.chapter-nav #chapterVisitChen{position:fixed;top:78px;right:4%;background:#273b36eb;border:1px solid #c4ab7890;padding:7px 12px}.chapter-objective{top:92px}.chapter-brand{font-size:14px;gap:6px}.chapter-nav button{padding:6px 8px}.chapter-nav{max-width:220px}.chapter-nav #chapterSkip{padding:6px}.chapter-loading:after{inset:12px}}
@media(prefers-reduced-motion:reduce){.chapter-load-track>i,.lesson-progress>i{transition:none}}
