/* Exclusive tablet-landscape composition. Shared utilities live in responsive-base.css. */
body.compact-tablet-landscape.compact-gameplay .game:not([data-game-state="placing"]) .battle{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,1fr)}
body.compact-tablet-landscape .zaruba-home .home-center{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.3fr);grid-template-rows:auto auto auto;align-content:center;align-items:center;gap:12px 24px;width:min(980px,100%)}
body.compact-tablet-landscape .zaruba-home .home-brand{grid-column:1;grid-row:1;align-self:end}
body.compact-tablet-landscape .zaruba-home #home-title{grid-column:1;grid-row:2;font-size:clamp(28px,3.4vw,42px)}
body.compact-tablet-landscape .zaruba-home .home-live-status{grid-column:1;grid-row:3;align-self:start}
body.compact-tablet-landscape .zaruba-home .home-actions{grid-column:2;grid-row:1/4;gap:5px}

/* Battle only: no top banner/title row; narrow central status and outer side labels. */
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]){grid-template-columns:minmax(0,1fr) clamp(80px,8vw,96px) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;column-gap:0;row-gap:2px;padding-inline:max(2px,env(safe-area-inset-left)) max(2px,env(safe-area-inset-right))}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"])>header.room-navbar{grid-column:1/-1}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"])>.turn-banner{display:none}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"])>.battle{display:contents}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"])>.landscape-turn-status{display:flex;grid-column:2;grid-row:2;align-self:center;justify-self:center;writing-mode:horizontal-tb;transform:none;justify-content:center;align-items:center;font-size:16px;font-weight:700;line-height:1.15;width:100%;max-height:100%;text-align:center;white-space:normal;overflow-wrap:normal;padding:5px 2px;border:1px solid currentColor;border-radius:5px 3px 5px 3px;background:var(--home-paper,transparent)}
body.compact-tablet-landscape.compact-gameplay .game[data-game-state="playing"]>.landscape-turn-status:has(.special-mode-controls){align-self:stretch;flex-direction:column;gap:6px;overflow:hidden}
body.compact-tablet-landscape.compact-gameplay .landscape-turn-status .special-mode-controls{display:flex;flex-direction:column;gap:4px;width:100%;min-width:0;margin:0}
body.compact-tablet-landscape.compact-gameplay .landscape-turn-status .special-mode-controls .primary{width:100%;height:auto;min-height:44px;padding:4px 2px;font-size:clamp(10px,1.2vw,13px);line-height:1.05;white-space:normal;overflow-wrap:anywhere}
body.compact-tablet-landscape.compact-gameplay .landscape-turn-status .special-mode-controls p{max-height:70px;margin:0;font-size:10px;line-height:1.1;overflow:hidden}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"])>.post-game-controls{grid-column:1/-1;grid-row:3}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]) .battle>article{grid-column:1;grid-row:2;grid-template-columns:18px minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:0;align-items:stretch}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]) .battle>article:last-child{grid-column:3;grid-template-columns:minmax(0,1fr) 18px}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]) .battle .title{grid-column:1;grid-row:1;width:18px;height:100%;padding:0;justify-content:center;overflow:hidden}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]) .battle>article:last-child .title{grid-column:2}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]) .battle .title>div{display:flex;flex-direction:row;writing-mode:vertical-rl;align-items:center;justify-content:center;gap:10px;max-height:100%;overflow:hidden}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]) .battle>article:first-child .title>div{transform:rotate(180deg)}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]) .battle .title p{display:none}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]) .landscape-side-name{display:inline;font-size:12px;line-height:16px;flex-shrink:0}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]) .battle .title h2{font-size:11px;line-height:16px;max-height:100px;min-height:0}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]) .battle .title .player-identity{display:inline-flex;align-items:center;gap:3px}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]) .battle .board-component{grid-column:2;grid-row:1;display:grid;place-items:center}
body.compact-tablet-landscape.compact-gameplay .game:is([data-game-state="playing"],[data-game-state="finished"]) .battle>article:last-child .board-component{grid-column:1}

/* Tablet landscape: зберігаємо центральну композицію, прибираємо зайві reserves. */
@media(min-width:651px) and (max-width:1200px) and (min-height:601px) and (orientation:landscape){
 body.compact-tablet-landscape #app .zaruba-home{--lobby-max-width:680px;--lobby-title-size:44px;--lobby-gap:7px;--lobby-control-height:52px;--lobby-mode-height:58px;align-items:start;padding-top:clamp(76px,11dvh,100px)}
 body.compact-tablet-landscape #app .zaruba-home .home-center>*{grid-column:auto;grid-row:auto}
 /* Нижній anchor не резервує місце під прихований compact footer. */
 body.compact-tablet-landscape:has(.zaruba-home) .illustrated-fleet-scene{bottom:env(safe-area-inset-bottom)}
 body.compact-tablet-landscape:has(.zaruba-home) .illustrated-fleet-scene .home-decoration:is(.home-decoration-left,.home-decoration-right){bottom:0}
 /* Перекриття під кораблями та м'які краї з'єднують воду без прямокутного шва. */
 body.compact-tablet-landscape:has(.zaruba-home) .illustrated-fleet-scene .fleet-connecting-sea{
  bottom:0;left:4%;width:92%;height:100px;
  mask-image:linear-gradient(to right,transparent,black 28%,black 72%,transparent),linear-gradient(to bottom,black 75%,transparent);
  mask-composite:intersect;
  -webkit-mask-image:linear-gradient(to right,transparent,black 28%,black 72%,transparent),linear-gradient(to bottom,black 75%,transparent);
  -webkit-mask-composite:source-in
 }
}
body.compact-tablet-landscape .room-navbar .match-timer{min-width:58px}
body.compact-tablet-landscape #result-modal .result-progression{max-width:500px;justify-self:center;width:100%}

/* Зовнішня рамка і XP мають спільну доступну ширину, без старого ліміту 480px. */
html[data-skin="illustrated-fleet"] body.compact-tablet-landscape #result-modal .result-progression{max-width:none}
