/* Game of Life - what the automaton alone wears; the window, the menus
   and the dialogs come from the system sheet. */

#app-life {
  padding: calc(12 * var(--u));
}

/* the shape rail on the left, then the grid */
#life-main {
  display: flex;
  gap: calc(12 * var(--u));
  align-items: stretch;
}

#life-shapes {
  width: calc(96 * var(--u));
  flex: none;
  border: 1px solid #000;
  display: flex;
  flex-direction: column;
}

/* one entry per shape, its turn button under the name,
   a rule between two neighbours */
.life-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(4 * var(--u));
  padding: calc(6 * var(--u)) calc(5 * var(--u));
}

.life-entry + .life-entry {
  border-top: 1px solid #000;
}

.life-shape {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  padding: 0;
}

/* the quarter-turn button under each name */
.life-rot {
  appearance: none;
  font: inherit;
  background: #fff;
  border: 1px solid #000;
  border-radius: calc(4 * var(--u));
  width: calc(18 * var(--u));
  height: calc(14 * var(--u));
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.life-rot svg { width: calc(10 * var(--u)); height: calc(10 * var(--u)); display: block; }

.life-shape .label {
  font-size: calc(9.5 * var(--u));
  padding: 0 calc(3 * var(--u));
  background: #fff;
  white-space: nowrap;
}

.life-shape.selected .label { background: #000; color: #fff; }

#life-canvas {
  display: block;
  width: calc(440 * var(--u));
  border: 1px solid #000;
  background: #fff;
  image-rendering: pixelated;
  touch-action: none;
}

/* the bottom bar: the tally at the left, Step then Run at the right */
#life-bar {
  display: flex;
  align-items: center;
  gap: calc(10 * var(--u));
  margin-top: calc(8 * var(--u));
}

#life-status {
  flex: 1;
  font-size: calc(11 * var(--u));
}

#life-step, #life-run {
  appearance: none;
  font: inherit;
  font-size: calc(11.5 * var(--u));
  background: #fff;
  color: #000;
  border: calc(1.5 * var(--u)) solid #000;
  border-radius: calc(8 * var(--u));
  padding: calc(2 * var(--u)) calc(14 * var(--u));
}

/* one width for Run and Stop: the button does not breathe with its label */
#life-run {
  width: calc(64 * var(--u));
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

#life-step:disabled {
  color: #888;
  border-color: #888;
}
