*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{background:#171419;color:#fff1d6;font-family:"Trebuchet MS",Arial,sans-serif;overscroll-behavior:none}button,select{font:inherit}button{cursor:pointer;touch-action:none;-webkit-tap-highlight-color:transparent}button:focus-visible,select:focus-visible,canvas:focus-visible,a:focus-visible{outline:3px solid #70ded4;outline-offset:2px}button:disabled{cursor:wait;opacity:.65}[hidden]{display:none!important}.arcade-layout{height:100dvh;width:100%;display:flex;align-items:center;justify-content:center;position:relative}.game{--hud-h:92px;position:relative;height:min(100dvh,calc(100vw*760/420 + var(--hud-h)));width:min(100vw,calc((100dvh - var(--hud-h))*420/760));flex-shrink:0;background:#211b1a;overflow:hidden;isolation:isolate;user-select:none;-webkit-user-select:none;touch-action:none;container-type:inline-size}.playfield{position:absolute;inset:var(--hud-h) 0 0;overflow:hidden;background:#ddb776}.playfield canvas{width:100%;height:100%;display:block;touch-action:none}.desktop-panel,.keyboard-help{display:none}.status-bar{position:absolute;inset:0 0 auto;height:var(--hud-h);padding:4px 10px 0;background:#211b1a;border-bottom:2px solid #9c713d;z-index:6;display:grid;grid-template-rows:38px 30px 18px;gap:0;overflow:hidden}.hud{display:flex;align-items:center;gap:12px;min-width:0;font-weight:800}.lives{font-size:22px;color:#ff745f;letter-spacing:-2px;white-space:nowrap}.loot{display:flex;gap:4px;white-space:nowrap}.coin{color:#ffd173}.hud #score{font-size:13px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hud-actions{margin-left:auto;display:flex;gap:4px;align-items:center}.hud-actions button{border:1px solid #9c815d;background:#392b25;color:#ffefcc;width:32px;height:32px;border-radius:5px;font-size:20px}.language-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.language-picker select{width:55px;height:32px;background:#392b25;color:#ffefcc;border:1px solid #9c815d;border-radius:5px;font:12px system-ui;touch-action:manipulation}.subhud{display:flex;align-items:center;gap:12px;min-width:0;font-size:11px}.subhud #stage{flex:0 1 35%;font-size:11px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:.4px}.mission-hud,.boss-hud{flex:1;min-width:0;pointer-events:none}.mission-hud>div:first-child{display:flex;gap:6px;justify-content:space-between;align-items:center}.mission-hud #missionLabel{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mission-hud strong{white-space:nowrap;font-variant-numeric:tabular-nums}.mission-track,.boss-hud>div{height:3px;margin-top:4px;background:#514139;border-radius:2px;overflow:hidden}.mission-track i,.boss-hud i{display:block;height:100%;width:100%;background:#7bc1a0}.boss-hud #bossName{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;color:#ffb582;font-size:11px;font-weight:bold}.status-message{position:relative;min-width:0;font-size:11px;line-height:18px;color:#ebd7b3;pointer-events:none}.toast,.boss-hint{display:block;position:absolute;inset:0;text-align:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.toast{opacity:0;background:#211b1a;transition:opacity .12s}.toast.show{opacity:1}.boss-hint{color:#ffc973}.controls{--u:min(1vw,calc((100dvh - 92px)*420/76000));position:absolute;bottom:22px;left:0;right:0;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 14px;height:100px;z-index:4}.joystick{position:relative;width:calc(var(--u)*25);height:calc(var(--u)*25);flex-shrink:0;border-radius:50%;background:#553d2c58;border:2px solid #fff4d687;touch-action:none}.joystick-mark{position:absolute;inset:0;display:grid;place-items:center;color:#ffffff40;font-size:calc(var(--u)*20)}.stick{position:absolute;width:46%;height:46%;left:27%;top:27%;border-radius:50%;background:linear-gradient(#fff4d7d9,#bfaa8ed9);border:2px solid #fff8e6a1;box-shadow:0 3px 0 #684c3680;pointer-events:none}.fire-controls{display:flex;gap:6px;align-items:center}.fire-controls button{width:calc(var(--u)*14.5);height:calc(var(--u)*14.5);border-radius:50%;border:2px solid #ffe6b5;background:linear-gradient(#d27c53,#9e473b);box-shadow:0 3px 0 #663c2d;color:#fff6e5;font-size:calc(var(--u)*8);display:grid;place-items:center;padding:0;font-weight:bold}.fire-controls button[data-fire="0"]{width:calc(var(--u)*16);height:calc(var(--u)*16);background:linear-gradient(#55b7bd,#277b91)}.fire-controls button.active{transform:translateY(2px);filter:brightness(1.25)}.overlay{position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;padding:18px;background:#24180e44;backdrop-filter:blur(2px)}.card{text-align:center;width:100%;max-width:390px;max-height:95%;overflow-y:auto;padding:24px;background:linear-gradient(145deg,#fff0cf,#ead1a4);color:#513126;border:2px solid #fff2d6;border-radius:13px;box-shadow:0 5px 0 #a57748,0 17px 55px #291b1b66}.start-brand{font:700 20px Georgia,serif;letter-spacing:2px;color:#533327;margin:0 0 14px}.start-brand strong{color:#946127}.eyebrow{font-size:11px;font-weight:900;letter-spacing:1px;color:#94744f}h1{font:700 32px/1.08 Georgia,serif;margin:14px 0 12px}p{font-size:16px;line-height:1.5;margin:0 0 20px}.primary{width:100%;padding:14px 12px;background:linear-gradient(#389da5,#237881);color:#fff7df;border:2px solid #216c70;border-radius:9px;box-shadow:0 4px 0 #20565c;font-size:18px;font-weight:900;overflow-wrap:break-word}.primary:hover{filter:brightness(1.08)}.primary:active{transform:translateY(2px)}.instructions{font-size:13px;color:#7a6045;margin:17px 0 0;line-height:1.5}.secondary{width:100%;margin-top:14px;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}.result{display:flex;justify-content:center;gap:40px;margin:20px 0}.result span{font-size:14px;color:#8a6a4c}.result strong{display:block;font-size:28px;color:#4d3327;margin-top:5px}.hint{position:absolute;bottom:5px;left:0;right:0;text-align:center;font-size:9px;letter-spacing:2px;color:#503c26a0;pointer-events:none}.hint span{padding:0 5px}.map-panel{position:absolute;inset:0;z-index:3}.map-heading{position:absolute;top:8%;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: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:50px;height:50px;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:6px;font-size:13px;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:14px;max-height:28%;overflow-y:auto;background:linear-gradient(135deg,#fff0ce,#e8cfa1);color:#523529;border:2px solid #fff4dd;border-radius:11px;padding:12px 15px;box-shadow:0 4px 0 #86603c,0 10px 28px #28150d80}.map-brief h2{font:700 22px Georgia,serif;margin:4px 0 5px}.map-brief p{font-size:13px;line-height:1.35;margin:0 0 10px}.map-brief .primary{font-size:16px;padding:10px}.game.map-open .controls,.game.map-open .hint{display:none}.map-actions{display:flex}.map-actions .primary{flex:1}.game.map-open #stage{flex-basis:100%}
/* Desktop: all available window space; controls live below, outside the terrain. */
html[data-device="desktop"] .arcade-layout{display:flex;flex-direction:column;align-items:stretch}
html[data-device="desktop"] .game{--hud-h:78px;width:100%;height:calc(100dvh - 62px);flex:1;min-height:0;border:0;border-radius:0}
html[data-device="desktop"] .status-bar{padding:2px max(16px,calc((100vw - 1040px)/2));grid-template-rows:32px 24px 18px}
html[data-device="desktop"] .hud{gap:20px}html[data-device="desktop"] .hud #score{font-size:15px}html[data-device="desktop"] .subhud #stage{flex-basis:35%}
html[data-device="desktop"] .right-panel{display:flex;gap:18px;align-items:center;justify-content:center;min-height:62px;padding:8px 16px;background:#1b1718;border-top:1px solid #6b5036;z-index:7}
html[data-device="desktop"] .right-panel h2{display:none}.back-link{color:#eac58c;text-decoration:none;font-size:12px;white-space:nowrap}.right-panel .desktop-only{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 18px;font-size:11px;margin:0;color:#e3cfb0;line-height:1.4}.key-group{white-space:nowrap}kbd{display:inline-block;font:11px monospace;padding:2px 4px;border:1px solid #756047;border-radius:3px;background:#332923;color:#ffdf9d}.right-panel #desktopControls{min-width:185px}.right-panel .controls{position:static;--u:2.4px;height:44px;padding:0;gap:12px}.right-panel .joystick{width:44px;height:44px}.right-panel .joystick-mark{font-size:36px}.right-panel .fire-controls{gap:6px}.right-panel .fire-controls button{width:36px;height:36px;font-size:22px}.right-panel .fire-controls button[data-fire="0"]{width:40px;height:40px}.right-panel .stick{border-width:1px}
html[data-device="desktop"] .keyboard-help{display:block}html[data-device="desktop"] .touch-help,html[data-device="desktop"] .hint{display:none}
html[data-device="desktop"] .map-heading,html[data-device="desktop"] .map-nodes,html[data-device="desktop"] .map-brief{left:max(17px,calc(50% - 290px));right:max(17px,calc(50% - 290px))}
html[data-device="desktop"] .map-brief{max-height:29%;bottom:14px}html[data-device="desktop"] .card{max-width:460px}
/* iPad landscape preserves the portrait action field and puts touch pads on the sides. */
@media(min-width:760px) and (orientation:landscape){html[data-device="tablet"] .game{width:calc((100dvh - 92px)*420/760)}html[data-device="tablet"] .arcade-layout>.controls{--u:4.2px;bottom:35px;padding:0 24px;pointer-events:none!important}html[data-device="tablet"] .arcade-layout>.controls .joystick,html[data-device="tablet"] .arcade-layout>.controls .fire-controls{pointer-events:auto}}
@media(max-width:800px){html[data-device="desktop"] .right-panel{gap:8px;padding:6px 8px;min-height:84px}html[data-device="desktop"] .game{height:calc(100dvh - 84px)}.right-panel .desktop-only{font-size:10px;gap:3px 8px}.right-panel kbd{font-size:10px}.right-panel .back-link{display:none}.right-panel #desktopControls{min-width:160px}.right-panel .joystick{width:36px;height:36px}.right-panel .fire-controls button{width:30px;height:30px}.right-panel .fire-controls button[data-fire="0"]{width:34px;height:34px}}
@media(max-width:370px){.hud{gap:6px}.lives{font-size:19px}.loot{font-size:12px}.hud #score{font-size:11px}.hud-actions{gap:2px}.hud-actions button{width:28px}.language-picker select{width:46px}.status-bar{padding-left:6px;padding-right:6px}}
@media(max-height:620px){.card{padding:16px}.card h1{font-size:26px}.card p{font-size:13px;margin-bottom:12px}.start-brand{font-size:16px;margin-bottom:9px}.instructions{margin-top:10px}.map-heading{top:3%}.map-heading h1{font-size:20px}.map-node .seal{width:38px;height:38px}.map-node strong{font-size:11px}.map-brief{padding:8px 12px}.map-brief h2{font-size:18px}}
@media(prefers-reduced-motion:reduce){.toast{transition:none}}

html[data-device="desktop"] .playfield canvas{object-fit:contain}

.course-help{font-size:12px!important;line-height:1.45!important;margin:0 0 12px!important}.card{max-height:94%;overflow-y:auto;overscroll-behavior:contain}

.audio-settings{border:1px solid #b38a5260;border-radius:12px;margin:0 0 16px;padding:10px 14px;text-align:left}.audio-settings legend{font-size:13px;font-weight:700;padding:0 6px}.audio-settings label{display:flex;justify-content:space-between;gap:12px;font:14px system-ui}.audio-settings input{display:block;width:100%;height:28px;accent-color:#2e9198;cursor:pointer;margin:2px 0 7px}.audio-settings output{font-variant-numeric:tabular-nums}.audio-settings input:focus-visible{outline:2px solid #246d79;outline-offset:3px}

/* Wanted notice precedes combat; scrollable at short landscape heights. */
.wanted-card{border:3px double #80542e;background:linear-gradient(135deg,#f9e5b7,#dfc18a);padding:18px 22px}.wanted-card h1{font-size:clamp(25px,8cqw,36px);letter-spacing:3px;margin:0 0 6px}.wanted-card h2{font:700 25px Georgia,serif;margin:0 0 4px}.wanted-card #wantedPortrait{position:static;display:block;width:150px;height:125px;margin:0 auto 8px;border:1px solid #82532d55;background:#bfa37735}.wanted-card p{font-size:14px;line-height:1.35;margin:0 0 10px}.wanted-village{font-weight:700}.wanted-prize{display:flex;justify-content:center;align-items:baseline;gap:8px;border-block:1px solid #80542e66;padding:8px 0;margin:0 0 12px}.wanted-prize strong{font:700 28px Georgia,serif}.wanted-objective{font-size:13px!important}.wanted-card .primary{min-height:44px}.wanted-card{touch-action:pan-y}
@media(orientation:landscape) and (max-height:600px){.wanted-card #wantedPortrait{width:108px;height:90px}.wanted-card{padding:12px 18px}.wanted-card h1{font-size:25px}.wanted-card h2{font-size:21px}}

.wanted-card[data-wanted="big-jack"]{border-color:#60272a;background:linear-gradient(135deg,#f9e5b7,#dbba85)}.wanted-card[data-wanted="big-jack"] h2{color:#6d202a}
.wanted-card[data-wanted="rose-la-rafale"]{border-color:#683452;background:linear-gradient(135deg,#f9e5d6,#dfbfad)}.wanted-card[data-wanted="rose-la-rafale"] h2{color:#763257}
.wanted-card[data-wanted="el-coyote"]{border-color:#326864;background:linear-gradient(135deg,#fff0c4,#d9bd85)}.wanted-card[data-wanted="el-coyote"] h2{color:#256a68}

.defeat-portrait{display:block;width:min(250px,72cqw);height:auto;max-height:32dvh;object-fit:contain;margin:0 auto 8px}
@media(orientation:landscape) and (max-height:600px){.defeat-portrait{width:140px;max-height:110px}}

/* Slightly larger phone joystick, including its actual touch surface. */
html[data-device="mobile"] .joystick{width:calc(var(--u)*30);height:calc(var(--u)*30)}
html[data-device="mobile"] .joystick-mark{font-size:calc(var(--u)*24)}
