*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#09131d;color:#edf3f4;font-family:Arial,Helvetica,sans-serif}button{font:inherit;cursor:pointer;touch-action:none}#game{position:relative;width:100%;height:100%;overflow:hidden}canvas{display:block;width:100%;height:100%;touch-action:none}#hud{position:absolute;inset: max(14px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) auto max(18px,env(safe-area-inset-left));display:flex;align-items:center;gap:18px;pointer-events:none}#hud[hidden]{display:none}.brand{font-weight:900;font-size:23px;color:#ffd447;letter-spacing:-1px}.brand span{font-size:10px;letter-spacing:2px;color:#9caebb}#chapter{font-size:11px;letter-spacing:2px;flex:1}#meters{display:flex;gap:18px;font-size:12px;font-weight:700}#health{color:#ff7072}#focus{color:#63e6e4}#hud button{pointer-events:auto;background:#162938e6;border:1px solid #43515c;color:#fff;padding:9px 12px;font-size:11px}#caption{position:absolute;left:50%;bottom:24px;transform:translateX(-50%);font-size:12px;letter-spacing:1px;background:#07121bdb;padding:10px 20px;text-align:center;pointer-events:none;max-width:90%;white-space:nowrap}#caption:empty{display:none}#overlay{position:absolute;inset:0;display:flex;align-items:center;padding:5vw 9vw;background:linear-gradient(90deg,#08131cf5 0%,#08131ce0 37%,#08131c10 80%)}#overlay:empty{display:none}.panel{width:min(560px,85vw)}.eyebrow{font-size:11px;letter-spacing:4px;color:#61e1de;font-weight:bold;margin:0 0 22px}h1{font-size:clamp(42px,6.8vw,94px);line-height:.88;letter-spacing:-4px;margin:0;font-weight:900}h1 em{display:block;font-style:normal;color:#ffd447}h2{font-size:clamp(28px,4vw,54px);line-height:1;letter-spacing:-2px;margin:12px 0 20px}.subtitle{letter-spacing:8px;font-weight:700;color:#d7e0e5;margin:18px 0 26px;font-size:16px}.copy{color:#aabcc9;font-size:15px;line-height:1.7;max-width:460px}.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:26px}.actions button{padding:14px 22px;background:#ffd447;border:0;color:#142330;font-weight:800;font-size:12px;letter-spacing:1px}.actions .secondary{background:#233747;color:#d9e4e9;border:1px solid #415564}.foot{font-size:10px;letter-spacing:1px;line-height:1.9;color:#7f96a7;margin-top:24px}.chapters{display:flex;gap:8px;margin-top:18px}.chapters button{background:#1c3344;border:1px solid #4b6575;color:#d4e6ec;padding:9px 13px}.chapters button:disabled{opacity:.35;cursor:default}#touch{position:absolute;inset:auto max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));display:none;justify-content:space-between;pointer-events:none}#touch.show{display:flex}.leftpad,.rightpad{display:flex;gap:9px;align-items:end}#touch button{pointer-events:auto;user-select:none;-webkit-user-select:none;width:62px;height:62px;border-radius:50%;border:1px solid #94cbd177;background:#183140cc;color:#d2e4ec;font-size:10px;font-weight:bold}#touch button.active{background:#537578}#touch .fire{width:78px;height:78px;background:#ffd447d9;color:#142b3c}#rotate{display:none;position:absolute;bottom:4px;font-size:10px;width:100%;text-align:center;color:#94aabb}@media(max-height:500px){#overlay{padding:20px 7vw}h1{font-size:52px}.eyebrow{margin-bottom:12px}.subtitle{margin:12px 0}.copy{font-size:12px;line-height:1.5}.actions{margin-top:15px}.foot{margin-top:12px}#caption{bottom:96px;font-size:10px}.brand span{display:none}#hud{gap:10px}#meters{gap:10px}}@media(orientation:portrait){#rotate{display:block}.brand span{display:none}#chapter{font-size:9px}#hud{gap:8px}#meters{font-size:9px;gap:7px}#touch button{width:43px;height:50px}#touch .fire{width:53px;height:60px}.rightpad,.leftpad{gap:5px}#caption{bottom:95px;white-space:normal;width:90%}h1{font-size:54px}}

@media(max-height:500px){#touch.show~#rotate{bottom:1px}#caption{top:54px;bottom:auto;padding:6px 12px;font-size:9px;max-width:75%;white-space:normal}}

.chapters{display:none}.stage-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;max-height:50vh;overflow:auto}.stage-grid button{background:#182d3e;color:#dfe9e8;border:1px solid #48616d;padding:8px;font-size:10px;text-align:left}.stage-grid button:disabled{opacity:.3}.panel{max-height:94vh;overflow:auto}
#hud{background:linear-gradient(90deg,#07121ce6,#07121c99);padding:7px 10px;inset:8px max(12px,env(safe-area-inset-right)) auto max(12px,env(safe-area-inset-left));text-shadow:0 1px 3px #000}#caption{max-width:82%;white-space:normal;line-height:1.4}.slider{display:flex;gap:20px;align-items:center;margin:24px 0;color:#c5d9df}.slider input{width:240px;accent-color:#ffd447}#touch button{width:55px;height:55px}#touch .fire{width:65px;height:65px}@media(orientation:portrait){#touch button{width:37px;height:44px}#touch .fire{width:45px;height:54px}.leftpad,.rightpad{gap:4px}}

/* Build 3.1: fit one proportional 4:3 stage inside every window. */
body{display:grid;place-items:center}
#game{width:min(100vw,calc(100vh * 4 / 3));width:min(100vw,calc(100dvh * 4 / 3));height:auto;aspect-ratio:4/3;container-type:inline-size}
#overlay{padding:5% 7%}
.panel{width:min(560px,100%);max-height:100%;overflow:auto}
h1{font-size:clamp(38px,8cqw,80px)}
h2{font-size:clamp(26px,6cqw,48px)}
.stage-grid{max-height:38cqw}
#hud{gap:10px;flex-wrap:wrap}
#chapter{min-width:100px;letter-spacing:1px}
#meters{gap:10px}
#caption{bottom:18px;top:auto;font-size:11px;padding:7px 12px}
#touch{inset:auto max(10px,env(safe-area-inset-right)) max(15px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
.leftpad,.rightpad{gap:5px}
#touch button{width:44px;height:48px;font-size:9px}
#touch .fire{width:52px;height:56px}
.touch-layout #caption{top:64px;bottom:auto;max-width:80%;font-size:10px}
.slider{gap:12px;margin:16px 0}.slider input{width:min(240px,45cqw)}
@container(max-width:650px){
 #hud{gap:6px;padding:5px 7px;inset:5px 8px auto}
 .brand{font-size:18px}.brand span{display:none}
 #chapter{font-size:9px;min-width:85px}#meters{font-size:10px;gap:8px}
 #hud button{padding:6px 8px;font-size:9px}
 .eyebrow{font-size:9px;letter-spacing:2px;margin-bottom:10px}
 .subtitle{font-size:12px;letter-spacing:4px;margin:10px 0}
 .copy{font-size:12px;line-height:1.45}.actions{margin-top:12px;gap:7px}
 .actions button{padding:10px 14px;font-size:10px}.foot{margin-top:10px;font-size:9px}
 #caption{font-size:9px}.stage-grid{grid-template-columns:repeat(2,1fr)}
}
@container(max-width:420px){
 #chapter{flex-basis:calc(100% - 75px)}#meters{flex:1}
 .touch-layout #caption{top:66px;font-size:9px;padding:4px 8px}
 #rotate{font-size:8px}.stage-grid button{padding:6px}
}
@container(max-width:350px){
 #touch{gap:8px;align-items:end}.rightpad{display:grid;grid-template-columns:repeat(2,44px)}
 #touch .fire{width:44px;height:48px}
}

.more-games{display:inline-flex;align-items:center;justify-content:center;padding:12px 18px;border:1px solid currentColor;text-decoration:none;color:inherit;font:inherit;font-weight:bold;cursor:pointer}.more-games:hover{filter:brightness(1.2)}#gm-ad-status{position:absolute;bottom:16px;left:50%;transform:translateX(-50%);z-index:120;background:#101820;color:white;padding:10px 18px;border-radius:5px;pointer-events:none}
