/* P2 card grid (games patch, 2026-11-15; DESIGN-SYSTEM § Game card
   grid). The Games tab is a grid of six cards; a card opens its
   game in #game-view, Back returns to the grid. */

/* Grid: 2 columns desktop, 1 column phones (<=640px). The tracks
   are minmax(0, 1fr) — the 2026-11-05 phone lesson: a bare 1fr is
   minmax(auto, 1fr), so wide content (puzzle tiles) grew the track
   past the viewport. minmax(0, 1fr) holds the track to the
   container. */
#games-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
@media (max-width: 640px) {
  #games-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Cards: flat paper, 10px radius, 1px --line border. Coral only for
   the solved/primary state marker (the status line when the game was
   played today). A card is a <button>, so it is keyboard-operable
   natively; the global :focus-visible rule gives the 3px --focus
   ring. Nothing is hover-only: the status is text, always visible. */
.game-grid-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.game-grid-card:hover { border-color: var(--accent); }
.game-grid-card-name { display: block; font-weight: 600; }
.game-grid-card-desc { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 0.9rem; }
.game-grid-card-status { display: block; margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.game-grid-card-status--done { color: var(--accent); font-weight: 600; }

/* The opened game: 0.22s transform+opacity enter. Reduced motion
   gets an instant swap. The animation re-runs each time the view is
   unhidden (display:none -> shown restarts it). */
#game-view { animation: game-view-in 0.22s ease; }
@keyframes game-view-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #game-view { animation: none; }
}
