* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: #1b1d22;
  color: #e6e6e6;
  font: 14px/1.4 system-ui, sans-serif;
  min-height: 100vh;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #2a2d34;
}
header h1 { margin: 0; font-size: 16px; font-weight: 600; }
header nav a { color: #8ab4f8; text-decoration: none; }
header nav a:hover { text-decoration: underline; }
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px;
}

/* Editor (index.html) */
.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  padding: 16px 24px;
  align-items: start;
}
.canvas-area { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.editor-panel {
  background: #0f1115;
  border: 1px solid #2a2d34;
  border-radius: 4px;
  padding: 12px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.editor-panel .row { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.editor-panel label { display: inline-flex; align-items: center; gap: 4px; }
.editor-panel select, .editor-panel input[type="color"] {
  background: #1b1d22; color: #e6e6e6; border: 1px solid #3a3d44;
  padding: 4px; border-radius: 3px; font: inherit;
}
.editor-panel input[type="color"] { padding: 0; height: 28px; width: 50px; cursor: pointer; }
.editor-panel button {
  background: #2a2d34; color: #e6e6e6; border: 1px solid #3a3d44;
  padding: 4px 10px; border-radius: 3px; cursor: pointer; font: inherit;
}
.editor-panel button:hover { background: #3a3d44; }
.editor-panel h3 { margin: 12px 0 6px; font-size: 13px; color: #aaa; font-weight: 500; }
.editor-panel hr { border: none; border-top: 1px solid #2a2d34; margin: 12px 0; }
.editor-panel code {
  display: inline-block; background: #000; color: #b8d8ff; padding: 3px 6px;
  font-family: ui-monospace, monospace; font-size: 12px; border-radius: 3px;
}
.mini-picker-wrap {
  background: #0a0c10; border: 1px solid #2a2d34;
  max-height: 320px; overflow: auto; margin: 6px 0;
}
.mini-picker-wrap canvas { display: block; image-rendering: pixelated; cursor: crosshair; }
.mini-preview-wrap { background: #000; border: 1px solid #2a2d34; padding: 4px; }
.mini-preview-wrap canvas { display: block; image-rendering: pixelated; }
canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  border: 1px solid #2a2d34;
  display: block;
}
.hint { color: #888; font-size: 12px; margin: 0; }

/* Picker page */
.picker {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  padding: 16px 24px;
}
.picker h2 { font-size: 14px; margin: 0 0 8px; color: #ccc; }
.picker-canvas-wrap {
  background: #0f1115;
  border: 1px solid #2a2d34;
  overflow: auto;
  max-height: calc(100vh - 140px);
}
.picker-canvas-wrap canvas { display: block; }
.picker-info {
  position: sticky;
  top: 16px;
  align-self: start;
  background: #0f1115;
  border: 1px solid #2a2d34;
  padding: 14px;
  border-radius: 4px;
  max-width: 280px;
  overflow: hidden;
}
.picker-info #preview {
  max-width: 100%;
  overflow: hidden;
}
.picker-info #preview canvas {
  max-width: 100% !important;
  max-height: 220px !important;
  height: auto !important;
}
.picker-info code {
  background: #000;
  padding: 1px 5px;
  font-family: ui-monospace, monospace;
  color: #b8d8ff;
  font-size: 12px;
  border-radius: 2px;
}
.picker-info #snippet {
  display: block;
  padding: 8px;
  margin: 6px 0;
  font-size: 12px;
  word-break: break-all;
}
.picker-info button {
  background: #2a2d34;
  color: #e6e6e6;
  border: 1px solid #3a3d44;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
}
.picker-info button:hover { background: #3a3d44; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
.tabs button {
  background: #1b1d22;
  color: #e6e6e6;
  border: 1px solid #3a3d44;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
}
.tabs button:hover { background: #2a2d34; }
.tabs button.active { background: #3a4d6d; border-color: #5a7dad; }
