/* A second fire button stays in the terrain, reachable without a keyboard. */
.arena-fire{position:absolute;left:50%;bottom:max(12px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:4;min-width:132px;min-height:46px;padding:10px 22px;border:1px solid #e5bd7e;border-radius:999px;background:#ba7543;color:#fff7dc;box-shadow:0 3px 0 #784629,0 4px 18px #153f3540;font:800 22px/1 'Barlow Condensed',Impact,sans-serif;letter-spacing:1px;touch-action:manipulation}
.arena-fire:hover{background:#a96738}.arena-fire:active{transform:translate(-50%,2px);box-shadow:0 1px 0 #784629}
.arena-fire.magic{background:#9b592d;border-color:#ffda82;color:#ffe9a9;box-shadow:0 3px 0 #684025,0 0 18px #e9ad4c80}
.arena-fire:disabled{background:#617f68;color:#d3dfc7;border-color:#8ea58b;box-shadow:0 3px 0 #3d5e4c;cursor:wait}
.game-menu-toggle{display:none}
#game-menu{padding:22px;width:min(540px,calc(100% - 24px));max-height:calc(100dvh - 20px);overflow-y:auto;overscroll-behavior:contain}
#game-menu h2{margin:5px 45px 18px 0;font-size:32px}
#game-menu .header-actions{justify-content:space-between;gap:10px;padding-bottom:16px;border-bottom:1px solid #cbd5bf}
#game-menu .game-top{display:flex;flex-wrap:wrap;gap:12px;height:auto;padding:16px 0;background:none;justify-content:space-between}
#game-menu .modes{flex:1 0 100%;width:100%}
#game-menu .modes button{flex:1;min-height:44px;padding:9px 6px;font-size:12px}
#game-menu .wind small{display:inline;font-size:9px}
#game-menu .restart{min-height:44px;padding:6px 10px;border:1px solid #b4c3a7;border-radius:5px}
#game-menu .restart span{display:inline}
#game-menu .controls{display:grid;grid-template-columns:1fr 1fr;gap:15px;padding:16px 0 0;border-top:1px solid #cbd5bf;border-left:0;background:none}
#game-menu .controls>div{min-width:0}
#game-menu .controls .cannon-control{grid-column:1/-1}
#game-menu .controls .cannon-control>label{position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip-path:none;white-space:normal}
#game-menu .controls .cannons{margin-top:9px;gap:8px}
#game-menu .cannons button{min-height:48px;min-width:44px}
#game-menu .cannons button small{display:block}
#game-menu .controls .slider-control{display:block;height:auto}
#game-menu .controls label{display:flex;font-size:9px;line-height:1.3;gap:5px}
#game-menu .controls output{margin-left:auto;font-size:20px;flex-basis:auto}
#game-menu .controls input[type=range]{height:44px;margin:2px 0}
#game-menu .fire{grid-column:1/-1;min-height:48px;text-align:center}
#game-menu .fire>span{float:none}
#game-menu .range-labels{display:none}

@media(orientation:landscape) and (pointer:coarse){
  html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
  body{background:#20493f}
  main{max-width:none;padding:0!important}
  main>header,.intro,main>footer{display:none!important}
  .game{position:fixed;inset:0;display:block;width:100vw;width:100dvw;height:100vh;height:100dvh;margin:0!important;border:0;border-radius:0;box-shadow:none;overflow:hidden;background:linear-gradient(#20493f,#73978a 68%,#d1dfca)}
  .game>.game-top,.game>.controls,.game>.game-footer{display:none}
  .game>.arena{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(100vw,calc(100vh * 1200 / 550));width:min(100dvw,calc(100dvh * 1200 / 550));height:auto;aspect-ratio:1200/550;align-self:auto;justify-self:auto;overflow:hidden}
  .game>.arena>canvas:first-child{position:absolute;inset:0;display:block;width:100%;height:100%;aspect-ratio:auto}
  .game-menu-toggle{position:absolute;top:max(8px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:4;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;width:44px;height:44px;padding:10px;background:#f3f0dded;border:1px solid #c4c9ac;border-radius:9px;box-shadow:0 3px 12px #153f3520;color:#254b3b;touch-action:manipulation}
  .game-menu-toggle span{display:block;width:21px;height:2px;border-radius:2px;background:currentColor}
  .arena-fire{bottom:max(8px,env(safe-area-inset-bottom));min-height:48px;min-width:136px;font-size:22px}
  .game>.game-notices{position:absolute;z-index:3;left:max(8px,env(safe-area-inset-left));bottom:max(8px,env(safe-area-inset-bottom));width:auto;max-width:calc(50% - 84px);padding:4px 7px;min-height:0;border:1px solid #c4c9ac70;border-radius:6px;background:#f1f0dddf;display:flex;justify-content:flex-start;gap:3px;pointer-events:none}
  .game-notices .turn{gap:4px;flex-wrap:wrap}.game-notices .turn span{padding:0;border:0;background:none;font-size:8px;letter-spacing:.4px}.game-notices .turn b{font-size:7px;letter-spacing:.5px}
  .game-notices #toast.show{padding:0;font-size:9px;line-height:1.25;background:none}
  .game-notices .boss-reaction{font-size:10px}
  .game>.victory{position:absolute;inset:0;z-index:8;display:flex;justify-content:flex-start;overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:max(16px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));background:#163f32f5}
  .game>.victory[hidden]{display:none}
  .game>.victory>*{flex-shrink:0}
  #game-menu .controls{grid-template-columns:1fr 1fr}
}
@media(max-width:450px){.arena-fire{font-size:18px;min-height:44px;min-width:112px;padding:9px 16px}#game-menu{padding:18px}#game-menu .header-actions{gap:6px}}
@media(prefers-reduced-motion:reduce){.arena-fire:active{transform:translateX(-50%)}}

/* Display and invitation actions live in the menu, outside the flight path. */
.menu-extras{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 16px}
.menu-action{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:10px 12px;border:1px solid #a7b995;border-radius:6px;background:#e5ebd7;color:#254b3b;text-decoration:none;font:600 12px/1.4 'DM Sans',sans-serif;text-align:center;touch-action:manipulation}
.menu-action:hover{background:#d8e2c8}.menu-action:disabled{opacity:.7;cursor:default}
#online .invite-friend{margin-top:18px}
#online .invite-hint{font-size:11px;line-height:1.6;margin-top:8px}
#display-help-status:empty{display:none}
@media(orientation:landscape) and (pointer:coarse){
  .game-notices .turn{display:none}
  .game>.game-notices{padding:0;border:0;background:none}
}
@media(max-width:360px){.menu-extras{grid-template-columns:1fr}}

/* Keep wind direction and strength visible just above the mountain fire button. */
.arena-wind{position:absolute;left:50%;bottom:calc(max(12px,env(safe-area-inset-bottom)) + 53px);transform:translateX(-50%);z-index:4;display:flex;align-items:center;gap:8px;padding:4px 9px;border:1px solid #b8c9a36b;border-radius:6px;background:#244b3be6;color:#fff0ce;font:700 15px/1.2 'Barlow Condensed',Impact,sans-serif;white-space:nowrap;pointer-events:none}
.arena-wind small{font:9px/1.2 'DM Sans',sans-serif;letter-spacing:1.4px;color:#d4ddc4}
@media(orientation:landscape) and (pointer:coarse){.arena-wind{bottom:calc(max(8px,env(safe-area-inset-bottom)) + 55px)}}
@media(max-width:450px){.arena-wind{bottom:calc(max(12px,env(safe-area-inset-bottom)) + 51px);gap:6px}.arena-wind small{font-size:8px;letter-spacing:1px}}
@media(max-width:450px) and (orientation:landscape) and (pointer:coarse){.arena-wind{bottom:calc(max(8px,env(safe-area-inset-bottom)) + 51px)}}
