/* One Wind, Two Lights: one quiet stage for two maps. */
:root{color-scheme:dark;--night:#111a2b;--ink:#f4f0e7;--muted:#b8c6d8;--gold:#ffe1a2;--a:#91eedb;--b:#ffc28f;--line:#a4b9d02c;--serif:Georgia,'Yu Mincho','Hiragino Mincho ProN',serif;font-family:ui-sans-serif,system-ui,-apple-system,'Segoe UI',Meiryo,sans-serif;color:var(--ink);background:var(--night)}
*{box-sizing:border-box}html{min-height:100%;background:var(--night)}body{margin:0;min-height:100svh;background:radial-gradient(ellipse at 50% 0%,#293d5b 0,#15243a 45%,#101b2b 100%);color:var(--ink)}
body::before{content:'';position:fixed;inset:0;background:linear-gradient(#14203788,#101b2bea 80%),url('../assets/atlas-cover.png') center 36%/cover;opacity:.28;pointer-events:none}
body:has(dialog[open]){overflow:hidden}button,select,input{font:inherit}button{cursor:pointer;color:inherit;-webkit-tap-highlight-color:transparent}button:disabled{cursor:default;opacity:.4}button,a,select,input{touch-action:manipulation}:focus-visible{outline:3px solid #fff0b9;outline-offset:4px}[hidden]{display:none!important}
.sky{position:fixed;inset:0;overflow:hidden;pointer-events:none}.sky i{position:absolute;width:3px;height:3px;border-radius:50%;background:#ffedba;box-shadow:0 0 12px #bbeeff99;animation:twinkle 5s ease-in-out infinite alternate}.sky i:nth-child(1){left:12%;top:17%}.sky i:nth-child(2){left:82%;top:12%;animation-delay:1.4s}.sky i:nth-child(3){left:92%;top:62%;animation-delay:2.8s}.sky i:nth-child(4){left:8%;top:72%;animation-delay:.9s}.sky i:nth-child(5){left:68%;top:40%;animation-delay:3.6s}@keyframes twinkle{to{opacity:.2}}
/* Navigation stays quieter than the puzzle. */
.masthead{position:relative;display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:1080px;margin:auto;padding:14px max(24px,env(safe-area-inset-right)) 14px max(24px,env(safe-area-inset-left))}
.wordmark{display:flex;align-items:center;gap:10px;color:var(--ink);text-decoration:none;font:600 .96rem/1.25 var(--serif);letter-spacing:.03em}.wordmark-script{margin-left:.2em;color:var(--gold)}.wordmark small{display:block;margin-top:5px;color:#aebed0;font:500 .56rem/1.2 ui-sans-serif,system-ui,sans-serif;letter-spacing:.19em}.sigil{flex:none;color:var(--gold);font:1rem/1 ui-sans-serif,system-ui,sans-serif;white-space:nowrap;letter-spacing:-.12em}.masthead nav{display:flex;align-items:center;gap:6px}
.icon-button,.close-button{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:44px;min-height:44px;border:1px solid transparent;border-radius:50%;background:#e4effb08;color:#d7e2f1;font-size:1.08rem;transition:background .15s,border-color .15s,scale .15s}.icon-button#book-button{gap:7px;width:auto;padding:0 12px;border-radius:24px;color:var(--gold)}#progress-pill{color:#e0e8f1;font-size:.72rem;font-variant-numeric:tabular-nums;white-space:nowrap}.settings-launch{font-size:1.25rem}.close-button{border-color:#c2d1e030;font-size:1.4rem;background:#f0f5ff08}
#game{position:relative;max-width:960px;margin:0 auto;padding:8px 24px max(20px,env(safe-area-inset-bottom));outline:none}.story-line{display:flex;align-items:center;gap:18px;margin-bottom:12px;color:#bdcddd}.world-kicker{display:flex;align-items:center;gap:9px;flex:none;font-size:.75rem}.world-kicker small{margin-left:8px;color:#aabed1;font-size:.67rem}.chapter-rune{color:var(--gold);font-family:var(--serif)}.waypoints{display:flex;gap:4px;flex:1}.waypoint{height:2px;flex:1;border-radius:2px;background:#c1d4e326}.waypoint.done{background:var(--a);box-shadow:0 0 7px #92eedb30}.level-jump{min-height:44px;padding:6px 8px;border:0;background:none;color:#d1dfeb;font-size:.8rem}
.title-row{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 0 20px}.title-row>div:first-child{min-width:0}.title-row h1{margin:0;font:500 clamp(1.3rem,2.2vw,1.75rem)/1.4 var(--serif);letter-spacing:.04em;overflow-wrap:anywhere}.title-row .overline{display:none}.overline{margin:0 0 7px;color:#e0c58f;font-size:.65rem;font-weight:650;line-height:1.4;letter-spacing:.12em}.level-badge{flex:none;padding:6px 0 6px 12px;color:#9cacc1;font-size:.74rem;font-variant-numeric:tabular-nums;white-space:nowrap}#level-current{color:#ffe0a0;font-size:.9rem;font-weight:700}
/* No extra frame around either map card. */
.atlas-spread{display:grid;grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr);align-items:start;column-gap:14px;row-gap:12px;max-width:790px;margin:auto}.map-card{min-width:0}.map-a{--route:var(--a)}.map-b{--route:var(--b)}.fold{display:none}.atlas-join{display:flex;flex-direction:column;align-self:center;align-items:center;gap:8px;margin-top:26px;color:#e9d299;font-size:.7rem;opacity:.7}.atlas-join i{height:44px;border-left:1px solid #cfdeb935}
.map-label{display:flex;align-items:center;gap:7px;max-width:330px;margin:0 auto 9px;color:#dce7f0}.map-emblem{display:grid;place-items:center;width:21px;height:21px;flex:none;color:var(--route);font-size:.72rem}.map-label b{display:block;font-size:.8rem;font-weight:500;line-height:1.4}.map-label small,.map-index{display:none}
/* Keep essential board and pawn colors outside @supports: var() values otherwise invalidate old-engine fallbacks at computed-value time. */
.board{--n:4;position:relative;display:grid;grid-template-columns:repeat(var(--n),minmax(0,1fr));gap:5px;width:min(100%,330px);aspect-ratio:1;margin:auto;padding:9px;border:1px solid var(--route);border-radius:18px;background:#102035;box-shadow:0 15px 32px #050d1b38,inset 0 1px 0 #cee0f018;touch-action:pinch-zoom;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
@supports (color: color-mix(in srgb, white, black)){.board{border:1px solid color-mix(in srgb,var(--route) 48%,#69839e)}}
.cell{position:relative;min-width:0;aspect-ratio:1;border:1px solid #66819b42;border-radius:6px;background:#20354b}.cell.wall{background:#a9bdce;border:1px solid #edf7ff;box-shadow:inset 0 -3px 0 #657e97}.cell.wall::after{content:'';position:absolute;inset:2px;border-radius:2px;background:linear-gradient(#536c83,#536c83) center 50%/100% 2px no-repeat,linear-gradient(#536c83,#536c83) 35% 0/2px 50% no-repeat,linear-gradient(#536c83,#536c83) 70% 100%/2px 50% no-repeat;opacity:.8}
.cell.on-goal{border:1px solid var(--route);background:#30485b}.cell.arrived{background:#456276;box-shadow:inset 0 0 16px #c8e2df52,0 0 12px #c8e2df26}@supports (color: color-mix(in srgb, white, black)){.cell.on-goal{background:color-mix(in srgb,var(--route) 16%,#20354b)}.cell.arrived{background:color-mix(in srgb,var(--route) 36%,#20354b);box-shadow:inset 0 0 16px color-mix(in srgb,var(--route) 32%,transparent),0 0 12px color-mix(in srgb,var(--route) 15%,transparent)}}
.cell.trail::after{content:'';position:absolute;left:50%;top:50%;width:3px;height:3px;border-radius:50%;translate:-50% -50%;background:var(--route);opacity:.42}
.cell.hint-focus{z-index:3;outline:2px dashed #ffe5a5;outline-offset:2px;box-shadow:0 0 0 4px #182c3b,0 0 18px #ffe5a527}.goal-mark{position:absolute;inset:9%;display:grid;place-items:center;color:var(--route);font:1.5rem/1 ui-sans-serif,system-ui,sans-serif}
.pawn{position:absolute;inset:24%;z-index:2;border-radius:50%;background:radial-gradient(circle at 34% 26%,#fff9e9 0 6%,var(--route) 24%,var(--route) 76%);box-shadow:0 0 0 1.5px #fff4da,0 0 0 4px #ffffff38,0 3px 7px #030b1944,0 0 14px #c8e2df70}@supports (color: color-mix(in srgb, white, black)){.pawn{background:radial-gradient(circle at 34% 26%,#fff9e9 0 6%,color-mix(in srgb,var(--route) 85%,white) 24%,var(--route) 76%);box-shadow:0 0 0 1.5px #fff4da,0 0 0 4px color-mix(in srgb,var(--route) 22%,transparent),0 3px 7px #030b1944,0 0 14px color-mix(in srgb,var(--route) 44%,transparent)}}
.pawn::after{content:'';position:absolute;inset:35%;border-radius:inherit;background:#fff7d9;opacity:.9}.map-b .pawn{border-radius:4px;rotate:45deg;scale:.84}.board.arrived{border-color:var(--route)}
.map-caption{grid-column:1/-1;margin:0;color:#b4c6d8;text-align:center;font-size:.75rem;line-height:1.5}.input-guide{grid-column:1/-1;text-align:center;color:#bbcedd}.gesture-note{margin:0;font-size:.79rem;line-height:1.5}#input-detail{margin:5px 0 0;font-size:.77rem;line-height:1.6;color:#bacbde}#game .input-guide{order:5;margin-top:1px}#game #input-detail,#game .board-legend,#game .map-caption{display:none}
.board-legend{display:flex;flex-wrap:wrap;align-items:center;gap:12px 18px;margin:16px 0;color:#d6e1ec;font-size:.8rem;line-height:1.5}.board-legend>span{display:inline-flex;align-items:center;gap:7px}.legend-wall,.legend-path{display:inline-block;flex:none;width:19px;height:19px;border-radius:4px}.legend-wall{position:relative;border:1px solid #edf7ff;background:#a9bdce}.legend-wall::after{content:'';position:absolute;inset:2px;background:linear-gradient(#536c83,#536c83) center/100% 2px no-repeat,linear-gradient(#536c83,#536c83) 35% top/2px 50% no-repeat}.legend-path{border:1px solid #718ba1;background:#20354b}.legend-goal{color:var(--gold);font-size:1.2rem;font-style:normal}
/* Recovery actions retain their place; optional directions expand below. */
.play-deck{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:9px 12px;width:min(100%,480px);margin:20px auto 0;padding:0}.move-reading{grid-column:1;grid-row:2;display:flex;align-items:baseline;gap:7px;min-height:32px;color:#becddd}.reading-label,.move-reading>span:last-child{font-size:.76rem;line-height:1.4}.move-reading strong{color:var(--gold);font-size:1.35rem;font-weight:500;font-variant-numeric:tabular-nums}.controls{display:contents}
.dpad{grid-column:1/-1;grid-row:4;display:grid;grid-template-columns:repeat(4,minmax(44px,1fr));gap:8px}.dpad-glyph{display:none}.move-key{min-height:48px;border:1px solid #99b1c84d;border-radius:13px;background:#314960b3;color:#f2eddf;font-size:1.25rem;box-shadow:0 3px 0 #0d1725;transition:background .15s,translate .12s}.move-key[data-dir='left']{grid-column:1;grid-row:1}.move-key[data-dir='up']{grid-column:2;grid-row:1}.move-key[data-dir='down']{grid-column:3;grid-row:1}.move-key[data-dir='right']{grid-column:4;grid-row:1}.move-key:active{translate:0 2px;box-shadow:0 1px 0 #0d1725}
.action-rail{grid-column:1/-1;grid-row:3;display:flex;gap:8px}.action-rail button{display:flex;justify-content:center;align-items:center;gap:7px;flex:1;min-width:0;min-height:48px;padding:8px 6px;border:1px solid #adbed53d;border-radius:13px;background:#abc5df0c;color:#e0e9f2;font-size:.83rem;transition:background .15s,border-color .15s}.action-rail button span{color:#efd59c;font-size:1.15rem;line-height:1}#direction-toggle{grid-column:2;grid-row:2;justify-self:end;min-height:44px;padding:6px 1px 6px 10px;border:0;background:none;color:#bfd0e0;font-size:.75rem;letter-spacing:0}
.hint-text{grid-column:1/-1;grid-row:5;margin:3px 0 0;padding:12px 14px;border-left:2px solid #e2c78e;border-radius:0 9px 9px 0;background:#e8d6a40a;color:#f0dfbd;font-size:.86rem;line-height:1.7}#hint-dismiss{grid-column:2;grid-row:6;justify-self:end;min-height:44px;padding:7px 10px;border:0;background:none;color:#d2dfeb;font-size:.76rem}
.status{grid-column:1/-1;grid-row:7;margin:0;color:#e8d4a5;font-size:.78rem;line-height:1.6;text-align:center}.status:empty{display:none}.status.movement-message{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.status.warning{padding:8px 10px;border-radius:8px;background:#72463235;color:#ffdbad}
.storage-warning{grid-column:1/-1;grid-row:1;width:100%;padding:12px;border:1px solid #efb77480;border-radius:12px;background:#493427;color:#ffe2b8;font-size:.82rem;line-height:1.6;overflow-wrap:anywhere}.storage-warning .subtle-button{display:block;width:100%;margin-top:8px;color:#fff0d4}
.clear-panel{grid-column:1/-1;grid-row:1;display:grid;grid-template-columns:auto 1fr;column-gap:10px;padding:12px 16px 15px;border:1px solid #edcf8d56;border-radius:16px;background:linear-gradient(120deg,#344647e0,#1b3046ed)}.clear-panel .arrival-seal{grid-column:1;grid-row:1/3;align-self:center;width:31px;height:31px;margin:0}.clear-title{grid-column:2;margin:0;color:#ffe4b0;font:500 1.06rem/1.5 var(--serif)}#clear-detail{grid-column:2;margin:2px 0 0;font-size:.77rem;line-height:1.5;color:#c7d6df}.clear-panel .clear-actions{grid-column:1/-1;margin-top:12px}.clear-actions{display:flex;justify-content:center;gap:8px}.clear-actions>button{flex:1}.arrival-seal{display:grid;place-items:center;width:38px;height:38px;margin:0 auto 10px;border:1px solid #ecd18b70;border-radius:50%;color:#ffe1a3;font-size:1rem;box-shadow:0 0 22px #ffda8b18}
.play-deck:has(.clear-panel:not([hidden])) .dpad,.play-deck:has(.clear-panel:not([hidden])) #direction-toggle,.play-deck:has(.clear-panel:not([hidden])) #hint-button,.play-deck:has(.clear-panel:not([hidden])) #restart-button,.play-deck:has(.clear-panel:not([hidden])) .move-reading{display:none}.play-deck:has(.clear-panel:not([hidden])) .action-rail{grid-row:3;justify-self:center}.play-deck:has(.clear-panel:not([hidden])) #undo-button{min-width:120px;min-height:44px;border-color:transparent;background:none;color:#bfcede}
.play-deck:has(.storage-warning:not([hidden])) .clear-panel{grid-row:2}.play-deck:has(.storage-warning:not([hidden])) .move-reading,.play-deck:has(.storage-warning:not([hidden])) #direction-toggle{grid-row:3}.play-deck:has(.storage-warning:not([hidden])) .action-rail{grid-row:4}.play-deck:has(.storage-warning:not([hidden])) .dpad{grid-row:5}.play-deck:has(.storage-warning:not([hidden])) .hint-text{grid-row:6}.play-deck:has(.storage-warning:not([hidden])) #hint-dismiss{grid-row:7}.play-deck:has(.storage-warning:not([hidden])) .status{grid-row:8}
.primary-button,.subtle-button{min-height:44px;padding:10px 16px;border-radius:12px;font-size:.84rem;font-weight:500;line-height:1.45;transition:background .15s,border-color .15s}.primary-button{border:1px solid #ffe4ad;background:#f3d498;color:#2b2b32;font-weight:650;box-shadow:0 5px 16px #efd59a13}.primary-button span{margin-left:8px}.subtle-button{border:1px solid #b9cada3b;background:#b9d2e309;color:#d2deea}
.page-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:14px;padding:0;color:#a0b3c7;font-size:.66rem;line-height:1.6}.page-footer button{flex:none;min-height:44px;padding:8px 0 8px 8px;border:0;background:none;color:#c2d0df;font-size:.74rem}
/* A lesson is a single current prompt, beside the maps. */
#tutorial-banner{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:15px;padding:12px 15px;border:1px solid #a1c3d344;border-radius:14px;background:#26425b80}#tutorial-banner p{margin:3px 0;color:#d1deeb;font-size:.81rem;line-height:1.55}#tutorial-banner button{flex:none}
#tutorial-guide{max-width:790px;margin:0 auto 16px;padding:0 0 10px;border-bottom:1px solid #afcadd27}.tutorial-guide-top{display:flex;align-items:center;justify-content:space-between;gap:10px}#tutorial-progress{color:var(--gold);font-size:.75rem;font-weight:650}#tutorial-exit{max-width:64%;min-height:44px;padding:6px 0 6px 10px;border:0;background:none;color:#becddd;font-size:.75rem;text-align:right}#tutorial-guide h2{margin:2px 0 5px;font-size:1rem;font-weight:600;line-height:1.45}#tutorial-guide-text{margin:0;color:#d6e2ef;font-size:.86rem;line-height:1.6}#tutorial-preserve-note{margin:7px 0 0;color:#b4c4d7;font-size:.7rem;line-height:1.5}
body[data-mode='tutorial'] .story-line,body[data-mode='tutorial'] .title-row{display:none}body[data-mode='tutorial'] #game .input-guide{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}body[data-solved='true'] #tutorial-guide-text{display:none}#tutorial-guide-title:focus{outline:none}
/* Dialog scroll belongs to the dialog, not to the game below it. */
dialog{--dialog-pad:22px;width:610px;max-width:calc(100vw - 24px);max-height:calc(100svh - 28px);padding:var(--dialog-pad);overflow:auto;overscroll-behavior:contain;border:1px solid #a2b9d24f;border-radius:22px;background:#1a2a40;color:var(--ink);box-shadow:0 22px 80px #030b18a8}dialog::backdrop{background:#081320d9;backdrop-filter:blur(7px)}
.dialog-top{position:sticky;z-index:5;top:calc(-1 * var(--dialog-pad));display:flex;align-items:center;justify-content:space-between;gap:12px;margin:calc(-1 * var(--dialog-pad)) calc(-1 * var(--dialog-pad)) 14px;padding:17px var(--dialog-pad) 13px;border-bottom:1px solid #abc4da25;background:#1a2a40}.dialog-top h2{margin:0;font:500 1.4rem/1.4 var(--serif)}.dialog-top .overline{margin-bottom:3px;font-size:.58rem}.dialog-description{margin:12px 0;color:#cad7e4;font-size:.85rem;line-height:1.75}
#book-continue{width:100%;margin:1px 0 5px}.chapter-list{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:14px 0 18px}.chapter-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:44px;min-height:62px;padding:7px 4px;border:1px solid #c0d4e32e;border-radius:10px;background:#a1c2e009;text-align:center}.chapter-card::before{content:attr(data-roman);color:#e2d5b6;font:500 1.02rem/1.2 var(--serif)}.chapter-orb,.chapter-percent{display:none}.chapter-copy{min-width:0}.chapter-copy b{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.chapter-copy small{display:block;margin-top:4px;color:#a9c0d5;font-size:.64rem;font-variant-numeric:tabular-nums}.chapter-card[aria-current='true']{border-color:#eed29b;background:#e2cc8c15;box-shadow:inset 0 -2px #eed29b}.chapter-card[aria-current='true']::before{color:#ffe6b5}
.level-drawer{padding-top:2px}.level-drawer h3{margin:0 0 6px;color:#f0dfb7;font-size:1rem;font-weight:550}.chapter-focus{margin:7px 0 13px;color:#c4d3e2;font-size:.8rem;line-height:1.65}.level-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}.level-button{min-width:0;min-height:48px;padding:7px 2px;border:1px solid #adc4d637;border-radius:10px;background:#a9c8e009;color:#e3edf7;font-size:.87rem;font-variant-numeric:tabular-nums}.level-button.current{border-color:#ffe0a1;background:#f4d39818;color:#ffe9bb;box-shadow:inset 0 0 0 1px #ffe0a126}.level-button.cleared{border-color:#91eedb69;color:#a0eedc;background:#75d8c70a}.level-button.current.cleared{border-color:#ffe0a1}.refresher-label{display:block;margin-top:3px;color:#bbcadb;font-size:.61rem}
.field-guide{margin:18px 0;padding:0;list-style:none}.field-guide li{display:grid;grid-template-columns:28px minmax(0,1fr);gap:10px;margin:16px 0;color:#dae5ee;font-size:.9rem;line-height:1.7}.field-guide li>span:first-child{color:#e8cb94;font-size:.69rem;padding-top:3px}#help-tutorial{margin:10px 6px 0 0}#help-done{margin-top:10px}.data-actions{display:grid;gap:10px;margin:18px 0}.danger-button{color:#ffd4c5;border-color:#e6a59a44}.privacy-link{display:inline-flex;align-items:center;min-height:44px;color:#cce1f6;font-size:.83rem;text-underline-offset:4px}
.confirm-dialog{width:390px;padding:25px;text-align:center}.confirm-dialog h2{margin:8px 0;font-size:1.16rem;font-weight:600;line-height:1.5}.confirm-dialog p{color:#c5d4e2;font-size:.84rem;line-height:1.7}.confirm-dialog .clear-actions{margin-top:20px}
.settings-dialog{width:430px}.settings-field{margin:17px 0}.settings-field label{display:block;color:#e4ebf0;font-size:.87rem;line-height:1.5}.settings-field select{display:block;width:100%;min-height:48px;margin-top:8px;padding:9px 12px;border:1px solid #aec5df66;border-radius:11px;background:#112138;color:#f2f0e5}.settings-label-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px}.settings-label-row output{color:#ffe0a0;font-size:.85rem;font-variant-numeric:tabular-nums}.settings-field input[type='range']{width:100%;height:44px;margin:2px 0 0;accent-color:#f0d49b;cursor:pointer;touch-action:pan-y}.settings-detail{margin:7px 0;color:#b9cbdc;font-size:.76rem;line-height:1.6}.settings-warning{margin:9px 0;color:#ffe1a6;font-size:.8rem;line-height:1.6}.settings-dialog #settings-done{display:block;width:100%;min-height:48px;margin-top:15px}
/* Preserve the standalone privacy page. */
.policy-page{position:relative;display:block;max-width:820px;margin:26px auto;padding:30px clamp(20px,5vw,44px);border:1px solid #adc1d42d;border-radius:20px;background:#142237ed;line-height:1.9;font-size:1rem;overflow-wrap:anywhere}.policy-page h1{margin:16px 0 24px;font:600 clamp(1.6rem,4vw,2.15rem)/1.4 var(--serif);letter-spacing:.03em}.policy-page h2{margin:30px 0 9px;font-size:1.15rem;line-height:1.5;color:var(--gold)}.policy-page h3{margin:23px 0 8px;font-size:1.05rem;color:var(--gold)}.policy-page p{margin:10px 0 18px;color:#d6deeb}.policy-page .overline{color:var(--gold);font-size:.7rem}.policy-page a{color:#c3ddff;text-underline-offset:4px}.policy-nav{display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:24px;font-size:.83rem}.policy-translation{margin-top:40px;padding-top:24px;border-top:1px solid #a7c1d536;scroll-margin-top:20px}.policy-back{margin-top:28px}
body[data-chapter='1']{--a:#91eedb;--b:#ffc28f}body[data-chapter='2']{--a:#82dfe9;--b:#ffe19a}body[data-chapter='3']{--a:#a6ec94;--b:#83d6e9}body[data-chapter='4']{--a:#c7bbff;--b:#89d8f2}body[data-chapter='5']{--a:#ffce84;--b:#ff987c}body[data-chapter='6']{--a:#b9e6ff;--b:#def4ef}body[data-chapter='7']{--a:#77d7d5;--b:#a5baff}body[data-chapter='8']{--a:#ffa58a;--b:#8be0bb}body[data-chapter='9']{--a:#d5a7ff;--b:#f2b4d1}body[data-chapter='10']{--a:#ffe18c;--b:#bbafff}
@media(hover:hover){.icon-button:hover,.close-button:hover{background:#d8eaff15;border-color:#b7cede44}.action-rail button:hover,.subtle-button:hover,.chapter-card:hover,.level-button:hover{background:#bed9ed15;border-color:#b4cddc75}.primary-button:hover{background:#ffe3ae}.move-key:hover{background:#405e78}}
@media(max-width:760px){
 .masthead{padding:6px max(14px,env(safe-area-inset-right)) 6px max(14px,env(safe-area-inset-left));gap:9px}.wordmark{font-size:.8rem;gap:8px}#brand-first,.wordmark-script{display:block;margin:0;white-space:nowrap}.wordmark small{display:none}.sigil{font-size:.85rem}.masthead nav{gap:3px}.icon-button#book-button{padding:0 8px;gap:5px}#progress-pill{font-size:.66rem}
 #game{padding:7px 16px max(14px,env(safe-area-inset-bottom))}.story-line{display:none}.title-row{margin-bottom:13px;gap:10px}.title-row h1{font:500 1.05rem/1.5 ui-sans-serif,system-ui,sans-serif;letter-spacing:.01em}.level-badge{padding:4px 0 4px 6px;font-size:.7rem}#level-current{font-size:.82rem}
 .atlas-spread{--map-size:clamp(175px,calc((100svh - 380px)/2),235px);grid-template-columns:minmax(0,1fr);gap:12px}body[data-mode='tutorial'] .atlas-spread{--map-size:clamp(164px,calc((100svh - 390px)/2),222px)}.board,.map-label{width:min(100%,var(--map-size))}.board{padding:7px;gap:4px;border-radius:14px}.map-label{margin-bottom:5px;gap:5px}.map-label b{font-size:.73rem}.map-emblem{width:16px;height:16px;font-size:.66rem}.atlas-join{display:none}#game .input-guide{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.cell{border-radius:4px}.goal-mark{font-size:1.12rem}
 .play-deck{gap:6px 10px;margin-top:13px;max-width:420px}.move-reading{min-height:38px;gap:6px}.move-reading strong{font-size:1.15rem}.reading-label,.move-reading>span:last-child{font-size:.7rem}.action-rail{gap:7px}.action-rail button{min-height:46px;padding:8px 3px;font-size:.78rem;gap:5px}.dpad{gap:7px}.move-key{min-height:44px}#direction-toggle{font-size:.69rem}.page-footer{margin-top:8px;font-size:.58rem}.page-footer button{font-size:.7rem}
 #tutorial-banner{flex-wrap:wrap;padding:10px 12px;gap:7px;margin-bottom:12px}#tutorial-banner button{width:100%}#tutorial-banner .overline{display:none}#tutorial-guide{margin-bottom:11px;padding-bottom:10px}#tutorial-guide h2{font-size:.94rem}#tutorial-guide-text{font-size:.8rem;line-height:1.55}#tutorial-preserve-note{font-size:.67rem}#tutorial-exit{font-size:.7rem}.clear-panel{padding:11px 12px 13px}.clear-title{font-size:.99rem}#clear-detail{font-size:.74rem}.clear-panel .clear-actions{margin-top:10px}
 dialog{--dialog-pad:18px;max-height:calc(100svh - 24px);border-radius:19px}.dialog-top{padding-top:13px;padding-bottom:11px}.dialog-top h2{font-size:1.2rem}.chapter-copy b{font-size:.66rem}.chapter-copy small{font-size:.6rem}.chapter-list{gap:5px}.chapter-card{min-height:58px}.level-grid{gap:6px}.level-button{min-height:46px;font-size:.79rem}.chapter-focus{font-size:.76rem}.settings-field{margin:15px 0}.settings-detail{font-size:.74rem}.policy-page{margin:12px;padding:24px 18px}
}
/* Short portraits: both maps remain visible beside each other. The whole map is a swipe target, not each cell. */
@media(max-width:760px) and (max-height:740px),(max-width:760px) and (orientation:landscape){
 .atlas-spread{grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:12px;row-gap:8px;max-width:580px}.board,.map-label{width:min(100%,250px)}.board{padding:6px;gap:3px;border-radius:12px}.map-label{align-items:flex-start;min-height:27px;margin-bottom:4px}.map-label b{font-size:.7rem;line-height:1.4}.map-emblem{margin-top:1px}.cell{border-radius:3px}.cell.wall{box-shadow:inset 0 -2px 0 #657e97}.cell.wall::after{inset:1px;background-size:100% 1px,1px 50%,1px 50%}.goal-mark{font-size:clamp(.82rem,3.7vw,1.05rem)}.pawn{box-shadow:0 0 0 1px #fff4da,0 0 0 3px #ffffff33,0 0 9px #c8e2df70}@supports (color: color-mix(in srgb, white, black)){.pawn{box-shadow:0 0 0 1px #fff4da,0 0 0 3px color-mix(in srgb,var(--route) 20%,transparent),0 0 9px color-mix(in srgb,var(--route) 44%,transparent)}}.map-b .pawn{border-radius:2px}#tutorial-guide{max-width:580px}.play-deck{margin-top:16px}.clear-panel{margin-top:0}.settings-field{margin:12px 0}.settings-detail{line-height:1.5}
}
@media(min-width:761px) and (max-height:760px){.masthead{padding-block:8px}#game{padding-top:2px}.story-line{margin-bottom:2px}.title-row{margin-bottom:11px}.atlas-spread{max-width:730px}.board,.map-label{width:min(100%,clamp(170px,calc(100svh - 335px),300px))}.play-deck{margin-top:13px;gap:6px 12px}#tutorial-guide{margin-bottom:12px}.page-footer{margin-top:7px}}
@media(max-width:760px) and (orientation:landscape){.masthead{padding-block:3px}.wordmark #brand-first,.wordmark .wordmark-script{display:inline}.wordmark .wordmark-script{margin-left:.15em}.board,.map-label{width:min(100%,clamp(132px,calc(100svh - 200px),210px))}.title-row{margin-bottom:8px}.map-label{min-height:18px}#game{padding-top:2px}.play-deck{margin-top:10px}}
@media(max-width:350px){.masthead{padding-inline:10px;gap:4px}.wordmark{font-size:.73rem}.sigil{display:none}.masthead nav{gap:1px}#game{padding-inline:12px}.atlas-spread{column-gap:9px}.title-row h1{font-size:.94rem}.map-label b{font-size:.65rem}.reading-label{font-size:.65rem}.action-rail button{font-size:.72rem}dialog{--dialog-pad:14px}.chapter-copy b{font-size:.62rem}.chapter-copy small{font-size:.57rem}.chapter-card{padding-inline:2px}.clear-actions>button{padding-inline:8px;font-size:.77rem}}
@media(prefers-contrast:more){.cell{background:#102237;border-color:#8b9fb0}.cell.wall{background:#e4eaf2;border-color:#fff}.cell.wall::after{opacity:1}.reading-label,.map-label,.chapter-copy small,.settings-detail,.page-footer{color:#e5edf6}.action-rail button,.move-key,.level-button,.chapter-card{border-color:#b6c8da}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
.reduced-motion *,.reduced-motion *::before,.reduced-motion *::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
