.life-tool {
  max-width: none;
  margin: 4rem auto 0;
  border: 1px solid rgba(86, 212, 160, 0.2);
  border-radius: 0.75rem;
  background:
    linear-gradient(135deg, rgba(86, 212, 160, 0.065), transparent 42%),
    linear-gradient(315deg, rgba(78, 154, 241, 0.055), transparent 46%),
    var(--card);
  box-shadow: 0 1.2rem 3.2rem rgba(0, 0, 0, 0.3);
}

.life-tool__top {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.life-tool__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.life-stat {
  min-width: 8rem;
  border: 1px solid rgba(232, 228, 223, 0.09);
  border-radius: 0.55rem;
  padding: 0.65rem 0.75rem;
  background: rgba(0, 0, 0, 0.17);
}

.life-stat span {
  display: block;
  color: var(--faint);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.life-stat strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.1;
}

.life-tool__canvas-wrap {
  padding: 0 1rem 1rem;
}

.life-canvas {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(232, 228, 223, 0.12);
  border-radius: 0.65rem;
  background: #08090d;
  touch-action: none;
}

.life-controls {
  display: grid;
  gap: 0.85rem;
  border-top: 1px solid rgba(232, 228, 223, 0.08);
  padding: 1rem;
  grid-template-columns: 1fr auto;
}

.life-controls__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.life-button,
.life-select {
  min-height: 2.35rem;
  border: 1px solid rgba(232, 228, 223, 0.13);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.life-button {
  min-width: 5.2rem;
  padding: 0.45rem 0.72rem;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.life-button:hover,
.life-button:focus-visible {
  border-color: rgba(86, 212, 160, 0.55);
  background: rgba(86, 212, 160, 0.08);
  color: var(--text);
  transform: translateY(-1px);
}

.life-button[data-action="toggle"] {
  border-color: rgba(86, 212, 160, 0.38);
  color: var(--text);
}

.life-select {
  width: 12rem;
  padding: 0.45rem 0.55rem;
  color: var(--text);
}

.life-speed {
  display: grid;
  min-width: 13rem;
  align-content: center;
  gap: 0.35rem;
}

.life-speed label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--faint);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.life-speed input {
  width: 100%;
  accent-color: var(--life-green);
}


@media (max-width: 48rem) {
  .life-tool__top, .life-controls { grid-template-columns: 100%; }
  .life-select, .life-speed { width: 100%; min-width: 0; }
}
