.peg-game {
  --pg-paper: #f4e7c6;
  --pg-ink: #293f43;
  --pg-teal: #3c645f;
  --pg-gold: #efc77d;
  --pg-wood: #ba9360;
  color: var(--pg-ink);
  font-family: Georgia, "Times New Roman", serif;
}
.pg-shell { width: min(100%, 1120px); margin: 0 auto; padding: 12px 16px 10px; border: 3px solid var(--pg-wood); background: var(--pg-paper); box-shadow: inset 0 0 0 2px #fff5dc, 0 4px 0 #806244; }
.pg-heading, .pg-toolbar, .pg-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pg-heading h2 { margin: 2px 0 0; color: var(--pg-ink); font: 700 clamp(1.3rem, 2.5vw, 1.75rem)/1.1 Georgia, serif; }
.pg-kicker { margin: 0; color: var(--pg-teal); font: 700 .7rem/1.2 system-ui, sans-serif; letter-spacing: .12em; }
.pg-stamp { color: #76552b; font: 700 .75rem system-ui, sans-serif; letter-spacing: .08em; white-space: nowrap; }
.pg-instructions { max-width: 760px; margin: 7px auto; color: #425b58; font: .88rem/1.35 system-ui, sans-serif; text-align: center; }
.pg-toolbar { flex-wrap: wrap; margin-top: 9px; padding: 6px 8px; border-block: 2px dashed #c6ad7d; color: #395854; font: .85rem/1.3 system-ui, sans-serif; }
.pg-reward { font-weight: 700; }
.pg-count { margin-left: auto; white-space: nowrap; }
.pg-actions { justify-content: flex-end; }
.pg-actions button { min-height: 36px; padding: 5px 10px; border: 2px solid var(--pg-teal); border-radius: 2px; background: #fff3d5; color: var(--pg-ink); font: 700 .85rem/1.2 system-ui, sans-serif; cursor: pointer; }
.pg-actions button:hover:not(:disabled), .pg-actions button:focus-visible { outline: 3px solid #bf7a38; outline-offset: 2px; background: #f7dda5; }
.pg-actions button:disabled { cursor: default; opacity: .6; }
.pg-board-wrap { display: grid; place-items: center; min-height: 350px; padding: 10px 0 2px; }
.pg-board { display: grid; gap: clamp(6px, 1.1vw, 12px); width: min(78vw, 390px); }
.pg-row { display: flex; justify-content: center; gap: clamp(6px, 1.1vw, 12px); }
.pg-hole { display: grid; place-items: center; width: clamp(42px, 8vw, 68px); aspect-ratio: 1; padding: 0; border: 3px solid #806244; border-radius: 50%; background: #e3d1a8; color: #9a8154; box-shadow: inset 0 2px 4px #5e483320; font: 700 clamp(1.4rem, 3vw, 2.35rem)/1 system-ui, sans-serif; cursor: pointer; transition: transform .12s ease, background .12s ease, box-shadow .12s ease; }
.pg-hole.is-occupied { border-color: #3c645f; background: #f9e7b4; color: #3f796b; box-shadow: inset 0 0 0 4px #d8c08a, 0 3px 0 #806244; }
.pg-hole.is-empty { background: #e2d0a6; color: #806a42; }
.pg-hole.is-destination { border-color: #a35e16; background: #ffdc83; color: #6f4b15; box-shadow: 0 0 0 4px #c28c3866, 0 3px 0 #806244; }
.pg-hole.is-selected { outline: 4px solid #b66e20; outline-offset: 3px; transform: scale(1.06); }
.pg-hole:hover:not(:disabled) { transform: translateY(-2px); }
.pg-hole:focus-visible { outline: 4px solid #263e43; outline-offset: 4px; z-index: 1; }
.pg-hole:disabled { cursor: default; opacity: 1; }
.pg-status { min-height: 1.45em; margin: 6px 0 0; color: #395854; text-align: center; font: 700 .95rem/1.4 system-ui, sans-serif; }
.pg-help, .pg-reload-note { margin: 4px auto 0; color: #526660; text-align: center; font: .78rem/1.35 system-ui, sans-serif; }
.pg-reload-note { color: #6e5c3d; }
@media (max-width: 820px) {
  .pg-shell { padding-inline: 12px; }
  .pg-board { width: min(84vw, 360px); }
  .pg-board-wrap { min-height: 320px; }
  .pg-hole { width: clamp(38px, 8.5vw, 62px); }
}
@media (max-width: 640px) {
  .pg-shell { box-sizing: border-box; width: 100%; min-width: 0; }
  .pg-heading, .pg-toolbar { align-items: flex-start; flex-direction: column; }
  .pg-count { margin-left: 0; }
  .pg-actions { flex-wrap: wrap; justify-content: flex-start; }
  .pg-board { box-sizing: border-box; width: min(100%, 340px); min-width: 0; gap: 6px; }
  .pg-row { gap: 5px; }
  .pg-hole { box-sizing: border-box; width: clamp(34px, 10.8vw, 42px); }
  .pg-board-wrap { min-height: 280px; }
}
@media (max-height: 760px) {
  .pg-heading { display: none; }
  .pg-shell { padding-block: 5px 4px; }
  .pg-toolbar { margin-top: 4px; padding-block: 4px; }
  .pg-instructions { margin: 3px auto; font-size: .82rem; }
  .pg-board-wrap { min-height: 0; padding-block: 5px 1px; }
  .pg-board { width: min(70vw, 300px); gap: 5px; }
  .pg-row { gap: 5px; }
  .pg-hole { width: clamp(34px, 6vw, 54px); }
  .pg-status { margin-top: 3px; }
  .pg-help, .pg-reload-note { margin-top: 2px; }
}
@media (prefers-reduced-motion: reduce) { .peg-game *, .peg-game *::before, .peg-game *::after { scroll-behavior: auto; transition: none; animation: none; } }
