/* Detective chapter: premium night palette, touch-first instruments. */
.detective-feature{margin:42px 0 60px;border-radius:30px;overflow:hidden;display:grid;grid-template-columns:1.1fr 1fr;background:#122e3b;box-shadow:0 20px 55px #102f3925;color:#fff4d8;min-height:390px}.detective-feature>img{width:100%;height:100%;object-fit:cover;min-height:390px}.detective-feature-copy{padding:42px;align-self:center}.feature-tag{font-size:12px;letter-spacing:.1em;text-transform:uppercase;font-weight:900;color:#f2d18b}.detective-feature h2{font-size:clamp(32px,4vw,52px);color:#fff4d8;line-height:1.1;margin:18px 0 12px}.detective-feature p{color:#e1dfd2;font-size:19px;line-height:1.5}.detective-feature .feature-description{font-size:16px;color:#b9d2ce;margin:16px 0}.feature-facts{display:flex;gap:16px;font-size:13px;font-weight:800;color:#f2d18b;margin:24px 0}.detective-feature .btn{width:auto;font-size:17px}.detective-board{width:100%;color:#254c50;text-align:left}.detective-board button,.detective-board input{font:inherit}.det-btn{min-height:46px;border:1px solid #9bb2ad;background:#edf2e9;color:#163c42;border-radius:12px;font-weight:800;padding:11px 16px;cursor:pointer;touch-action:manipulation}.det-btn:hover{background:#dfeae0}.det-btn:focus-visible,.det-fragment:focus-visible,.det-scene:focus-visible{outline:3px solid #dc9d36;outline-offset:3px}.det-toolbar{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:8px;margin:16px 0}.det-toolbar .det-btn{flex:1;max-width:240px;white-space:normal}.det-toolbar strong{min-width:90px;text-align:center}.det-status{font-size:14px;line-height:1.5;min-height:42px;padding:12px 14px;background:#edf2e9;border-radius:12px;margin:16px 0}.det-small{font-size:13px;line-height:1.5;margin:14px 0;color:#496365}.detective-board details{font-size:14px;line-height:1.55;margin:14px 0}.detective-board summary{cursor:pointer;padding:10px 0;font-weight:800}.det-scene-wrap{position:relative;overflow:hidden;border-radius:18px;background:#132c35;width:100%;box-shadow:0 10px 28px #163b3f25}.det-scene{display:block;width:100%;aspect-ratio:1;touch-action:none;cursor:crosshair}.det-scene-badge{position:absolute;top:10px;left:10px;max-width:calc(100% - 20px);padding:6px 10px;border-radius:8px;background:#122c39de;color:#f5e2ad;font-size:11px;pointer-events:none}.det-scene-loading{position:absolute;inset:40% 0;text-align:center;color:#f2dcad;font-weight:800;pointer-events:none}.det-evidence{padding:0;list-style:none;display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0}.det-evidence li{padding:9px 10px;border:1px solid #d6ded1;border-radius:10px;font-size:13px;font-weight:800}.det-evidence li span{color:#7e9389}.det-evidence li.is-found{background:#dcf1df;border-color:#77a591;color:#215a46}.det-answer-form{display:flex;gap:12px;flex-wrap:wrap;align-items:end;margin-top:20px}.det-answer-form label{flex:1;min-width:140px;font-size:14px;font-weight:800}.det-answer-form input{display:block;width:100%;box-sizing:border-box;min-height:48px;border:1px solid #9bb2ad;border-radius:12px;padding:10px 14px;margin-top:8px;background:#fffef7;color:#163c42;font-size:20px;letter-spacing:.1em}.det-answer-form>.det-btn{flex:1;min-width:150px}.det-disk{width:180px;height:180px;margin:20px auto;border-radius:50%;background:repeating-conic-gradient(#b2884d 0deg 1deg,#e7d39c 1deg 11.25deg);box-shadow:inset 0 0 0 9px #b08242,0 7px 20px #3c4f3e20;display:flex;justify-content:center;align-items:center;position:relative;color:#183a41;gap:20px}.det-disk:before{content:'';position:absolute;inset:24px;border-radius:50%;background:#f3e9c8;border:2px solid #bd9b5e;transform:rotate(var(--turn,0deg));box-shadow:inset 0 0 0 10px #ddc998}.det-disk span,.det-disk b{font-size:32px;z-index:1}.det-disk i{position:absolute;bottom:27px;color:#ac793e;font-style:normal}.det-cipher .det-small{text-align:center}.det-code{font-size:32px;letter-spacing:.2em;text-align:center;font-weight:900;color:#23505a}.det-cipher-pairs{display:flex;gap:9px;justify-content:center}.det-cipher-pairs span{display:flex;flex-direction:column;text-align:center;background:#f1e6c5;border-radius:12px;padding:10px 14px;font-size:22px}.det-cipher-pairs i{font-style:normal;font-size:16px;color:#7f866d}.det-puzzle{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;max-width:600px;margin:0 auto}.det-fragment{aspect-ratio:1;border:2px solid #a99978;border-radius:8px;padding:0;overflow:hidden;background:#213e48;cursor:pointer}.det-fragment span{display:block;width:100%;height:100%;background-repeat:no-repeat;transition:transform .2s}.det-fragment.selected{outline:4px solid #db9c37;outline-offset:-4px}.det-reference{display:block;width:min(100%,350px);border-radius:14px;margin:12px auto}.det-route{position:relative;aspect-ratio:1;max-width:540px;margin:0 auto;background:linear-gradient(#162e3cf2,#244b50e8),url(assets/map-detective.webp) center/cover;border-radius:18px}.det-route svg{width:100%;height:100%}.det-route line{stroke:#97c2b5;stroke-width:1.1}.det-route text{font-size:5px;fill:#183c45;stroke:#f2e2b2;stroke-width:4;paint-order:stroke;font-weight:900;text-anchor:middle;dominant-baseline:middle}.det-route .det-btn{position:absolute;transform:translate(-50%,-50%);font-size:11px;padding:7px 8px;min-height:44px;border-color:#b2cfb9;background:#f5ead1;max-width:95px}.det-route .visited{background:#a4ceb9}.det-route .current{background:#f4c463;outline:3px solid #fff1af;outline-offset:2px}.det-route-state{text-align:center;font-weight:900;margin:16px 0}.det-notes{padding:18px;background:#f5ebd1;border:1px solid #dfcf9e;border-radius:16px;box-shadow:0 4px 10px #5e614510;margin-bottom:18px}.det-notes h3{font-size:18px;margin:0 0 12px}.det-notes p{font-size:14px;line-height:1.5;border-bottom:1px solid #ded3b6;padding-bottom:9px}.det-notes p:last-child{border:0;padding-bottom:0}.det-fact{display:flex;align-items:center;gap:12px;min-height:48px;font-size:14px;line-height:1.5;padding:8px 0}.det-fact input{width:22px;height:22px;flex:none;accent-color:#287965}.det-dossiers{display:grid;grid-template-columns:1fr 1fr;gap:12px}.det-dossiers .det-btn{text-align:left;padding:17px;background:#e9eee5}.det-dossiers strong{display:block;font-size:15px;margin-bottom:10px}.det-dossiers span{font-size:13px;line-height:1.5;display:block;font-weight:600}.det-timeline{padding:0;list-style:none;display:grid;gap:10px}.det-timeline .det-btn{width:100%;display:flex;align-items:center;gap:14px;text-align:left;font-size:15px}.det-timeline b{color:#b18038;font-size:22px}.det-timeline i{margin-left:auto;font-style:normal;font-size:22px}.detective-board .selected{background:#f4dfad;border-color:#b88b3b}.det-wave{background:#142d3b;padding:18px;border-radius:18px}.det-wave svg{width:100%;display:block}.det-wave path{fill:none;stroke-width:3}.det-wave .target{stroke:#77dbca}.det-wave .tuning{stroke:#f4c46d;stroke-dasharray:7 4;stroke-width:2}.det-wave p{display:flex;justify-content:space-between;margin:12px 0 0;font-size:12px}.det-wave p span{color:#77dbca}.det-wave p strong{color:#f4c46d}.det-range{display:block;font-size:15px;font-weight:800;margin:22px 0}.det-range output{float:right;color:#9d6f2c}.det-range input{display:block;width:100%;min-height:44px;accent-color:#267866}.det-star-reference{display:flex;align-items:center;justify-content:space-between;background:#ede9d8;border:1px solid #d4c799;border-radius:14px;margin-bottom:12px;padding:10px 18px;font-size:14px;font-weight:800}.det-star-reference svg{width:110px;height:110px}.det-star-reference line{stroke:#7c874e;stroke-width:1.5}.det-star-reference circle{fill:#bb8d3a}.det-stars{position:relative;aspect-ratio:1;border-radius:18px;background:radial-gradient(ellipse at 70% 20%,#354d72,#132b3a 70%);box-shadow:inset 0 0 55px #090f1f88}.det-stars svg{width:100%;height:100%;position:absolute}.det-stars line{stroke:#e9c87d;stroke-width:1;filter:drop-shadow(0 0 1px #e7c989)}.det-stars button{position:absolute;transform:translate(-50%,-50%);border:0;background:none;color:#f9e6a5;font-size:30px;padding:0;min-height:48px;min-width:48px;text-shadow:0 0 20px #ffe49e99}.det-stars button.selected{background:#f7d18533;border-radius:50%;outline:2px solid #f1ca78}.map-view.detective .map-node .island{background:#f4e3ad;border-color:#80643b}.map-view.detective .map-node.current .island{background:#e8b759}.map-view.detective .map-inner{background-size:cover;background-position:center}.map-view.detective .map-node p{font-size:12px;max-width:160px;background:#102c39e8;color:#fff0c6;padding:5px 9px;border-radius:7px}.map-view.detective .map-decoration{opacity:.3}
@media(max-width:700px){.detective-feature{grid-template-columns:1fr;margin:26px 0 40px;border-radius:22px}.detective-feature>img{min-height:0;aspect-ratio:3/2;height:auto}.detective-feature-copy{padding:26px}.detective-feature h2{font-size:34px}.detective-feature p{font-size:17px}.detective-feature .btn{width:100%}.det-dossiers{grid-template-columns:1fr}.detective-board{margin-top:8px}.det-cipher-pairs span{padding:9px 11px}.det-route .det-btn{font-size:10px;padding:6px;max-width:76px}.det-notes{padding:14px}.det-scene-badge{font-size:10px}.det-toolbar .det-btn{padding:10px}.det-timeline .det-btn{font-size:13px;padding:11px}.det-star-reference svg{width:95px;height:95px}}
@media(prefers-reduced-motion:reduce){.det-fragment span{transition:none}}
/* Keep the title independent of controls: never squeeze the observatory word. */
.map-view.detective .map-top>div:first-child{min-width:0}.map-view.detective .map-top h2{overflow-wrap:normal;word-break:normal;line-height:1.2}.detective-board,.det-notes,.det-dossiers,.det-timeline{min-width:0;max-width:100%}.det-scene,.det-reference{object-fit:contain}.det-route .det-btn{font-size:12px;line-height:1.2;width:78px;max-width:78px}.det-toolbar .det-btn{flex:1 1 110px}.det-answer-form input{min-width:0}.det-disk{flex-shrink:0}
@media(max-width:700px){.map-view.detective .map-top{display:grid;grid-template-columns:minmax(0,1fr) auto 46px;align-items:center;gap:12px 8px;padding:18px 18px 32px;background:linear-gradient(#fff3d9fc 80%,#fff3d900)}.map-view.detective .map-top>div:first-child{grid-column:1/-1;width:100%;flex:none}.map-view.detective .map-top h2{font-size:24px;margin-top:5px;max-width:100%}.map-view.detective .map-top>.narration-tools{margin-left:0;justify-content:flex-start}.map-view.detective .map-top .menu-exit{white-space:nowrap;min-height:46px}.map-view.detective .map-top .icon-btn{flex-shrink:0;width:46px}.det-route .det-btn{font-size:11px;width:72px;max-width:72px}.detective-feature-copy{min-width:0}.feature-facts{flex-wrap:wrap;gap:8px 16px}.det-evidence{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* The legacy board is a centered flex column; new instruments need full-width blocks. */
.game-board.detective-board{display:block;min-width:0;width:100%}.det-stars,.det-route,.det-puzzle,.det-wave,.det-cipher{width:100%;max-width:100%}.det-puzzle{max-width:600px}.det-stars,.det-route{max-width:540px;margin-left:auto;margin-right:auto}.det-puzzle .det-fragment{min-width:0;width:100%}
.det-route svg{display:block}
/* Selection stays unmistakable over detailed artwork, including on a phone. */
.det-fragment{position:relative;overflow:visible}.det-fragment span{border-radius:5px;overflow:hidden}.det-fragment.selected{z-index:2;outline:4px solid #08766b;outline-offset:1px;box-shadow:0 0 0 8px #f4ce65,0 8px 20px #173b4a45;transform:translateY(-3px);border-color:#fff7db}.det-fragment.selected:after{content:'✓';position:absolute;top:5px;right:5px;display:grid;place-items:center;width:27px;height:27px;border-radius:50%;background:#08766b;color:#fff;border:2px solid #fff7d8;box-shadow:0 2px 6px #0005;font-size:19px;font-weight:900;pointer-events:none}.det-timeline .det-btn.selected{background:#176d66;color:#fff9df;outline:3px solid #e9b843;outline-offset:2px}.det-timeline .det-btn.selected b{color:#ffe1a1}
.parents-guide .guide-hero{display:grid;grid-template-columns:.85fr 1fr;gap:28px;align-items:center;margin:12px 0 26px}.guide-art{position:relative;min-width:0;border-radius:22px;overflow:hidden;aspect-ratio:1.15;background:#eee0bf}.guide-art>img:first-child{width:100%;height:100%;object-fit:cover;display:block}.parents-guide .guide-hero h2{font-size:clamp(28px,3vw,42px);margin:16px 0}.parents-guide .guide-hero p{font-size:16px;color:#3b665c;line-height:1.65}.guide-skills{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.guide-skills span{background:#e7eddf;color:#355d50;padding:8px 12px;border-radius:30px;font-size:13px;font-weight:850}.parents-guide .guide-lead{font-size:17px;line-height:1.7;margin:22px 0 30px}.parents-guide h3{font-size:25px;margin:26px 0 18px}.guide-steps{padding:0;list-style:none;display:grid;gap:14px}.guide-steps li{display:flex;gap:16px;align-items:flex-start;padding:20px;border:1px solid #e1e3d3;border-radius:18px;background:#fffcf4}.guide-steps li>b{display:grid;place-items:center;min-width:36px;height:36px;border-radius:50%;background:#efd19c;color:#594728;font-weight:900}.parents-guide h4{font-size:18px;margin:2px 0 10px;font-weight:900;line-height:1.3;color:#254b45}.guide-steps p,.guide-modes p{font-size:15px;line-height:1.65}.guide-modes{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:24px 0}.guide-modes>div{padding:20px;border-radius:18px;background:#eaf0e4}.parents-guide .actions .btn{white-space:normal;text-align:center}.parents-guide .guide-hero>div{min-width:0}
@media(max-width:700px){.parents-guide .guide-hero{grid-template-columns:1fr;gap:16px}.guide-art{aspect-ratio:1.8}.parents-guide .guide-hero h2{font-size:29px;line-height:1.15}.parents-guide .guide-hero p{font-size:15px}.parents-guide .guide-lead{font-size:16px}.guide-modes{grid-template-columns:1fr}.guide-steps li{padding:16px 13px;gap:12px}.parents-guide h4{font-size:17px}.guide-steps p,.guide-modes p{font-size:14px}.guide-skills span{font-size:12px}.parents-guide h3{font-size:23px}.parents-guide .actions{display:grid;grid-template-columns:1fr}}
/* Courier route: an illuminated observatory map with tactile dimensional nodes. */
.det-courier-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:5px 8px;border-radius:10px;background:linear-gradient(110deg,#1b384b,#365872);color:#ffe7a3;box-shadow:inset 0 1px #ffffff44,0 3px 7px #152a3850;font-size:10px;font-weight:800}.det-courier-heading span{font-size:9px;letter-spacing:.04em}.det-courier-heading strong{font-size:12px;white-space:nowrap}.det-fixed-scene>.det-courier-route{background:#132e50 url('assets/detective-courier-route.webp') center/cover;border:3px solid #b69250;border-radius:18px;box-shadow:inset 0 0 20px #0008,0 5px 12px #162a3d55;overflow:hidden}.det-courier-route svg{position:absolute;inset:0;overflow:visible;pointer-events:none}.det-courier-route .route-road-shadow{stroke:#172b3a;stroke-width:3.6;stroke-linecap:round;filter:drop-shadow(0 1px 1px #020a10)}.det-courier-route .route-road-light{stroke:#e8bd6a;stroke-width:1.4;stroke-linecap:round;stroke-dasharray:2 1.5}.det-courier-route g.travelled .route-road-light{stroke:#8dffe1;stroke-width:2;stroke-dasharray:3 1;filter:drop-shadow(0 0 2px #8dffe1);animation:det-route-flow .8s linear infinite}.det-courier-route text{font-size:5.3px;fill:#143a4a;stroke:#fff1c4;stroke-width:4.6;paint-order:stroke;font-weight:900}.det-courier-route .det-btn{z-index:2;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1px;width:68px;max-width:68px;min-height:44px;padding:3px 4px;border:1px solid #e4c07b;border-radius:13px;color:#e7f6ed;background:linear-gradient(155deg,#567b83,#25485b 50%,#152d40);box-shadow:inset 0 2px 2px #ffffff70,0 4px 0 #102837,0 6px 8px #0009;font-size:10px;line-height:1.1;text-align:center}.det-courier-route .det-btn.visited{background:linear-gradient(155deg,#4c9c8e,#206955 65%,#144d49);border-color:#a1f8d4}.det-courier-route .det-btn.current{background:linear-gradient(150deg,#ffe59b,#e6a63e 60%,#a35d1c);border-color:#fff2bd;color:#3d3020;outline:2px solid #ffe9a2;outline-offset:1px;box-shadow:inset 0 2px 3px #fff9,0 4px 0 #835019,0 0 13px #fbd374}.det-node-icon{display:grid;place-items:center;width:19px;height:19px;border-radius:50%;font-size:14px;color:#ffe4a0;background:radial-gradient(circle at 32% 25%,#fff5b9,#d3a23d 50%,#7b5020);box-shadow:0 2px 3px #10233180,inset 0 1px #fff9}.det-node-name{max-width:100%;overflow-wrap:normal}.det-courier-marker{position:absolute;z-index:4;pointer-events:none;transform:translate(-50%,-125%);transition:left .55s ease,top .55s ease;filter:drop-shadow(0 2px 4px #001c30)}.det-courier-marker i{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:radial-gradient(circle at 35% 25%,#fffef2,#ffdf63 48%,#db8c27 75%);color:#fff7bd;border:1px solid #fff2b0;box-shadow:0 0 9px #fff1a2;animation:det-courier-sparkle 1.4s ease-in-out infinite alternate;font-style:normal}.det-fixed-controls>.det-courier-path{text-align:center;margin:0;color:#53655e;font-size:10px;line-height:1.2;max-height:26px;overflow:hidden}.det-fixed-controls>.det-route-state{margin:0;padding:5px;border-radius:10px;background:#e9f3e5;color:#285346;font-size:12px}.det-courier-controls .det-btn{background:linear-gradient(#fff9df,#d7e7d7);border:1px solid #a6c0a0;box-shadow:inset 0 1px #fff,0 3px 0 #a0b39d;font-weight:800}@keyframes det-route-flow{to{stroke-dashoffset:-4.5}}@keyframes det-courier-sparkle{to{transform:scale(1.14);box-shadow:0 0 15px #fff1a2}}@media(prefers-reduced-motion:reduce){.det-courier-marker{transition:none}.det-courier-marker i,.det-courier-route g.travelled .route-road-light{animation:none}}
@media(max-height:650px){.det-fixed-board[data-detective-stage=route] .det-courier-heading,.det-fixed-board[data-detective-stage=route] .det-courier-path{display:none}.det-fixed-board[data-detective-stage=route] .det-route-state{padding:4px}.det-fixed-board[data-detective-stage=route] .det-fixed-controls{gap:3px}}

.det-courier-route .det-btn{padding:1px 3px 2px;gap:0;background:linear-gradient(160deg,#35566aaa,#102a3de8);border-color:#dfc184;box-shadow:inset 0 1px 2px #ffffff55,0 3px 0 #102837,0 5px 8px #0008}.det-courier-route .det-btn .det-node-picture{width:46px;height:30px;object-fit:contain;filter:drop-shadow(0 2px 2px #001727);pointer-events:none}.det-courier-route .det-node-name{font-weight:800;text-shadow:0 1px 2px #001b24}.det-courier-route .det-btn.current .det-node-name{text-shadow:none}.det-courier-marker{transform:translate(40%,-110%)}.det-courier-marker i{width:16px;height:16px;font-size:11px}
