:root {
  --page: #ffffff;
  --ink: #2b3340;
  --muted: #6f7886;
  --rule: #e3e7ee;
  --link: #2c5aa0;

  --board: #d6e0f2;
  --board-edge: #c3d1ea;
  --hole: #f7f9fc;
  --hole-edge: #e3e9f4;

  --red: #e8827c;
  --red-edge: #d96f68;
  --red-ghost: #f7d5d2;
  --yellow: #f0cc6e;
  --yellow-edge: #e0b953;
  --yellow-ghost: #faedcc;

  --bar: #b9c6de;
  --bar-chosen: #6a83b3;
  --win-ring: #3d4756;

  --button: #2b3340;
  --button-text: #ffffff;
  --button-secondary: #eef1f7;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 2.5rem 1.25rem 3rem;
  max-width: 62rem;
  margin-inline: auto;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

header p {
  margin: 0;
  max-width: 44rem;
  color: var(--ink);
}

header {
  margin-bottom: 2rem;
}

.game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17.5rem;
  gap: 2rem;
  align-items: start;
}

.board {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.caption {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.board-face {
  fill: var(--board);
  stroke: var(--board-edge);
  stroke-width: 2;
}

.hole {
  fill: var(--hole);
  stroke: var(--hole-edge);
  stroke-width: 2;
}

.piece {
  stroke-width: 3;
}

.piece.red {
  fill: var(--red);
  stroke: var(--red-edge);
}

.piece.yellow {
  fill: var(--yellow);
  stroke: var(--yellow-edge);
}

.ghost {
  pointer-events: none;
}

.ghost.red {
  fill: var(--red-ghost);
}

.ghost.yellow {
  fill: var(--yellow-ghost);
}

.win-ring {
  fill: none;
  stroke: var(--win-ring);
  stroke-width: 5;
  pointer-events: none;
}

.bar {
  fill: var(--bar);
  transition: height 120ms ease-out, y 120ms ease-out;
}

.bar.chosen {
  fill: var(--bar-chosen);
}

.column-hit {
  fill: transparent;
  cursor: pointer;
  outline: none;
}

.column-hit:focus-visible {
  fill: rgba(43, 51, 64, 0.06);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-top: 4.6%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.field select {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--page);
}

.hint {
  margin: -0.3rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.buttons {
  display: flex;
  gap: 0.5rem;
}

button {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--button);
  background: var(--button);
  color: var(--button-text);
  cursor: pointer;
}

button.secondary {
  background: var(--button-secondary);
  border-color: var(--rule);
  color: var(--ink);
}

button:hover {
  filter: brightness(0.96);
}

.status {
  margin: 0.3rem 0 0;
  font-weight: 600;
  min-height: 1.5em;
}

.thinking {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-height: 1.4em;
}

.tally {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.keys {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.notes {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  max-width: 44rem;
}

.notes p {
  margin: 0 0 1rem;
}

@media (max-width: 720px) {
  body {
    padding: 1.5rem 1rem 2rem;
  }

  .game {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .panel {
    padding-top: 0;
  }
}

/* Embedded in the portfolio: just the game, tighter margins. */
.embed body {
  padding: 0.5rem;
  max-width: none;
}

.embed .page-only {
  display: none;
}
