/* Shared layout for the two-player strategy games: head / board / buttons (portrait), board left + controls right (landscape) */
html,body{height:100%}
body.game{padding:calc(8px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left))}
#layout{flex:1;min-height:0;width:100%;display:grid;gap:10px;justify-content:center;align-content:center;justify-items:center;
  --bw:min(96vw,calc((100vh - 250px)*var(--asp)));--bw:min(96vw,calc((100dvh - 250px)*var(--asp)));
  grid-template-columns:auto;grid-template-areas:"head" "board" "actions"}
@media (orientation:landscape){
  #layout{--bw:min(calc((100vh - 28px)*var(--asp)),62vw);--bw:min(calc((100dvh - 28px)*var(--asp)),62vw);
    grid-template-columns:var(--bw) minmax(180px,1fr);grid-template-rows:1fr auto;grid-template-areas:"board head" "board actions";column-gap:4vw;justify-items:stretch;width:100%;max-width:1400px;margin:0 auto}
  #head{align-self:center}#actions{align-self:end;padding-bottom:8px}
}
#head{grid-area:head;display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center}
#head a.back{align-self:flex-start;font-size:clamp(.9rem,2vw,1.3rem)}
#head h1{margin:.2rem 0;font-size:clamp(1.4rem,4vmin,3rem)}
#status{margin:.3rem 0;min-height:1.6em;font-size:clamp(1.2rem,4vmin,2.8rem);font-weight:700;text-align:center}
#actions{grid-area:actions;display:flex;flex-wrap:wrap;gap:10px;justify-content:center}
#actions .btn{margin:0;font-size:clamp(.95rem,2.5vmin,1.7rem);padding:.55em 1.2em}
.btn.alt{background:var(--sky);box-shadow:0 5px 0 #2f8fd8}
.btn.alt:active{box-shadow:0 1px 0 #2f8fd8}
#board{grid-area:board;width:var(--bw);height:calc(var(--bw)/var(--asp));touch-action:manipulation}
