* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: sans-serif;
  background: #272330;
  color: white;
  height: 100vh;
}

.container {
  display: flex;
  height: 100vh;
}

.controls {
  width: 50%;
  min-width: 340px;
  overflow-y: auto;
  padding: 20px;
  background: #1f1b28;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.controls h1 {
  margin: 0 0 8px 0;
  font-size: 24px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

input,
button {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 8px;
}

button {
  background: #4f46e5;
  color: white;
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
}

.preview {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow: auto;
}

canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

@media (max-width: 900px) {
  .container {
    flex-direction: column;
    height: auto;
  }

  .controls {
    width: 150%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .preview {
    min-height: 50vh;
  }
}