* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 920px;
  padding: 10px 12px 24px;
  font-family: system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  background: #1b1d2a;
  color: #e8e8f0;
}
h1 { font-size: 1.5rem; margin: 0.3em 0; }
h2 { font-size: 1.15rem; margin: 0 0 0.5em; }
a { color: #8fd0ff; }
nav { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0; }
.note { color: #b9f0c4; }
section { background: #252840; border-radius: 6px; padding: 12px; margin: 12px 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 8px 0; }
label { display: inline-flex; align-items: center; gap: 6px; }
input[type="number"] { width: 72px; }
input[type="text"] { width: 150px; }
input, select, textarea, button {
  font: inherit;
  background: #12131d;
  color: #e8e8f0;
  border: 1px solid #55598a;
  border-radius: 4px;
  padding: 4px 8px;
}
button { background: #3a3f78; cursor: pointer; }
button:hover { background: #4b51a0; }
textarea { width: 100%; font-family: monospace; margin: 4px 0; }
.drop { border: 2px dashed #55598a; border-radius: 6px; padding: 10px; margin-bottom: 8px; }
.drop.over { border-color: #ff2d95; background: #2e2a4a; }
.canvaswrap { overflow: auto; max-height: 360px; margin-top: 8px; }
.checker {
  background-color: #444;
  background-image: linear-gradient(45deg, #555 25%, transparent 25%, transparent 75%, #555 75%),
    linear-gradient(45deg, #555 25%, transparent 25%, transparent 75%, #555 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
canvas { image-rendering: pixelated; max-width: 100%; }
#swatchCanvas { display: block; margin: 6px 0; border: 1px solid #55598a; }
.frames { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; max-height: 220px; overflow: auto; }
.frame { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 110px; font-size: 12px; text-align: center; word-break: break-all; }
.thumb { max-width: 96px; max-height: 64px; width: auto; height: auto; background: #444; }
footer { font-size: 13px; color: #b0b3d0; }
@media (max-width: 640px) {
  body { font-size: 14px; }
  .row { gap: 6px 10px; }
  input[type="text"] { width: 120px; }
}
