:root{--ink:#403c33;--muted:#80796b;--paper:#eee8dc;--card:#fbf8ef;--line:#d8d0bf;--accent:#856b45;--selected:#635440;--selected-text:#fff9e8;--shadow:rgba(65,51,32,.1)}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--paper);color:var(--ink);font-family:"Microsoft YaHei UI","PingFang SC",system-ui,sans-serif;transition:background .25s,color .25s}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:disabled{cursor:default;opacity:.45}a{color:inherit;text-underline-offset:4px}button:focus-visible,a:focus-visible,canvas:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:4px}button{color:var(--ink)}[hidden]{display:none!important}.skip{position:fixed;left:15px;top:-70px;z-index:30;background:var(--card);padding:12px}.skip:focus{top:12px}.game-header{display:flex;justify-content:space-between;align-items:center;gap:20px;max-width:1460px;margin:auto;padding:24px 36px;border-bottom:1px solid var(--line)}.back-link{font-size:12px;text-decoration:none;color:var(--muted)}.wordmark{font:600 12px/1.5 system-ui;letter-spacing:2px}.wordmark span{letter-spacing:1px;font-weight:400;margin-left:14px;color:var(--muted);font-size:11px}.edition{font-size:11px;color:var(--muted)}.game-shell{max-width:1460px;margin:auto;padding:30px 36px 0}.game-intro{margin:0 0 25px}.eyebrow{font-size:10px;font-weight:600;letter-spacing:2px;color:var(--accent)}h1{font:600 32px/1.35 Georgia,"Songti SC","Noto Serif SC",serif;margin:8px 0 10px}h2{font-size:21px;line-height:1.6;font-weight:600}.game-intro>p:last-child{font-size:13px;color:var(--muted);line-height:1.8;margin:0}.game-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:0 0 22px}.game-tabs button{display:flex;align-items:center;gap:13px;text-align:left;border:1px solid var(--line);border-radius:8px;background:var(--card);padding:17px 18px;min-width:0;transition:transform .15s,background .15s}.game-tabs button:hover{transform:translateY(-2px)}.game-tabs button[aria-selected=true]{background:var(--selected);color:var(--selected-text);border-color:var(--selected)}.game-tabs b{font-size:16px;display:block;margin:0 0 6px;font-weight:600}.game-tabs small{font-size:10px;opacity:.7;line-height:1.6;display:block}.tab-number{font:13px Georgia;opacity:.55}.tab-arrow{margin-left:auto;opacity:.55}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 276px;gap:24px;align-items:start}.game-view{border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--card);box-shadow:0 12px 38px var(--shadow);outline:none}.game-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 17px;border-bottom:1px solid var(--line)}.game-toolbar>div:first-child{display:flex;align-items:center;gap:12px}.chapter{font-size:10px;letter-spacing:1px;padding:4px 8px;background:var(--paper);border-radius:3px;color:var(--muted)}#game-title{font-size:13px;font-weight:600}.view-tools{display:flex;gap:8px}.view-tools button{font-size:10px;background:transparent;border:0;color:var(--muted);padding:5px}.game-stage{position:relative;aspect-ratio:8/5;background:#d1bc95;overflow:hidden}#game-mount,#game-mount>div,#game-mount canvas{position:absolute;inset:0;width:100%;height:100%;display:block}#game-mount canvas{touch-action:manipulation;outline:none}.pause-screen,.load-screen{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;background:#172229b8;color:#fff;gap:13px;z-index:3;backdrop-filter:blur(4px)}.pause-screen b{font:24px Georgia,"Songti SC",serif}.pause-screen span,.load-screen{font-size:12px}.load-screen.error{padding:30px;text-align:center;line-height:2}.game-message{padding:15px 18px;font-size:13px;line-height:1.85;min-height:66px;border-top:1px solid var(--line);background:var(--card)}.game-actions{padding:0 17px 14px;display:flex;flex-wrap:wrap;gap:7px}.game-actions button,.save-box button,.touch-action-keys button{border:1px solid var(--line);background:var(--paper);border-radius:5px;padding:9px 11px;font-size:11px;line-height:1.4}.game-actions .primary{background:var(--selected);color:var(--selected-text);border-color:var(--selected)}.control-help{font-size:10px;line-height:1.8;color:var(--muted);padding:0 17px 14px;margin:0}.game-notebook{background:var(--card);border:1px solid var(--line);border-radius:9px;padding:21px 22px}.notebook-heading{font-size:10px;color:var(--accent);letter-spacing:1px;display:flex;align-items:center;justify-content:space-between}.notebook-dot{width:5px;height:5px;border-radius:50%;background:var(--accent)}.game-notebook h2{font:600 20px/1.65 Georgia,"Songti SC",serif;margin:13px 0 24px}.game-notebook h3{font-size:11px;font-weight:600;margin:20px 0 10px}.pocket{border-top:1px solid var(--line)}.pocket ul{list-style:none;padding:0;display:flex;flex-wrap:wrap;gap:6px;margin:0}.pocket li{font-size:10px;line-height:1.7;padding:5px 7px;background:var(--paper);border-radius:3px}.journal ol{padding-left:15px;font-size:11px;line-height:1.85;color:var(--muted);margin:0}.journal li{padding:0 0 8px 1px}.save-box{border-top:1px solid var(--line);margin-top:15px;padding-top:15px}#save-status{font-size:9px;color:var(--muted);display:block;line-height:1.8}.save-box>div{display:flex;gap:8px;margin-top:10px}.save-box button{font-size:10px;padding:7px 9px;background:transparent}.touch-controls{display:none;padding:0 17px 15px;gap:18px;align-items:center}.dpad{display:grid;grid-template-columns:repeat(3,32px);grid-template-rows:repeat(2,29px);gap:3px}.dpad button{border:1px solid var(--line);background:var(--paper);border-radius:4px;color:var(--ink);touch-action:none;font-size:12px}.dpad button:first-child{grid-column:2}.dpad button:nth-child(2){grid-column:1;grid-row:2}.dpad button:nth-child(3){grid-column:2;grid-row:2}.dpad button:nth-child(4){grid-column:3;grid-row:2}.touch-action-keys{display:flex;gap:5px;flex-wrap:wrap}.touch-action-keys button{touch-action:none;padding:9px 8px;font-size:10px}.design-notes{margin:32px 0 45px;border:1px solid var(--line);border-radius:8px;padding:18px 22px;background:var(--card)}.design-notes summary{font-size:12px;cursor:pointer;color:var(--muted);line-height:1.8}.design-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:26px;margin-top:25px}.design-grid article>span{font-size:10px;color:var(--accent)}.design-grid h3{font:600 19px/1.6 Georgia,"Songti SC",serif;margin:10px 0}.design-grid p{font-size:12px;line-height:1.95;color:var(--muted)}.design-grid b{font-size:10px;font-weight:500;line-height:1.8;display:block}.prototype-note{font-size:10px;color:var(--muted);line-height:1.9;margin:20px 0 0}.next-worlds{margin:40px 0 35px}.next-worlds h2{font:600 25px/1.6 Georgia,"Songti SC",serif;margin:10px 0 20px}.next-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px}.next-grid article{border:1px solid var(--line);border-radius:7px;padding:18px 20px;background:var(--card)}.next-grid span{font-size:10px;color:var(--accent);display:block;margin-bottom:8px}.next-grid b{font-size:14px;font-weight:600}.next-grid p{font-size:11px;color:var(--muted);line-height:1.9;margin:9px 0 0}.game-footer{max-width:1460px;display:flex;justify-content:space-between;gap:20px;margin:0 auto;padding:25px 36px;font-size:10px;color:var(--muted);border-top:1px solid var(--line)}body[data-game=islands]{--ink:#d5e8e6;--muted:#85a7ab;--paper:#102930;--card:#19363d;--line:#325059;--accent:#b4d8c9;--selected:#badcc9;--selected-text:#163731;--shadow:rgba(0,0,0,.2)}body[data-game=movers]{--ink:#2a3542;--muted:#67717a;--paper:#f2d897;--card:#fff8e5;--line:#d5b975;--accent:#d35d3d;--selected:#d75e3f;--selected-text:#fff7dc;--shadow:rgba(112,59,17,.1)}body[data-game=movers] .game-view{border:2px solid #344354;border-radius:9px;box-shadow:5px 6px 0 #34435420}body[data-game=movers] .game-tabs [aria-selected=true]{border:2px solid #344354}body[data-game=movers] h1{font-family:"Microsoft YaHei UI",system-ui,sans-serif;font-weight:800}body[data-game=islands] .game-stage{background:#75a9af}.game-view:fullscreen{display:flex;flex-direction:column;background:var(--card)}.game-view:fullscreen .game-stage{flex:1;aspect-ratio:auto;min-height:0}.game-view:fullscreen .game-toolbar{flex-shrink:0}.game-view:fullscreen .game-message{flex-shrink:0;min-height:0;padding:10px 17px}.game-view:fullscreen .control-help{display:none}body.embedded .game-header,body.embedded .game-intro,body.embedded .design-notes,body.embedded .next-worlds,body.embedded .game-footer{display:none}body.embedded .game-shell{padding:16px}body.embedded .game-tabs{margin-bottom:15px}body.embedded .game-tabs button{padding:12px 15px}body.embedded .game-layout{gap:18px}
@media(max-width:1100px){.game-layout{grid-template-columns:minmax(0,1fr) 230px;gap:16px}.game-notebook{padding:18px}.game-shell{padding:25px}.game-header{padding:20px 25px}.game-notebook h2{font-size:18px}.game-tabs b{font-size:14px}.game-tabs button{padding:14px 13px;gap:9px}.game-tabs small{font-size:9px}.game-footer{padding:22px 25px}}
@media(max-width:820px){.game-layout{grid-template-columns:1fr}.game-notebook{display:grid;grid-template-columns:1fr 1fr;gap:0 22px}.notebook-heading,.game-notebook>h2{grid-column:1/-1}.game-notebook>h2{margin:10px 0 12px}.pocket{border:0}.journal h3{margin-top:20px}.save-box{grid-column:1/-1;margin-top:8px;display:flex;justify-content:space-between;align-items:center;gap:10px}.save-box>div{margin:0;flex-shrink:0}.game-tabs b{font-size:13px}.tab-number,.tab-arrow{display:none}.design-grid{gap:18px}body.embedded .game-notebook{padding:13px 16px}body.embedded .game-notebook h2{font-size:16px}body.embedded .game-notebook .journal{display:none}body.embedded .game-notebook .pocket{grid-column:1/-1}body.embedded .game-notebook h3{margin:6px 0}body.embedded .save-box{padding-top:10px}}
@media(max-width:600px){.game-header{padding:17px 16px;gap:10px}.wordmark{font-size:10px;letter-spacing:1px}.wordmark span{display:none}.edition{font-size:9px}.back-link{font-size:10px}.game-shell{padding:22px 14px 0}.game-intro{margin-bottom:20px}h1{font-size:27px}.game-intro>p:last-child{font-size:12px}.game-tabs{gap:6px;margin-bottom:15px}.game-tabs button{padding:13px 9px}.game-tabs b{font-size:12px;margin-bottom:5px}.game-tabs small{font-size:8px;line-height:1.8}.game-toolbar{padding:10px 12px}.chapter{font-size:8px;padding:3px 6px}#game-title{font-size:11px}.game-toolbar>div:first-child{gap:7px}.view-tools button{font-size:9px;padding:4px}.game-message{font-size:11px;padding:12px;min-height:60px}.game-actions{padding:0 12px 12px;gap:6px}.game-actions button{font-size:10px;padding:8px 9px}.control-help{font-size:9px;padding:0 12px 13px}.touch-controls{display:flex;padding:0 12px 12px;gap:10px}.game-notebook{padding:17px;gap:0 16px}.game-notebook h2{font-size:17px}.journal ol{font-size:10px}.pocket li{font-size:9px}.design-notes{padding:15px 16px;margin-top:24px}.design-grid{grid-template-columns:1fr;gap:19px}.design-grid h3{font-size:18px}.next-worlds h2{font-size:22px}.next-grid{grid-template-columns:1fr 1fr;gap:9px}.next-grid article{padding:14px}.next-grid b{font-size:12px}.next-grid p{font-size:10px}.game-footer{padding:20px 16px;font-size:9px;align-items:center}body.embedded .game-shell{padding:10px}body.embedded .game-tabs button{padding:11px 8px}.game-view:fullscreen .game-actions{padding-bottom:8px}.game-view:fullscreen .touch-controls{padding-bottom:8px}}
.game-view:fullscreen .game-stage{flex:1 1 0;min-height:0;aspect-ratio:auto;container-type:size}
.game-view:fullscreen #game-mount{inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);width:min(100cqw,160cqh);height:min(62.5cqw,100cqh)}
.game-view:fullscreen .game-toolbar,.game-view:fullscreen .game-message,.game-view:fullscreen .game-actions,.game-view:fullscreen .touch-controls{flex-shrink:0}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}body,.game-tabs button{transition:none}}
/* Extension V2: the palette follows each world's visual language. */
body[data-game=detective]{--ink:#e5e3df;--muted:#aaa9a5;--paper:#111317;--card:#1b1e24;--line:#42464d;--accent:#d8b67d;--selected:#c9b28c;--selected-text:#181b20;--shadow:rgba(0,0,0,.25)}
body[data-game=wuxia]{--ink:#293b36;--muted:#687269;--paper:#e7e3d5;--card:#f7f3e9;--line:#c4c7b7;--accent:#995b44;--selected:#445b4d;--selected-text:#f7f2df;--shadow:rgba(40,56,43,.09)}
body[data-game=ecology]{--ink:#2b4338;--muted:#67766b;--paper:#e0e5d9;--card:#f2f5e9;--line:#bdcbb9;--accent:#587458;--selected:#496451;--selected-text:#f4f4e6;--shadow:rgba(41,67,47,.09)}
body[data-game=wasteland]{--ink:#e7dcc8;--muted:#b0a697;--paper:#252527;--card:#333235;--line:#555149;--accent:#dfa76c;--selected:#ba8657;--selected-text:#201e1c;--shadow:rgba(0,0,0,.3)}
body[data-game=dream]{--ink:#e7def3;--muted:#b2a3c7;--paper:#201b36;--card:#2c2645;--line:#514563;--accent:#d6bbd5;--selected:#c3a6ce;--selected-text:#271d3b;--shadow:rgba(7,5,30,.24)}
body[data-game=arcade]{--ink:#e0eaf3;--muted:#8fa9bb;--paper:#111b2d;--card:#19263b;--line:#34495d;--accent:#6cddc9;--selected:#5ed3c1;--selected-text:#102438;--shadow:rgba(2,10,26,.3)}
.game-tabs{gap:8px;margin-bottom:18px}.game-tabs button{padding:10px 13px;gap:10px}.game-tabs b{font-size:14px;margin-bottom:4px}.game-tabs small{font-size:9px}.game-intro{margin-bottom:20px}.game-intro h1{font-size:30px}.next-grid a{display:inline-block;font-size:11px;color:var(--accent);margin-top:4px}
@media(max-width:600px){.game-tabs{gap:5px}.game-tabs button{padding:9px 7px}.game-tabs b{font-size:11px}.game-tabs small{font-size:8px}.game-intro h1{font-size:24px}.game-intro>p:last-child{font-size:11px}.game-toolbar>div:first-child{flex-wrap:wrap;gap:3px 7px}.chapter{font-size:8px}body.embedded .game-tabs button{padding:9px 7px}.next-grid a{font-size:10px}}
