/* The base of every game page: exactly one screen tall, never scrolling; the in-game bar (shared/bar.css, built by
   shared/shell.js) on top and the game's stage under it. Colours, sizes and layers come from shared/tokens.css; buttons,
   pop-ups and counters from shared/ui.css. Also the die that Snakes and Ladders, Ludo and Backgammon throw. */
:root { color-scheme: dark; --head: var(--gk-bar); font-family: var(--gk-font); background: var(--gk-night); color: var(--gk-ink); }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(ellipse at 50% 28%, var(--gk-room-glow) 0, var(--gk-room) 52%, var(--gk-night) 100%) fixed;
}
h2, h3, p { margin-top: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, a, input, select, canvas { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: var(--gk-ink); }
/* A button that cannot be pressed is faded; the shared buttons (.gk-btn) grey themselves instead, and a die waiting for
   another player's turn stays bright, as it still shows the last roll. */
button:disabled { cursor: default; }
:where(button:disabled:not(.gk-btn, .die)) { opacity: .5; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible { outline: var(--gk-focus); outline-offset: var(--gk-focus-gap); }

/* The bar's place until shared/shell.js has built it (shared/bar.css styles the finished bar). */
.topbar { flex: none; height: var(--head); padding: 0 18px; display: flex; align-items: center; gap: 14px; background: var(--gk-well); border-bottom: 1px solid var(--gk-line); }
.game-title { font-size: var(--gk-text-md); color: var(--gk-gold); white-space: nowrap; }
.top-actions { display: flex; gap: 8px; margin-inline-start: auto; }
@media (orientation: portrait) { :root { --head: 52px; } .topbar { padding: 0 12px; gap: 9px; } }
@media (orientation: landscape) and (max-height: 560px) { :root { --head: 44px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* The die: shared/dice.js builds it as a solid, lit body and shared/dice.css paints it and its shadow. Here: its size and
   its states in a game. */
.die { --die: 72px; --player-color: var(--gk-gold); position: relative; width: var(--die); height: var(--die); flex: none; padding: 0; border: 0; border-radius: 21%; background: none; perspective: calc(var(--die) * 9); opacity: 1; transition: box-shadow .2s, transform .15s; }
.die.ready { animation: die-ready 1.1s ease-in-out infinite alternate; }
.die.ready:hover { filter: brightness(1.06); }
.die.ready:active { transform: scale(.94); animation: none; }
/* A thrown die leaves its place for the board (/shared/dice.js). */
.die.thrown { z-index: 60; pointer-events: none; animation: none; box-shadow: none !important; }
@keyframes die-ready { to { transform: scale(1.06); } }
