* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050807;
}

.boardViewport {
  width: 100vw;
  height: 100vh;
  overflow: auto;
}

#board {
  display: block;
  position: relative;
  touch-action: pan-x pan-y;
  transform-origin: 0 0;
  user-select: none;
}

.controls {
  position: fixed;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(20, 20, 20, 0.7);
  padding: 8px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
  z-index: 10;
}

.controlRow {
  display: flex;
  align-items: center;
  gap: 8px;
}

button {
  padding: 6px 12px;
  cursor: pointer;
  background: #222;
  color: #eee;
  border: 1px solid #444;
  border-radius: 4px;
  font-family: sans-serif;
}

button:hover {
  background: #333;
}

.colorControl {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font: 13px sans-serif;
  white-space: nowrap;
}

.speedControl {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font: 13px sans-serif;
  white-space: nowrap;
}

.colorControl input {
  width: 28px;
  height: 24px;
  padding: 0;
  border: 1px solid #444;
  background: transparent;
  cursor: pointer;
}

@media (max-width: 760px) {
  .controls {
    max-width: calc(100vw - 24px);
  }

  .controlRow {
    flex-wrap: wrap;
  }
}

.generationValue {
  color: #fff;
  font: 13px sans-serif;
  white-space: nowrap;
}

.sizeControl {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font: 13px sans-serif;
  white-space: nowrap;
}

.sizeControl input {
  width: 58px;
  padding: 5px;
  background: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 4px;
}

.ruleControl {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font: 13px sans-serif;
  white-space: nowrap;
}