* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, system-ui, sans-serif;
  background: #1a1a1e;
  color: #e0e0e0;
  overflow: hidden;
}

#toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 12px;
  background: #26262c;
  border-bottom: 1px solid #38383f;
  align-items: center;
}

.tb-group {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-right: 12px;
  border-right: 1px solid #38383f;
}

.tb-group:last-child {
  border-right: none;
}

label {
  font-size: 12px;
  display: flex;
  gap: 4px;
  align-items: center;
}

select,
input[type='number'] {
  background: #1a1a1e;
  color: #e0e0e0;
  border: 1px solid #44444c;
  border-radius: 4px;
  padding: 3px 5px;
}

input[type='number'] {
  width: 64px;
}

button {
  background: #3a6ea5;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
}

button:hover {
  background: #4a7eb5;
}

button.active {
  background: #a55e3a;
}

.readout {
  font-family: monospace;
  font-size: 11px;
  color: #9aa;
}

#main {
  display: flex;
  width: 100%;
  height: calc(100% - 50px);
}

#stage {
  position: relative;
  flex: 1;
  height: 100%;
}

#stage canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
#side-panel {
  width: 280px;
  min-width: 280px;
  height: 100%;
  background: #26262c;
  border-left: 1px solid #38383f;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#panel-tabs {
  display: flex;
  border-bottom: 1px solid #38383f;
  flex-shrink: 0;
}
.panel-tab {
  flex: 1;
  background: #202026;
  color: #aaa;
  border: none;
  border-radius: 0;
  padding: 10px 6px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 2px solid transparent;
}
.panel-tab:hover {
  background: #2c2c34;
  color: #ddd;
}
.panel-tab.active {
  background: #26262c;
  color: #fff;
  border-bottom-color: #3a6ea5;
}
#panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.panel-section {
  margin-bottom: 16px;
}
.panel-section h3 {
  font-size: 12px;
  margin: 0 0 8px;
  color: #9ab;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}
.field-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #bbb;
}
.field-value {
  font-family: monospace;
  color: #7fb0e0;
}
.field input[type='range'] {
  width: 100%;
}
.field-row {
  display: flex;
  gap: 8px;
}
.field-row .field {
  flex: 1;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}
.toggle-row input {
  width: 16px;
  height: 16px;
}
.seed-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.seed-row input[type='number'] {
  flex: 1;
}
.seed-row button {
  padding: 4px 8px;
  font-size: 11px;
}
