/* One physical game frame continues to own village, battle and popup scaling.
   Live viewport measurements include browser chrome and the iOS safe rectangle. */
#game-container[data-ratio="auto"] {
  aspect-ratio:auto;width:100vw;height:100vh;height:100dvh;
}
#game-container[data-viewport-fit="ready"] {
  position:fixed;
  left:var(--game-viewport-left,0px);top:var(--game-viewport-top,0px);
  width:var(--game-viewport-width,100vw);height:var(--game-viewport-height,100dvh);
  min-width:0;min-height:0;max-width:none;max-height:none;
  margin:0;
}
.game-safe-area-probe {
  position:fixed;inset:0;z-index:-1;visibility:hidden;pointer-events:none;
  padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px)
    env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);
}
.game-landscape-hint {
  position:fixed;z-index:400;left:50%;bottom:var(--hint-bottom,12px);
  transform:translateX(-50%);display:flex;align-items:center;gap:10px;
  box-sizing:border-box;width:max-content;max-width:calc(100vw - 32px);
  padding:7px 8px 7px 12px;border:1px solid #b9a16d;border-radius:9px;
  background:#fff8e8f5;color:#635338;box-shadow:0 2px 10px #1116;
  font:12px/1.35 Arial,sans-serif;
}
.game-landscape-hint[hidden] {display:none;}
.game-landscape-hint>button {
  flex:0 0 32px;width:32px;height:32px;padding:0;border:0;border-radius:6px;
  background:#ead9b6;color:#6e5836;font:23px/1 Arial,sans-serif;touch-action:manipulation;
}
.game-landscape-hint>button:focus-visible {outline:2px solid #268fc3;outline-offset:2px;}
/* Cancel browser panning only where the game actually consumes a drag. Other
   controls keep pinch zoom, native focus and scrolling in readable content. */
#game-container :is(canvas,[data-formation-drag],[data-equipment-drag]),
#game-container .sa-setup .sa-board-cell[data-story-ninja] {
  touch-action:none;
}
@media (pointer:coarse) {
  #game-container :is(button,a,[role="button"]) {touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
  #game-container :is([data-formation-drag],[data-equipment-drag]),
  #game-container .sa-setup .sa-board-cell[data-story-ninja] {touch-action:none;}
  #game-container :is(input,textarea,select) {-webkit-user-select:text;user-select:text;}
  #game-container :is([data-formation-drag],[data-equipment-drag],canvas),
  #game-container .sa-setup .sa-board-cell[data-story-ninja] {-webkit-touch-callout:none;}
}
