/* Preserve the picture comparison; commands and results own their real state. */
.welcome-view { gap: 20px; padding-block: 24px; }
.welcome-copy { max-width: 30rem; }
#welcomeTitle { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.2; }
.primary-button, .quiet-button, .control-button {
  min-height: 44px; border-radius: 12px; padding: 10px 16px;
  font-size: 15px; font-weight: 750; line-height: 1.25;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.primary-button { background: #2464b0; color: #fff; border: 1px solid #1f589a; box-shadow: inset 0 -2px 0 #1c4a80; }
.primary-button:hover, .primary-button:focus-visible { background: #1f589a; color: #fff; }
.primary-button:active { background: #194778; box-shadow: inset 0 2px 0 #153b63; }
.quiet-button, .control-button { background: #fff; color: #183c31; border-color: #b9c8c0; }
.quiet-button:active, .control-button:active { background: #e3eee8; box-shadow: inset 0 2px 0 #c3d4cb; }
.primary-button:focus-visible, .quiet-button:focus-visible, .control-button:focus-visible { outline: 3px solid #183c31; outline-offset: 3px; }
.control-button[aria-pressed="true"] { background: #e3eee8; border-color: #376b55; box-shadow: inset 0 0 0 1px #376b55; }
button:disabled { opacity: 1; background: #e8ece9; color: #6c7871; border-color: #c9d2cc; box-shadow: none; cursor: not-allowed; }
.game-actions { gap: 8px; }
.control-button { min-width: 44px; }
.board-viewport { height: clamp(120px, calc(100dvh - 350px), 460px); }
.modal-layer { z-index: 100; overflow-y: auto; padding: 16px; }
.modal-panel { max-height: calc(100dvh - 32px); overflow-y: auto; padding: clamp(20px, 4vw, 32px); }
.modal-actions { gap: 10px; flex-wrap: wrap; }
.modal-actions > button { flex: 1 1 140px; }
@media (max-width: 800px) {
  .welcome-view { padding-block: 18px; }
  .game-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .game-actions .control-button { padding: 9px 10px; font-size: 14px; }
  .board-viewport { height: min(66vw, calc(100dvh - 490px)); }
}
@media (orientation: landscape) and (max-height: 520px) {
  .board-viewport { height: calc(100dvh - 270px); min-height: 110px; }
  .game-heading { display: flex; gap: 10px; }
  .game-actions { display: flex; flex-wrap: wrap; width: auto; justify-content: flex-end; }
  .game-actions .control-button { padding-inline: 10px; }
  .modal-panel h2 { margin-block: 0 8px; }
  .result-stats { margin-top: 12px; }
  .modal-actions { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .primary-button, .quiet-button, .control-button { transition: none; }
}
