* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; font-family: 'Segoe UI', system-ui, sans-serif; }
body { display: flex; background: #0d0d1a; color: #e0e0f0; }

#sidebar {
  width: 300px;
  min-width: 300px;
  height: 100vh;
  background: #13132a;
  border-right: 1px solid #252545;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
#sidebar::-webkit-scrollbar { width: 5px; }
#sidebar::-webkit-scrollbar-track { background: #13132a; }
#sidebar::-webkit-scrollbar-thumb { background: #3a3a6a; border-radius: 3px; }

#canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #8080ff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 12px;
  border-bottom: 1px solid #252545;
}

.section { display: flex; flex-direction: column; gap: 8px; }

.section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #5555a0;
  margin-bottom: 2px;
}

.field { display: flex; flex-direction: column; gap: 3px; }

label {
  font-size: 0.78rem;
  color: #9090c0;
}

input[type="number"],
input[type="text"],
select {
  background: #1a1a35;
  border: 1px solid #333365;
  border-radius: 6px;
  color: #e0e0f0;
  padding: 7px 10px;
  font-size: 0.83rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
input[type="number"]:focus,
input[type="text"]:focus,
select:focus { border-color: #6666ff; }
select option { background: #1a1a35; }

input[type="number"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
input[type="number"]:disabled + label,
.field:has(input:disabled) label { color: #55557a; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
input[type="color"] {
  width: 38px;
  height: 34px;
  border: 1px solid #333365;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}
.color-hex {
  flex: 1;
  background: #1a1a35;
  border: 1px solid #333365;
  border-radius: 6px;
  color: #e0e0f0;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-family: 'Consolas', monospace;
  outline: none;
  transition: border-color 0.15s;
}
.color-hex:focus { border-color: #6666ff; }

.btn {
  padding: 10px 14px;
  border-radius: 7px;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.04em;
  width: 100%;
}
.btn-primary { background: #4444cc; color: #fff; }
.btn-primary:hover { background: #5555ee; transform: translateY(-1px); }
.btn-secondary { background: #1e1e3e; color: #8888cc; border: 1px solid #3a3a6a; }
.btn-secondary:hover { background: #2a2a52; transform: translateY(-1px); }
.btn-row { display: flex; flex-direction: column; gap: 7px; }

.hint { font-size: 0.7rem; color: #444470; line-height: 1.5; }

#loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 26, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  gap: 14px;
}
.spinner {
  width: 38px; height: 38px;
  border: 3px solid #2a2a4a;
  border-top-color: #6666ff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: #5555a0; font-size: 0.82rem; }

#info-bar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(19, 19, 42, 0.75);
  border: 1px solid #252545;
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 0.72rem;
  color: #404060;
  pointer-events: none;
  white-space: nowrap;
}

.radio-group {
  display: flex;
  gap: 16px;
}
.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: #e0e0f0;
  cursor: pointer;
}
input[type="radio"] {
  accent-color: #6666ff;
  cursor: pointer;
}
textarea {
  background: #1a1a35;
  border: 1px solid #333365;
  border-radius: 6px;
  color: #e0e0f0;
  padding: 7px 10px;
  font-size: 0.83rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  resize: vertical;
  min-height: 80px;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
textarea:focus { border-color: #6666ff; }

.divider {
  height: 1px;
  background: #1e1e3e;
  margin: 2px 0;
}
