* { box-sizing: border-box; }
body {
  margin: 0;
  background: #111;
  color: #ddd;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
}
main { max-width: 960px; margin: 0 auto; padding: 16px; }
h1 { font-size: 18px; margin: 0 0 12px; font-weight: 600; }
h2 { font-size: 15px; margin: 24px 0 8px; font-weight: 600; }

.board {
  background: #000;
  border: 6px solid #2a2a2a;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.board canvas { display: block; width: 100%; aspect-ratio: 5 / 1; }
.board.full {
  position: fixed; inset: 0; z-index: 10;
  border: 0; border-radius: 0; cursor: pointer;
}
.board.full canvas { width: min(100vw, 500vh); }

.controls { display: grid; gap: 12px; margin-top: 16px; }
textarea {
  width: 100%; min-height: 96px; padding: 10px;
  background: #1c1c1c; color: #eee; border: 1px solid #333; border-radius: 6px;
  font: inherit; font-size: 16px; resize: vertical;
}
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
label { font-size: 14px; display: flex; gap: 6px; align-items: center; }
select, input[type="range"] { accent-color: #ff8a00; }
select {
  background: #1c1c1c; color: #eee; border: 1px solid #333;
  border-radius: 4px; padding: 4px 6px; font: inherit; font-size: 14px;
}
button {
  background: #2a2a2a; color: #eee; border: 1px solid #444; border-radius: 6px;
  padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer;
}
button:hover { background: #353535; }
button.primary { background: #ff8a00; border-color: #ff8a00; color: #111; font-weight: 600; }
button.primary:hover { background: #ff9d2a; }
.hint { font-size: 12px; color: #888; margin: 0; }

#history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#history li {
  display: flex; gap: 8px; align-items: center;
  background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 6px; padding: 6px 8px;
}
#history .load {
  flex: 1; text-align: left; background: none; border: 0; padding: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#history .load:hover { color: #ff9d2a; background: none; }
#history time { font-size: 12px; color: #777; white-space: nowrap; }
#history .del { padding: 4px 10px; font-size: 12px; }
.empty { font-size: 13px; color: #777; }
