body {
  background-color: #121212;
  color: #e0e0e0;
  font-family: 'Arial', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  height: 100vh;
}

header, footer {
  width: 100%;
  text-align: center;
  padding: 1rem 0;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column; /* Stack controls and canvas vertically */
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 1rem 0;
}

canvas {
  border: 1px solid #e0e0e0;
  background-color: #000;
}

h1 {
  margin: 0;
}

a {
  color: #bb86fc;
}

#controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: #1e1e1e;
  border-radius: 8px;
  width: calc(80% + 2px);
  border: 1px solid #333;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

label {
  font-size: 1rem;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 150px;
  height: 7px;
  background: #444;
  border-radius: 5px;
  outline: none;
  opacity: 0.7;
  transition: opacity .2s;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #bb86fc;
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #bb86fc;
  border-radius: 50%;
  cursor: pointer;
}

button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: 1px solid #bb86fc;
  border-radius: 5px;
  background-color: transparent;
  color: #bb86fc;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

button:hover {
  background-color: #bb86fc;
  color: #121212;
}

span {
  min-width: 40px;
  text-align: left;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
}

select {
  background-color: #333;
  color: #e0e0e0;
  border: 1px solid #555;
  border-radius: 5px;
  padding: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: #bb86fc;
}

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: #444;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.3s;
}

input[type="checkbox"]:checked {
  background-color: #bb86fc;
}

input[type="checkbox"]:checked::after {
  content: '✔';
  font-size: 14px;
  color: #121212;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}