@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800;900&family=DM+Sans:wght@400;500;600;700&display=swap');
*{box-sizing:border-box}body{margin:0;background:#0c141b;color:#f8e9c8;font-family:'DM Sans',sans-serif;min-height:100vh;display:grid;place-items:center}main{width:min(1600px,100%);padding:0 34px}header{height:90px;display:flex;align-items:center;justify-content:space-between;gap:20px}.brand{font:900 27px 'Barlow Condensed',sans-serif;color:#e9ba69;text-decoration:none;display:flex;align-items:center;gap:14px}.brand span{font:700 13px 'DM Sans',sans-serif;letter-spacing:2px;border-left:1px solid #536063;padding-left:14px}.chapter{font-size:12px;letter-spacing:3px;color:#98aaa9}.tools{display:flex;gap:8px}button{cursor:pointer;color:inherit;font:600 12px 'DM Sans',sans-serif;border:1px solid #65716d;background:#15222b;padding:12px 16px;border-radius:3px}button:hover{background:#324449}button:focus-visible{outline:3px solid #edbd73;outline-offset:3px}#fullscreen{font-size:22px;padding:5px 14px}#stage{position:relative;aspect-ratio:16/9;width:100%;overflow:hidden;background:#172c3a;border:1px solid #64716a;border-radius:6px;box-shadow:0 22px 65px #0006}canvas{display:block;width:100%;height:100%}.vignette{position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 100px #0008;z-index:2}#overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:linear-gradient(90deg,#081820d9,#091b2388,#091b2344);z-index:5;text-align:center}#overlay[hidden],#hud[hidden]{display:none}.titlecard{width:100%;padding:24px}.eyebrow{font-size:12px;letter-spacing:3px;color:#eac68c}h1{font:900 clamp(38px,6.8vw,100px)/.87 'Barlow Condensed',Impact,sans-serif;letter-spacing:-1px;margin:22px 0 15px;transform:rotate(-3deg);text-shadow:3px 4px #162b31}h1 em{font-style:normal;color:#efbf74;letter-spacing:4px}.subtitle{font:700 16px 'Barlow Condensed',sans-serif;letter-spacing:7px}.ornament{color:#d1a770;font-size:22px}.intro{font-size:15px;line-height:1.65;margin:10px 0 22px;color:#dfdacb}.primary{background:#edbe79;color:#202c2d;border:2px solid #fae0ae;box-shadow:0 5px 0 #836441;font:800 20px 'Barlow Condensed',sans-serif;letter-spacing:2px;padding:13px 40px;min-width:220px}.primary:hover{background:#f9d69a}.primary span{margin-left:30px}.difficulty{display:flex;justify-content:center;gap:8px;margin-top:23px}.difficulty button{border:none;background:transparent;color:#a6b2b0;font-size:11px;padding:8px 10px}.difficulty button.selected{color:#f1c580;border-bottom:1px solid #d6af71;border-radius:0}.hint{font-size:12px;color:#c3c9bc;margin:13px 0 0}footer{display:flex;align-items:center;justify-content:space-between;gap:15px;min-height:80px;color:#a7b0ac;font-size:11px}.key{display:inline-block;padding:4px 7px;border:1px solid #4b595b;border-radius:3px;color:#e2d9c3;margin-left:13px;margin-right:5px;font-size:10px}.key:first-child{margin-left:0}.note{font-size:10px;letter-spacing:1px}#hud{position:absolute;inset:22px 26px auto;display:flex;align-items:center;justify-content:space-between;gap:20px;z-index:3;text-shadow:1px 2px #101820}small{display:block;font-size:10px;letter-spacing:2px;color:#e3dbc7}.health span{color:#f1c67e;font-size:28px}.bossbar{width:40%;text-align:center;font-size:11px;letter-spacing:2px}.bossbar>div{background:#132331;border:1px solid #f1d5a1;padding:3px;height:12px;margin-top:8px}.bossbar i{display:block;background:#dfa468;height:100%;width:100%;transition:width .15s}.charge span{color:#edc478;font-size:22px}#pause{background:#11242c99;font-size:18px;padding:6px 12px}#message{position:absolute;top:30%;left:0;width:100%;text-align:center;pointer-events:none;z-index:4;font:900 clamp(24px,5vw,68px) 'Barlow Condensed',Impact,sans-serif;text-shadow:4px 4px #162934;color:#f8dfaa;transform:rotate(-4deg)}#touch{display:none;position:absolute;bottom:10px;left:12px;right:12px;justify-content:space-between;z-index:4}#touch>div{display:flex;gap:7px}#touch button{touch-action:none;background:#10232cb0;border-color:#bea67c66;min-width:44px;height:42px;padding:6px;font-size:11px}#stage:fullscreen{max-width:none;width:100vw;height:100vh;border:0;display:grid;place-items:center;background:#070e15}#stage:fullscreen canvas{object-fit:contain}.results{font-size:17px;line-height:1.9;color:#e4d5b8}.end-title{font-size:clamp(42px,7vw,90px)}@media(pointer:coarse){#touch{display:flex}footer{display:none}}@media(max-width:800px){main{padding:0 10px}.chapter,.note{display:none}header{height:64px}.brand span{font-size:10px;letter-spacing:1px}.tools button{font-size:10px;padding:7px}footer{flex-wrap:wrap;font-size:10px}.titlecard{padding:10px}.eyebrow{font-size:9px}.intro{display:none}h1{margin:10px 0;font-size:clamp(38px,8vw,65px)}.subtitle{font-size:12px;margin:8px;letter-spacing:4px}.ornament{display:none}.primary{font-size:16px;padding:9px 20px}.difficulty{margin-top:10px}.hint{margin:5px 0;font-size:10px}#hud{inset:10px;gap:8px}.health span{font-size:18px}.bossbar{font-size:8px}.charge span{font-size:16px}small{font-size:8px}}@media(max-width:550px) and (orientation:portrait){#stage{aspect-ratio:16/9}canvas{position:absolute;height:100%;width:100%;object-fit:contain}#hud .bossbar{width:35%}.titlecard h1{font-size:54px}.intro{display:block;font-size:13px}.difficulty{flex-direction:column;align-items:center}#touch button{min-width:37px}#touch{left:5px;right:5px}.brand span{max-width:120px}}

@media(max-width:550px) and (orientation:portrait){.titlecard h1{font-size:30px}.eyebrow,.subtitle,.intro,.hint,.difficulty{display:none}.primary{font-size:13px;padding:7px 14px;min-width:160px}.titlecard{padding:5px}header{height:60px}#touch{bottom:3px}#touch button{height:30px;font-size:9px;min-width:30px}#hud{inset:5px}.charge{display:none}#pause{padding:2px 7px}#hud .bossbar{width:48%}.health span{font-size:14px}#stage{border-radius:2px}.results{font-size:10px;line-height:1.3;margin:6px}.end-title{font-size:25px!important}footer{display:none}body:after{content:"Gira tu celular para jugar en horizontal";font-size:12px;color:#b6b6a6;position:fixed;bottom:22px;left:0;right:0;text-align:center}}

#mission{position:absolute;z-index:3;left:0;right:0;bottom:18px;text-align:center;font-size:14px;color:#f5e3bd;text-shadow:1px 2px 3px #000;pointer-events:none}.charge span{font-size:14px}.math-setting{display:flex;align-items:center;justify-content:center;gap:12px;font-size:13px;margin:10px}.math-setting select{font:inherit;color:#f9dfac;background:#142b35;border:1px solid #8d927b;padding:7px;border-radius:3px}.titlecard h1{font-size:clamp(36px,5.5vw,82px)}.titlecard .intro{margin:8px 0 14px}#math-panel[hidden]{display:none}#math-panel{position:absolute;inset:0;z-index:10;background:#07151cc9;display:grid;place-items:center;backdrop-filter:blur(5px);overflow:auto}.math-card{width:min(490px,94%);padding:26px 34px;text-align:center;background:#183039;border:2px solid #dab77e;border-radius:10px;box-shadow:0 12px 60px #0009}.math-card h2{font:800 30px 'Barlow Condensed',sans-serif;margin:12px 0 0}.math-card #math-equation{font:900 62px 'Barlow Condensed',sans-serif;color:#ffda8d;margin:10px 0}.math-card label{display:block;font-size:16px;margin:8px}.math-card input{width:100%;max-width:240px;padding:12px;font:700 26px 'DM Sans',sans-serif;color:#142e38;text-align:center;background:#fff0cf;border:2px solid #e7c182;border-radius:5px;outline-offset:4px}.math-card #math-feedback{min-height:38px;font-size:14px;line-height:1.4;color:#f4dcb0;margin:12px 0}.math-card .primary{display:block;margin:0 auto 14px;font-size:18px}.math-card #math-cancel{background:transparent;border:0;text-decoration:underline;font-size:14px;padding:5px}.math-explain{font-size:13px;line-height:1.5;color:#c2d1c7;margin:10px 0 0}#math-panel~#touch{z-index:4}@media(pointer:coarse){#mission{bottom:58px;font-size:11px}}@media(max-height:650px),(max-width:800px){.math-card{padding:12px 20px}.math-card #math-equation{font-size:40px;margin:4px}.math-card h2{font-size:23px;margin:3px}.math-card input{font-size:20px;padding:7px}.math-card #math-feedback{margin:5px;min-height:26px;font-size:12px}.math-card .primary{padding:8px;margin-bottom:5px}.math-explain{margin:3px;font-size:11px}.math-setting{margin:5px;font-size:11px}.math-setting select{padding:4px}}@media(max-width:550px) and (orientation:portrait){.math-setting{display:none}#math-panel{position:fixed}.math-card{padding:24px}#mission{font-size:8px;bottom:37px}.charge{display:none}}

#hub-ui[hidden],#shop-panel[hidden]{display:none}#hub-ui{position:absolute;inset:0;z-index:4;pointer-events:none}.hub-head{position:absolute;left:40px;top:26px}.hub-head h2{font:800 44px 'Barlow Condensed',sans-serif;margin:6px 0}.hub-head p{font-size:14px;margin:5px 0}#wallet{color:#ffcf7d;font-weight:bold}#loadout{color:#d0dccc}.hub-actions{position:absolute;right:26px;top:26px;display:flex;gap:9px;pointer-events:auto}#hub-near{position:absolute;left:0;right:0;bottom:50px;text-align:center;font-size:14px;color:#ffe0a1}#shop-panel{position:absolute;inset:0;z-index:11;display:grid;place-items:center;background:#07151ce8;overflow:auto}.shop-card{width:min(970px,96%);max-height:96%;overflow:auto;background:#17313b;border:1px solid #dcb77c;padding:20px 28px;border-radius:8px}.shop-card header{height:auto;margin-bottom:8px}.shop-card h2{font:800 32px 'Barlow Condensed',sans-serif;margin:0}.shop-card p{font-size:14px;line-height:1.5;margin:7px 0}#shop-balance{color:#ffd28a}#shop-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin:15px 0}.power-card{border:1px solid #64776e;display:flex;gap:14px;padding:13px;border-radius:5px}.power-card.equipped{border-color:#eec17a;background:#253d42}.power-icon{font-size:35px;min-width:30px;color:#ffda92}.power-card h3{margin:5px 0;font-size:19px}.power-card p{font-size:13px}.power-card button{font-size:12px;padding:8px 12px}.power-card button:disabled{cursor:default;opacity:.55}.shop-help{color:#bdcbbf;font-size:12px!important}.map-back{display:block;margin:15px auto 0;border:0;background:transparent;text-decoration:underline}#bag{padding:8px;font-size:18px}@media(max-width:800px){.hub-head{left:15px;top:12px}.hub-head h2{font-size:28px}.hub-head p{font-size:10px}.hub-actions{right:10px;top:12px;flex-direction:column}.hub-actions button{padding:7px;font-size:10px}#hub-near{font-size:10px;bottom:44px}.shop-card{padding:12px}.shop-card h2{font-size:25px}#shop-grid{gap:7px}.power-card{padding:8px;gap:8px}.power-card h3{font-size:16px}.power-card p{font-size:12px}.power-icon{font-size:25px;min-width:20px}}@media(max-width:550px) and (orientation:portrait){#shop-panel{position:fixed}#shop-grid{grid-template-columns:1fr}.hub-head h2{font-size:20px}.hub-head .eyebrow,#loadout{display:none}.hub-actions button{font-size:8px;padding:4px}#hub-near{display:none}}

html{min-height:100%;-webkit-text-size-adjust:100%}body{overscroll-behavior:none}button,input,select{touch-action:manipulation}#stage #game{object-fit:contain}.tools{flex-shrink:0}#touch button{user-select:none;-webkit-user-select:none}#shop-panel .shop-card{overscroll-behavior:contain}.math-card input{font-size:24px}.charge{min-width:130px}#pause,#bag{flex-shrink:0}#hub-ui .hub-head p{overflow-wrap:anywhere}.hub-actions button{min-height:40px}.shop-card header{flex-wrap:wrap;gap:10px}.power-card{min-width:0}.power-card button{white-space:normal}.math-setting select{max-width:100%}#math-panel{padding:10px}#touch{padding-bottom:env(safe-area-inset-bottom)}
@media(max-width:1000px){main{padding:0 12px}header{height:66px}.chapter{display:none}footer{font-size:11px;line-height:2;min-height:66px}.note{display:none}.charge{min-width:90px}.bossbar{font-size:10px}.math-card{max-height:100%;overflow:auto}.shop-card{max-height:100%}}
@media(pointer:coarse){#touch button{min-width:50px;height:50px;font-size:12px;border-radius:10px;background:#142833df;border:1px solid #d2ba8799}#touch>div{gap:8px}#mission{bottom:74px;padding:0 12px}#hub-near{bottom:85px}#touch{bottom:10px}footer{display:none}}
@media(max-width:650px) and (orientation:portrait){body{display:block}main{padding:0 8px;padding-bottom:env(safe-area-inset-bottom)}header{height:64px;gap:7px}.brand{font-size:23px;gap:8px}.brand span{max-width:120px;font-size:9px;padding-left:8px}.tools{gap:5px}.tools button{min-height:36px;padding:6px;font-size:9px}#stage{aspect-ratio:3/4;max-height:calc(100svh - 80px);min-height:390px;border-radius:8px}canvas{position:static;height:100%;width:100%}body:after{content:none}#hud{inset:12px 12px auto;gap:8px;flex-wrap:wrap}.health{order:0}.health span{font-size:20px}.health small{font-size:10px}.bossbar,#hud .bossbar{order:4;width:100%;font-size:11px}.charge{display:block;order:1;flex:1;text-align:right}.charge small{font-size:9px}.charge span{font-size:11px}.bossbar>div{margin-top:5px}.titlecard{padding:20px 12px}.titlecard h1{font-size:54px}.eyebrow{display:block;font-size:9px;letter-spacing:1.5px}.subtitle{display:block;font-size:12px}.intro{display:block;font-size:13px}.difficulty{display:flex;flex-direction:row;gap:2px;margin:12px 0}.difficulty button{font-size:9px;padding:7px}.math-setting{display:flex;flex-direction:column;gap:5px;font-size:12px;margin-top:10px}.math-setting select{font-size:14px;padding:8px}.hint{display:block;font-size:10px;line-height:1.4;margin-top:12px}.primary{font-size:17px;padding:12px 20px;min-width:180px}.end-title{font-size:44px!important}.results{font-size:14px;line-height:1.5;margin:14px 0}#mission{font-size:11px;line-height:1.4;bottom:73px}.hub-head{top:18px;left:18px}.hub-head h2{font-size:34px}.hub-head p{font-size:12px}#loadout{display:block;max-width:250px}.hub-actions{top:160px;left:18px;right:18px;flex-direction:row}.hub-actions button{flex:1;font-size:10px;padding:8px;min-height:44px}.hub-head .eyebrow{display:block}#hub-near{display:block;font-size:11px;bottom:94px}#shop-panel,#math-panel{position:fixed;inset:0;z-index:100;padding:12px;padding-top:max(12px,env(safe-area-inset-top));padding-bottom:max(12px,env(safe-area-inset-bottom))}.shop-card{width:100%;padding:16px;max-height:100%;border-radius:9px}#shop-grid{grid-template-columns:1fr;gap:12px}.power-card{padding:14px}.power-card h3{font-size:20px}.power-card p{font-size:14px}.power-card button{min-height:42px;font-size:13px}.shop-card>p{font-size:14px}.shop-card #shop-close{min-height:44px;font-size:13px}.math-card{padding:24px 16px;width:100%;max-height:100%;overflow:auto}.math-card h2{font-size:30px}.math-card #math-equation{font-size:62px}.math-card input{padding:14px;font-size:28px}.math-card #math-feedback{font-size:14px;line-height:1.5;margin:16px 0}.math-card .primary{padding:14px;min-height:48px}.math-card #math-cancel{min-height:44px;font-size:14px}.math-explain{font-size:13px;line-height:1.5}#touch{left:8px;right:8px}#touch>div{gap:5px}#touch button{min-width:40px;width:44px;height:48px;font-size:10px}#touch [data-key="KeyC"]{width:48px}}
@media(max-height:550px) and (orientation:landscape) and (pointer:coarse){body{display:block}main{padding:0}body>main>header{height:38px;padding:0 12px}.brand{font-size:19px}.brand span{font-size:9px}.tools button{padding:3px 8px;min-height:28px}#stage{height:calc(100svh - 38px);width:100%;aspect-ratio:auto;border:0;border-radius:0}#hud{inset:8px 16px auto}.health span{font-size:18px}.bossbar{font-size:9px}.charge span{font-size:10px}#touch button{height:40px;min-width:48px;font-size:10px}#mission{bottom:57px;font-size:10px}.titlecard h1{font-size:45px;margin:8px 0}.titlecard .intro,.titlecard .subtitle,.titlecard .ornament{display:none}.titlecard .eyebrow{font-size:9px}.titlecard .primary{padding:8px 22px;font-size:16px}.difficulty{margin:8px 0}.math-setting{margin:6px}.hint{margin:4px}.math-card{padding:10px 20px;max-width:540px}.math-card #math-equation{font-size:34px;margin:0}.math-card h2{font-size:22px;margin:0}.math-card label{font-size:12px;margin:3px}.math-card input{font-size:20px;padding:5px}.math-card #math-feedback{min-height:20px;font-size:12px;margin:4px}.math-card .primary{font-size:14px;padding:7px;min-height:32px;margin-bottom:2px}.math-card #math-cancel{font-size:12px;padding:3px}.math-explain{display:none}.hub-head{top:12px}.hub-head h2{font-size:28px}.hub-head p{font-size:11px}.hub-actions{top:12px}.shop-card{padding:12px 20px}.shop-card h2{font-size:25px}}
@media(max-height:550px) and (orientation:landscape) and (pointer:coarse){#stage{max-width:calc((100svh - 38px)*1.77778);margin:auto}}

.world-only{display:none}#stage.in-world .world-only{display:block}#stage.in-world .actions button:not(.world-only){display:none}#stage.in-world #hub-ui .hub-head{background:#173b32dd;padding:12px 18px;border-radius:6px;top:14px;left:16px}.in-world .hub-head h2{font-size:26px;margin:3px 0}.in-world .hub-head p{font-size:12px}.in-world .hub-head .eyebrow{font-size:9px}#stage.in-world #mission,#stage.in-world #hub-near{text-shadow:1px 2px #183c32;color:#fff4c8}#stage.in-world #hub-near{background:#173b32bd;left:20%;right:20%;border-radius:4px;padding:7px;bottom:60px}#stage.in-world canvas{touch-action:none}#stage.in-world #touch .movement{display:grid;grid-template-columns:repeat(3,46px);grid-template-rows:repeat(2,43px);gap:4px}#stage.in-world .movement [data-key="ArrowUp"]{grid-column:2;grid-row:1}#stage.in-world .movement [data-key="ArrowLeft"]{grid-column:1;grid-row:2}#stage.in-world .movement [data-key="ArrowRight"]{grid-column:3;grid-row:2}#stage.in-world .movement [data-key="ArrowDown"]{grid-column:2;grid-row:2}#stage.in-world #touch button{width:46px;height:43px;min-width:0}#stage.in-world #touch .actions{align-items:flex-end}#stage.in-world #touch #world-enter{width:80px;height:48px}@media(pointer:coarse){#stage.in-world #hub-near{bottom:115px;font-size:11px;left:12px;right:12px}#stage.in-world #mission{bottom:92px;font-size:10px}}@media(max-width:650px) and (orientation:portrait){#stage.in-world .hub-head h2{font-size:23px}#stage.in-world .hub-head p{font-size:10px}#stage.in-world .hub-head{max-width:90%}#stage.in-world #hub-near{font-size:10px}} 
.game-modal[hidden]{display:none}.game-modal{position:fixed;inset:0;z-index:30;background:#07181eea;display:grid;place-items:center;padding:20px;overflow:auto;backdrop-filter:blur(7px)}.character-card,.session-card,.arena-card{width:min(800px,96vw);max-height:94dvh;overflow:auto;text-align:center;background:#17363c;border:2px solid #d9bd85;border-radius:15px;padding:24px}.game-modal h2{font:800 34px 'Barlow Condensed',sans-serif;margin:8px}.game-modal p{font-size:15px;line-height:1.5;color:#e4d9bd}.character-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:24px 0}.character-grid button{background:#213f42;border:2px solid #677c6e;border-radius:12px;padding:12px}.character-grid button:hover,.character-grid button.selected{border-color:#f2c873;background:#34524c}.character-grid canvas{width:100%;height:auto;position:static}.character-grid strong{font-size:23px;display:block}.character-grid span{display:block;font-size:13px;margin:6px}.session-card{max-width:550px}.session-card input{width:100%;padding:14px;font-size:16px;border:1px solid #d7bd86;background:#0e272f;color:#fce4b2;border-radius:6px}.session-card button{margin:5px;padding:12px;font-size:13px}#session-panel{z-index:40}#session-state{font-size:10px;align-self:center;max-width:85px;color:#abd8c9}#invite-friends{border-color:#ccb77d}#change-character{pointer-events:auto;margin-top:5px;font-size:10px;padding:7px;background:#203d35}.power-card .power-icon{display:grid;place-items:center;width:64px;height:64px;min-width:64px;border-radius:50%;background:#173333;box-shadow:inset 0 0 15px #cbedbb22;color:#f5d575;font-size:38px}.power-ice{color:#9ceaff!important}.power-shield,.power-aura{box-shadow:0 0 14px #99e6c944!important}.arena-card{max-width:760px}.arena-card #arena-canvas{width:min(100%,600px);height:auto;position:static;margin:0 auto}.arena-card #arena-score{font:800 40px 'Barlow Condensed',sans-serif;color:#f7d181;display:block}.arena-card #arena-prize{font-size:13px;color:#e1c17b;letter-spacing:2px}.arena-card #arena-equation{font:800 30px 'Barlow Condensed',sans-serif;margin:8px}.arena-card #arena-form{display:flex;align-items:center;justify-content:center;gap:12px}.arena-card #arena-form[hidden]{display:none}.arena-card input{width:160px;font-size:25px;text-align:center;padding:10px;background:#ffe9bd;border:0;border-radius:5px}.arena-card .primary{font-size:16px;padding:11px 20px;min-width:120px;margin:0}.arena-card #arena-feedback{min-height:24px;font-size:14px}.arena-footer{display:flex;justify-content:center;gap:10px;margin-top:15px}.arena-footer button{font-size:12px}#joystick{display:none;touch-action:none}#touch small{font-size:8px;letter-spacing:.5px;pointer-events:none}
@media(pointer:coarse){#joystick{display:grid;place-items:center;position:relative;width:108px;height:108px;border-radius:50%;background:#14363aaa;border:2px solid #d2dfb67a;box-shadow:inset 0 0 25px #07191c88;flex:none}#joystick-knob{width:48px;height:48px;border-radius:50%;background:#e3c58be8;border:2px solid #fff0bf;box-shadow:0 4px 14px #0005;pointer-events:none}#touch>.movement,#stage.in-world #touch>.movement{display:none}#touch{align-items:flex-end;bottom:14px;left:16px;right:16px}#touch .actions{display:grid;grid-template-columns:48px 64px 66px;align-items:end;gap:8px}#touch .actions button{border-radius:50%;background:#143039dc;border:2px solid #adc4aa;width:48px;min-width:48px;height:48px;font-size:10px}#touch .actions [data-key="Space"]{grid-column:3;grid-row:1;width:66px;height:66px;font-size:30px;background:#a68e48e8;color:#fff1bc}#touch .actions [data-key="KeyX"]{grid-column:2;grid-row:2;width:64px;height:64px;font-size:25px;background:#944d40e8;color:#ffe5b6}#touch .actions [data-key="KeyC"]{grid-column:2;grid-row:1}#touch .actions [data-key="ShiftLeft"]{grid-column:1;grid-row:2}#stage.in-world #touch .actions{display:flex}#stage.in-world #touch #world-enter{width:76px;height:76px;border-radius:50%;background:#c29c58e8;color:#122f30;font-size:13px}#mission{bottom:150px;font-size:10px;pointer-events:none}#stage.in-world #mission{bottom:142px}#stage.in-world #hub-near{bottom:164px}}
@media(max-width:650px) and (orientation:portrait){.game-modal{padding:10px}.character-card,.arena-card,.session-card{padding:18px 12px;max-height:96dvh}.character-grid{gap:7px;margin:15px 0}.character-grid button{padding:6px}.character-grid strong{font-size:18px}.character-grid span{font-size:10px}.game-modal h2{font-size:27px}.game-modal p{font-size:13px}#session-state{display:none}.tools #invite-friends{font-size:8px;max-width:58px;line-height:1.2}.brand span{max-width:90px}.arena-card #arena-canvas{max-height:110px;object-fit:contain}.arena-card input{width:120px}.arena-footer{flex-direction:column}.arena-footer button{min-height:44px}#touch{left:10px;right:10px}#joystick{width:96px;height:96px}#touch .actions{gap:5px;grid-template-columns:42px 57px 59px}#touch .actions [data-key="Space"]{width:59px;height:59px}#touch .actions [data-key="KeyX"]{width:57px;height:57px}#touch .actions button{width:42px;height:42px;min-width:42px}.power-card .power-icon{min-width:50px;width:50px;height:50px;font-size:30px}}
@media(max-height:550px) and (orientation:landscape) and (pointer:coarse){#joystick{width:85px;height:85px}#joystick-knob{width:40px;height:40px}#touch{bottom:8px}#touch .actions{grid-template-columns:42px 52px 58px;gap:5px}#touch .actions [data-key="Space"]{width:58px;height:58px}#touch .actions [data-key="KeyX"]{width:52px;height:52px}#touch .actions button{width:42px;min-width:42px;height:42px}#mission{bottom:119px;font-size:9px}.game-modal{padding:10px}.character-card,.arena-card{padding:10px 20px}.character-grid{margin:8px 0}.character-grid canvas{max-height:110px;object-fit:contain}.arena-card #arena-canvas{max-height:75px;object-fit:contain}.arena-card p{font-size:12px;margin:5px}.arena-card h2{font-size:23px}.arena-card #arena-score{font-size:26px}.arena-card #arena-equation{font-size:24px}.arena-card input{font-size:20px;padding:7px}.arena-footer{margin-top:5px}.arena-card #arena-feedback{font-size:12px;min-height:15px}}

/* Full-scene mobile viewport and a separate thumb-control area. */
#player-name{display:block;width:min(100%,320px);margin:10px auto;padding:12px;font-size:18px;border:2px solid #dfbd7d;border-radius:8px;background:#fff1d3;color:#163333}
#touch{pointer-events:none}#touch button,#touch #joystick{pointer-events:auto;touch-action:none}#touch button>*{pointer-events:none}button:disabled{opacity:.65;cursor:default}.power-card button:disabled{color:#ffe3a3}
@media(pointer:coarse),(max-width:650px){
 html,body{width:100%;height:100%;min-height:0;overflow:hidden}body{display:block}main{width:100%;height:100dvh;padding:0;display:flex;flex-direction:column}main>header{height:48px;min-height:48px;padding:0 8px;gap:5px}.brand span{display:none}.tools{gap:4px}.tools button{min-height:36px;font-size:10px;padding:6px}#stage{flex:1;width:100%;height:0;min-height:0;max-height:none;max-width:none;aspect-ratio:auto;border:0;border-radius:0;margin:0}
 #stage #game{position:absolute;left:0;top:64px;width:100%;height:calc(100% - 224px);object-fit:contain}
 #touch{display:flex;bottom:max(12px,env(safe-area-inset-bottom));left:12px;right:12px;z-index:6}#touch .movement,#stage.in-world #touch .movement{display:none}#joystick{display:grid;place-items:center;position:relative;width:90px;height:90px;flex:none;border-radius:50%;border:2px solid #d2dfb67a;background:#14363aaa}#joystick-knob{width:42px;height:42px;border-radius:50%;background:#e3c58b;pointer-events:none}
 #touch .actions{display:grid;grid-template-columns:42px 58px 60px;gap:5px;align-items:end}#touch .actions button{height:42px;width:42px;min-width:42px;border-radius:50%}#touch .actions [data-key="KeyX"]{grid-column:2;grid-row:2;width:58px;height:58px}#touch .actions [data-key="Space"]{grid-column:3;grid-row:1;width:60px;height:60px}#touch .actions [data-key="KeyC"]{grid-column:2;grid-row:1}#touch .actions [data-key="ShiftLeft"]{grid-column:1;grid-row:2}
 #overlay{z-index:8;overflow:auto}.titlecard{margin:auto}.game-modal{z-index:40}#hud{inset:6px 10px auto;flex-wrap:nowrap;gap:8px}#hud .bossbar{order:0;width:38%;font-size:9px}.charge{min-width:0;flex:1}.health span{font-size:17px}#mission{bottom:140px;font-size:11px}#stage.in-world #mission{display:none}#stage.in-world #hub-near{bottom:130px;font-size:11px;left:8px;right:8px}
 #stage.in-world #hub-ui .hub-head{top:5px;left:8px;right:8px;max-width:none;padding:6px 8px;display:flex;align-items:center;flex-wrap:wrap;gap:5px;background:#173b32ed}.in-world .hub-head h2{font-size:18px}.in-world .hub-head .eyebrow,#loadout{display:none!important}.in-world .hub-head p{font-size:12px;margin:0}#change-character{margin:0 0 0 auto;min-height:32px}#message{font-size:28px}footer{display:none}
}
@media(orientation:landscape) and (max-height:550px) and (pointer:coarse){
 main>header{height:38px;min-height:38px}#stage #game{top:0;height:100%;width:100%;object-fit:contain}#touch{bottom:8px}#joystick{width:76px;height:76px}#hud{inset:5px 110px auto}#mission{bottom:8px;left:100px;right:180px;width:auto}#stage.in-world #hub-near{bottom:8px;left:105px;right:95px}#stage.in-world #hub-ui .hub-head{right:auto;max-width:75%}
}

.character-grid{grid-template-columns:repeat(4,minmax(0,1fr))}@media(max-width:650px){.character-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.character-grid canvas{max-height:130px;object-fit:contain}}

.shop-tabs{display:flex;gap:8px;margin:16px 0;position:sticky;top:0;background:#173039;padding:8px 0;z-index:2}.shop-tabs button{flex:1;font-size:15px;min-height:48px}.shop-tabs button[aria-pressed="true"]{background:#f1c477;color:#142f35;border:2px solid #ffe5aa}.item-price{color:#ffdb8c!important;font-weight:700!important;font-size:16px!important}#shop-category-description{font-size:15px;line-height:1.5}#shop-owner{font-size:16px;line-height:1.5}

#chat-panel[hidden]{display:none}#chat-panel{position:fixed;right:20px;bottom:20px;width:min(380px,94vw);height:min(470px,85dvh);z-index:150;background:#17353d;border:2px solid #e1bd79;border-radius:12px;display:flex;flex-direction:column;box-shadow:0 10px 50px #000a;padding:12px}#chat-panel header{height:44px;min-height:44px;font-size:15px}#chat-messages{flex:1;overflow-y:auto;min-height:90px;padding:5px}#chat-messages p{background:#25454c;padding:9px;border-radius:8px;font-size:15px;overflow-wrap:anywhere;margin:8px 0}#chat-messages .mine{background:#4b553e}#chat-messages strong,#chat-messages span{display:block}#chat-messages strong{font-size:13px;color:#f4cc82;margin-bottom:4px}#chat-status{font-size:13px;line-height:1.4;margin:7px 0}#chat-form{display:flex;gap:7px}#chat-input{min-width:0;flex:1;padding:12px;font-size:16px;border-radius:5px;background:#fff2d6;color:#193337;border:0}#chat-form button{padding:9px;font-size:12px}#reset-panel{z-index:200}#reset-accept{background:#9c3935;color:#fff;font-size:14px}#reset-cancel{font-size:15px}#chat-unread{color:#ffe096}@media(max-width:650px){#chat-panel{right:8px;bottom:8px;width:calc(100% - 16px);height:min(460px,85dvh)}.tools{gap:3px}.tools button{font-size:9px;padding:5px}#sound{max-width:50px}}

#rotate-screen{display:none}#rotate-screen h2{font:800 38px 'Barlow Condensed',sans-serif;margin:14px 0}#rotate-screen p{font-size:16px;line-height:1.6}#rotate-screen .rotate-icon{font-size:82px;color:#f2c67e}#rotate-help{font-size:14px!important;color:#bacfc9}#rotate-screen .primary{white-space:normal;min-width:0;width:100%;max-width:310px}
@media(pointer:coarse) and (orientation:portrait){body:not(.typing) #rotate-screen{display:grid;position:fixed;inset:0;z-index:300;place-items:center;padding:30px;text-align:center;background:#102d35}#rotate-screen>div{max-width:380px}}
@media(pointer:coarse) and (orientation:landscape){
 html,body{height:100dvh;width:100%;overflow:hidden}main{height:100dvh;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom)}main>header{height:36px;min-height:36px}#stage{max-width:none;max-height:none;min-height:0;flex:1;aspect-ratio:auto;width:100%;margin:0}#stage #game{top:0;left:0;width:100%;height:100%;object-fit:contain}#hud{inset:6px 115px auto;flex-wrap:nowrap}#touch{left:12px;right:12px;bottom:8px}#joystick{height:76px;width:76px}#joystick-knob{height:36px;width:36px}#touch .actions{grid-template-columns:40px 50px 54px;gap:5px}#touch .actions [data-key="KeyX"]{height:50px;width:50px}#touch .actions [data-key="Space"]{height:54px;width:54px}#touch .actions button{height:40px;width:40px;min-width:40px}#mission{left:105px;right:175px;bottom:7px;width:auto}#overlay{overflow-y:auto;align-items:safe center}.titlecard{padding:8px 16px}.titlecard h1{font-size:38px}.titlecard .intro,.titlecard .subtitle,.titlecard .eyebrow{display:none}.titlecard .primary{min-height:40px}.titlecard .difficulty{margin:5px}.character-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:8px 0}.character-grid canvas{max-height:90px;object-fit:contain}.character-card{padding:10px 16px}.character-card h2{font-size:23px;margin:4px}#player-name{font-size:16px;padding:8px;margin:5px auto}.character-grid strong{font-size:18px}.character-grid span{font-size:11px}.game-modal{padding:8px;align-items:safe center}.shop-card{max-height:calc(100dvh - 16px);overflow:auto}.shop-tabs{margin:6px 0}.shop-tabs button{min-height:40px}#chat-panel{height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);bottom:8px;right:max(8px,env(safe-area-inset-right));width:min(420px,70vw)}#chat-panel header{min-height:32px;height:32px}
}

/* Consistent canvas proportions and viewport-sized menus. */
#stage .character-grid canvas{position:static;display:block;width:100%;height:auto;aspect-ratio:8/9;object-fit:contain;max-height:none}.character-grid button{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.character-grid canvas{flex:none}#map-view{pointer-events:auto;min-height:36px;font-size:12px;padding:7px 10px;background:#eac17e;color:#153239;margin:4px}
#shop-panel{position:fixed;inset:0;z-index:120;padding:12px;overflow:hidden;display:flex;align-items:center;justify-content:center}#shop-panel[hidden]{display:none}#shop-panel .shop-card{width:min(1050px,100%);height:100%;max-height:800px;min-height:0;overflow:hidden;display:grid;grid-template-rows:auto auto auto auto minmax(0,1fr) auto;gap:5px;padding:14px}#shop-panel .shop-card>header{height:auto;min-height:44px;flex:none;margin:0}#shop-owner,#shop-category-description{margin:0;font-size:14px}#shop-grid{overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;min-height:0;margin:0;padding:4px 4px 18px;align-content:start;grid-template-columns:repeat(2,minmax(0,1fr))}.shop-tabs{position:static;margin:0;padding:4px 0}.shop-tabs button{min-height:44px}.shop-art{display:block;width:100px;height:100px;min-width:100px;flex:none;background-image:url('assets/shop.png');background-size:400% 200%;background-repeat:no-repeat;align-self:center}.power-card{padding:12px;align-items:center}.power-card>div{min-width:0}.power-card button{min-height:44px}.shop-help{margin:0!important;font-size:12px!important}#stage #game{object-fit:contain!important}
@media(pointer:coarse){#stage.in-world #game{top:48px;left:0;width:100%;height:calc(100% - 78px)}#stage.in-world #hub-ui .hub-head{top:0;left:0;right:0;max-width:none;padding:3px 8px;height:46px;flex-wrap:nowrap}.in-world .hub-head h2,.in-world .hub-head .eyebrow{display:none!important}#stage.in-world #hub-near{bottom:0;left:105px;right:95px;margin:0;font-size:11px;padding:5px;background:#173b32dd}#map-view{font-size:10px;min-height:34px;margin:0}#stage .character-grid canvas{height:auto!important;max-height:none!important;width:min(100%,130px)!important;object-fit:contain!important}.character-card{max-height:calc(100dvh - 16px);overflow:auto;align-self:start}.character-grid{align-items:start}.character-grid button{padding:6px}.character-grid strong{font-size:18px}.character-grid span{font-size:12px}#shop-panel{padding:6px}#shop-panel .shop-card{padding:8px;max-height:none;grid-template-rows:auto auto minmax(0,1fr)}#shop-owner,#shop-category-description,.shop-help{display:none}#shop-panel .shop-card>header{grid-row:1}#shop-panel .shop-tabs{grid-row:2}#shop-panel #shop-grid{grid-row:3}.shop-card h2{font-size:22px}#shop-balance{font-size:13px;line-height:1.2}.power-card{padding:8px;gap:8px}.power-card h3{font-size:17px}.power-card p{font-size:13px;line-height:1.35}.shop-art{width:78px;height:78px;min-width:78px}.shop-tabs button{font-size:13px;padding:6px}#shop-close{min-height:40px}}
@media(max-width:600px){#shop-grid{grid-template-columns:1fr}}

#stage canvas.shop-art{position:static!important;display:block;width:90px;height:90px;min-width:90px;object-fit:contain!important;background:none;flex:none}@media(pointer:coarse){#stage canvas.shop-art{width:76px;height:76px;min-width:76px}}

/* Close follow camera uses the actual stage aspect, so the map fills the phone. */
.character-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
#stage.in-world #game{top:0;left:0;width:100%;height:100%}
#touch .actions [data-key="KeyX"].firing{box-shadow:0 0 0 4px #91efff;background:#22768b}
#touch .actions [data-key="KeyX"].firing:after{content:'➜';position:absolute;inset:0;display:grid;place-items:center;transform:rotate(var(--aim-angle,0rad));color:#fff;font-size:24px;pointer-events:none}
@media(pointer:coarse){
 #stage.in-world #game{top:0;height:100%;object-fit:fill!important}
 #stage.in-world #hub-ui .hub-head{top:5px;left:8px;right:8px;width:auto;height:40px;border-radius:8px;background:#143630c9;gap:8px}
 #stage.in-world #hub-near{bottom:8px;left:110px;right:105px;font-size:12px;pointer-events:none}
 #wallet{font-size:14px!important;white-space:nowrap}#map-view,#change-character{font-size:12px;min-height:36px}
 .character-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 #touch .actions [data-key="KeyX"]{position:relative;width:60px;height:60px;touch-action:none}
 #touch .actions [data-key="Space"]{width:60px;height:60px}
 #touch .actions{grid-template-columns:42px 60px 60px;gap:7px}
 #touch .actions small{font-size:9px}
}

/* Illustrated interiors: merchandise on the counter, duel controls beside the ring. */
#shop-panel{background:#160f0d;padding:0;backdrop-filter:none}
#shop-panel .shop-card{position:relative;isolation:isolate;width:100%;height:100%;max-height:none;border:0;border-radius:0;padding:16px 24px;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(90px,1fr) auto minmax(180px,36%);gap:8px;background:#36241c}
.shop-scene{position:absolute;inset:0;z-index:-1;background:linear-gradient(0deg,#1c100eed 0%,transparent 58%),url('assets/shop-interior.png') center 40%/cover no-repeat}
#shop-panel .shop-card>header{grid-row:1;align-items:flex-start;padding:8px 12px;background:#20150dc9;border:1px solid #e5bd7859;border-radius:8px;width:100%;gap:10px}
#shop-panel .shop-card>header h2{font-size:32px;color:#ffe1a0;text-shadow:2px 3px #271613}
#shop-panel #shop-owner,#shop-panel #shop-category-description,#shop-panel .shop-help{display:none}
#shop-panel #shop-balance{font-size:16px;line-height:1.3;margin:3px 0 0;color:#ffdf91}
#shop-panel .shop-tabs{grid-row:3;width:min(620px,100%);padding:0;background:#231613dc;border-radius:8px}
#shop-panel .shop-tabs button{font-size:14px;min-height:44px}
#shop-panel #shop-grid{grid-row:4;display:grid;grid-auto-flow:column;grid-template-columns:none;grid-auto-columns:minmax(280px,32%);grid-template-rows:1fr;overflow-x:auto;overflow-y:auto;gap:12px;padding:4px 4px 12px;scroll-snap-type:x proximity;align-content:stretch}
#shop-panel .power-card{scroll-snap-align:start;align-items:center;min-width:0;border:2px solid #927449;border-radius:6px;background:#281f1beF;box-shadow:inset 0 0 18px #0008;padding:12px}
#shop-panel .power-card.equipped{border-color:#ffdb80;background:#3b3323f5}
#shop-panel .power-card h3{color:#ffe9aa;font-size:20px;margin:3px 0}
#shop-panel .power-card p{font-size:14px;line-height:1.3;margin:5px 0}
#shop-panel .power-card button{min-height:44px;font-size:13px;width:100%}
#arena-panel{background:linear-gradient(90deg,#160f1520,#160f1540),url('assets/arena-interior.png') center/cover no-repeat;backdrop-filter:none;padding:24px;align-items:center;justify-items:end}
#arena-panel .arena-card{width:min(520px,47vw);max-height:calc(100dvh - 48px);background:#21191beF;border:2px solid #c99d61;border-radius:10px;padding:18px;box-shadow:0 12px 50px #0009}
#arena-panel h2{color:#ffdf99;font-size:40px}#arena-panel .eyebrow{font-size:13px;color:#edd1a5}
#arena-panel #arena-canvas{height:100px;max-height:100px;object-fit:contain}
#arena-panel .arena-card p{font-size:14px;line-height:1.4}
#level-lock-panel{z-index:140}#level-lock-panel .session-card{background:#233c37;border-color:#e6c587}#level-lock-panel p{font-size:18px}
@media(pointer:coarse),(max-width:800px){
 #shop-panel .shop-card{padding:8px max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left));grid-template-rows:auto minmax(55px,1fr) 40px minmax(145px,42%);gap:4px}
 #shop-panel .shop-card>header{padding:5px 9px;min-height:48px}#shop-panel .shop-card>header h2{font-size:24px}#shop-panel #shop-balance{font-size:14px}
 #shop-panel .shop-tabs button{min-height:40px;padding:5px;font-size:13px}
 #shop-panel #shop-grid{grid-auto-columns:minmax(270px,45%);gap:8px;padding-bottom:5px}
 #shop-panel .power-card{padding:7px;gap:8px}#shop-panel .power-card h3{font-size:17px}#shop-panel .power-card p{font-size:13px}#shop-panel .power-card small{font-size:11px}
 #arena-panel{padding:8px max(10px,env(safe-area-inset-right));background-position:35% center}
 #arena-panel .arena-card{width:52vw;max-height:calc(100dvh - 16px);padding:10px 14px}
 #arena-panel h2{font-size:28px;margin:3px}#arena-panel #arena-canvas{height:64px;max-height:64px}
 #arena-panel .arena-card p{font-size:13px;margin:5px 0}#arena-panel #arena-score{font-size:28px}#arena-panel #arena-equation{font-size:24px}
 #arena-panel .arena-footer{flex-wrap:wrap;margin-top:8px}#arena-panel .arena-footer button{min-height:40px}
}
@media(max-width:600px) and (orientation:portrait){#arena-panel .arena-card{width:100%;margin-top:25vh;max-height:70dvh}#shop-panel #shop-grid{grid-auto-columns:90%}}

/* Separate merchant frames keep the shelves and counter perfectly still. */
.shop-scene{overflow:hidden;background:#322218;pointer-events:none}
.shop-artboard{position:absolute;left:50%;top:40%;width:max(100%,177.78vh);aspect-ratio:16/9;transform:translate(-50%,-40%);background:url('assets/shop-empty.png') center/100% 100% no-repeat}
#stage #merchant-animation{position:absolute!important;right:7%;top:0;width:46%;height:54%;max-height:none;object-fit:contain;object-position:bottom}
#shop-panel .outfit-display{position:absolute;left:5%;top:22%;width:140px;height:170px;pointer-events:none;text-align:center;color:#ffe2a1;text-shadow:1px 2px #000;background:#201b1980;border-radius:10px;padding:5px}
#stage #outfit-preview{position:static!important;width:120px;height:135px;object-fit:contain}
#outfit-name{display:block;font-size:14px}
#shop-panel #merchant-speech{position:absolute;left:24%;top:25%;max-width:220px;background:#f4deb6;color:#38291f;border:2px solid #614d37;border-radius:12px;padding:9px 12px;font-size:16px;line-height:1.25;pointer-events:none}
@media(pointer:coarse),(max-height:550px){#shop-panel .outfit-display{left:4%;top:18%;width:90px;height:100px;padding:2px}#stage #outfit-preview{width:74px;height:78px}#outfit-name{font-size:12px}#shop-panel #merchant-speech{top:20%;left:22%;max-width:190px;font-size:13px;padding:6px 9px}}

/* Printed cards inspired by the reference; the map stays clear behind the notice. */
#level-lock-panel,#controls-panel{backdrop-filter:none;background:#07181e28;z-index:140;padding:18px}
.paper-card,#overlay .paper-menu{color:#283333;background-color:#eadbb9;background-image:radial-gradient(#80664416 .7px,transparent .9px),linear-gradient(112deg,#f1e5c8,#dfcca4);background-size:5px 5px,100% 100%;border:7px double #596e66!important;border-radius:0!important;box-shadow:0 0 0 5px #e6d5ae,0 12px 35px #0008;outline:1px solid #ad8d6c;text-align:center}
#level-lock-panel .paper-card{width:min(430px,88vw);max-height:90dvh;padding:20px 24px;transform:rotate(-1.5deg);overflow:auto;background-color:#eadbb9;border-color:#596e66}
#level-lock-panel #lock-portrait{position:static;display:block;margin:0 auto 8px;width:110px;height:115px;object-fit:contain;border:2px solid #67685a;border-radius:50%;background:#c6b59b}
#level-lock-panel h2{font-size:30px;color:#283333;margin:8px 0}#level-lock-panel .eyebrow{font-size:13px;color:#6b4c40}
#level-lock-panel p,#controls-panel p{font-family:Georgia,serif;font-size:18px;color:#352d27;line-height:1.45}
#level-lock-panel button,#controls-panel button,#overlay .paper-menu button.paper-option,#overlay .paper-menu #start{background:transparent;border:0;box-shadow:none;color:#283333;font-weight:900;font-family:'Barlow Condensed',sans-serif;letter-spacing:.6px;font-size:26px;padding:7px 10px;min-height:44px;margin:0;min-width:0}
#level-lock-panel button:hover,#level-lock-panel button:focus-visible,#controls-panel button:hover,#overlay .paper-menu button:hover,#overlay .paper-menu button:focus-visible,#overlay .paper-menu summary:hover{color:#b63127}
#level-lock-panel button{color:#b63127}.paper-foot{display:block;color:#6d5a47;font-size:11px;margin-top:14px;letter-spacing:1px}.paper-progress{display:flex;align-items:center;gap:10px;margin:16px auto;color:#816a44;width:90%;font-weight:bold}.paper-progress i{height:5px;flex:1;border-top:2px solid #6b7f70;border-bottom:1px solid #6b7f70}
#overlay:has(.paper-menu){background:#08182042;backdrop-filter:none;padding:20px;overflow:auto}
#overlay .paper-menu{width:min(480px,90vw);max-height:calc(100dvh - 100px);overflow:auto;padding:25px 32px;margin:auto}
#overlay .paper-menu .eyebrow,#overlay .paper-menu .intro,#overlay .paper-menu .subtitle,#overlay .paper-menu .ornament{display:none}
#overlay .paper-menu h1{font-size:44px;color:#293633;text-shadow:none;letter-spacing:1px;margin:0 0 18px;line-height:.95}#overlay .paper-menu h1 em{color:#293633}
#overlay .paper-menu #start,#overlay .paper-menu .paper-option{display:block;width:100%;font-size:30px;line-height:1.1}#overlay .paper-menu #start{color:#b63127}
#overlay .paper-menu #loading{color:#756249;font-size:12px;margin:14px 0 0;line-height:1.3}
#menu-settings{margin:5px 0;color:#293633}#menu-settings summary{list-style:none;cursor:pointer;font:900 26px 'Barlow Condensed',sans-serif;padding:7px;min-height:44px}#menu-settings summary::-webkit-details-marker{display:none}#menu-settings .difficulty{margin:8px 0;gap:6px}#overlay .paper-menu .difficulty button{font-size:13px;color:#293633;border-color:#9a8a68;background:#dfcea8}#overlay .paper-menu .difficulty button.selected{background:#5b6b58;color:#fff4d4}#menu-settings .math-setting{font-size:14px;color:#293633}#menu-settings select{background:#f9edcf;color:#293633}
#controls-panel .paper-card{width:min(510px,90vw);max-height:90dvh;overflow:auto;padding:20px}
@media(orientation:landscape) and (max-height:550px){#overlay:has(.paper-menu){padding:12px}#overlay .paper-menu{width:360px;max-height:calc(100dvh - 65px);padding:12px 22px}#overlay .paper-menu h1{font-size:27px;margin:0 0 5px}#overlay .paper-menu #start,#overlay .paper-menu .paper-option,#menu-settings summary{font-size:23px;min-height:36px;padding:4px}#overlay .paper-menu #loading{margin:4px 0;font-size:11px}#level-lock-panel .paper-card{width:430px;max-height:92dvh;padding:12px 20px;transform:rotate(-1deg)}#level-lock-panel #lock-portrait{width:68px;height:70px;margin:0 auto 4px}#level-lock-panel h2{font-size:24px;margin:4px}#level-lock-panel p{font-size:16px;margin:6px 0}.paper-progress{margin:9px auto}.paper-foot{margin-top:5px}#controls-panel p{font-size:15px;line-height:1.35}}

#arena-panel #arena-action{position:absolute;left:0;bottom:4%;width:54%;height:82%;object-fit:contain;pointer-events:none}
#arena-panel .arena-card{position:relative;z-index:1}
#stage #merchant-animation{transform-origin:50% 95%;animation:merchant-breathe 2.8s ease-in-out infinite}
@keyframes merchant-breathe{0%,100%{transform:translateY(0) scaleY(1)}50%{transform:translateY(-2px) scaleY(1.012)}}
@media(pointer:coarse){#arena-panel #arena-action{width:49%;height:85%;left:0}}
@media(prefers-reduced-motion:reduce){#stage #merchant-animation{animation:none}}

#arena-panel #arena-canvas{display:none}

#stage #merchant-animation{right:25%;top:1%;width:50%;height:54%;object-position:center bottom}
#shop-panel .shop-card>header{position:relative;background:none;border:0;pointer-events:none}
#shop-panel .shop-card>header>div{background:#20150dd9;padding:6px 12px;border-radius:6px;max-width:34%;pointer-events:auto}
#shop-panel #shop-close{position:fixed;right:max(12px,env(safe-area-inset-right));top:10px;z-index:130;pointer-events:auto;background:#2b2018;border:2px solid #e1c38a;min-height:44px}
#shop-panel #merchant-speech{left:auto;right:4%;top:27%;max-width:20%}
#arena-panel #arena-action{left:0;bottom:0;width:100%;height:100%;object-fit:contain}
#arena-panel.combat-live .arena-card{position:absolute;inset:8px 12px auto;width:auto;max-width:none;max-height:none;padding:5px 10px;background:#172727a6;border:0;box-shadow:none;overflow:visible;pointer-events:none}
#arena-panel.combat-live .arena-card>h2,#arena-panel.combat-live .arena-card>.eyebrow,#arena-panel.combat-live .arena-card>p:first-of-type{display:none}
#arena-panel.combat-live #arena-score{font-size:23px}#arena-panel.combat-live #arena-prize{font-size:12px}#arena-panel.combat-live #arena-equation{font-size:16px;margin:3px}
#arena-panel.combat-live #arena-feedback{font-size:13px;margin:3px}
#arena-panel.combat-live .arena-footer{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);margin:0;pointer-events:auto}#arena-panel.combat-live #arena-invite{display:none}
#arena-controls{position:fixed;bottom:14px;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));display:flex;justify-content:space-between;pointer-events:none}#arena-controls[hidden]{display:none}#arena-controls>div{display:flex;gap:7px}#arena-controls button{pointer-events:auto;touch-action:none;min-height:55px;min-width:55px;border-radius:50%;font-size:12px;background:#19373dd9}#arena-controls [data-arena-key="KeyX"]{background:#943b31}
#arena-panel.arena-question .arena-card{inset:50% auto auto 50%;transform:translate(-50%,-50%);width:min(520px,85vw);padding:20px;background:#e9d8b5;color:#293c37;border:6px double #6e7e68;pointer-events:auto}#arena-panel.arena-question #arena-equation{font-size:36px;color:#293c37}#arena-panel.arena-question #arena-feedback,#arena-panel.arena-question #arena-prize,#arena-panel.arena-question #arena-score{color:#293c37}#arena-panel.arena-question #arena-controls{display:none}#arena-panel.arena-question .arena-footer{position:static;transform:none;margin:12px 0 0}
@media(pointer:coarse){#shop-panel .shop-card>header>div{max-width:34%;padding:4px 7px}#shop-panel #merchant-speech{font-size:12px;max-width:22%;right:2%}#arena-panel.combat-live .arena-footer button{font-size:10px;max-width:140px;min-height:36px;padding:4px}#arena-controls button{min-width:48px;min-height:48px;font-size:10px}#arena-panel.combat-live #arena-score{font-size:19px}}

/* Dedicated touch layer: decoration never intercepts a finger. */
.vignette,#mission,#message{pointer-events:none!important}
#touch{z-index:65;touch-action:none;user-select:none;-webkit-user-select:none}
#touch button,#joystick{touch-action:none;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}
#touch button:active{filter:brightness(1.4);transform:scale(.96)}
@media(pointer:coarse){
 #touch{left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));align-items:end}
 #joystick{width:96px!important;height:96px!important;background:#123f49a6;border:3px solid #f4dfaba6;box-shadow:0 3px 15px #0005}#joystick-knob{width:42px;height:42px}
 #touch .actions{grid-template-columns:52px 68px 70px;gap:8px}#touch .actions button{min-width:52px;width:52px;height:52px}
 #touch .actions [data-key="KeyX"]{width:68px;height:68px}#touch .actions [data-key="Space"]{width:70px;height:70px}#touch .actions small{font-size:10px}
 #stage.in-world #touch .actions{display:block}#stage.in-world #world-enter{width:78px;min-height:64px;font-size:14px}
 #stage.in-world #hub-near{left:125px;right:110px;bottom:12px;font-size:12px}
 #hud{inset:6px 10px auto;pointer-events:none}#hud button{pointer-events:auto;min-height:44px;min-width:44px}#mission{left:120px;right:220px;bottom:10px}
}

#arena-rain{position:absolute;inset:0;pointer-events:none;z-index:7}#arena-rain button{position:absolute;transform:translateX(-50%) rotate(-5deg);pointer-events:auto;min-width:76px;min-height:48px;background:#ffe5a0;color:#38251d;border:3px solid #54372c;border-radius:14px;font:bold 22px Georgia;box-shadow:0 4px 0 #714b37}#arena-bonus-form{position:absolute;left:50%;top:30%;transform:translateX(-50%);z-index:30;background:#fff0c9;color:#38251d;padding:16px;max-width:90%;width:330px;border:4px double #614333;display:flex;flex-wrap:wrap;gap:8px}#arena-bonus-form[hidden]{display:none}#arena-bonus-form label{width:100%;font-weight:bold}#arena-bonus-form input{width:100px;min-height:44px;font-size:22px}#arena-bonus-form button{min-height:44px}#bonus-close{margin-left:auto}

.scene-wallet{display:flex;align-items:center;gap:9px;padding:9px 13px;margin:6px 0;background:#30221c;border:2px solid #dfbd69;border-radius:9px;color:#ffe7a0;font:700 18px Georgia;box-shadow:0 3px 0 #130e0b}.scene-wallet span{font-size:27px;color:#ffd455}.scene-wallet small{font:10px sans-serif;display:block}.arena-wallet{position:absolute;left:16px;top:14px;z-index:10;margin:0}.combat-live .arena-wallet{position:fixed;left:12px;top:12px;font-size:14px;pointer-events:none}.arena-wallet small{max-width:65px}#stage #shop-panel header .scene-wallet{width:max-content;max-width:100%}@media(max-width:700px){.scene-wallet{font-size:14px;padding:5px 8px;gap:5px}.scene-wallet span{font-size:20px}.arena-wallet{top:8px;left:8px}.combat-live .arena-wallet{top:5px;left:5px;font-size:11px}.arena-wallet small{display:none}#stage #shop-panel header{max-width:42%}}
