/* Rally page width is the route artwork width, not the browser width.
 * Desktop previously kept a second sidebar outside the image and letterboxed
 * the course. Stack every game panel in the same centered 704px column.
 * Never resize, crop or modify the approved Normal rally image itself. */
@media (min-width:761px) {
 html,body {
  height:auto;
  min-height:100%;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior-y:auto;
 }
 .app {
  display:block;
  width:min(704px,calc(100% - 16px));
  height:auto;
  min-height:0;
  margin-inline:auto;
  padding:8px 0 16px;
  overflow:visible;
 }
 .shell {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto auto auto;
  align-items:start;
  gap:8px;
  min-height:0;
  width:100%;
 }
 .hud {display:contents}
 .brand {
  grid-column:1;
  grid-row:1;
  width:100%;
  min-height:64px;
  align-self:stretch;
 }
 .track-panel {
  grid-column:1;
  grid-row:2;
  width:100%;
  height:auto;
  min-height:0;
  max-height:none;
  aspect-ratio:1122 / 1542;
  justify-self:stretch;
  align-self:start;
 }
 .track-art {
  display:block;
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  flex:0 1 auto;
 }
 .entry-card {
  grid-column:1;
  grid-row:3;
  width:100%;
  min-width:0;
  align-self:stretch;
 }
 .position-board {right:8px;top:8px}
}

/* Existing phone/tablet keyboard layout already fills the image width and
 * keeps separate header, stage, and challenge rows; do not impose a desktop
 * fixed artwork height or replace its screen-height layout. */

/* The separate Stage/Time/Elapsed/percentage card was removed from Rally.
 * Three rows fit Header → Full route → Pokémon answer on mobile as well.
 * Preserve the existing track viewport and keyboard-typing behavior. */
@media (max-width:760px) {
 .shell,body.typing .shell {
  grid-template-rows:auto minmax(60px,1fr) auto;
 }
 .entry-card,body.typing .entry-card {
  grid-column:1;
  grid-row:3;
 }
}
@media (max-width:760px) and (max-height:480px) {
 body.typing .shell {
  grid-template-rows:auto minmax(54px,1fr) auto;
 }
}
