*{box-sizing:border-box}html,body{margin:0;height:100%;overflow:hidden}body{background:radial-gradient(ellipse at 50% 35%,#654735 0,#282027 54%,#15151c 100%);display:flex;align-items:center;justify-content:center;font-family:ui-rounded,"Trebuchet MS",Arial,sans-serif;color:#fff4df;overscroll-behavior:none}button{font:inherit;cursor:pointer;touch-action:none;-webkit-tap-highlight-color:transparent}button:focus-visible,canvas:focus-visible{outline:3px solid #63ddd8;outline-offset:3px}button:disabled{cursor:wait;opacity:.65}[hidden]{display:none!important}.game{position:relative;width:min(100vw,calc(100svh * 420 / 760));height:min(100svh,calc(100vw * 760 / 420));overflow:hidden;isolation:isolate;background:#dbad70;box-shadow:0 0 100px #0008;touch-action:none;user-select:none;-webkit-user-select:none}canvas{display:block;width:100%;height:100%;touch-action:none}.hud{position:absolute;inset:0 0 auto;display:flex;align-items:flex-start;justify-content:space-between;padding: max(16px, env(safe-area-inset-top)) 13px 4px;background:linear-gradient(#452817bb,transparent);pointer-events:none}.lives{font-size:clamp(18px,5.2vw,27px);color:#ff725a;letter-spacing:-2px;text-shadow:0 2px #743b2c,0 0 3px #642c1d;white-space:nowrap;padding-top:7px}.brand{text-align:center;background:linear-gradient(#684430,#402a23);padding:8px 13px 10px;border-radius:5px;border:2px solid #aa774a;box-shadow:0 3px 0 #281d15,0 7px 16px #29180038;transform:rotate(-1deg);font-family:Georgia,serif;line-height:1.05;text-shadow:0 2px #291d15}.brand span{font-weight:800;font-size:14px;letter-spacing:4px;display:block}.brand strong{font-size:22px;letter-spacing:.5px;color:#ffda84}.loot{background:#4b2e25df;border:1px solid #b08a57;padding:8px 11px;border-radius:20px;font-weight:800;display:flex;gap:7px;align-items:center;min-width:57px}.coin{color:#ffce53;font-size:21px;line-height:1;text-shadow:0 1px #a96a16}.subhud{position:absolute;top:88px;left:16px;right:16px;display:flex;align-items:center;justify-content:space-between;font-size:14px;font-weight:800;color:#fff9e9;text-shadow:0 1px 3px #351e0d}.subhud>span{padding:5px 9px;background:#4c3128a3;border-radius:7px}#stage{letter-spacing:1px;font-size:12px}.subhud>div{display:flex;gap:5px}.subhud button{border:1px solid #ffffff65;background:#4c3128cc;color:#fff4de;width:32px;height:32px;border-radius:50%;font-weight:bold;font-size:17px}.boss-hud{position:absolute;top:130px;left:24%;right:24%;text-align:center;font-size:12px;letter-spacing:2px;font-weight:800;text-shadow:0 1px #4f1c14}.boss-hud>div{height:9px;background:#50362a;border:2px solid #71452b;border-radius:10px;overflow:hidden;margin-top:5px}.boss-hud i{display:block;height:100%;background:#fa7254;width:100%;transition:width .15s}.controls{position:absolute;left:0;right:0;bottom:25px;height:110px;display:flex;align-items:center;justify-content:space-between;padding:0 15px;transition:opacity .15s}.joystick{position:relative;width:106px;height:106px;border-radius:50%;background:#553d2c58;border:2px solid #fff4d687;box-shadow:inset 0 0 0 7px #67452a22,0 3px 12px #392c2425;touch-action:none}.joystick-mark{position:absolute;inset:8px;display:flex;align-items:center;justify-content:center;color:#ffffff40;font-size:88px;font-weight:400}.stick{position:absolute;width:49px;height:49px;border-radius:50%;background:linear-gradient(#fff4d7d9,#bfaa8ed9);border:2px solid #fff8e6a1;box-shadow:0 3px 0 #684c3680;left:26.5px;top:26.5px;pointer-events:none}.fire-controls{display:flex;align-items:center;gap:6px;padding-top:25px}.fire-controls button{width:62px;height:62px;border-radius:50%;border:3px solid #ffe6b5;background:linear-gradient(#d27c53,#9e473b);box-shadow:0 4px 0 #663c2d,0 0 0 2px #65452d, inset 0 0 0 3px #f6b2736b;color:#fff6e5;font-size:37px;line-height:1;font-weight:800;display:grid;place-items:center;padding:0}.fire-controls button[data-fire="0"]{width:69px;height:69px;background:linear-gradient(#55b7bd,#277b91);box-shadow:0 4px 0 #315563,0 0 0 2px #65452d,inset 0 0 0 3px #89d7d96b}.fire-controls button.active{transform:translateY(3px);filter:brightness(1.2);box-shadow:0 1px 0 #663c2d,0 0 0 2px #65452d}.overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:24px;background:linear-gradient(#2c211111,#2c21114d 65%,#2c211180);backdrop-filter:blur(2px);z-index:5}.card{text-align:center;width:100%;max-width:340px;padding:27px 22px 23px;background:linear-gradient(145deg,#fff0cf,#ead1a4);color:#513126;border:2px solid #fff2d6;border-radius:15px;box-shadow:0 5px 0 #a57748,0 17px 55px #291b1b66;transform:rotate(-.6deg)}.eyebrow{font-size:12px;font-weight:900;letter-spacing:1.5px;color:#94744f}h1{font-family:Georgia,serif;font-size:clamp(27px,7.2vw,34px);margin:14px 0 12px;line-height:1.08;letter-spacing:-1px}p{font-size:16px;line-height:1.5;margin:0 0 20px}.primary{width:100%;padding:15px 13px;background:linear-gradient(#389da5,#237881);color:#fff7df;border:2px solid #216c70;border-radius:10px;box-shadow:0 4px 0 #20565c;font-size:18px;font-weight:900}.primary:hover{filter:brightness(1.08)}.primary:active{transform:translateY(3px);box-shadow:0 1px 0 #20565c}.instructions{font-size:14px;color:#7a6045;margin:19px 0 0;line-height:1.5}.touch-help{display:none}.hint{position:absolute;bottom:7px;left:0;right:0;text-align:center;font-size:10px;font-weight:900;letter-spacing:2px;color:#5b4630b3;pointer-events:none}.hint span{padding:0 7px}.result{display:flex;justify-content:center;gap:42px;margin:22px 0 26px}.result span{font-size:14px;color:#8a6a4c}.result strong{display:block;font-size:28px;color:#4d3327;margin-top:5px}.toast{position:absolute;top:22%;left:12px;right:12px;text-align:center;pointer-events:none;font-family:Georgia,serif;font-weight:bold;font-size:23px;color:#fff8d9;text-shadow:0 2px 4px #482718;opacity:0;transition:opacity .25s}.toast.show{opacity:1}@media(pointer:coarse){.touch-help{display:block}.keyboard-help{display:none}}@media(max-height:620px){.card{padding:17px}.card h1{font-size:28px}.card p{margin-bottom:12px}.instructions{margin-top:13px}.hud{padding-top:10px}.subhud{top:79px}}@media(prefers-reduced-motion:reduce){.boss-hud i,.toast{transition:none}.card{transform:none}}
/* Scale the touch controls with the portrait play area on smaller screens. */
.game{--u:min(1vw,calc(1svh * 420 / 760))}.controls{height:calc(var(--u) * 26.19);bottom:calc(var(--u) * 5.95);padding:0 calc(var(--u) * 3.57)}.joystick{width:calc(var(--u) * 25.24);height:calc(var(--u) * 25.24);flex-shrink:0}.joystick-mark{inset:calc(var(--u) * 1.9);font-size:calc(var(--u) * 20.95)}.stick{width:calc(var(--u) * 11.67);height:calc(var(--u) * 11.67);left:calc(var(--u) * 6.31);top:calc(var(--u) * 6.31)}.fire-controls{gap:calc(var(--u) * 1.43);padding-top:calc(var(--u) * 5.95)}.fire-controls button{width:calc(var(--u) * 14.76);height:calc(var(--u) * 14.76);font-size:calc(var(--u) * 8.81)}.fire-controls button[data-fire="0"]{width:calc(var(--u) * 16.43);height:calc(var(--u) * 16.43)}
.boss-hud{left:20%;right:20%;letter-spacing:1px}.boss-hint{display:block;margin-top:5px;font-size:12px;line-height:1.25;letter-spacing:.2px;color:#fff8e4;text-shadow:0 1px 3px #4b2d18}.boss-hud>span:first-child{display:block;background:#563527b3;border-radius:5px;padding:3px 5px}.boss-hud .boss-hint{background:#563527a3;border-radius:5px;padding:3px 4px}
.game{container-type:inline-size}.mission-hud{position:absolute;top:127px;left:17px;right:17px;padding:7px 10px;background:#493329cc;border:1px solid #f3d29775;border-radius:8px;pointer-events:none}.mission-hud>div:first-child{display:flex;justify-content:space-between;gap:10px;font-size:14px}.mission-track{height:5px;background:#241b19;margin-top:5px;border-radius:5px;overflow:hidden}.mission-track i{display:block;height:100%;background:#7bc1a0;width:100%}.game.has-boss .mission-hud{top:auto;bottom:155px;left:25%;right:25%;padding:5px 8px}.game.has-boss .mission-hud>div:first-child{font-size:12px}.map-panel{position:absolute;inset:0;z-index:3}.map-heading{position:absolute;top:17%;left:14px;right:14px;text-align:center;color:#fff4d4;text-shadow:0 2px 5px #332416}.map-heading .eyebrow{color:#ffe7b0}.map-heading h1{font-size:clamp(21px,6cqw,26px);margin:6px 0}.map-heading p{font-size:14px;margin:0;font-weight:800}.map-nodes{position:absolute;top:29%;left:0;right:0;height:44%}.map-node{position:absolute;transform:translate(-50%,-50%);border:0;background:transparent;color:#fff6d7;width:138px;display:flex;flex-direction:column;align-items:center;padding:0}.map-node:disabled{cursor:default;opacity:1}.map-node .seal{display:grid;place-items:center;width:51px;height:51px;border:3px solid #ffe2a1;border-radius:50%;background:#9a5838;box-shadow:0 4px 0 #5d3d2b,0 5px 15px #27190f80;font:bold 27px Georgia;color:#fff1c2}.map-node.available .seal{background:#c36940;box-shadow:0 0 0 6px #ffcf6630,0 4px 0 #5d3d2b}.map-node.protected .seal{background:#2d8078;border-color:#beecd3}.map-node.locked .seal{background:#665747;border-color:#c4b28e;color:#cbbc9c}.map-node strong{margin-top:8px;font-size:14px;background:#372b20df;border:1px solid #e9c4867a;border-radius:5px;padding:4px 8px;white-space:nowrap}.map-node small{font-size:12px;background:#372b20bd;padding:2px 7px;border-radius:3px;color:#f7dfaf}.map-brief{position:absolute;left:17px;right:17px;bottom:22px;background:linear-gradient(135deg,#fff0ce,#e8cfa1);color:#523529;border:2px solid #fff4dd;border-radius:13px;padding:13px 15px;box-shadow:0 4px 0 #86603c,0 10px 28px #28150d80}.map-brief h2{font-family:Georgia,serif;font-size:22px;margin:4px 0 5px}.map-brief p{font-size:14px;line-height:1.35;margin:0 0 11px}.map-brief .primary{font-size:16px;padding:11px}.map-brief .eyebrow{font-size:12px}.secondary{width:100%;margin-top:15px;border:1px solid #9d7957;background:#dfc295;color:#523529;border-radius:8px;padding:10px;font-size:15px;font-weight:bold}.card small{display:block;font-size:12px;line-height:1.3;color:#826344;margin-top:8px}.game.map-open .controls,.game.map-open .hint{display:none}.game.map-open .subhud #stage{font-size:12px}.toast{z-index:4}.boss-hud{z-index:2}@media(max-height:620px){.map-heading{top:16%}.map-heading h1{font-size:20px}.map-brief{bottom:12px;padding:9px 12px}.map-brief h2{font-size:19px}.map-brief p{margin-bottom:7px}.map-node .seal{width:44px;height:44px}.map-node strong{margin-top:5px}}

.map-actions{display:flex;align-items:stretch;gap:8px}.map-actions .primary{flex:1.3;width:0;line-height:1.2}.map-actions .secondary{flex:1;width:0;margin:0;padding:10px 7px;font-size:14px;line-height:1.2;background:#e7cd9c;border:2px solid #ad895b;box-shadow:0 3px 0 #ad895b}.lives{font-size:clamp(17px,4.9vw,23px);letter-spacing:-1px}

/* Arcade layout: portrait playfield preserves the same view on every device. */
.arcade-layout{display:flex;align-items:center;justify-content:center;gap:24px;width:100%;height:100dvh;position:relative}.desktop-panel{display:none}.tablet-only{display:none}
@media(min-width:1000px) and (min-height:650px){
 .arcade-layout{padding:20px}.game{height:calc(100dvh - 40px);width:calc((100dvh - 40px)*420/760);max-width:calc(100vw - 520px);max-height:calc((100vw - 520px)*760/420);--u:1cqw;border-radius:12px;border:2px solid #bf956b55}
 .desktop-panel{display:block;width:210px;flex-shrink:0;color:#f5dfb9}.desktop-panel a{color:#f9cc7a;text-decoration:none;font-size:15px}.desktop-panel h2{font:900 30px/1.1 Georgia,serif;color:#ffda84}.desktop-panel p{font-size:15px;line-height:1.8;color:#c5ac94}.desktop-panel .edition{font-size:12px;letter-spacing:2px;color:#79d4cf;margin-top:30px}.desktop-panel kbd{display:inline-block;background:#342b29;border:1px solid #b2946b;border-radius:4px;min-width:30px;padding:1px 7px;margin:4px 7px 4px 0;font:13px monospace}.right-panel h2{font-size:23px}
}
@media(pointer:fine) and (hover:hover){.controls{display:none!important}.hint{bottom:18px;color:#4b3127}.keyboard-help{display:block}.touch-help{display:none}}
@media(pointer:coarse) and (min-width:760px) and (orientation:portrait){.game{width:min(100vw,calc(100dvh*420/760));height:min(100dvh,calc(100vw*760/420));--u:1cqw}.card{max-width:430px;padding:34px}.card h1{font-size:40px}.card p{font-size:19px}.primary{font-size:21px;padding:18px}.map-brief{padding:20px;bottom:28px}.map-brief h2{font-size:28px}.map-brief p{font-size:18px}.map-heading h1{font-size:32px}.map-node strong{font-size:18px}}
@media(pointer:coarse) and (min-width:760px) and (orientation:landscape){
 .arcade-layout{padding:12px;gap:20px}.game{height:calc(100dvh - 24px);width:calc((100dvh - 24px)*420/760);max-width:none;max-height:none;--u:1cqw;border-radius:10px}.desktop-panel{display:block;width:150px;align-self:flex-start;margin-top:40px}.desktop-only{display:none}.tablet-only{display:block}.desktop-panel h2{font:900 24px/1.1 Georgia;color:#ffda84}.desktop-panel p{font-size:14px;color:#ceb799;line-height:1.5}.desktop-panel a{color:#ffda84;font-size:14px}.right-panel{margin-top:65px}.right-panel h2{font-size:19px}
 .arcade-layout>.controls{position:absolute;bottom:max(35px,env(safe-area-inset-bottom));left:0;right:0;padding:0 25px;height:125px;z-index:8;pointer-events:none!important;--u:4.2px}.arcade-layout>.controls .joystick,.arcade-layout>.controls .fire-controls{pointer-events:auto}.arcade-layout>.controls .joystick{width:120px;height:120px}.arcade-layout>.controls .stick{left:33.5px;top:33.5px;width:49px;height:49px}.arcade-layout>.controls .fire-controls{gap:7px}.arcade-layout>.controls .fire-controls button{width:58px;height:58px;font-size:34px}.arcade-layout>.controls .fire-controls button[data-fire="0"]{width:64px;height:64px}
}

@media(min-width:760px) and (orientation:portrait){html[data-device="tablet"] .game{width:min(100vw,calc(100dvh*420/760));height:min(100dvh,calc(100vw*760/420));--u:1cqw}html[data-device="tablet"] .card{max-width:430px;padding:34px}html[data-device="tablet"] .card h1{font-size:40px}html[data-device="tablet"] .card p{font-size:19px}html[data-device="tablet"] .primary{font-size:21px;padding:18px}html[data-device="tablet"] .map-brief{padding:20px;bottom:28px}html[data-device="tablet"] .map-brief h2{font-size:28px}html[data-device="tablet"] .map-brief p{font-size:18px}html[data-device="tablet"] .map-heading h1{font-size:32px}html[data-device="tablet"] .map-node strong{font-size:18px}}

@media(min-width:760px) and (orientation:landscape){html[data-device="tablet"] .arcade-layout{padding:12px;gap:20px}html[data-device="tablet"] .game{height:calc(100dvh - 24px);width:calc((100dvh - 24px)*420/760);max-width:none;max-height:none;--u:1cqw;border-radius:10px}html[data-device="tablet"] .desktop-panel{display:block;width:150px;align-self:flex-start;margin-top:40px}html[data-device="tablet"] .desktop-only{display:none}html[data-device="tablet"] .tablet-only{display:block}html[data-device="tablet"] .desktop-panel h2{font:900 24px/1.1 Georgia;color:#ffda84}html[data-device="tablet"] .desktop-panel p{font-size:14px;color:#ceb799;line-height:1.5}html[data-device="tablet"] .desktop-panel a{color:#ffda84;font-size:14px}html[data-device="tablet"] .right-panel{margin-top:65px}html[data-device="tablet"] .right-panel h2{font-size:19px}html[data-device="tablet"] .arcade-layout>.controls{position:absolute;bottom:max(35px,env(safe-area-inset-bottom));left:0;right:0;padding:0 25px;height:125px;z-index:8;pointer-events:none!important;--u:4.2px}html[data-device="tablet"] .arcade-layout>.controls .joystick,html[data-device="tablet"] .arcade-layout>.controls .fire-controls{pointer-events:auto}html[data-device="tablet"] .arcade-layout>.controls .joystick{width:120px;height:120px}html[data-device="tablet"] .arcade-layout>.controls .stick{left:33.5px;top:33.5px;width:49px;height:49px}html[data-device="tablet"] .arcade-layout>.controls .fire-controls{gap:7px}html[data-device="tablet"] .arcade-layout>.controls .fire-controls button{width:58px;height:58px;font-size:34px}html[data-device="tablet"] .arcade-layout>.controls .fire-controls button[data-fire="0"]{width:64px;height:64px}
}

html[data-device="desktop"] .controls{display:none!important}
html[data-device="desktop"] .keyboard-help{display:block}
html[data-device="desktop"] .touch-help{display:none}
html[data-device="tablet"] .controls:not([hidden]),html[data-device="mobile"] .controls:not([hidden]){display:flex!important}
html[data-device="tablet"] .game.map-open .controls,html[data-device="mobile"] .game.map-open .controls{display:none!important}
html[data-device="tablet"] .touch-help,html[data-device="mobile"] .touch-help{display:block}
html[data-device="tablet"] .keyboard-help,html[data-device="mobile"] .keyboard-help{display:none}
html[data-device="tablet"] .desktop-only{display:none}
html[data-device="tablet"] .tablet-only{display:block}

/* V13: desktop buttons and keyboard reference remain available at every width. */
html[data-device="desktop"] .controls:not([hidden]){display:flex!important}
html[data-device="desktop"] .arcade-layout{--play-h:min(calc(100dvh - 32px),calc((100vw - 300px)*760/420));display:grid;grid-template-columns:calc(var(--play-h)*420/760) 220px;gap:24px;justify-content:center;align-items:center;padding:16px}
html[data-device="desktop"] .game{grid-column:1;grid-row:1;width:calc(var(--play-h)*420/760);height:var(--play-h);max-width:none;max-height:none;--u:1cqw;border-radius:10px}
html[data-device="desktop"] .desktop-panel:first-child{display:none}
html[data-device="desktop"] .right-panel{display:block;grid-column:2;grid-row:1;width:220px;align-self:center;margin:0;padding:20px;background:#211c22e8;border:1px solid #bc946e66;border-radius:12px}
html[data-device="desktop"] .right-panel h2{font:700 23px Georgia,serif;margin:0 0 16px;color:#ffda84}
html[data-device="desktop"] .right-panel .desktop-only{display:block;font-size:14px;color:#e1c7a8;line-height:1.7;margin:0}
html[data-device="desktop"] .right-panel .tablet-only{display:none}
html[data-device="desktop"] .right-panel p:last-child{font-size:12px;color:#bca78d;margin:14px 0 0}
html[data-device="desktop"] .right-panel kbd{display:inline-block;min-width:28px;background:#46392e;border:1px solid #b2946b;border-radius:4px;padding:1px 6px;margin:3px 6px 3px 0;font:12px monospace;color:#fff2d5}
html[data-device="desktop"] .right-panel .key-group{display:block;margin-bottom:12px}
html[data-device="desktop"] .hint{bottom:7px}
@media(max-width:719px){
 html[data-device="desktop"] .arcade-layout{--play-h:min(calc(100dvh - 154px),calc((100vw - 24px)*760/420));grid-template-columns:1fr;grid-template-rows:var(--play-h) auto;gap:10px;padding:8px 12px;align-content:center}
 html[data-device="desktop"] .game{justify-self:center}
 html[data-device="desktop"] .right-panel{grid-column:1;grid-row:2;width:100%;max-width:550px;padding:9px 12px;justify-self:center}
 html[data-device="desktop"] .right-panel h2{font-size:15px;margin:0 0 5px}
 html[data-device="desktop"] .right-panel .desktop-only{display:flex;flex-wrap:wrap;gap:2px 14px;line-height:1.3;font-size:11px}
 html[data-device="desktop"] .right-panel .key-group{margin:0}
 html[data-device="desktop"] .right-panel kbd{font-size:10px;margin:2px 3px 2px 0;padding:1px 3px;min-width:18px}
 html[data-device="desktop"] .right-panel p:last-child{display:none}
}

.language-picker{display:inline-flex;align-items:center}.language-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.language-picker select{background:#4c3128ee;color:#fff4de;border:1px solid #ffffff80;border-radius:6px;width:55px;height:32px;font:12px system-ui;touch-action:manipulation}.language-picker select:focus-visible{outline:3px solid #63ddd8;outline-offset:2px}.subhud>div{flex-shrink:0}.subhud{gap:5px}.subhud>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card{max-height:95%;overflow-y:auto}.primary,.secondary{overflow-wrap:break-word}.map-brief{max-height:32%;overflow-y:auto}.map-brief p{font-size:13px}.right-panel{max-height:calc(100dvh - 32px);overflow-y:auto}

.subhud{z-index:6}.subhud select{cursor:pointer}html[data-device="desktop"] .right-panel{z-index:7}
