/* Edge-to-edge battlefield. Only this iPhone edition loads these overrides. */
body.ios-app{--safe-l:max(env(safe-area-inset-left,0px),var(--native-safe-l,0px));--safe-r:max(env(safe-area-inset-right,0px),var(--native-safe-r,0px));--safe-t:max(env(safe-area-inset-top,0px),var(--native-safe-t,0px));--safe-b:max(env(safe-area-inset-bottom,0px),var(--native-safe-b,0px))}
@media (orientation:landscape) and (max-height:600px){
 body.ios-app.playing{height:var(--phone-height,100dvh);overflow:hidden;touch-action:none}
 body.ios-app.playing #app{padding:0;width:100%;max-width:none;margin:0}
 body.ios-app.playing .masthead,body.ios-app.playing #app > footer,body.ios-app .play-hints{display:none}
 body.ios-app .play-screen{position:fixed;top:var(--phone-top,0px);left:var(--phone-left,0px);width:var(--phone-width,100vw);height:var(--phone-height,100dvh);border:0;overflow:hidden}
 body.ios-app #arena{position:absolute;inset:0;width:100%;height:100%;min-height:0;max-width:none;padding:0;margin:0;background:#26342d}
 body.ios-app #gameCanvas{width:100%;height:100%;max-width:none;aspect-ratio:auto;object-fit:cover;object-position:50% 52%;margin:0}
 body.ios-app .mission-bar{position:absolute;z-index:4;top:var(--safe-t);left:max(8px,var(--safe-l));right:max(8px,var(--safe-r));height:36px;padding:0 8px;gap:8px;border:0;background:linear-gradient(180deg,#101918e8,#10191855);border-radius:0 0 8px 8px}
 body.ios-app .mission-bar .eyebrow{display:none}
 body.ios-app .mission-bar h2{font-size:12px;margin:0;white-space:nowrap}
 body.ios-app .mission-right{gap:10px;font-size:11px}
 body.ios-app .mission-right #specialBtn{display:none}
 body.ios-app #pauseBtn{padding:6px 10px;min-width:64px;min-height:34px;font-size:12px}
 body.ios-app .survival-bar{position:absolute;z-index:4;top:calc(38px + var(--safe-t));left:max(10px,var(--safe-l));right:max(10px,var(--safe-r));height:auto;min-height:0;display:flex;flex-wrap:nowrap;gap:4px;padding:0;border:0;background:none;overflow:visible}
 body.ios-app .survival-bar button{flex:1 1 0;min-width:0;min-height:34px;padding:3px 4px;border-radius:5px;background:#13281edb;white-space:pre-line;font-size:10px;line-height:1.25;text-align:center}
 body.ios-app #bunkerBtn{display:none}
 body.ios-app .survival-bar small{display:none}
 body.ios-app .survival-bar.evacuate small{display:block;position:absolute;top:38px;left:0;right:0;max-width:none;margin:0;text-align:center;padding:5px;background:#4b261edf;font-size:12px;color:#ffe6b7;pointer-events:none}
 body.ios-app #bossHUD{top:calc(77px + var(--safe-t));left:calc(18% + var(--safe-l));right:calc(18% + var(--safe-r));width:auto}
 body.ios-app #bossHUD>div:first-child{font-size:11px;gap:5px}
 body.ios-app #bossHUD small{font-size:9px;white-space:nowrap}
 body.ios-app .boss-track{margin-top:4px;height:5px}
 body.ios-app .hud{position:absolute;z-index:4;bottom:max(3px,var(--safe-b));left:max(10px,var(--safe-l));right:max(10px,var(--safe-r));height:42px;padding:5px 9px;gap:12px;border:0;border-radius:7px;background:#101c19bf;pointer-events:none}
 body.ios-app .hud-character,body.ios-app .score-block{display:none}
 body.ios-app .meter-block{min-width:50px;flex:1}
 body.ios-app .meter-block>span{display:flex;font-size:10px;margin-bottom:4px;gap:5px}
 body.ios-app .meter-block b{font-size:10px}
 body.ios-app .meter{height:4px}
 body.ios-app .ammo-block{min-width:108px;pointer-events:auto;min-height:38px;text-align:center}
 body.ios-app .ammo-block small{font-size:9px;white-space:nowrap}
 body.ios-app .ammo-block strong{font-size:16px;margin-top:1px}
 body.ios-app .ammo-block>span{display:none}
 body.ios-app .resource-block{display:grid;min-width:65px;gap:2px;font-size:10px}
 body.ios-app .resource-block b{margin-left:5px}
 body.ios-app .touch-controls{display:block}
 body.ios-app .stick{width:100px;height:100px;left:calc(max(12px,var(--safe-l)) + 4px);bottom:calc(51px + var(--safe-b));background:#1020193b;border:1px solid #d5e8d34f}
 body.ios-app .stick span{width:40px;height:40px;left:29px;top:29px;background:#bed4c252}
 body.ios-app .stick small{top:41px;font-size:11px}
 body.ios-app .aim-stick{left:auto;right:calc(max(12px,var(--safe-r)) + 4px);border-color:#e5b67599}
 body.ios-app .touch-actions{right:calc(max(12px,var(--safe-r)) + 115px);bottom:calc(51px + var(--safe-b));gap:5px}
 body.ios-app .touch-actions button{width:59px;height:34px;min-height:34px;font-size:11px;background:#15231cb3;border-radius:8px}
 body.ios-app .field-tip{display:none}
 body.ios-app .wave-banner{font-size:19px;letter-spacing:2px;padding:12px;inset:38% 12% auto}
 body.ios-app #toast{bottom:calc(49px + var(--safe-b));font-size:11px;padding:8px 14px;max-width:52%}
 body.ios-app .modal{top:var(--phone-top,0px);left:var(--phone-left,0px);right:auto;bottom:auto;width:var(--phone-width,100vw);height:var(--phone-height,100dvh);padding:max(6px,var(--safe-t)) max(10px,var(--safe-r)) max(6px,var(--safe-b)) max(10px,var(--safe-l))}
 body.ios-app .panel{max-height:calc(var(--phone-height,100dvh) - 12px - var(--safe-t) - var(--safe-b));padding:18px}
 body.ios-app .panel.video-panel,body.ios-app .panel.comic-panel{padding:0}
 body.ios-app .panel h2{font-size:23px;margin:9px 0}
 body.ios-app:not(.playing) #app{padding:0 max(8px,var(--safe-r)) 0 max(8px,var(--safe-l))}
 body.ios-app:not(.playing) .masthead{height:38px}
 body.ios-app .home-screen{min-height:calc(var(--phone-height,100dvh) - 40px)}
 body.ios-app .hero-copy{padding:10px 18px 30px;grid-template-rows:16px 68px 58px 26px auto;gap:6px 24px}
 body.ios-app .hero-copy h1{font-size:72px}
 body.ios-app .quick-controls{display:none}
 body.ios-app .start-button{height:42px}
 body.ios-app .character-card .avatar{height:40px}
 body.ios-app .home-bottom{padding:6px 18px}
}
@media (orientation:landscape) and (max-height:320px){
 body.ios-app .stick{width:84px;height:84px;bottom:calc(47px + var(--safe-b))}
 body.ios-app .stick span{width:34px;height:34px;left:24px;top:24px}
 body.ios-app .stick small{top:34px;font-size:10px}
 body.ios-app .touch-actions{right:calc(max(12px,var(--safe-r)) + 98px);bottom:calc(46px + var(--safe-b));flex-direction:row;gap:4px}
 body.ios-app .touch-actions button{width:46px;height:36px;font-size:10px}
 body.ios-app .hud{height:38px;gap:8px}
 body.ios-app .mission-bar{height:32px}
 body.ios-app #pauseBtn{height:32px;min-height:32px;padding:4px 8px}
 body.ios-app .survival-bar{top:calc(33px + var(--safe-t))}
 body.ios-app #bossHUD{top:calc(70px + var(--safe-t))}
 body.ios-app .hero-copy{grid-template-rows:14px 55px 45px 25px auto;gap:4px 20px;padding:5px 12px 25px}
 body.ios-app .hero-copy h1{font-size:58px}
 body.ios-app .start-button{height:38px}
}

/* Compact status panels leave the battlefield visible between them. */
@media(orientation:landscape) and (max-height:600px){
 body.ios-app .hud{padding:0;gap:8px;background:transparent;box-shadow:none;height:38px}
 body.ios-app .hud .hero-meter{flex:0 0 clamp(130px,25vw,230px);width:clamp(130px,25vw,230px);max-width:none;min-width:0;padding:6px 8px;border-radius:6px;background:#101c19ad}
 body.ios-app .hud .hero-meter>span{font-size:9px;gap:3px;white-space:nowrap}
 body.ios-app .hud .hero-meter b{font-size:9px}
 body.ios-app .hud .ammo-block{margin-left:auto;background:#101c19ad;border-radius:6px;padding:2px 7px}
 body.ios-app .hud .resource-block{background:#101c19ad;border-radius:6px;padding:5px 7px}
}

/* Block Safari double-tap zoom at the fixed battlefield itself, including HUD.
   Menus retain scrolling and pinch zoom; their taps have no zoom delay. */
body.ios-app{touch-action:manipulation}
body.ios-app #play{touch-action:none;overscroll-behavior:none;-webkit-user-select:none;user-select:none}
body.ios-app button,body.ios-app a{touch-action:manipulation}
/* Touch controls stay above the battlefield; decorative children never catch input. */
body.ios-app .touch-controls{z-index:6}
body.ios-app .stick{touch-action:none;-webkit-touch-callout:none;user-select:none}
body.ios-app .stick.is-held{border-color:#eac58c;background:#82724c66;box-shadow:0 0 0 2px #eac58c44}
body.ios-app .stick.is-held span{background:#eac58c99}
/* Pause must stay tappable above the play surface and outside the safe-area edge. */
@media(orientation:landscape) and (max-height:600px){
 body.ios-app .mission-bar{z-index:8;top:calc(4px + var(--safe-t));height:44px;pointer-events:none}
 body.ios-app #pauseBtn{pointer-events:auto;touch-action:none;min-width:76px;min-height:44px;height:44px;padding:8px 12px;-webkit-touch-callout:none}
 body.android-app.ios-app .support-dock{top:calc(52px + var(--safe-t))}
 body.android-app.ios-app #bossHUD{top:calc(55px + var(--safe-t))}
 body.android-app.ios-app .survival-bar.evacuate{top:calc(106px + var(--safe-t))}
}
