[hidden]{display:none!important}
:root{font-family:Tahoma,Arial,sans-serif;color:#f9e7b5;background:#283f37;color-scheme:dark}*{box-sizing:border-box}body{margin:0;min-height:100svh;background:radial-gradient(ellipse at 50% 10%,#4c6250,#243c34 80%)}button{-webkit-tap-highlight-color:transparent;font:inherit;cursor:pointer;color:inherit;border:2px solid #392e27;background:#4f6253;border-radius:12px;touch-action:none;user-select:none;-webkit-user-select:none;box-shadow:0 3px 0 #201f1d}button:focus-visible{outline:3px solid #ffe296;outline-offset:3px}button:hover{filter:brightness(1.12)}button:active,button.held{transform:translateY(2px);box-shadow:0 1px 0 #201f1d;filter:brightness(1.2)}#app{width:min(1160px,100%);margin:auto;padding:0 28px}header{height:90px;display:flex;align-items:center;justify-content:space-between;direction:ltr}.brand{font-size:25px;font-weight:1000;letter-spacing:1px;color:#f3cb68;text-shadow:2px 3px #292a24,-1px -1px #fff0a6;transform:rotate(-2deg)}.brand b{color:#e98c59}.brand span{display:block;text-align:center;font-size:10px;letter-spacing:0;color:#dacda8;text-shadow:none;margin-top:5px}.chapter{font-size:12px;direction:rtl;color:#dccfa9}.chapter span{color:#d99a4b;padding:0 10px}.tools{display:flex;gap:8px}.tools button{width:36px;height:34px;font-size:21px}#stage{position:relative;aspect-ratio:9/16;width:min(100%,calc(82svh * 9 / 16));margin-inline:auto;border-radius:22px;overflow:hidden;box-shadow:0 0 0 3px #3b3026,0 0 0 8px #937048,0 0 0 10px #392e27,0 25px 55px #0005;border:3px solid #d5a667;background:#a3bab4}canvas{display:block;width:100%;height:100%;touch-action:none}#hud{position:absolute;inset:17px 20px auto;display:flex;flex-direction:row;direction:ltr;align-items:flex-start;gap:8px;pointer-events:none;font-size:15px;font-weight:bold}#hud[hidden]{display:none}#overlay{position:absolute;inset:0;background:linear-gradient(270deg,#233b3455,#233b3400);display:flex;align-items:center;justify-content:flex-start;padding:3.5% 5%;z-index:3}#overlay[hidden]{display:none}.panel{container-type:inline-size;width:44%;max-width:420px;background:#eee0badf;border:3px solid #49382c;outline:5px solid #bc8d57;border-radius:90px 85px 24px 24px;box-shadow:8px 12px 0 #39342944;padding:30px 26px 20px;text-align:center;color:#49382c;transform:rotate(1deg)}.eyebrow{font-size:10px;color:#7d603d}h1{font-size:clamp(22px,11cqi,50px);line-height:1.1;margin:16px 0 12px;font-weight:1000;color:#52775b;text-shadow:2px 3px #c5b481}h1 em{font-style:normal;color:#ba633f}.panel>p{font-size:12px;line-height:1.8;margin:12px auto;max-width:300px}.pills{display:flex;justify-content:center;gap:7px;margin:14px 0}.pills span{border:1px dashed #997a50;border-radius:5px;padding:5px 6px;font-size:9px}.primary{background:#c16744;color:#fff0c0;border:2px solid #49382c;padding:12px 22px;min-width:190px;font-weight:bold;font-size:17px;box-shadow:0 4px #834b33;transform:rotate(-2deg)}.primary span{float:left;margin-right:24px;font-size:13px;margin-top:3px}.panel .instructions{font-size:9px;line-height:1.8;color:#7e694d;margin-top:16px}#toast{position:absolute;top:90px;left:50%;transform:translateX(-50%);max-width:min(88%,420px);border-style:solid;border-width:26px 24px 38px;border-image-source:url('../assets/ui/toast-frame.png');border-image-slice:73 82 131 83;border-image-width:26px 24px 38px;border-image-outset:0;border-image-repeat:stretch;padding:6px 10px;color:#f3e7c9;font-size:13px;font-weight:bold;text-align:center;line-height:1.35;text-shadow:0 2px 4px #000,0 0 10px #000c;opacity:0;pointer-events:none;transition:opacity .25s;white-space:normal;z-index:9}#toast.show{opacity:1}#controls{display:flex;direction:ltr;align-items:center;justify-content:space-between;padding:27px 0 18px;user-select:none;-webkit-user-select:none}#controls>div{display:flex;gap:12px;align-items:center}#controls button{width:67px;height:57px;font-size:24px;background:#ead6aa;color:#514130;border:2px solid #3a3126;box-shadow:0 4px #171f19;border-radius:18px}#controls small{display:block;font-size:10px;margin-top:-3px}#controls .jump{background:#d99958;width:78px;transform:rotate(3deg)}#controls .shoot{background:#9bac83}.control-hint{font-size:11px;color:#b4b695}footer{padding:16px 0 20px;border-top:1px dashed #f1d5a325;display:flex;justify-content:space-between;direction:ltr;font-size:9px;letter-spacing:1px;color:#9aa68a}.rotate-note{display:none}
@media(max-width:650px){#app{padding:0 14px}header{height:72px}.brand{font-size:20px}.chapter{display:none}#stage{border-radius:14px;width:min(100%,calc(88svh * 9 / 16))}#overlay{padding:8%;justify-content:center;background:#263b3444}.panel{width:100%;max-width:310px;padding:24px 18px 14px}h1{font-size:43px;margin:14px 0 12px}.panel>p{font-size:11px}.panel .instructions{font-size:8px}#hud{inset:12px 10px;font-size:12px}#toast{top:80px;font-size:10px}.control-hint{display:none}footer{font-size:7px}footer span:nth-child(2){letter-spacing:0}}
@media(orientation:landscape) and (max-height:600px){#app{padding:0 max(8px,env(safe-area-inset-left));height:100svh;width:100%;display:flex;justify-content:center;align-items:center}header,#hud,#boss-hud,#combat-hud,nav#controls,footer,.chapter{display:none!important}#stage{height:100svh;width:auto;max-width:100%;border-radius:0;border:0;box-shadow:none}.rotate-note{display:flex;align-items:center;justify-content:center;position:absolute;inset:0;text-align:center;font-size:14px;line-height:1.6;color:#eee1b9;background:#101722d9;padding:10%;z-index:6}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
/* Mission 01: comic-action palette sampled visually from the supplied poster. */
:root{background:#101722;color:#ece3d1}body{background:radial-gradient(ellipse at 50% 15%,#29384a,#0f1722 80%)}.brand{color:#eadbc0;text-shadow:2px 3px #0a101a;transform:none;letter-spacing:1px}.brand b{color:#dc6249}.brand span{color:#97a5b3}.chapter{color:#a7b6c7}.chapter span{color:#d75d43}.tools button{background:#273347;border:1px solid #66738455;border-radius:7px;color:#ded6c5}#stage{border:1px solid #7a879633;border-radius:10px;box-shadow:0 24px 65px #0009,0 0 0 5px #202c3a}canvas{background:#152334}#overlay{background:linear-gradient(270deg,#111a29fa 0%,#111a29ef 48%,#111a2933 75%);padding:4% 5%;isolation:isolate}.poster{position:absolute;left:0;top:0;width:51%;height:100%;object-fit:contain;object-position:left center;z-index:-1;filter:saturate(.88);background:#778993}.panel{width:44%;max-width:420px;background:transparent;border:0;outline:0;border-radius:0;box-shadow:none;padding:12px 0;text-align:right;color:#ece3d1;transform:none}.eyebrow{font-size:10px;letter-spacing:2px;color:#de7958;direction:ltr}h1{font-size:clamp(20px,10.5cqi,48px);line-height:1.15;color:#f0e6d3;text-shadow:3px 4px #080f19;margin:23px 0 18px}h1 em{color:#e37050}.panel>p{font-size:13px;line-height:1.9;color:#a8b5c2;margin:12px 0;max-width:325px}.pills{justify-content:flex-start;gap:8px;margin:20px 0}.pills span{border:1px solid #8192a433;color:#c2cad0;border-radius:4px;padding:6px 8px}.primary{color:transparent;border:0;border-radius:0;box-shadow:none;transform:none;padding:0;width:clamp(240px,68vw,340px);aspect-ratio:2103/716;min-width:0}.primary span{display:none}.panel .instructions{color:#8b9cad;font-size:10px;line-height:1.9}#controls button{background:#253248;color:#d0d7db;border:1px solid #67758788;border-radius:10px;box-shadow:0 4px #050c15}#controls .jump{background:#c16b45;color:#fff1d5;transform:none}#controls .shoot{background:#933b37;color:#f1d4c0}#controls .dash{background:#244753;color:#a0d4d8;font-size:26px}.control-hint{color:#8495a6}footer{color:#667e93;border-color:#9aa4ae22}#toast{color:#f6ecd4}.rotate-note{color:#a3b6c7}#combat-hud{position:absolute;bottom:16px;left:18px;right:18px;display:flex;justify-content:space-between;font-size:10px;color:#d5d6cb;pointer-events:none;text-shadow:0 2px 3px #000}#dash-status{color:#93d0d3}
@media(max-width:650px){#overlay{background:linear-gradient(0deg,#111a29fc 5%,#111a29f2 45%,#111a29b8 100%);padding:6%;align-items:flex-end}.poster{width:100%;height:100%;object-fit:cover;object-position:center 25%;opacity:.65}.panel{width:100%;max-width:none;padding:0}h1{font-size:38px;margin:10px 0}.panel>p{font-size:11px;max-width:100%}.pills{margin:12px 0}.eyebrow{font-size:8px}.primary{padding:12px 18px}.panel .instructions{font-size:8px;margin-top:10px}#controls{gap:12px}#controls>div{gap:7px}#controls button{width:49px;height:55px}#controls .jump{width:60px}#combat-hud{bottom:27px;font-size:8px}}
@media(orientation:landscape) and (max-height:600px){#overlay{align-items:center;padding:2% 10%;background:linear-gradient(270deg,#111a29fa,#111a29eb 48%,#111a2922 85%)}.poster{width:50%;height:100%;object-fit:contain;opacity:1}.panel{width:45%;padding:5px 0}h1{font-size:33px;margin:8px 0}.eyebrow{font-size:8px}.panel>p{font-size:10px}.pills{margin:10px 0}.primary{padding:9px 18px;font-size:14px}.panel .instructions{font-size:8px;margin-top:9px}#combat-hud{bottom:18px;left:38%;right:35%;font-size:8px}#controls button{width:51px;height:49px}#controls .jump{width:62px}}

/* Image-backed health and area/progress panels. Baked artwork provides the frame,
   icons and 5 filled hearts; dynamic state is drawn as opaque covers (matching the
   panel's dark interior) plus live text/fill on top, positioned from pixel analysis
   of the source art (percentages of the full exported image, transparent padding
   included, since that's what background-size:contain displays). */
.health,.progress{position:relative;width:clamp(110px,35vw,150px);aspect-ratio:2172/724;background-repeat:no-repeat;background-size:contain;background-position:center;pointer-events:none;container-type:inline-size}
.health{background-image:url('../assets/ui/hud/health.png')}
.progress{background-image:url('../assets/ui/hud/area.png')}
#health{position:absolute;opacity:0}
.heart-mask{position:absolute;top:42%;height:20%;width:9.6%;background:#050f1b;border-radius:30%;display:none}
.heart-mask:nth-of-type(1){left:10.7%}
.heart-mask:nth-of-type(2){left:21.6%}
.heart-mask:nth-of-type(3){left:32.5%}
.heart-mask:nth-of-type(4){left:43.3%}
.heart-mask:nth-of-type(5){left:54.2%}
.health[data-hp="4"] .heart-mask:nth-of-type(n+5),
.health[data-hp="3"] .heart-mask:nth-of-type(n+4),
.health[data-hp="2"] .heart-mask:nth-of-type(n+3),
.health[data-hp="1"] .heart-mask:nth-of-type(n+2),
.health[data-hp="0"] .heart-mask:nth-of-type(n+1){display:block}
#coins{position:absolute;top:40%;left:77.8%;width:13.8%;height:24%;background:#050f1b;border-radius:18%;display:flex;align-items:center;justify-content:center;font-size:clamp(11px,3vw,15px);font-weight:bold;color:#eaf6ff;font-family:Tahoma,Arial,sans-serif}
#area{position:absolute;top:33%;left:21%;width:73%;height:23%;background:#050f1b;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:clamp(6px,7.5cqi,10px);font-weight:bold;color:#eaf6ff;padding:0 6px;text-align:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.progress>div{position:absolute;top:59%;left:34.5%;width:49.5%;height:9%;background:#050f1b;border-radius:999px;overflow:hidden;margin:0}
.progress i{display:block;height:100%;width:0;background:#0ecbfd;border-radius:999px}

/* Boss health plate, positioned from pixel analysis of the source art the same way. */
#boss-hud{position:absolute;top:max(50%,calc(env(safe-area-inset-top) + 260px));left:50%;transform:translate(-50%,-50%);width:clamp(220px,60vw,340px);aspect-ratio:2172/724;background:url('../assets/ui/hud/boss.png') no-repeat center/contain;pointer-events:none}
#boss-hud>span{position:absolute;opacity:0}
#boss-hud>.track{position:absolute;top:54.3%;left:22%;width:62.9%;height:11.2%;background:#12141c;border-radius:6px;overflow:hidden;margin:0}
#boss-health{display:block;height:100%;width:100%;background:linear-gradient(90deg,#c21f16,#ff8a00);border-radius:6px}

/* Game-surface Safari zoom/callout lock. */
html,body,#app,#stage,canvas,#controls{
  touch-action:none;
  overscroll-behavior:none;
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
}
html,body{
  width:100%;
  min-height:100%;
  overflow:hidden;
}

/* The desktop game frame is portrait too, so use the portrait menu composition. */
#overlay .poster{z-index:-2}
#overlay::before{
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:linear-gradient(0deg,#07111ff5 0%,#07111fea 27%,#07111f70 49%,transparent 72%);
}
@media(min-width:1025px){
  #overlay{align-items:flex-end;background:linear-gradient(0deg,#111a29fc 5%,#111a29ee 42%,#111a2944 100%);padding:6%}
  .poster{width:100%;height:100%;object-fit:cover;object-position:center 25%;opacity:.65}
  .panel{width:100%;max-width:none;padding:0}
  h1{font-size:38px;margin:10px 0}
  .panel>p{font-size:12px;max-width:100%}
  .pills{margin:12px 0}
  .panel .instructions{font-size:9px;margin-top:10px}
}
