:root {
  --life-cell: 20px;
  --life-rate: 1.25;
  --life-zone: 2.75;
  --life-zone-charged: 18;
  --life-opacity: 0.4;
  --life-color: var(--accent);
  --life-hover: var(--highlight);
  --life-grid: #30345a;
  --life-grid-major: #3f4578;
  --life-spark: #5a61aa;
  --life-highlife: #ea76c0;
  --life-drylife: #50dec8;
  --life-move: #95cb79;
}

@media (max-width: 640px) {
  :root {
    --life-cell: 12px;
  }
}

.life {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.life-controls {
  position: fixed;
  left: 0.5rem;
  bottom: 0.75rem;
  z-index: 2;
  display: flex;
  gap: 0.5rem;
}

.life-controls button {
  display: grid;
  place-items: center;
  width: max(2.75rem, 44px);
  height: max(2.75rem, 44px);
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.life-controls button:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.life-controls button:focus-visible {
  outline-offset: 2px;
  border-radius: 0.5rem;
}

.life-controls svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.life-sound path + path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.life-toggle[aria-pressed="false"] .life-play,
.life-toggle[aria-pressed="true"] .life-pause,
.life-sound[aria-pressed="false"] .life-on,
.life-sound[aria-pressed="true"] .life-off {
  display: none;
}

body {
  -webkit-touch-callout: none;
}

main {
  -webkit-user-select: none;
  user-select: none;
}

main p,
main a {
  -webkit-user-select: text;
  user-select: text;
}

.life-debug {
  position: fixed;
  right: 0.5rem;
  bottom: 0.75rem;
  z-index: 3;
  margin: 0;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  color: var(--muted);
  font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
