:root{color-scheme:dark;background:#0b0d12}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
#gotham-iphone{padding:0;min-height:100dvh}
#gotham-iphone .phone{height:100dvh;min-height:0;width:min(100%,520px);border:0;border-radius:0;aspect-ratio:auto;box-shadow:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
#gotham-iphone .phone > .status,#gotham-iphone .phone > .home{display:none}
@media(min-width:521px){
  #gotham-iphone .phone[data-mode="game"]{background:transparent}
  #gotham-iphone:has(.phone[data-mode="game"])::before{background-position:center,center 12%}
}

/* Keep the game at the smallest viewport height so Safari's bars cannot resize the board. */
:root:has(.phone[data-mode="game"]),
body:has(.phone[data-mode="game"]){
  overflow:hidden;
  overscroll-behavior:none;
}
#gotham-iphone:has(.phone[data-mode="game"]){min-height:0}
#gotham-iphone .phone[data-mode="game"]{
  height:100vh;
  height:100svh;
}
#gotham-iphone .phone[data-mode="game"] .draughts{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:var(--game-title-height) minmax(0,1fr) max-content;
  align-items:stretch;
  justify-items:center;
  gap:4px;
  padding:0 10px 8px;
  overflow:hidden;
  touch-action:none;
  --game-title-height:clamp(64px,27cqh,235px);
}
#gotham-iphone .phone[data-mode="game"] .draughts .game-heading{
  width:100%;
  height:auto;
  padding:5cqh 0 0;
}
#gotham-iphone .phone[data-mode="game"] .game-wordmark{max-height:100%}
#gotham-iphone .phone[data-mode="game"] .draughts .tabletop{
  container-type:size;
  align-self:stretch;
  width:100%;
  height:100%;
  margin:0;
  place-items:end center;
}
#gotham-iphone .phone[data-mode="game"] .tabletop .board-shell{
  width:min(100cqw,100cqh,440px);
}
#gotham-iphone .phone[data-mode="game"] .draughts .game-controls{
  width:min(100%,406px);
  margin:0;
  grid-template-rows:repeat(3,minmax(44px,auto)) minmax(40px,auto);
}

@media (max-height:490px) and (orientation:landscape){
  #gotham-iphone .phone[data-mode="game"] .draughts{
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-rows:minmax(0,1fr) max-content;
    gap:6px;
    padding:6px;
  }
  #gotham-iphone .phone[data-mode="game"] .draughts .tabletop{
    grid-column:1;
    grid-row:1 / 3;
    place-items:center;
  }
  #gotham-iphone .phone[data-mode="game"] .draughts .game-heading{
    grid-column:2;
    grid-row:1;
    padding-top:0;
    align-self:center;
  }
  #gotham-iphone .phone[data-mode="game"] .draughts .game-controls{
    grid-column:2;
    grid-row:2;
  }
}
