/* On desktop, treat the app as one viewport-sized page and fit the board to
   the space left after the header, controls, and footer. */
@media (min-width: 761px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-rows: 75px minmax(0, 1fr) auto;
    padding-inline: clamp(16px, 2vw, 40px);
  }

  .topbar {
    height: 75px;
    min-height: 0;
  }

  .game-layout {
    width: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, min(1100px, calc(100dvh - 210px), calc(100% - 390px))) minmax(290px, 360px);
    justify-content: start;
    gap: clamp(14px, 2vw, 24px);
    align-items: stretch;
  }

  .board-column {
    min-height: 0;
    display: grid;
    grid-template-rows: 32px minmax(0, 1fr) 22px 20px;
  }

  .board-toolbar {
    height: auto;
  }

  .board-frame {
    min-height: 0;
    display: grid;
    place-items: center start;
    overflow: hidden;
    padding: clamp(4px, 1vh, 9px);
  }

  .board,
  .board[data-size="16"],
  .board[data-size="25"] {
    width: min(100%, calc(100dvh - 210px));
    min-width: 0;
    max-width: 100%;
    max-height: 100%;
  }

  .board[data-size="9"] .cell {
    font-size: clamp(22px, 2.3vw, 44px);
  }

  .board[data-size="16"] .cell {
    font-size: clamp(16px, 1.5vw, 30px);
  }

  .board[data-size="25"] .cell {
    font-size: clamp(12px, 1.25vw, 25px);
  }

  .side-panel {
    min-height: 0;
    align-content: start;
    gap: clamp(7px, 1.3vh, 13px);
  }

  .control-card {
    padding: 13px;
  }

  .card-heading {
    margin-bottom: 12px;
  }

  .difficulty-heading {
    margin-top: 12px;
  }

  .difficulty-option {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .select-control {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .pad-key {
    height: 27px;
  }

  .shortcut-hint {
    margin-top: 8px;
  }

  .page-footer {
    margin-top: clamp(8px, 1.8vh, 20px);
    padding: 9px 0 11px;
  }
}

@media (min-width: 761px) and (max-height: 820px) {
  .app-shell {
    grid-template-rows: 62px minmax(0, 1fr) auto;
  }

  .topbar {
    height: 62px;
  }

  .control-card {
    padding: 11px;
  }

  .card-heading {
    margin-bottom: 10px;
  }

  .difficulty-heading {
    margin-top: 10px;
  }

  .separator {
    margin: 10px 0 9px;
  }

  .play-card .card-heading {
    margin-bottom: 8px;
  }

  .notes-toggle-row {
    margin-bottom: 8px;
  }

  .pad-key {
    height: clamp(23px, 3.8vh, 31px);
  }

  .shortcut-hint {
    margin-top: 8px;
  }
}

@media (min-width: 1200px) {
  .game-layout {
    justify-content: center;
  }
}
