/*
 * Puzzle screen (predetermined-puzzle-mode WP05): src/ui/puzzle-view.js.
 * Tokens and primitives only; the board keeps its own styles (board.css).
 *
 *   .puzzle            the screen; grid areas
 *     >= 720 px          heading over  board | panel
 *     < 720 px           one column: heading, board, panel
 *   .puzzle__prompt    'Find the best move for White' (text, not an image)
 *   .puzzle__feedback  the polite live region; its height is reserved, so
 *                      the text appearing never moves the buttons
 *   .puzzle__buttons   Show solution / Skip, or Next puzzle, or Retry
 * 16 px gutters come from the page; every track can shrink to 0, so there is
 * no horizontal scroll from 360 px.
 */

.puzzle {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "heading"
    "board"
    "panel";
  gap: var(--space-3);
  align-items: start;
}

.puzzle__heading {
  grid-area: heading;
  min-width: 0;
}

.puzzle__title {
  font-size: var(--text-section-title);
  line-height: var(--line-height-tight);
}

.puzzle__prompt {
  min-height: 1.5em;
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-md);
  overflow-wrap: anywhere;
}

.puzzle__board {
  grid-area: board;
  min-width: 0;
}

.puzzle__panel {
  grid-area: panel;
  min-width: 0;
}

.puzzle__feedback {
  min-height: 3rem;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-left: 4px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  overflow-wrap: anywhere;
}

.puzzle__buttons button,
.puzzle__back {
  min-height: var(--touch-target);
}

.puzzle__buttons {
  gap: var(--space-2);
}

@media (min-width: 720px) {
  .puzzle {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-areas:
      "heading heading"
      "board panel";
    gap: var(--space-4);
  }
}
