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

body {
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  height: 100vh;
}

#app {
  display: flex;
  height: 100vh;
}

#toolbar {
  width: 240px;
  min-width: 240px;
  background: #16213e;
  border-right: 2px solid #0f3460;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#toolbar h2 {
  text-align: center;
  color: #e94560;
  font-size: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid #0f3460;
}

.tool-section {
  background: #1a1a2e;
  border-radius: 6px;
  padding: 8px;
}

.tool-section label {
  display: block;
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.tool-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid #0f3460;
  background: #16213e;
  color: #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
}

.tool-btn:hover {
  background: #0f3460;
  color: #fff;
}

.tool-btn.active {
  background: #e94560;
  color: #fff;
  border-color: #e94560;
}

.tool-btn:active {
  transform: scale(0.95);
}

.texture-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
}

.tex-btn {
  padding: 4px 6px;
  border: 1px solid #0f3460;
  background: #16213e;
  color: #ccc;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  transition: all 0.15s;
}

.tex-btn:hover { background: #0f3460; }
.tex-btn.active { background: #533483; color: #fff; border-color: #533483; }

.size-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.size-inputs input {
  width: 50px;
  padding: 4px;
  background: #0d1b3e;
  border: 1px solid #0f3460;
  color: #e0e0e0;
  border-radius: 3px;
  font-size: 12px;
  text-align: center;
}

.size-inputs span { color: #888; }

#resize-btn, #save-btn, #load-btn {
  padding: 4px 10px;
  background: #0f3460;
  border: 1px solid #533483;
  color: #e0e0e0;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
}

#resize-btn:hover, #save-btn:hover, #load-btn:hover {
  background: #533483;
}

.save-load {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.save-load input {
  flex: 1;
  padding: 4px;
  background: #0d1b3e;
  border: 1px solid #0f3460;
  color: #e0e0e0;
  border-radius: 3px;
  font-size: 12px;
}

#saves-list {
  width: 100%;
  background: #0d1b3e;
  border: 1px solid #0f3460;
  color: #e0e0e0;
  border-radius: 3px;
  font-size: 11px;
}

#saves-list option:hover { background: #0f3460; }

input[type="range"] {
  width: 100%;
  accent-color: #e94560;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.toggle-row input { accent-color: #e94560; }

.help-text {
  font-size: 10px;
  color: #888;
  line-height: 1.6;
}

#status-bar {
  margin-top: auto;
  padding: 6px;
  background: #0d1b3e;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #888;
}

#canvas {
  flex: 1;
  display: block;
  cursor: crosshair;
}
