*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 1rem;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

pre {
  font-family: ui-monospace, monospace;
  font-size: 90%;
}

table {
  border-collapse: collapse;
}

table caption {
  margin-block-end: 0.5em;
}

th,
td {
  padding: 0.5em;
  border: 1px solid currentColor;
  text-align: start;
  text-wrap: nowrap;
}

fieldset {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  margin: 0;
  padding: 1em;
}

legend {
  font-size: 90%;
  font-style: italic;
}

input:not(:is([type="checkbox"],[type="radio"])) {
  display: block;
  margin-block: 0.25em;
}

button,
a.button {
  padding: 0.5em 1em;
  border: 2px outset currentColor;
  border-radius: 20%;
  color: inherit;
  font: inherit;
  text-decoration: none;
}

button:active,
a.button:active {
  scale: 1.25;
}

button svg {
  width: auto;
  height: 2em;
  fill: currentColor;
}

div.controls {
  display: flex;
  flex-basis: 100%;
  align-items: center;
  gap: 1em;
  width: 100%;
}

#settings {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5em 2em;
}

#settings fieldset {
  width: clamp(min(33ch, 100%), 40ch, 100%);
}

#settings details {
  font-size: 90%;
}

#settings details div.field,
#moves details {
  margin-block: 0.75em;
  margin-inline-start: 1em;
}

div.choreos {
  display: flex;
  flex-wrap: wrap;
  margin-block: 1em;
  gap: 1.5em 2em;
}

div.choreo {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  max-width: 100%;
  padding: 1em;
  overflow: auto;
}

div.choreo div.controls {
  justify-content: center;
}

div.choreo button {
  border: 0;
}

table.choreo td:first-child {
  background-color: #aaaaaa;
  font-size: 80%;
  text-align: end;
}

details.choreos {
  margin-block-start: 2em;
  padding: 1em;
}

#population {
  border: 1px solid currentColor;
  font-size: 90%;
}

div.controls.final {
  margin-block-start: 1em;
}

div.iterations {
  margin-block: 1em;
  font-size: 90%;
  font-style: italic;
}

.animation-controls {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
}
