/* cgol playground; colours come from the host page's CSS variables. */
.cgol {
  margin: 1.5em 0;
}

.cgol-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.5em;
}

.cgol-controls select,
.cgol-controls button,
.cgol-controls input {
  font: inherit;
}

.cgol-play {
  display: inline-grid;
}

.cgol-play > span {
  grid-area: 1 / 1;
}

.cgol-play > span:last-child,
.cgol-play.cgol-playing > span:first-child {
  visibility: hidden;
}

.cgol-play.cgol-playing > span:last-child {
  visibility: visible;
}

.cgol-controls input[type="number"] {
  width: 4em;
}

/* Shrinks to the canvas; scrolls when the canvas is wider than the column.
   The border lives here so the canvas box is exactly the grid. */
.cgol-viewport {
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--color-gray-50, #c0c0c0);
}

.cgol-canvas {
  display: block;
  max-width: none;
  image-rendering: pixelated;
  touch-action: none;
}

.cgol-canvas.cgol-editable {
  cursor: crosshair;
}

.cgol-status {
  margin: 0.5em 0;
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}
