/* Snakes and Ladders. The board is a square sized by app.js (--side) to the room .board-wrap is given.
   Wide screens (desktop, a tablet on its side, a sideways phone): the board beside the players.
   Upright screens: the board on top; on a tablet the players and the die stand side by side under it. */
.stage { flex: 1; min-height: 0; display: flex; gap: 18px; justify-content: center; padding: 12px max(12px, var(--gk-safe-end)) max(12px, var(--gk-safe-bottom)) max(12px, var(--gk-safe-start)); }
.board-wrap { flex: 1; min-width: 0; min-height: 0; display: grid; place-items: center; max-width: 820px; }
.frame { --side: 360px; position: relative; width: var(--side); height: var(--side); padding: calc(var(--side) * .024); border-radius: calc(var(--side) * .04);
  background: linear-gradient(145deg, var(--gk-raise), var(--gk-rim)); border: 1px solid var(--gk-gold-deep); box-shadow: 0 0 0 3px var(--gk-rim), var(--gk-shadow-2), var(--gk-inset); }
.board { position: relative; width: 100%; height: 100%; direction: ltr; }
.board svg { display: block; width: 100%; height: 100%; border-radius: calc(var(--side) * .014); box-shadow: 0 0 0 2px var(--gk-rim); }
.board .num { font: var(--gk-number) 21px var(--gk-font); } /* its colour comes with the board's look (art.js) */
.pawn { position: absolute; width: 6.6%; aspect-ratio: 3 / 4; translate: -50% -78%; background: center / contain no-repeat; filter: drop-shadow(0 2px 2px #0007); pointer-events: none;
  transition: left .17s linear, top .17s linear, opacity .2s; z-index: 2; }
.pawn.mine::after { content: ""; position: absolute; left: 50%; top: -22%; width: 34%; aspect-ratio: 1; translate: -50% 0; rotate: 45deg; background: var(--gk-gold); border-radius: 2px; box-shadow: var(--gk-shadow-1); }
.pawn.away { opacity: 0; }
/* Walking, climbing and sliding are drawn by shared/walk.js. */
/* A clear board behind New game and while a room waits for its people. */
html.gk-clear .pawn { visibility: hidden; }

.side { flex: none; width: 288px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.seats { display: grid; gap: 8px; }
/* On the player's face the pawn is a small badge. */
.gk-seat i.gk-face-badge { background-size: 62%; }
.gk-seat i { flex: none; width: 24px; height: 32px; background: center / contain no-repeat; }
.roll { display: flex; align-items: center; gap: 14px; padding: 6px 4px; }
.roll-text { flex: 1; min-width: 0; }
.die:disabled { opacity: 1; }

/* Upright screens: the board on top. */
@media (max-width: 1023px) and (orientation: portrait) {
  .stage { flex-direction: column; align-items: center; gap: 10px; padding-top: 10px; }
  .board-wrap { width: 100%; max-width: none; }
  .side { width: min(100%, 560px); gap: 8px; justify-content: flex-start; }
  .seats { grid-template-columns: 1fr 1fr; gap: 6px; }
}
/* A phone: small plates, two to a row. */
@media (max-width: 599px) {
  .gk-seat { padding: 6px 9px; gap: 7px; border-radius: 12px; } .gk-seat i { width: 18px; height: 24px; } .gk-seat-note { display: none; } .gk-seat-score { min-width: 30px; font-size: var(--gk-text-md); }
  .die { --die: 58px; } .roll { padding: 2px 4px; }
}
/* An upright tablet: the players on one side under the board, the die and the turn on the other. */
@media (min-width: 600px) and (max-width: 1023px) and (orientation: portrait) {
  .side { width: 100%; max-width: 760px; flex-direction: row; align-items: center; gap: 18px; }
  .seats { flex: 3; } .roll { flex: 2; min-width: 0; }
  .die { --die: 84px; } .gk-turn { font-size: var(--gk-text-lg); }
}
/* A tablet on its side: a narrower column beside the board. */
@media (min-width: 600px) and (max-width: 1023px) and (orientation: landscape) { .side { width: 256px; } }
/* A sideways phone. */
@media (orientation: landscape) and (max-height: 560px) {
  .stage { gap: 12px; padding-top: 6px; padding-bottom: max(6px, var(--gk-safe-bottom)); } .side { width: 240px; gap: 8px; }
  .gk-seat { padding: 5px 10px; } .gk-seat-note { display: none; } .gk-seat i { width: 18px; height: 24px; } .die { --die: 52px; }
}
