/*
 * Yacht Crash demo - page layout.
 * Demo V2 (V2-2): desktop / large tablet layout (≥ 1024 px). One top row (brand, SIMULATED badge, history,
 * balance), then the game column - scene ~75–80% of its height, compact A/B panels below - and the
 * Players & Bets side column. Below 1024 px a simple stacked fallback keeps the demo usable; the dedicated
 * tablet and smartphone layouts (portrait, landscape, Players & Bets drawer) are D2d-3.
 */
.app {
  display: grid;
  gap: var(--gap);
  width: 100%;
  max-width: 1600px;
  min-height: 100dvh;
  margin: 0 auto;
  padding-block: max(var(--gap), env(safe-area-inset-top))
    max(var(--gap), env(safe-area-inset-bottom));
  padding-inline: max(var(--gap-lg), env(safe-area-inset-left))
    max(var(--gap-lg), env(safe-area-inset-right));
}

.app.app-ready {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'header'
    'game'
    'players';
  align-content: start;
}

.app-header {
  grid-area: header;
}

.game {
  grid-area: game;
  display: grid;
  gap: var(--gap);
  min-width: 0;
}

.players-bets {
  grid-area: players;
  min-width: 0;
}

.panels {
  display: grid;
  gap: var(--gap);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
  .panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/*
 * Desktop: the scene takes all the height left by the compact panels (about 154 px), i.e. roughly 75–80% of the
 * game column at 1280×800 and 1440×900, and about 75% at 1024×768.
 */
@media (min-width: 1024px) {
  .app.app-ready {
    grid-template-columns: minmax(0, 1fr) clamp(220px, 20vw, 320px);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      'header header'
      'game players';
  }

  .game {
    grid-template-rows: minmax(300px, 1fr) auto;
    min-height: 0;
  }

  .players-bets {
    min-height: 0;
  }
}

/* Tall enough screens fit the whole game in one viewport (the bets list scrolls inside its column). */
@media (min-width: 1024px) and (min-height: 700px) {
  .app.app-ready {
    height: 100dvh;
  }
}
