/* Checkers, Connect Four, and Downhill Dash share the storybook palette. */
.new-game {
  --game-paper: #f4e7c6;
  --game-ink: #293f43;
  --game-teal: #46716c;
  --game-gold: #efc77d;
  --game-wood: #ba9360;
  color: var(--game-ink);
  font-family: Georgia, "Times New Roman", serif;
}

.new-game .ng-shell {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: clamp(12px, 2vw, 20px);
  border: 3px solid var(--game-wood);
  background: var(--game-paper);
  box-shadow: inset 0 0 0 2px #fff5dc, 0 4px 0 #806244;
}

.new-game .ng-heading, .new-game .ng-toolbar, .new-game .ng-actions, .new-game .ng-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.new-game .ng-heading { display: none; }
.new-game .ng-heading h2 { margin: 2px 0 0; color: var(--game-ink); font: 700 clamp(1.3rem, 2.5vw, 1.8rem)/1.1 Georgia, serif; }
.new-game .ng-kicker { margin: 0; color: var(--game-teal); font: 700 .78rem/1.2 system-ui, sans-serif; letter-spacing: .12em; }
.new-game .ng-stamp { color: #76552b; font: 700 .8rem system-ui, sans-serif; letter-spacing: .08em; white-space: nowrap; }
.new-game .ng-instructions { max-width: 72ch; margin: 10px 0; color: #425b58; font: 1rem/1.45 system-ui, sans-serif; }
.new-game .ng-toolbar { flex-wrap: wrap; padding: 8px 10px; border-block: 2px dashed #c6ad7d; color: #395854; font: .9rem/1.35 system-ui, sans-serif; }
.new-game .ng-reward { font-weight: 700; }
.new-game .ng-actions { justify-content: flex-end; }
.new-game .ng-actions button, .new-game .ng-actions select {
  min-height: 38px;
  padding: 6px 12px;
  border: 2px solid var(--game-teal);
  border-radius: 2px;
  background: #fff3d5;
  color: var(--game-ink);
  font: 700 .9rem/1.25 system-ui, sans-serif;
  cursor: pointer;
}
.new-game .ng-actions button:hover:not(:disabled), .new-game .ng-actions button:focus-visible, .new-game .ng-actions select:focus-visible { outline: 3px solid #bf7a38; outline-offset: 2px; }
.new-game .ng-actions button:active:not(:disabled) { transform: translateY(2px); }
.new-game .ng-actions button:disabled { cursor: default; opacity: .65; }
.new-game .ng-play { display: grid; place-items: center; min-height: 0; padding: 8px 0 2px; }
.new-game .ng-checkers-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  width: min(100%, 480px, calc(100vh - 350px));
  aspect-ratio: 1;
  overflow: hidden;
  border: 6px solid #805f3c;
  background: #805f3c;
  box-shadow: inset 0 0 0 2px #d6b57a, 0 4px 0 #684c32;
}
.new-game .ng-square { display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; background: #f0dfb9; cursor: default; }
.new-game .ng-square.is-dark { background: #46716c; cursor: pointer; }
.new-game .ng-square.is-dark:hover, .new-game .ng-square.is-target { box-shadow: inset 0 0 0 4px #efc77d; }
.new-game .ng-square.is-selected { box-shadow: inset 0 0 0 4px #fff2bb; }
.new-game .ng-square:focus-visible { position: relative; z-index: 1; outline: 3px solid #283f43; outline-offset: -4px; }
.new-game .ng-square:disabled { opacity: 1; }
.new-game .ng-checker-piece { display: grid; place-items: center; width: 73%; aspect-ratio: 1; border: 3px solid #fff4d7; border-radius: 50%; box-shadow: 0 3px 0 #263a3c66, inset 0 -4px 0 #0002; color: #fff8e6; font: 700 clamp(1rem, 3vh, 1.45rem)/1 system-ui, sans-serif; }
.new-game .ng-checker-piece.is-human { background: #b87c36; }
.new-game .ng-checker-piece.is-computer { background: #293f43; }
.new-game .ng-checker-piece.is-king { outline: 2px solid #efc77d; outline-offset: -6px; }
.new-game .ng-readout { width: min(100%, 490px); margin: 8px auto 0; color: #395854; font: .9rem/1.35 system-ui, sans-serif; }
.new-game .ng-connect-wrap { width: min(100%, 560px, calc(100vh - 350px)); }
.new-game .ng-connect-drops, .new-game .ng-connect-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(4px, .8vw, 8px); }
.new-game .ng-connect-drops { padding: 4px clamp(8px, 1.6vw, 14px); border: 2px solid #315b57; border-bottom: 0; background: #e8f0df; }
.new-game .ng-connect-drop { min-height: 34px; border: 2px solid #315b57; border-radius: 2px; background: #fff3d5; color: #203b3c; font: 800 1.3rem/1 system-ui, sans-serif; cursor: pointer; }
.new-game .ng-connect-drop:not(:disabled):hover, .new-game .ng-connect-drop:focus-visible { outline: 3px solid #bf7a38; outline-offset: 1px; background: #f7dda5; }
.new-game .ng-connect-drop:disabled { opacity: 1; background: #e1e8da; color: #294442; cursor: default; }
.new-game .ng-connect-board { padding: clamp(8px, 1.6vw, 14px); border: 5px solid #ba9360; background: #46716c; box-shadow: inset 0 0 0 2px #d9bb83, 0 4px 0 #806244; }
.new-game .ng-connect-cell { display: block; width: 100%; min-height: 0; aspect-ratio: 1; border: 2px solid #d7c69e; border-radius: 50%; background: #f4e7c6; box-shadow: inset 0 3px 5px #173f4c24; }
.new-game .ng-connect-cell.is-human { border-color: #fff0c2; background: #c9893d; box-shadow: inset 0 3px 5px #70461e66; }
.new-game .ng-connect-cell.is-computer { border-color: #fff0d2; background: #293f43; box-shadow: inset 0 3px 5px #18222b66; }
.new-game .ng-hill { position: relative; width: min(100%, 760px); }
.new-game .ng-hill canvas { display: block; width: 100%; height: clamp(220px, 34vh, 300px); border: 3px solid #ba9360; border-radius: 0; background: #dce9d7; box-shadow: inset 0 0 0 2px #f4e7c6, 0 4px 0 #806244; }
.new-game .ng-steer-controls { display: flex; justify-content: center; gap: 12px; margin: 5px auto 0; }
.new-game .ng-steer-controls button { min-width: 116px; min-height: 34px; padding: 4px 12px; border: 2px solid #46716c; border-radius: 2px; background: #fff3d5; color: #293f43; font: 700 .9rem/1.2 system-ui,sans-serif; cursor: pointer; }
.new-game .ng-steer-controls button:hover, .new-game .ng-steer-controls button:focus-visible { outline: 3px solid #bf7a38; outline-offset: 2px; background: #f7dda5; }
.new-game .ng-steer-controls button:active { transform: translateY(2px); }
.new-game .ng-hill .ng-readout { width: 100%; gap: 8px; flex-wrap: wrap; padding: 7px 9px; border: 1px solid #b6a074; background: #fff7e3; color: #263f40; font-weight: 700; }
.new-game .ng-hill .ng-readout strong, .new-game .ng-hill .ng-readout em { color: #1f383a; font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.new-game .ng-level-note { margin: 5px 0; color: #395854; font: .88rem/1.35 system-ui, sans-serif; text-align: center; }
.new-game .ng-status { min-height: 1.5em; margin: 5px 0 0; color: #395854; text-align: center; font: .95rem/1.4 system-ui, sans-serif; }
.new-game .ng-status.is-success { color: #286344; font-weight: 700; }
.new-game .ng-status.is-failure { color: #874934; font-weight: 700; }
.new-game .ng-status.is-paused { color: #395f68; font-weight: 700; }

@media (max-width: 600px) {
  .new-game .ng-heading, .new-game .ng-toolbar { align-items: flex-start; flex-direction: column; }
  .new-game .ng-stamp { font-size: .72rem; }
  .new-game .ng-actions { flex-wrap: wrap; }
  .new-game .ng-checkers-board { width: min(100%, 430px, calc(100vw - 58px)); }
  .new-game .ng-connect-wrap { width: min(100%, 460px); }
  .new-game .ng-readout { justify-content: center; flex-wrap: wrap; gap: 6px 18px; }
}

@media (max-height: 760px) {
  .new-game .ng-shell { padding: 10px 14px; }
  .new-game .ng-instructions { margin: 7px 0; }
  .new-game .ng-toolbar { padding-block: 6px; }
  .new-game .ng-play { padding-top: 5px; }
  .new-game .ng-checkers-board { width: min(100%, 400px, calc(100vh - 330px)); }
  .new-game .ng-connect-wrap { width: min(100%, 500px, calc(100vh - 330px)); }
  .new-game .ng-hill canvas { height: min(28vh, 220px); }
}

@media (prefers-reduced-motion: reduce) {
  .new-game *, .new-game *::before, .new-game *::after { scroll-behavior: auto; transition: none; animation: none; }
}
