:root{color-scheme:dark;--ink:#dcd7eb;--dim:#8d85a5;--violet:#c2a1ff}*{box-sizing:border-box}body{margin:0;background:#0d0c14;color:var(--ink);font:16px/1.5 'Microsoft YaHei',system-ui,sans-serif}main{max-width:1330px;margin:auto;padding:26px 40px}header{display:flex;align-items:center;gap:25px;margin-bottom:24px}.brand{display:flex;gap:12px;align-items:center;text-decoration:none;color:#f3edf9;font-size:23px;font-weight:800;letter-spacing:3px}.brand small{display:block;font:10px/1.6 monospace;letter-spacing:2px;color:#998aaa}.emblem{font-size:39px;color:var(--violet)}.edition{margin-left:auto;color:#8e859f;font-size:14px}.edition span{border:1px solid #383044;padding:3px 7px;margin-left:10px}button{font:inherit;cursor:pointer;color:inherit;border:1px solid #393045;background:#1a1624;border-radius:5px;padding:9px 14px}button:hover{background:#2d2341;border-color:#a680e7}button:focus-visible,a:focus-visible{outline:2px solid #d5b0ff;outline-offset:4px}.cabinet{border:1px solid #483759;box-shadow:0 15px 65px #0008;border-radius:9px;overflow:hidden}.topline{background:#1b1626;display:flex;justify-content:space-between;align-items:center;padding:10px 18px;font:12px monospace;letter-spacing:1.5px;color:#b6a8cc}.topline i{display:inline-block;width:6px;height:6px;background:#d3b3ff;margin-right:8px}.topline button{border:0;padding:0;background:none;font-size:13px}.screen{position:relative;aspect-ratio:16/9;overflow:hidden;background:#171026}canvas{display:block;width:100%;height:100%;image-rendering:pixelated;outline:0}#overlay{position:absolute;inset:0;padding:9% 7%;background:linear-gradient(90deg,#0e0b22f2,#140b2670 65%,#140b2610);display:flex;align-items:flex-start;flex-direction:column;justify-content:center}#overlay .eyebrow{color:#c7a3fe;font:11px monospace;letter-spacing:2px}h1{font-size:clamp(25px,4.2vw,58px);line-height:1.23;margin:20px 0;font-weight:900;letter-spacing:2px}h1 em{font-style:normal;color:#cab0ff}#overlay p{color:#b7aecb;font-size:15px;margin:0 0 25px}#start,#resume{color:#21142e;background:#d0adff;font-weight:800;border:1px solid #e5d1ff;padding:13px 23px;min-width:180px;text-align:left}#start span{float:right}#load{font-size:12px;color:#aaa0bf;margin-top:12px}#paused{position:absolute;inset:0;background:#100e22dc;text-align:center;padding-top:16%;backdrop-filter:blur(4px)}[hidden]{display:none!important}.ticker{display:flex;justify-content:space-between;gap:10px;padding:11px 17px;background:#191421;font-size:12px;color:#afa0c0}.ticker span:first-child{color:#c6a1f3}.controls{display:grid;grid-template-columns:0.8fr 1fr 1fr 1fr;gap:12px;margin:20px 0}.movement,.spell{border:1px solid #322a40;border-radius:6px;background:#16131e;min-height:110px;padding:16px}.label{font-size:12px;color:#a091b7;letter-spacing:1px}.movement>div{display:flex;gap:5px;align-items:center;margin-top:9px;font-size:12px;color:#a69bb6}kbd{display:inline-block;background:#292131;border:1px solid #584665;border-bottom-width:3px;border-radius:3px;min-width:24px;padding:1px 5px;text-align:center;font:12px monospace;color:#dfc9f9}.spell{display:flex;align-items:center;gap:13px;text-align:left;position:relative}.spell-icon{font-size:35px;color:#d2a4ff}.binding{color:#bd82ff}.hand{color:#e6b47a}.spell h3{font-size:17px;margin:4px 0}.spell p{font-size:12px;margin:0;color:#90849f}.cool{position:absolute;right:9px;top:8px;font-size:10px;color:#887498}button.spell:active{transform:translateY(2px)}footer{display:flex;justify-content:space-between;gap:12px;color:#756a86;font-size:12px}footer button{font-size:12px;margin-left:15px;padding:4px 8px;background:transparent;border:0}.touch{display:none}@media(max-width:800px){main{padding:15px 12px}.edition{display:none}header{gap:10px;justify-content:space-between}.brand{font-size:20px}header button{font-size:12px}.controls{grid-template-columns:repeat(3,1fr);gap:6px}.movement{display:none}.spell{padding:14px 8px;min-height:100px;gap:7px}.spell-icon{display:none}.spell p{font-size:11px}.spell h3{font-size:16px}.label{font-size:10px}.touch{display:flex;gap:12px;margin:12px 0}.touch button{min-width:65px;touch-action:none}footer{flex-direction:column}.ticker{font-size:10px}.ticker span:first-child{display:none}#overlay{padding:5%}#overlay .eyebrow{display:none}h1{font-size:28px;margin:8px 0}#overlay p{font-size:12px;margin:0 0 10px}#start{padding:8px 14px}#load{margin-top:5px}.topline{font-size:10px}.cool{font-size:9px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}
.credits{margin-top:14px;color:#81748f;font-size:12px;max-width:900px}.credits summary{cursor:pointer;width:max-content}.credits p{line-height:1.8}.credits a{color:#b59bcf}button:disabled{cursor:wait;opacity:.55}@media(max-width:550px){#overlay p{display:none}#overlay h1{font-size:23px;line-height:1.2;margin:5px 0 12px}#load{font-size:10px}#start{min-width:150px;font-size:13px;padding:7px 12px}.ticker{font-size:9px}}

#wardrobe,#binding-variant,#binding-vine{position:absolute;z-index:2;transform:translate(-50%,-50%);white-space:nowrap;font-size:14px;padding:8px 12px;background:#302045ee;border-color:#ca9cff;box-shadow:0 3px 16px #0008;touch-action:manipulation}canvas{touch-action:manipulation}#melee{touch-action:manipulation}

.language-picker{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 14px;font-size:12px}.language-picker>span{color:#b7aecb;margin-right:4px}.language-picker button{padding:5px 12px;min-height:32px}.language-picker button[aria-pressed="true"]{background:#49315f;border-color:#d0adff;color:#f5eaff;box-shadow:inset 0 0 0 1px #d0adff}html[lang="en"] h1{font-size:clamp(24px,3.6vw,48px);letter-spacing:0}html[lang="en"] .brand{letter-spacing:0}.controls>*{min-width:0}.ticker #hint{flex:1;text-align:center}#overlay{padding-top:3%;padding-bottom:3%}@media(max-width:800px){html[lang="en"] h1{font-size:27px}.language-picker{gap:6px;margin-bottom:8px}.language-picker button{padding:3px 9px;min-height:28px}}@media(max-width:550px){.language-picker{gap:5px;margin-bottom:6px}.language-picker>span{display:none}.language-picker button{font-size:11px;min-height:25px;padding:2px 8px}html[lang="en"] #overlay h1{font-size:21px}#overlay h1{margin-bottom:7px}#load{max-width:100%;line-height:1.2}.brand{font-size:17px}.topline{letter-spacing:0;gap:8px}.ticker span:last-child{display:none}}

#feather-cursor{position:absolute;z-index:4;pointer-events:none;width:36px;height:44px;--feather-facing:1;transform:translate(-50%,-50%) scaleX(var(--feather-facing));filter:drop-shadow(0 1px 2px #130d28);}
#feather-cursor svg{width:100%;height:100%;overflow:visible;transform-box:view-box;transform-origin:18px 22px;transform:translateY(var(--feather-lift,0px)) rotate(var(--feather-angle,0deg))}
/* Dungeon scenes: three cells per viewport; overflow only for a fourth capture. */
#dungeon-open,#dungeon-back{position:absolute;z-index:6;background:#251c30ed;border-color:#b49867;color:#f6dfaa;box-shadow:0 3px 12px #0008;font-size:14px}#dungeon-open{right:14px;bottom:14px}#dungeon-back{left:14px;top:12px}#dungeon-gallery{position:absolute;inset:0;z-index:5;display:flex;flex-direction:column;padding:12px 24px 8px;background:linear-gradient(#110f1bef,#1d1626e8)}.dungeon-title{min-height:65px;display:flex;flex-direction:column;justify-content:center;align-items:center}.dungeon-title h2{font-size:22px;letter-spacing:3px;color:#efd7a9;margin:0}.dungeon-title span{font-size:12px;color:#baabca}#dungeon-viewport{min-height:0;flex:1;overflow:hidden;touch-action:pan-y}#dungeon-viewport.can-scroll{overflow-x:auto;touch-action:pan-x;cursor:grab;scrollbar-width:thin;scrollbar-color:#917195 #1d1626;overscroll-behavior-x:contain}#dungeon-cells{display:flex;gap:12px;height:100%;width:100%}.prison-card{flex:0 0 calc((100% - 24px)/3);min-width:0;display:flex;flex-direction:column;align-items:center;padding:8px 8px 10px;overflow:hidden;border:2px solid #625264;border-radius:3px;background:#302936;user-select:none;touch-action:pan-x}.prison-card:hover{background:#3b2d43;border-color:#d0b488}.cell-number{font:11px monospace;color:#c3ac89;letter-spacing:1px}.cell-room{position:relative;min-height:0;flex:1;width:100%;margin:7px 0;background:repeating-linear-gradient(0deg,transparent 0 25px,#51405238 25px 27px),linear-gradient(#100e1c,#211b2c);border:4px solid #514655;box-shadow:inset 0 0 25px #0009}.cell-room canvas{width:100%;height:100%;object-fit:contain;image-rendering:pixelated}.cell-bars{position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(90deg,transparent 0 calc(20% - 5px),#79717d 0 calc(20% - 3px),#24212c 0 20%);opacity:.65;border-top:5px solid #625767;border-bottom:5px solid #625767}.prison-card strong{font-size:16px;color:#efddba}.cell-caption{font-size:11px;color:#bba6cb}.empty-cell{opacity:.5}.empty-cell .cell-room{min-height:40px}.dungeon-navigation{display:flex;align-items:center;justify-content:center;gap:18px;min-height:34px;font-size:12px;color:#beadc7}.dungeon-navigation button{font-size:11px;padding:3px 14px}.dungeon-navigation button:disabled{cursor:default}.dungeon-mode #paused{z-index:7}.dungeon-mode #wardrobe,.dungeon-mode #binding-variant,.dungeon-mode #binding-vine{font-size:12px;padding:5px 10px}@media(max-width:800px){#dungeon-gallery{padding:5px 10px}.dungeon-title{min-height:47px}.dungeon-title h2{font-size:16px;letter-spacing:1px}.dungeon-title span,.dungeon-navigation{font-size:10px}#dungeon-cells{gap:6px}.prison-card{flex-basis:calc((100% - 12px)/3);padding:3px 3px 5px}.cell-room{margin:3px 0;border-width:2px}.cell-number,.cell-caption{font-size:9px}.prison-card strong{font-size:12px}#dungeon-back,#dungeon-open{font-size:11px;padding:5px 8px}#dungeon-back{left:7px;top:7px}.dungeon-navigation{gap:6px;min-height:22px}.dungeon-navigation button{padding:1px 9px}.dungeon-mode #wardrobe,.dungeon-mode #binding-variant,.dungeon-mode #binding-vine{font-size:10px;padding:2px 6px}}@media(max-width:550px){.cell-caption{display:none}.dungeon-title h2{font-size:13px}.dungeon-title{min-height:40px}.dungeon-navigation{font-size:9px}.prison-card strong{font-size:11px}}
/* In-screen currency and narrow, tall prison controls. */
.screen{container-type:inline-size}
#laughter-bank{position:absolute;z-index:8;right:2.3%;top:2.2%;height:7%;display:flex;align-items:center;gap:12px;min-width:13%;padding:0 1%;border:1px solid #ad8651;background:#281f29ed;border-radius:4px;color:#ebce94;font-size:clamp(9px,1.2cqw,14px);white-space:nowrap;cursor:pointer}
#laughter-value{font-size:clamp(12px,1.8cqw,22px);font-variant-numeric:tabular-nums;color:#ffe8b8}
#dungeon-back{left:2.3%;top:2.2%;font-size:clamp(8px,1.1cqw,14px);padding:.5% .8%}
#prison-controls{position:absolute;z-index:3;left:2.3%;top:23%;bottom:10%;width:13%;display:flex;flex-direction:column;padding:1%;background:#191420e8;border:1px solid #6f5578;border-radius:5px}
#prison-controls h2{font-size:clamp(9px,1.25cqw,16px);line-height:1.25;margin:0 0 13%;color:#e0c0f4;text-align:center;overflow-wrap:anywhere}
.binding-options{display:flex;flex:1;min-height:0;flex-direction:column;gap:9%}
.binding-options button{flex:1;min-height:0;text-align:center;padding:3% 1%;font-size:clamp(9px,1.35cqw,17px);overflow-wrap:anywhere}
.binding-options button[aria-pressed="true"]{border-color:#e0b888;background:#583c50;color:#fff0cb;box-shadow:inset 3px 0 #ffdca2}
#dungeon-wardrobe{margin-top:15%;width:100%;font-size:clamp(7px,1cqw,12px);line-height:1.3;padding:7% 1%;color:#d7c3eb;overflow-wrap:anywhere}
#prison-controls button:disabled{cursor:default}
#prison-break{position:absolute;z-index:3;right:3%;top:23%;bottom:10%;width:4%;display:flex;flex-direction:column;align-items:center;gap:3%;color:#ded0e4;font-size:clamp(8px,1.2cqw,14px);font-variant-numeric:tabular-nums;pointer-events:none}
#prison-break-label{width:180%;text-align:center;line-height:1.25;overflow-wrap:anywhere}
#prison-break-meter{position:relative;flex:1;min-height:0;width:50%;background:#100d19e8;border:1px solid #8b7895;box-shadow:0 0 0 3px #1c1522a0;overflow:hidden}
#prison-break-fill{position:absolute;bottom:0;left:0;right:0;height:0;background:#52c878;box-shadow:inset 2px 0 #ffffff22}
@media(max-width:800px){#laughter-bank{gap:7px}.binding-options{gap:7%}}
@media(max-width:550px){.brand small{display:none}.brand{font-size:14px;gap:5px;letter-spacing:0}.emblem{font-size:25px}header #sound{padding:5px;font-size:10px}html[lang="en"] .brand{font-size:11px}#laughter-bank{gap:5px}#prison-controls{padding:.7%;width:14%}#prison-controls h2{margin-bottom:9%}.binding-options{gap:5%}#prison-break-meter{box-shadow:none}}

/* Accessible modal shop; icons are drawn at native 48px pixel resolution. */
#magic-available{position:absolute;z-index:8;right:2.3%;top:10%;color:#ffe5a4;font-size:clamp(8px,1.15cqw,14px);line-height:1.3;text-shadow:0 1px 3px #000,0 0 6px #000;pointer-events:none;animation:magic-float 2s ease-in-out infinite}
#shop-guide-arrow{position:absolute;z-index:9;right:18%;top:7%;color:#ffe2a1;font-size:clamp(20px,3cqw,38px);line-height:1;text-shadow:0 2px 4px #000;pointer-events:none;animation:magic-arrow 1s ease-in-out infinite}
#laughter-bank.shop-invitation{border-color:#ffe2a1;box-shadow:0 0 0 2px #edc37166,0 0 18px #f7cf7444}
#magic-shop{width:min(680px,92vw);max-height:90vh;overflow:auto;padding:24px;background:#191420;color:#eee4f4;border:2px solid #ac8cba;border-radius:8px;box-shadow:0 18px 80px #000a;font:15px/1.5 system-ui}
#magic-shop::backdrop{background:#090710c9}
.shop-top{display:flex;justify-content:space-between;gap:20px;align-items:center}.shop-top h2{font-size:24px;margin:0;color:#f3d9a6}.shop-top button{padding:6px 16px}
#shop-balance{color:#e9c88c;font-variant-numeric:tabular-nums;margin:10px 0 18px}
#shop-guide-text{padding:9px 12px;background:#493827;border:1px solid #c49c56;border-radius:4px;color:#ffe9b7;font-size:14px}
.shop-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.shop-item{min-width:0;display:flex;flex-direction:column;align-items:center;text-align:center;border:1px solid #5b4967;background:#241c30;border-radius:5px;padding:16px 12px}
.shop-item h3{margin:0 0 14px;font-size:18px;color:#e8d2f5}.shop-item canvas{width:144px;height:144px;max-width:100%;aspect-ratio:1;image-rendering:pixelated;border:2px solid #6c547b;box-shadow:5px 5px #100e18}
.shop-item button{margin-top:18px;width:144px;max-width:100%;font-weight:700;font-variant-numeric:tabular-nums;color:#ffe2a4;border-color:#c0a064;background:#473724}
.shop-item button.unaffordable{color:#ffaaa8;background:#442026;border-color:#b85057;opacity:1;cursor:default}
.shop-item p{color:#baabc8;font-size:12px;line-height:1.5;margin:12px 0 0}
.shop-item.owned{filter:grayscale(1);opacity:.65}.shop-item.owned button{cursor:default;opacity:1}
.shop-item.tutorial-highlight{border:2px solid #ffdc8a;box-shadow:0 0 0 3px #f9d57a2b,0 0 22px #f3be5b26}
@keyframes magic-float{50%{transform:translateY(-3px)}}@keyframes magic-arrow{50%{transform:translate(4px,-4px)}}
@media(max-width:550px){#magic-shop{padding:15px}.shop-top h2{font-size:20px}.shop-top button{font-size:12px}.shop-items{gap:10px}.shop-item{padding:12px 7px}.shop-item h3{font-size:14px}.shop-item canvas{width:96px;height:96px}.shop-item button{font-size:12px;padding:7px 4px}.shop-item p{font-size:11px}#shop-guide-text{font-size:12px}}
@media(prefers-reduced-motion:reduce){#magic-available,#shop-guide-arrow{animation:none}}

.start-actions{display:flex;align-items:stretch;gap:12px;flex-wrap:wrap}#new-game{font-weight:700;min-width:135px;border-color:#9578af;background:#292036;color:#e2c7f6;padding:10px 18px}#new-game:hover{background:#40304f}#new-game-note{color:#b4a5c3;font-size:11px;line-height:1.35;max-width:440px;margin-top:9px}#new-game:disabled{cursor:wait}
@media(max-width:550px){.start-actions{gap:8px}#new-game{min-width:110px;padding:6px 10px;font-size:12px}#new-game-note{font-size:9px;margin-top:5px;max-width:94%}#overlay #load{margin-top:4px}}
/* First-time guidance freezes play and leaves only the highlighted target interactive. */
#onboarding-shade{position:absolute;inset:0;z-index:30;background:#080610c9;cursor:default}
.screen .onboarding-target{z-index:32!important;overflow:visible;color:#fff1b2!important;background:#684720!important;border:2px solid #ffe08a!important;box-shadow:0 0 0 4px #f2bb4b66,0 0 24px 6px #f2ba4c99!important}
.onboarding-target::before{content:"";position:absolute;width:5px;height:5px;left:-10px;top:-11px;background:#fff3b5;box-shadow:19px -4px #ffe196,54px 0 #ffc651,90px -3px #fff3b5,114px 15px #ffcf69,91px 47px #ffcf69,29px 48px #fff0a6,-3px 27px #ffd478;animation:guide-pixels .85s steps(2,end) infinite;pointer-events:none}
.onboarding-target::after{content:"";position:absolute;inset:-7px;border:2px dashed #ffe4a4;animation:guide-border 1.1s steps(2,end) infinite;pointer-events:none}
#onboarding-message{position:absolute;z-index:31;right:3%;width:43%;color:#ffe59c;pointer-events:none;font-size:clamp(11px,1.7cqw,21px);font-weight:700;line-height:1.55;text-shadow:0 2px #382117}
#onboarding-message p{margin:0;padding:4% 5%;background:#2a1d1ce8;border:2px solid #c99a48;box-shadow:4px 4px #0a0816;animation:guide-copy-float 2s ease-in-out infinite}
#onboarding-message svg{position:absolute;right:6%;width:clamp(48px,9cqw,112px);height:auto;image-rendering:pixelated;filter:drop-shadow(3px 3px #382019)}
#onboarding-message[data-guide="shop"]{top:21%}#onboarding-message[data-guide="shop"] svg{bottom:113%;transform:rotate(-45deg);animation:guide-shop-arrow .8s steps(4,end) infinite}
#onboarding-message[data-guide="dungeon"]{bottom:23%}#onboarding-message[data-guide="dungeon"] svg{top:115%;transform:rotate(45deg);animation:guide-dungeon-arrow .8s steps(4,end) infinite}
#magic-unlocked{width:min(470px,92vw);max-height:92vh;overflow:auto;border:2px solid #efc16c;background:#191326;color:#ffe1a2;text-align:center;border-radius:7px;padding:20px;box-shadow:0 0 50px #0009}
#magic-unlocked::backdrop{background:#100c1bd9}#magic-unlocked h2{font-size:23px;margin:0 0 12px}#unlock-preview{width:min(100%,360px);height:auto;aspect-ratio:6/5;margin:0 auto;border:2px solid #5e4780;image-rendering:pixelated}#unlock-message{font-size:18px;font-weight:700;color:#ffe08b;line-height:1.5;margin:14px 0}#unlock-close{background:#674c23;border-color:#f6d480;color:#fff0b6;font-weight:700;min-width:130px}
@keyframes guide-shop-arrow{50%{transform:translate(7px,-7px) rotate(-45deg)}}@keyframes guide-dungeon-arrow{50%{transform:translate(7px,7px) rotate(45deg)}}@keyframes guide-pixels{50%{opacity:.35;transform:translateY(-4px)}}@keyframes guide-border{50%{opacity:.4}}
@media(max-width:550px){#overlay p{display:block;font-size:10px;line-height:1.25;margin:2px 0 5px}#overlay h1,html[lang="en"] #overlay h1{font-size:18px;margin:3px 0 5px}#onboarding-message{width:52%}#magic-unlocked{padding:14px}#magic-unlocked h2{font-size:19px}#unlock-message{font-size:15px}#unlock-preview{max-height:45vh;width:auto;max-width:100%}.onboarding-target::before{box-shadow:19px -4px #ffe196,54px 0 #ffc651,65px 24px #fff3b5,29px 27px #fff0a6,-3px 17px #ffd478;width:3px;height:3px}}
@keyframes guide-copy-float{50%{transform:translateY(-3px)}}
@media(prefers-reduced-motion:reduce){.onboarding-target::before,.onboarding-target::after,#onboarding-message svg,#onboarding-message p{animation:none!important}}
