:root{color-scheme:dark;--paper:#e6dcc6;--paper-light:#f0e7d4;--paper-dim:#c9bea6;--ink:#2c3b35;--muted:#a7b3a5;--stage:#23332f;--stage-deep:#182824;--copper:#ad6045;--copper-light:#d68b69;--line:#d3ccb32b;--serif:"Songti SC","STSong","SimSun",serif;--sans:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;--paper-grain:repeating-linear-gradient(7deg,transparent 0 3px,#58482c05 3px 4px),linear-gradient(112deg,#baa4740a,#fff9df20 48%,#82745110);font-family:var(--sans);font-synthesis:none}
*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0}html{background:var(--stage-deep)}body{overflow:hidden;color:var(--paper);background:radial-gradient(ellipse at 50% 24%,#55614b36,transparent 70%),linear-gradient(135deg,#2c3b33,var(--stage-deep) 85%);-webkit-font-smoothing:antialiased}body::before{position:fixed;inset:0;z-index:-1;content:"";pointer-events:none;opacity:.35;background:repeating-linear-gradient(91deg,transparent 0 7px,#9dac9220 7px 8px),repeating-linear-gradient(1deg,transparent 0 5px,#d4c6a307 5px 6px)}button,input{font:inherit;font-family:var(--sans)}button{appearance:none;-webkit-appearance:none;cursor:pointer;border:0;background:none;color:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:disabled{cursor:default;opacity:.36}button:focus-visible,input:focus-visible,canvas:focus-visible{outline:2px solid var(--copper-light);outline-offset:4px}button:focus:not(:focus-visible),canvas:focus:not(:focus-visible){outline:none}button:active:not(:disabled){transform:translateY(1px)}[hidden],.hidden{display:none!important}h1,h2,h3,p{margin:0}h1,h2,h3{font-family:var(--serif);font-weight:500}.app-shell{height:100%;height:100dvh;min-height:0;isolation:isolate}.screen{width:100%;height:100%;min-height:0}.eyebrow{font-size:11px;line-height:1.6;letter-spacing:3px;color:var(--muted)}.button{display:inline-flex;min-height:46px;align-items:center;justify-content:center;gap:14px;padding:10px 22px;font-size:14px;line-height:1.5;letter-spacing:1px;transition:background .15s,box-shadow .15s,color .15s}.button-primary{color:#f8ead0;background:var(--copper);box-shadow:inset 0 0 0 1px #db977342,0 4px 14px #12221b16}.button-primary:hover:not(:disabled){background:#bb6b4d;box-shadow:inset 0 0 0 1px #e7b59277}.button-paper{background:var(--paper);background-image:var(--paper-grain);color:var(--ink)}.button-paper:hover:not(:disabled){background-color:var(--paper-light)}.button-quiet{color:var(--paper-dim);box-shadow:inset 0 -1px #d3ccb338}.button-quiet:hover:not(:disabled){color:var(--paper-light);background:#e4d7b907}.button-outline{border:1px solid var(--line);color:var(--paper-dim)}.button-outline:hover:not(:disabled){border-color:#d3ccb370;color:var(--paper-light)}.text-button{min-height:44px;padding:8px 12px;font-size:12px;letter-spacing:1px;color:var(--muted)}.text-button:hover{color:var(--paper-light)}.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.rule-line{width:40px;height:1px;background:currentColor;opacity:.35}
/* Typography and paper make the opening card independent of image loading. */
.home-screen{display:flex;flex-direction:column;justify-content:center;padding:max(32px,env(safe-area-inset-top)) max(44px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(44px,env(safe-area-inset-left));position:relative;overflow:auto}.home-screen:after{content:"";position:absolute;inset:24px;border:1px solid #d4c8a419;pointer-events:none}.home-frame{width:min(890px,100%);margin:auto;display:grid;grid-template-columns:1.3fr .7fr;gap:90px;align-items:center;padding:50px 0}.home-heading{position:relative}.home-heading>.eyebrow{font-size:13px;letter-spacing:8px;color:#b8baa1}.edition-line{display:flex;gap:12px;align-items:center;font-size:10px;letter-spacing:5px;color:#9ca18d;margin:24px 0 7px}.home-heading h1{position:relative;display:inline-block;font-size:clamp(80px,8.5vw,126px);line-height:1.45;letter-spacing:.07em;color:var(--paper-light);text-shadow:0 5px 25px #091e1422}.home-heading h1>span:not(.title-seal){display:inline-block;font-size:.86em;transform:translateY(-.04em)}.title-seal{position:absolute;font-family:var(--serif);right:-34px;top:35px;padding:4px 5px 5px;border:1px solid #b77152;color:#ca8861;font-size:12px;letter-spacing:0;line-height:1.25;transform:rotate(4deg)}.home-tagline{font-family:var(--serif);font-size:21px;line-height:1.5;letter-spacing:4px;margin-top:9px}.home-copy{margin-top:23px;font-size:13px;line-height:2;letter-spacing:1px;color:var(--muted)}.home-menu{display:flex;flex-direction:column;gap:12px;min-width:205px;margin-top:60px}.home-menu>.button{width:100%}.home-primary{justify-content:space-between;padding-inline:23px}.button-arrow{font-size:23px;line-height:1}.home-menu-minor{display:flex;justify-content:center;align-items:center;margin-top:10px;gap:1px;color:#7c8b77}.home-progress{font-size:11px;line-height:1.8;letter-spacing:.5px;text-align:center;color:var(--muted);min-height:20px}.home-footer{display:flex;justify-content:space-between;gap:18px;position:relative;z-index:1;font-size:10px;letter-spacing:1px;line-height:1.8;color:#8b9b87}.home-footer span:last-child{text-align:right}
/* Each selection card reserves a line for the puzzle's distinct discovery. */
.select-screen{max-width:1260px;margin:auto;padding:40px 48px;overflow:auto;scrollbar-color:#7f8d75 transparent}.page-header{display:flex;justify-content:space-between;align-items:center;gap:24px;padding-bottom:27px;border-bottom:1px solid var(--line)}.page-header h1{font-size:32px;line-height:1.5;letter-spacing:3px;margin-top:5px}.page-header>.button{min-width:80px}.selection-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:44px;padding-top:30px}.chapter-tabs{display:flex;flex-direction:column;gap:8px}.chapter-tab{min-height:76px;width:100%;text-align:left;padding:14px 18px;border:1px solid transparent;color:var(--muted);font-family:var(--serif);font-size:17px;line-height:1.5;letter-spacing:1px}.chapter-tab small,.chapter-tab .chapter-tab-number{display:block;margin-bottom:3px;font:10px/1.5 var(--sans);letter-spacing:2px;color:#8b9d88}.chapter-tab[aria-current="true"],.chapter-tab[aria-selected="true"],.chapter-tab.active,.chapter-tab.is-active{background:#e0d8bf0c;border-color:#d0c4a62b;color:var(--paper-light);box-shadow:inset 3px 0 var(--copper-light)}.chapter-tab:hover:not(:disabled){background:#e0d8bf08;color:var(--paper-light)}.chapter-intro{min-height:101px;margin-bottom:17px}.chapter-intro h2{font-size:28px;line-height:1.5;letter-spacing:2px;margin:4px 0 10px}.chapter-intro>p:last-child{font-size:12px;line-height:1.8;color:var(--muted)}.level-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.level-card{display:grid;grid-template-columns:33px minmax(0,1fr);align-content:center;column-gap:15px;row-gap:5px;position:relative;width:100%;min-height:112px;padding:19px 18px;text-align:left;background:#d5ccb00a;border:1px solid #d5ccb02b;transition:background .15s,border-color .15s}.level-card:hover:not(:disabled){background:#dfd5b916;border-color:#cbb99880}.level-card[aria-current="true"],.level-card.current{border-color:#bb7e5e;box-shadow:inset 0 0 0 1px #bb7e5e22}.level-card.complete,.level-card.completed,.level-card[data-completed="true"]{background:#d7cfaf10}.level-number{font-family:var(--serif);grid-row:1/span 3;font-size:24px;line-height:1.5;letter-spacing:1px;color:#a3b096}.level-name{font-family:var(--serif);font-size:18px;line-height:1.5;letter-spacing:1px;color:var(--paper-light)}.level-discovery{font-size:11px;line-height:1.7;color:var(--muted)}.level-state{font-size:10px;line-height:1.6;letter-spacing:.8px;color:#c48e6e}.selection-progress{margin-top:22px;font-size:11px;color:var(--muted);line-height:1.8;letter-spacing:1px}
/* The canvas gets a real layout rectangle. Controls never float over cells. */
.game-shell{width:100%;height:100%;min-height:0;display:grid;grid-template-columns:184px minmax(0,1fr) 182px;grid-template-rows:48px minmax(0,1fr) auto;grid-template-areas:"header header header" "brief board controls" "status status status";column-gap:18px;row-gap:14px;padding:max(20px,env(safe-area-inset-top)) max(32px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(32px,env(safe-area-inset-left));max-width:1800px;margin:auto}.game-header{grid-area:header;display:flex;align-items:center;gap:24px;border-bottom:1px solid var(--line);padding-bottom:14px;min-width:0}.game-wordmark{font-family:var(--serif);font-size:24px;line-height:1.1;letter-spacing:5px;color:var(--paper-light);white-space:nowrap}.game-header-note{font-size:10px;letter-spacing:2px;color:#9dac97}.chapter-label{margin-left:auto;font-size:11px;line-height:1.6;letter-spacing:2px;color:#b9bea4;text-align:right}.game-brief{grid-area:brief;align-self:center;min-width:0;padding:12px 0 18px}.level-heading h1{font-size:30px;line-height:1.4;letter-spacing:3px;color:var(--paper-light);margin:8px 0 15px;overflow-wrap:anywhere}.level-subtitle{font-size:12px;line-height:1.9;color:var(--muted);letter-spacing:.5px}.counts{display:flex;gap:28px;margin:30px 0 0;padding-top:21px;border-top:1px solid var(--line);font-variant-numeric:tabular-nums}.counts>div{min-width:45px}.counts dt{font-size:10px;line-height:1.5;letter-spacing:2px;color:var(--muted)}.counts dd{font-family:var(--serif);font-size:26px;line-height:1.5;letter-spacing:1px;margin:4px 0 0;color:#ded9bb;white-space:nowrap}.board-reminder{font-size:10px;line-height:1.8;letter-spacing:.5px;color:#91a18b;margin-top:23px;max-width:150px}.board-stage{grid-area:board;position:relative;min-width:0;min-height:0;overflow:hidden;isolation:isolate;align-self:stretch}#world{display:block;width:100%;height:100%;user-select:none;-webkit-user-select:none;touch-action:none;outline-offset:-4px;position:absolute;inset:0}#world:focus-visible{outline:1px dashed #c9b98a88}.game-controls{grid-area:controls;align-self:center;display:flex;flex-direction:column;align-items:center;gap:25px;min-width:0}.direction-group{display:flex;flex-direction:column;align-items:center;gap:14px}.control-caption{font-size:10px;letter-spacing:3px;line-height:1.5;color:#a3ad96}.direction-pad{--key:50px;display:grid;grid-template-columns:repeat(3,var(--key));grid-template-rows:repeat(3,var(--key));gap:4px;position:relative}.direction-pad:before{position:absolute;left:calc(50% - 2px);top:calc(50% - 2px);width:4px;height:4px;content:"";background:#c7c5a465;transform:rotate(45deg);pointer-events:none}.direction-pad button{width:var(--key);height:var(--key);display:grid;place-items:center;padding:0;color:#3c493a;background:var(--paper);background-image:var(--paper-grain);box-shadow:0 2px 0 #101e192d;clip-path:polygon(1% 2%,33% 0,66% 2%,99% 0,100% 32%,98% 68%,100% 98%,65% 100%,32% 98%,0 100%,2% 65%,0 32%);transition:background .1s,color .1s,filter .1s}.direction-pad button>span{font:27px/1 var(--sans);font-weight:300;pointer-events:none}.direction-pad #dir-up{grid-column:2;grid-row:1}.direction-pad #dir-right{grid-column:3;grid-row:2}.direction-pad #dir-down{grid-column:2;grid-row:3}.direction-pad #dir-left{grid-column:1;grid-row:2}.direction-pad button:hover:not(:disabled),.direction-pad button:focus-visible,.direction-pad button.preview,.direction-pad button.is-preview,.direction-pad button[aria-pressed="true"],.direction-pad button[data-active="true"]{background-color:#f0e5c8;color:#8f533b;filter:drop-shadow(0 0 6px #d5b67e30)}.direction-pad button:active:not(:disabled),.direction-pad button.active{background:var(--copper);color:#ffebc9}.direction-pad button:focus-visible{outline:2px dashed #945a3a;outline-offset:-7px}.utility-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 12px;width:100%;max-width:176px}.utility-button{min-height:48px;display:flex;justify-content:center;align-items:center;gap:7px;padding:8px 5px;font-size:12px;line-height:1.5;letter-spacing:1px;color:#c1c5aa;border:1px solid #d4c8a421}.utility-button:hover:not(:disabled){border-color:#d4c8a470;color:var(--paper-light);background:#d4c8a407}.utility-icon{display:inline-grid;place-items:center;width:18px;height:22px;font:23px/1 var(--sans);font-weight:300;color:#aab799}.hint-icon{border:1px solid #aab79985;border-radius:50%;width:17px;height:17px;font-size:12px}.menu-icon{font-size:17px}.keyboard-note{font-size:9px;line-height:1.6;letter-spacing:.5px;color:#80937e;text-align:center}.game-status-area{grid-area:status;min-height:23px;min-width:0}.status{font-size:11px;line-height:1.8;letter-spacing:.6px;min-height:20px;color:#b6bda1;text-align:center;margin:0 auto;max-width:720px}.result{width:min(690px,100%);margin:0 auto 7px;padding:12px 17px;display:flex;align-items:center;justify-content:space-between;gap:18px;background:var(--paper);background-image:var(--paper-grain);color:var(--ink);box-shadow:0 3px 18px #11211920}.result-message h2{font-size:22px;line-height:1.3;letter-spacing:2px}.result-message p{font-size:11px;line-height:1.7;color:#66705b;margin-top:4px}.result-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}.result-actions .button{min-height:44px;padding:8px 15px;font-size:12px}.result .button-quiet{color:#66705b;box-shadow:none}.result .button-quiet:hover{color:#81462f;background:#a7946110}
/* Chapter pauses have no score grades. */
.interlude-screen{display:grid;place-items:center;padding:32px;overflow:auto}.interlude-card{max-width:630px;width:100%;padding:42px 38px;text-align:center}.interlude-card h1{font-size:clamp(29px,4vw,43px);line-height:1.6;letter-spacing:4px;margin:22px 0}.interlude-mark{display:flex;justify-content:center;align-items:flex-end;gap:13px;height:52px;margin:25px auto 8px;opacity:.78}.interlude-mark span{display:block;width:8px;height:18px;border-radius:60% 35% 30% 40%;background:var(--paper-dim);transform:rotate(-18deg);position:relative}.interlude-mark span:after{content:"";position:absolute;left:11px;top:8px;width:7px;height:16px;border-radius:50% 40% 50% 30%;background:inherit;transform:rotate(25deg)}.interlude-mark span:nth-child(2){margin-bottom:12px}.interlude-mark span:nth-child(3){margin-bottom:24px;background:var(--copper-light)}.interlude-copy{font-family:var(--serif);font-size:17px;line-height:2;letter-spacing:1px;color:#c6c8ad}.interlude-stats{font-size:11px;line-height:1.8;color:var(--muted);letter-spacing:1px;margin:23px 0 0}.interlude-actions{display:flex;flex-direction:column;gap:11px;max-width:235px;margin:34px auto 0}
/* Native dialogs trap focus; content scrolls rather than shrinking controls. */
.paper-dialog{color-scheme:light;width:min(560px,calc(100% - 36px));max-height:min(88dvh,820px);margin:auto;padding:27px 30px 24px;border:1px solid #e6d7b594;background:var(--paper);background-image:var(--paper-grain);color:var(--ink);box-shadow:0 24px 80px #081a1470;overflow:auto;overscroll-behavior:contain;scrollbar-color:#8d927a transparent}.paper-dialog::backdrop{background:#0b1c18b8;backdrop-filter:blur(5px)}.dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding-bottom:20px;border-bottom:1px solid #3b4b3421}.dialog-heading .eyebrow{font-size:10px;letter-spacing:2px;color:#7a8069}.dialog-heading h2{font-size:29px;line-height:1.4;letter-spacing:3px;margin-top:3px}.close-button{display:grid;place-items:center;flex-shrink:0;width:44px;height:44px;font:29px/1 var(--sans);font-weight:300;color:#67745e;margin:-7px -11px 0 0}.close-button:hover{background:#58694c0c;color:#784832}.paper-dialog .button-outline{color:#59664f;border-color:#6971555c}.paper-dialog .button-outline:hover{color:#3c4b32;background:#8291650a;border-color:#63754f}.paper-dialog .button-quiet{color:#57654d;box-shadow:inset 0 -1px #58654b35}.paper-dialog button:focus-visible,.paper-dialog input:focus-visible{outline-color:#965535}.hint-pages{padding-top:6px}.hint-step{display:grid;grid-template-columns:32px minmax(0,1fr);gap:12px;padding:21px 0;border-bottom:1px solid #3b4b3421}.hint-step-number{font:19px/1.5 var(--serif);color:#a16b4e}.hint-step h3{font-size:17px;line-height:1.6;letter-spacing:1px;margin-bottom:8px}.hint-step p{font-size:13px;line-height:1.9;color:#59654f;white-space:pre-line;overflow-wrap:anywhere}.hint-step .hint-route-context{font-size:11px;color:#7b816b;margin:0 0 10px}.hint-step .hint-route{font-family:var(--sans);font-size:21px;line-height:1.8;letter-spacing:4px;color:#93583c;word-break:break-word}.hint-route span{display:inline-flex;min-width:28px;min-height:32px;justify-content:center;align-items:center;letter-spacing:0;margin:0 4px 5px 0;border:1px solid #aa89624a}.dialog-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:22px}.dialog-note{font-size:10px;line-height:1.8;color:#7a806a;max-width:180px}.dialog-footer>.button{font-size:12px;flex-shrink:0}.settings-section{padding:19px 0;border-bottom:1px solid #3b4b3421}.settings-section:last-child{border-bottom:0;padding-bottom:0}.settings-section h3{font-size:16px;line-height:1.5;letter-spacing:1px;margin-bottom:13px}.range-setting{display:grid;grid-template-columns:40px minmax(0,1fr) 38px;gap:12px;align-items:center;min-height:46px;font-size:12px;color:#54624b}.range-setting input{width:100%;min-width:0;height:44px;accent-color:#a86749;margin:0;cursor:pointer}.range-setting output{text-align:right;font-size:11px;font-variant-numeric:tabular-nums;color:#7a8069}.toggle-setting{display:grid;grid-template-columns:minmax(0,1fr) 42px;gap:18px;position:relative;align-items:center;min-height:62px;cursor:pointer}.toggle-setting strong{display:block;font-size:13px;font-weight:400;line-height:1.6}.toggle-setting small{display:block;font-size:10px;line-height:1.7;color:#7a816b;max-width:345px;margin-top:2px}.toggle-setting input{position:absolute;right:0;top:50%;width:42px;height:44px;opacity:0;margin:0;transform:translateY(-50%);z-index:1;cursor:pointer}.toggle-track{display:block;width:38px;height:22px;border:1px solid #7c856969;border-radius:22px;background:#7584661f;position:relative;pointer-events:none;transition:background .15s}.toggle-track:after{content:"";position:absolute;left:4px;top:4px;width:12px;height:12px;border-radius:50%;background:#7b866a;transition:transform .15s,background .15s}.toggle-setting input:checked+.toggle-track{background:#a7644521;border-color:#aa7758}.toggle-setting input:checked+.toggle-track:after{background:#a56143;transform:translateX(16px)}.toggle-setting input:focus-visible+.toggle-track{outline:2px solid #965535;outline-offset:4px}.save-section>p{font-size:11px;line-height:1.8;color:#758068;max-width:420px}.save-actions{display:flex;gap:12px;margin-top:16px}.save-actions .button{font-size:12px;min-height:44px;padding:8px 17px}.save-section .settings-status{color:#925d42;margin-top:10px;min-height:18px;white-space:pre-line}.help-content{padding-top:21px}.help-lead{font-family:var(--serif);font-size:18px;line-height:1.8;letter-spacing:1px}.rules-list{margin:17px 0 23px;padding-left:21px;font-size:12px;line-height:2;color:#5c6952}.rules-list li{padding-left:4px;margin-bottom:6px}.key-guide{font-size:11px;line-height:1.8;color:#69765c;display:grid;gap:8px;margin:0;padding:17px 0;border-top:1px solid #3b4b3421;border-bottom:1px solid #3b4b3421}.key-guide div{display:flex;justify-content:space-between;gap:14px}.key-guide dt{color:#495d3e}.key-guide dd{margin:0;text-align:right}.help-note{font-size:11px;line-height:1.9;color:#7a806b;margin-top:17px}.credits{margin-top:25px}.credits h3{font-size:16px;line-height:1.8;margin-bottom:7px}.credits p{font-size:11px;line-height:1.9;color:#788069}.credits .build-label{font-size:9px;letter-spacing:1px;margin-top:12px;color:#929780}.toast{position:fixed;z-index:30;left:50%;bottom:max(24px,env(safe-area-inset-bottom));transform:translateX(-50%);max-width:calc(100vw - 32px);min-width:200px;padding:13px 20px;background:var(--paper);background-image:var(--paper-grain);color:#46583d;box-shadow:0 6px 30px #0b201654;font-size:12px;line-height:1.8;text-align:center}
/* Portrait: board above a pad and four secondary actions. */
@media(max-width:760px){.home-screen{padding:32px 28px 20px}.home-screen:after{inset:14px}.home-frame{grid-template-columns:1fr;gap:30px;padding:34px 0 25px;width:min(330px,100%)}.home-heading{text-align:center}.home-heading>.eyebrow{font-size:11px;letter-spacing:6px}.edition-line{justify-content:center;margin-top:19px;font-size:9px}.home-heading h1{font-size:86px;line-height:1.4;letter-spacing:.04em}.title-seal{right:-17px;top:22px;font-size:10px}.home-tagline{font-size:17px;letter-spacing:2.5px;margin-top:0}.home-copy{font-size:11px;line-height:1.9;margin-top:13px}.home-menu{margin:0 auto;width:min(254px,100%);gap:10px}.home-menu-minor{margin-top:0}.home-progress{font-size:10px;min-height:0}.home-progress:empty{display:none}.home-footer{font-size:9px;justify-content:center;text-align:center;gap:2px;flex-direction:column}.home-footer span:last-child{text-align:center}.select-screen{padding:25px 20px max(22px,env(safe-area-inset-bottom))}.page-header{padding-bottom:20px;gap:12px}.page-header h1{font-size:27px;letter-spacing:2px}.page-header .eyebrow{font-size:9px;letter-spacing:2px}.page-header>.button{min-width:65px;padding:8px 13px;font-size:12px}.selection-layout{grid-template-columns:1fr;gap:24px;padding-top:20px}.chapter-tabs{flex-direction:row;gap:6px;overflow-x:auto;padding:0 2px 8px;scrollbar-width:thin;scrollbar-color:#8d927a transparent}.chapter-tab{width:auto;min-width:120px;min-height:72px;flex-shrink:0;padding:11px 14px;font-size:15px}.chapter-tab small,.chapter-tab .chapter-tab-number{font-size:9px;letter-spacing:1px}.chapter-tab[aria-current="true"],.chapter-tab[aria-selected="true"],.chapter-tab.active,.chapter-tab.is-active{box-shadow:inset 0 -2px var(--copper-light)}.chapter-intro{min-height:0;margin-bottom:18px}.chapter-intro h2{font-size:25px;margin-top:4px}.chapter-intro>.eyebrow{font-size:9px}.chapter-intro>p:last-child{font-size:11px}.level-list{gap:10px;grid-template-columns:1fr}.level-card{min-height:92px;grid-template-columns:32px minmax(0,1fr);column-gap:15px;row-gap:3px;padding:14px 16px}.level-name{font-size:18px}.level-discovery{font-size:11px}.selection-progress{margin-top:18px;font-size:10px}.game-shell{grid-template-columns:minmax(0,1fr);grid-template-rows:32px auto minmax(0,1fr) auto auto;grid-template-areas:"header" "brief" "board" "controls" "status";gap:9px;padding:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}.game-header{padding-bottom:10px;gap:10px}.game-wordmark{font-size:19px;letter-spacing:3px}.game-header-note{display:none}.chapter-label{font-size:9px;letter-spacing:1px}.game-brief{align-self:auto;padding:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 16px;align-items:center}.level-heading h1{font-size:23px;line-height:1.35;letter-spacing:2px;margin:1px 0 2px}.level-heading>.eyebrow{font-size:9px;letter-spacing:1.5px}.level-subtitle{font-size:10px;line-height:1.6;letter-spacing:0}.counts{margin:0;padding:0;border:0;gap:15px;align-items:center}.counts>div{min-width:28px}.counts dt{font-size:9px;letter-spacing:1px}.counts dd{font-size:21px;line-height:1.3;margin:2px 0 0;letter-spacing:0}.board-reminder{display:none}.board-stage{min-height:0}.game-controls{width:min(334px,100%);justify-self:center;display:grid;grid-template-columns:auto minmax(0,1fr);gap:17px;align-items:center;justify-content:center;align-self:auto}.direction-group{gap:0}.control-caption{display:none}.direction-pad{--key:47px;gap:3px}.direction-pad button>span{font-size:26px}.utility-controls{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-width:none}.utility-button{min-height:52px;flex-direction:column;gap:2px;padding:5px 3px;font-size:10px;letter-spacing:1px}.utility-icon{font-size:22px;height:21px}.hint-icon{height:16px;font-size:11px;margin:2px 0 3px}.menu-icon{font-size:16px}.keyboard-note{display:none}.game-status-area{min-height:19px}.status{font-size:10px;line-height:1.65;letter-spacing:.1px;min-height:17px;max-width:100%}.result{margin-bottom:4px;padding:10px 12px;gap:10px}.result-message h2{font-size:18px;letter-spacing:1px}.result-message p{font-size:9px;line-height:1.5;margin-top:3px}.result-actions{gap:4px}.result-actions .button{padding:7px 10px;font-size:11px;letter-spacing:.5px}.interlude-screen{padding:22px}.interlude-card{padding:24px 10px}.interlude-card h1{font-size:29px;letter-spacing:2px}.interlude-copy{font-size:15px;line-height:1.9}.interlude-card .eyebrow{font-size:10px;letter-spacing:2px}.interlude-actions{margin-top:25px}.paper-dialog{width:calc(100% - 28px);max-height:calc(100dvh - 40px);padding:22px 21px 20px}.dialog-heading{padding-bottom:15px}.dialog-heading h2{font-size:26px}.dialog-heading .eyebrow{font-size:9px}.hint-step{grid-template-columns:25px minmax(0,1fr);gap:10px;padding:17px 0}.hint-step p{font-size:12px}.hint-step h3{font-size:16px}.hint-step-number{font-size:17px}.dialog-footer{gap:12px}.dialog-note{font-size:9px;max-width:125px}.dialog-footer>.button{font-size:11px;padding:10px 16px}.toggle-setting{gap:12px}.toggle-setting small{font-size:10px;max-width:230px}.range-setting{grid-template-columns:32px minmax(0,1fr) 33px;gap:9px}.help-lead{font-size:16px}.toast{font-size:11px;bottom:max(16px,env(safe-area-inset-bottom))}}
@media(max-width:360px){.home-screen{padding:22px 22px 18px}.home-frame{gap:21px;padding:20px 0}.home-heading h1{font-size:76px}.home-copy{margin-top:10px}.home-menu{width:231px;gap:8px}.home-menu>.button{min-height:44px;font-size:13px}.home-heading>.eyebrow{font-size:10px}.edition-line{margin-top:12px}.home-tagline{font-size:15px}.home-footer{font-size:8px}.game-shell{gap:7px;padding:10px 10px 8px}.level-heading h1{font-size:21px}.level-subtitle{font-size:9px}.counts{gap:11px}.counts dd{font-size:19px}.direction-pad{--key:44px;gap:3px}.game-controls{gap:12px;max-width:286px}.utility-controls{gap:6px}.utility-button{min-height:49px}.result{padding:8px 10px;gap:6px}.result-message h2{font-size:16px}.result-message p{font-size:8px}.result-actions .button{padding:7px 9px;font-size:10px}.paper-dialog{padding:19px 17px}.save-actions{gap:8px}.save-actions .button{padding:8px 14px}.dialog-footer>.button{padding:9px 12px}.hint-step .hint-route{font-size:19px;letter-spacing:3px}}
/* Short landscape keeps the board between the readout and the same controls. */
@media(orientation:landscape) and (max-height:560px){.game-shell{grid-template-columns:142px minmax(0,1fr) 154px;grid-template-rows:29px minmax(0,1fr) auto;grid-template-areas:"header header header" "brief board controls" "status status status";gap:8px 12px;padding:max(9px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}.game-header{padding-bottom:8px;gap:16px}.game-wordmark{font-size:19px;letter-spacing:3px}.game-header-note{display:block;font-size:9px;letter-spacing:1px}.chapter-label{font-size:9px;letter-spacing:1px}.game-brief{display:block;align-self:center;padding:0}.level-heading>.eyebrow{font-size:9px;letter-spacing:1px}.level-heading h1{font-size:23px;line-height:1.3;letter-spacing:2px;margin:5px 0 8px}.level-subtitle{font-size:10px;line-height:1.7}.counts{margin:15px 0 0;padding:12px 0 0;border-top:1px solid var(--line);gap:23px}.counts dt{font-size:9px}.counts dd{font-size:21px;line-height:1.3;margin-top:3px}.board-reminder{display:none}.game-controls{display:flex;flex-direction:column;width:100%;gap:10px;align-self:center}.direction-group{gap:0}.control-caption{display:none}.direction-pad{--key:44px;gap:3px}.utility-controls{gap:5px 8px;max-width:150px}.utility-button{min-height:44px;flex-direction:row;padding:6px 3px;gap:4px;font-size:10px}.utility-icon{width:16px;height:20px;font-size:20px}.hint-icon{width:14px;height:14px;font-size:10px;margin:0}.menu-icon{font-size:15px}.keyboard-note{display:none}.status{font-size:9px;min-height:16px;line-height:1.5}.game-status-area{min-height:16px}.result{width:min(590px,100%);padding:7px 12px;margin-bottom:3px}.result-message h2{font-size:18px}.result-message p{font-size:9px;margin-top:1px}.result-actions .button{min-height:44px;padding:7px 12px;font-size:11px}.home-screen{padding:22px 40px 15px}.home-frame{width:min(675px,100%);grid-template-columns:1.3fr 1fr;gap:65px;padding:8px 0 15px}.home-heading{text-align:left}.home-heading>.eyebrow{font-size:10px}.edition-line{justify-content:flex-start;font-size:8px;letter-spacing:3px;margin-top:12px;margin-bottom:2px}.home-heading h1{font-size:74px;line-height:1.3}.title-seal{top:17px;right:-21px;font-size:9px}.home-tagline{font-size:15px;letter-spacing:2px;margin-top:3px}.home-copy{font-size:10px;line-height:1.7;margin-top:9px}.home-menu{width:100%;gap:7px;margin:0;min-width:180px}.home-menu>.button{min-height:44px;font-size:12px;padding:8px 18px}.home-menu-minor{margin-top:0}.home-progress{font-size:9px;line-height:1.5}.home-footer{font-size:8px;flex-direction:row;justify-content:space-between}.home-footer span:last-child{text-align:right}.interlude-screen{padding:13px 25px}.interlude-card{padding:15px;max-width:640px}.interlude-mark{display:none}.interlude-card h1{font-size:27px;line-height:1.5;margin:12px 0}.interlude-copy{font-size:13px;line-height:1.7}.interlude-stats{font-size:10px;margin-top:12px}.interlude-actions{flex-direction:row;justify-content:center;max-width:none;margin-top:20px}.interlude-actions .button{font-size:12px;min-height:44px}.paper-dialog{max-height:calc(100dvh - 22px)}.select-screen{padding:22px 30px}.selection-layout{grid-template-columns:175px minmax(0,1fr);gap:25px;padding-top:20px}.chapter-tabs{flex-direction:column;gap:5px;overflow:visible;padding:0}.chapter-tab{width:100%;min-height:64px;padding:8px 13px}.chapter-tab[aria-current="true"],.chapter-tab[aria-selected="true"],.chapter-tab.active,.chapter-tab.is-active{box-shadow:inset 3px 0 var(--copper-light)}.chapter-intro{margin-bottom:15px;min-height:0}.chapter-intro h2{font-size:24px}.level-list{grid-template-columns:repeat(2,minmax(0,1fr))}.level-card{grid-template-columns:24px minmax(0,1fr);column-gap:9px;padding:12px;min-height:108px}.level-number{font-size:21px}.level-name{font-size:16px}.level-discovery{font-size:10px}}
@media(min-width:1600px) and (min-height:850px){.game-shell{grid-template-columns:220px minmax(0,1fr) 220px;padding-top:30px;padding-bottom:24px;column-gap:24px;grid-template-rows:57px minmax(0,1fr) auto}.level-heading h1{font-size:35px}.direction-pad{--key:57px;gap:5px}.game-controls{gap:32px}.utility-controls{max-width:188px;gap:9px 14px}.utility-button{min-height:52px}.counts{gap:37px}.counts dd{font-size:29px}.home-frame{gap:120px}.home-menu{min-width:225px}.board-reminder{font-size:11px}}
body.high-contrast,body[data-high-contrast="true"],html.high-contrast{--paper:#fff0c8;--paper-light:#fff7df;--paper-dim:#e1d8b7;--muted:#c4d1b6;--line:#eee0b85a;--copper:#9e482c;--copper-light:#f3aa79}.high-contrast .level-subtitle,.high-contrast .status,.high-contrast .keyboard-note,.high-contrast .board-reminder{color:#d8dfc5}.high-contrast .utility-button{border-color:#e5ddb976;color:#f3e8c8}.high-contrast .utility-icon{color:#e1deb3}.high-contrast .level-card{border-color:#d5cba867}.high-contrast .paper-dialog{color:#1b2c19}.high-contrast .paper-dialog p,.high-contrast .paper-dialog small{color:#43543a}.high-contrast .direction-pad button{box-shadow:inset 0 0 0 2px #fff0cb}.reduced-motion *,[data-reduced-motion="true"] *{animation:none!important;transition:none!important;scroll-behavior:auto!important}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.continue-copy{display:flex;flex-direction:column;gap:3px;text-align:left}.continue-copy small{font-size:9px;line-height:1.5;letter-spacing:.5px;opacity:.78}.continue-copy small:empty{display:none}.home-notice{font-size:10px;line-height:1.8;color:#e1b78f;text-align:center;padding:8px 0;border-top:1px solid #ddad7833}.selection-note{font-size:10px;line-height:1.8;color:var(--muted);margin-top:8px}.selection-tools{display:flex;gap:6px;flex-wrap:wrap;margin-top:15px;border-top:1px solid var(--line);padding-top:8px}.selection-tools .text-button:first-child{padding-left:0;padding-right:15px}.toggle-setting input{width:44px}.toggle-setting{grid-template-columns:minmax(0,1fr) 44px}
@media(orientation:portrait) and (max-height:650px){.home-screen{padding-top:18px;padding-bottom:15px}.home-frame{padding-top:12px;padding-bottom:12px;gap:18px}.home-copy{display:none}.home-heading h1{line-height:1.25}.edition-line{margin-top:10px;margin-bottom:4px}.home-menu{gap:7px}.home-menu-minor{margin-top:0}.home-progress{font-size:9px}.home-footer{font-size:8px}}

/* Independent-play review: readable feedback, primary product name, scoped hints. */
.home-heading h1{font-size:clamp(62px,6.6vw,94px);letter-spacing:.045em;line-height:1.35;margin-top:18px;white-space:nowrap}
.home-heading .edition-line{font:23px/1.5 var(--serif);letter-spacing:6px;margin:7px 0 20px;color:var(--paper-dim)}
.home-copy{color:#bec8b8}.game-header-note{font-size:13px;letter-spacing:3px}
.level-subtitle,.status{font-size:13px;line-height:1.65;color:#d0d8c6}
.status{min-height:22px;letter-spacing:.1px}.game-status-area{min-height:22px}
.result-message p{font-size:12px;line-height:1.6;color:#42513e}
.utility-button{font-size:13px;color:#d7dcc8}.keyboard-note{color:#b9c5b1}
.hint-step p{font-size:14px;line-height:1.75;color:#42513e}
.hint-step .hint-route-context,.hint-scope-note{font:12px/1.7 var(--sans);color:#4e5b46;letter-spacing:0}
.hint-scope-note{margin:17px 0 8px}.hint-start-toggle{min-height:44px;padding:8px 14px;font-size:12px;letter-spacing:.5px}
.hint-start-panel{margin:12px 0 0;padding:10px;background:#f2ead8;border:1px solid #7d846954;text-align:center}
.hint-start-panel canvas{width:min(260px,100%);height:auto;display:block;margin:0 auto}
.hint-start-panel figcaption{font:12px/1.6 var(--sans);color:#46523f;margin-top:8px}
.hint-step .hint-route{font:13px/1.6 var(--sans);letter-spacing:0;color:#374530;word-break:normal}
.hint-route-groups{display:flex;flex-direction:column;gap:13px;margin:12px 0 0;padding:0;list-style:none}
.hint-route-group{border:1px solid #8e957660;padding:10px;background:#f6efdc65}
.hint-route-group h4,.hint-route-group-label,.hint-step .hint-route-group-title{font:12px/1.5 var(--sans);color:#526047;margin:0 0 8px;letter-spacing:.3px}
.hint-route-steps{display:flex;flex-wrap:wrap;gap:6px}
.hint-step-button{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;vertical-align:top;min-width:44px;min-height:48px;padding:5px 7px;margin:0 5px 5px 0;border:1px solid #9674558a;background:#f6ecd8;color:#794229;font:14px/1.5 var(--sans);cursor:pointer}
.hint-step-button[aria-pressed="true"]{color:#fff6df;background:#795039;border-color:#795039;box-shadow:inset 0 0 0 2px #efd5ab}
.hint-step .hint-route .hint-step-button span{display:inline;min-width:0;min-height:0;border:0;margin:0;letter-spacing:0;font-size:inherit}
.hint-step-button:focus-visible{outline:2px solid #674427;outline-offset:2px}
.hint-route-steps .hint-step-button{margin:0}.hint-route-clear{min-height:44px;font-size:12px;padding:8px 12px}
.hint-route-mark-status{font:12px/1.7 var(--sans);color:#4b573f;letter-spacing:0;margin-top:10px;min-height:21px}
.dialog-note{font-size:11px;color:#526047}.hint-dialog .dialog-footer{align-items:flex-start}
@media(max-width:760px){
 .home-heading h1{font-size:clamp(49px,14.5vw,66px);margin-top:12px}.home-heading .edition-line{font-size:21px;margin:5px 0 13px;letter-spacing:5px}
 .home-copy{font-size:12px}.game-wordmark{font-size:18px;letter-spacing:2px}.chapter-label{font-size:10px;letter-spacing:.4px}
 .level-subtitle,.status{font-size:12px;line-height:1.6}.status{min-height:20px}.game-status-area{min-height:20px}
 .utility-button{font-size:12px}.result-message p{font-size:12px;line-height:1.5}.result-actions .button{font-size:12px}
 .result{align-items:center;gap:8px}.result-message{min-width:0}.result-message h2{font-size:17px}
 .hint-step p{font-size:13px}.hint-dialog .dialog-note{font-size:11px;max-width:112px}.hint-dialog .dialog-footer>.button{font-size:12px;padding:9px 12px}
 .hint-route-group{padding:9px 8px}.hint-step-button{margin-right:4px;padding:5px 6px}.hint-start-panel canvas{max-width:230px}
}
@media(max-width:360px){
 .game-shell{padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));gap:6px}
 .level-heading h1{font-size:20px}.level-subtitle{font-size:12px}.game-brief{gap:0 9px}.counts{gap:9px}
 .result{padding:7px 9px;gap:6px}.result-message p{font-size:12px}.result-actions{flex-direction:column;gap:2px}.result-actions .button{min-height:44px;padding:5px 8px;font-size:11px}
 .hint-step{grid-template-columns:19px minmax(0,1fr);gap:7px}.hint-dialog .dialog-footer{flex-wrap:wrap}.hint-dialog .dialog-footer>.button{margin-left:auto}
}
@media(orientation:portrait) and (max-height:650px){.home-heading h1{margin-top:8px;font-size:49px}.home-heading .edition-line{margin:2px 0 8px;font-size:19px}.game-shell{gap:5px}.game-brief .level-heading h1{font-size:19px}}
@media(orientation:landscape) and (max-height:560px){.home-heading h1{font-size:52px;margin-top:7px}.home-heading .edition-line{font-size:18px;margin:3px 0 8px}.game-header-note{font-size:12px}.level-subtitle,.status{font-size:12px;line-height:1.5}.result-message p{font-size:12px}.utility-button{font-size:12px}.game-status-area{min-height:18px}}

/* R3: learned relationships remain visible after the chapter. */
#screen-chapter{align-items:start}#screen-chapter .interlude-card{max-width:940px;padding:26px 12px}.chapter-review{display:grid;gap:18px;margin-top:24px}.chapter-study{padding:20px;background:#e5ddc1;color:#283c35;border:1px solid #f4ecd0;text-align:left}.chapter-study h2{font:22px var(--serif);line-height:1.5;letter-spacing:1px;margin:0 0 15px}.study-frames{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.study-frames figure{margin:0;min-width:0}.study-frames canvas{display:block;width:100%;height:auto}.study-frames figcaption{font-size:13px;line-height:1.65;margin-top:9px}.study-note,.study-pending{font-size:13px;line-height:1.8;margin:12px 0 0;color:#435048}.review-legend{font-size:12px;line-height:1.8;color:#cbd3bf}.review-open{margin-top:16px;min-height:44px}.interlude-stats{font-size:12px}.chapter-study{animation:study-arrive .4s ease-out both}@keyframes study-arrive{from{opacity:.2;transform:translateY(9px)}to{opacity:1;transform:none}}.reduced-motion .chapter-study{animation:none}@media(prefers-reduced-motion:reduce){.chapter-study{animation:none}}@media(max-width:760px){#screen-chapter{padding:20px 14px}#screen-chapter .interlude-card{padding:14px 0}.chapter-study{padding:15px 12px}.chapter-study h2{font-size:20px}.study-frames{gap:8px}.study-frames figcaption{font-size:12px}.study-note,.study-pending{font-size:12px}.chapter-review{gap:14px}.interlude-stats{font-size:12px}}

#screen-chapter .interlude-mark{height:28px;margin:12px auto 6px}#screen-chapter .interlude-card h1{margin:16px 0}#screen-chapter .interlude-stats{margin-top:14px}
#screen-chapter .interlude-card h1{text-wrap:balance}@media(max-width:360px){#screen-chapter .interlude-card h1{font-size:24px;line-height:1.5;letter-spacing:1px}.study-frames{gap:6px}.chapter-study{padding:14px 10px}}

/* R4: show every omitted input and keep six-frame reviews readable on phones. */
.study-frames{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:22px 16px}
.study-frames canvas{max-width:280px;margin:0 auto}
.study-frames .study-caption{margin:0;font-size:14px;line-height:1.7}
.study-frames .study-transition{margin:7px 0 0;padding:8px 10px;background:#f5edd6;border-left:2px solid #987452;font:13px/1.75 var(--sans);color:#394c42;overflow-wrap:anywhere}
.hint-stage-list{list-style:none;margin:14px 0 0;padding:0;display:grid;gap:13px}
.hint-stage-list[hidden]{display:none}
.hint-goal-stage{padding:11px 12px;border-left:2px solid #9b7653;background:#e9dfc680;min-width:0}
.hint-goal-stage h4{margin:0 0 7px;font:14px/1.65 var(--sans);font-weight:600;color:#3d503e;overflow-wrap:anywhere}
.hint-step .hint-goal-stage p{margin:0}
.hint-goal-figure{margin:12px 0 0;min-width:0}
.hint-goal-board{display:block;width:100%;max-width:220px;height:auto;margin:0 auto}
.hint-goal-caption{margin:8px 0 0;font:12px/1.75 var(--sans);color:#465441;overflow-wrap:anywhere}
@media(max-width:760px){.study-frames{gap:22px 12px}.study-frames .study-caption{font-size:13px}.study-frames .study-transition{font-size:13px}.hint-goal-stage{padding:10px}.hint-goal-stage h4{font-size:13px}}

/* Keep a keyboard-accessible exit beside each optional hint expansion. */
.hint-dialog .hint-footer{position:sticky;bottom:-24px;z-index:2;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);align-items:stretch;gap:9px 12px;padding:12px 0 18px;margin-top:20px;background:var(--paper);box-shadow:0 -7px 12px var(--paper)}
.hint-dialog .hint-footer .dialog-note{grid-column:1/-1;max-width:none;margin:0}
.hint-dialog .hint-footer>.button{min-height:44px;min-width:0;margin:0;padding:9px 12px;letter-spacing:.2px;font-size:12px;white-space:normal}
@media(max-width:760px){.hint-dialog .hint-footer{bottom:-20px;gap:8px;padding-bottom:14px}}
