@import url('https://fonts.googleapis.com/css2?family=Anuphan:wght@400;500;600;700;800&display=swap');
:root{font-family:Anuphan,Arial,sans-serif;color:#161616;background:#faf8f1;--gold:#f2b900}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,select{min-height:44px;border-radius:16px;padding:10px 18px;border:1px solid #dedbd1;background:#fff;color:inherit}button{cursor:pointer}button:disabled{opacity:.5;cursor:wait}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #0e6bba;outline-offset:3px}[hidden]{display:none!important}.welcome{max-width:760px;margin:auto;padding:32px 24px 50px}.back{display:block;margin-bottom:40px;color:#444}.eyebrow{font-size:13px;font-weight:700;color:#806400}h1{font-size:clamp(34px,7vw,58px);line-height:1.15;letter-spacing:-1px;margin:16px 0}p{line-height:1.8}.characters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:28px 0}.characters img{width:100%;border-radius:22px;aspect-ratio:1;object-fit:contain}.pick{display:flex;align-items:center;justify-content:space-between;margin:24px 0}.primary{background:var(--gold);border:0;font-weight:800;color:#080808;box-shadow:0 5px 22px #8c710522}.welcome .primary{width:100%}.small,details{font-size:13px;color:#666}details{margin-top:32px}details a{color:inherit}#experience{position:fixed;inset:0;height:100dvh;background:#111;overflow:hidden}#cameraFeed{position:absolute;inset:0;width:100%;height:100%;touch-action:none}.hud{position:absolute;background:#151515da;color:white;border:1px solid #ffffff24;backdrop-filter:blur(10px);border-radius:20px;z-index:3}.top{top:max(10px,env(safe-area-inset-top));left:12px;right:12px;padding:6px;display:flex;align-items:center;justify-content:space-between;gap:6px}.top span{font-size:13px}.hud button{background:#ffffff0c;color:white;border:1px solid #ffffff36}.tracking{position:absolute;left:20px;right:20px;top:calc(max(10px,env(safe-area-inset-top)) + 70px);padding:10px 14px;border-radius:18px;background:#111d;color:white;text-align:center;font-size:14px;pointer-events:none}.actions{position:absolute;left:20px;right:20px;bottom:calc(max(22px,env(safe-area-inset-bottom)) + 75px);display:flex;justify-content:center;pointer-events:none;z-index:4}.actions button{pointer-events:auto;max-width:100%}.dock{left:12px;right:12px;bottom:calc(max(10px,env(safe-area-inset-bottom)) + 38px);padding:12px 14px}.progress{display:flex;gap:10px;align-items:center;font-size:12px;margin-top:8px}.progress input{flex:1;min-width:30px;accent-color:var(--gold)}.controls{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:8px}.controls button{padding:8px 12px}.controls label{font-size:12px;margin-left:auto;display:flex;align-items:center;gap:5px}.controls input{width:65px;accent-color:var(--gold)}.diagnostic{position:absolute;bottom:max(4px,env(safe-area-inset-bottom));right:16px;background:#1119;color:white;font-size:11px;min-height:30px;padding:3px 10px;border:0}.actions.playback{bottom:calc(max(10px,env(safe-area-inset-bottom)) + 235px)}@media(max-height:520px){.top{left:8px;right:8px}.dock{left:8px;right:auto;width:55%;padding:8px}.tracking{top:75px;left:auto;width:40%;right:12px}.actions{left:60%;bottom:80px}.actions.playback{bottom:80px}.controls label{display:none}}

.camera-options{margin:15px 0 22px}.camera-options label{display:block;margin:10px 0}.camera-options select{max-width:100%;width:100%}#copyWelcomeDiagnostic{margin-top:12px}#browserHint{background:#fff3cb;border-radius:14px;padding:14px}#cameraFeed{max-width:none;max-height:none;transform:none;object-fit:contain}

/* Clear chapters, separate from the single-scene camera trial. */
.chapter-choices{display:grid;gap:16px;margin:30px 0}.chapter-choice{display:grid;grid-template-columns:150px minmax(0,1fr);gap:18px;padding:16px;background:#fff;border:1px solid #e6e0d0;border-radius:24px}.chapter-choice.current{border-color:#d7aa12}.chapter-choice img{width:100%;height:150px;object-fit:cover;border-radius:16px}.chapter-choice h2{font-size:21px;line-height:1.45;margin:6px 0}.chapter-choice p{font-size:14px;margin:0 0 12px;color:#5e5a51}.chapter-choice a{display:block;color:#382e0d;font-size:14px;font-weight:700;padding:12px 0;min-height:44px}.pilot-note{display:block;font-size:12px;color:#766622}#pilotSetup{scroll-margin-top:20px}.top{flex-wrap:wrap}.top button{padding:9px 12px}.top span{flex:1;min-width:90px}@media(max-width:500px){.chapter-choice{grid-template-columns:1fr;gap:12px}.chapter-choice img{height:150px}.welcome{padding-left:18px;padding-right:18px}.back{margin-bottom:24px}.tracking{top:calc(max(10px,env(safe-area-inset-top)) + 80px)}}

/* Use original mascot artwork, with chapter labels beside it. */
.chapter-character-art{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0}.chapter-character-art img{width:100%;height:auto;object-fit:contain;border-radius:18px}.chapter-character-art.pair{flex-direction:column}.chapter-character-art.pair img{max-width:100px}.chapter-choice{align-items:center}.chapter-choice h2{font-size:20px}.chapter-choice p{font-size:13px}.chapter-choice a{color:#080808;text-decoration:none;border-bottom:1px solid #e9ddb9}.chapter-choice a:focus-visible{outline:3px solid #0e6bba;outline-offset:3px}#pilotSetup{font-size:24px}@media(max-width:500px){.chapter-choice{grid-template-columns:95px minmax(0,1fr);padding:14px;gap:14px}.chapter-choice h2{font-size:18px}.chapter-character-art img{height:auto}.chapter-character-art.pair img{max-width:90px}.chapter-choice p{line-height:1.7}.chapter-choice .eyebrow{font-size:12px}}

.chapter-choice{min-height:175px}.chapter-character-art.pair img{max-width:70px}.chapter-choice .pilot-note{margin-top:10px}.chapter-choice a{margin-top:4px}@media(max-width:500px){.chapter-character-art.pair img{max-width:68px}.chapter-choice{min-height:175px}}

/* Selected chapter is visible during loading and remains above the scene title. */
.chapter-label{color:#f2b900;font-size:13px;font-weight:700;margin-bottom:6px;line-height:1.5}.hud.top{min-height:62px;height:auto;padding:8px;flex-wrap:nowrap}.hud.top button{height:44px;min-height:44px;line-height:1.2;white-space:nowrap}.hud.top span{min-width:0;font-size:12px}.tracking{top:calc(max(10px,env(safe-area-inset-top)) + 76px)}
body.chapter-entry #welcome{max-width:650px;min-height:90dvh;display:flex;flex-direction:column;justify-content:center;padding-top:30px}body.chapter-entry h1{font-size:clamp(28px,4vw,42px);line-height:1.5;letter-spacing:0}body.chapter-entry #welcome>p:not(#welcomeStatus),body.chapter-entry #welcome>.pick,body.chapter-entry #welcome>.camera-options,body.chapter-entry #pilotSetup,body.chapter-entry #pilotSetup+p{display:none}body.chapter-entry #openCamera{display:none}body.chapter-entry #welcomeStatus{font-size:16px;background:white;border:1px solid #e9dfc3;border-radius:22px;padding:24px;line-height:1.7}body.chapter-entry:not(.needs-camera-gesture) #welcomeStatus:before{content:'';display:block;width:28px;height:28px;border:3px solid #eee5ce;border-top-color:#ac8500;border-radius:50%;margin-bottom:16px;animation:ar-loading-spin 1s linear infinite}body.chapter-entry.needs-camera-gesture #openCamera{display:block}body.chapter-entry.needs-camera-gesture #welcome>.camera-options{display:block}body.chapter-entry .back{align-self:flex-start;margin-bottom:24px}@keyframes ar-loading-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){body.chapter-entry #welcomeStatus:before{animation:none}}

@media(orientation:landscape) and (max-height:600px){.actions{left:auto;right:18px;width:min(42vw,340px);bottom:max(20px,env(safe-area-inset-bottom))}.actions.playback{bottom:max(20px,env(safe-area-inset-bottom))}.actions button{width:100%;white-space:normal}.tracking{top:85px;left:auto;right:16px;width:40%}}

/* Keep size control visible in portrait and landscape, including compact phone layouts. */
.controls .shared-viewer-scale{display:flex!important;flex-direction:column;align-items:stretch;gap:2px;width:150px;min-height:52px;max-width:100%;margin-left:auto}.shared-viewer-scale>span{display:flex;justify-content:space-between;gap:8px;color:#fff}.shared-viewer-scale output{color:#f2b900}.controls .shared-viewer-scale input{width:100%;height:28px;min-width:80px;margin:0;touch-action:pan-x}@media(max-width:380px){.controls .shared-viewer-scale{width:125px}}@media(orientation:landscape) and (max-height:520px){.controls .shared-viewer-scale{width:120px;min-height:48px}}
