:root {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

body {
  margin: 0;
  background: #0b0f14;
  color: #e8eef7;
}

.app-header {
  padding: 18px 16px;
  border-bottom: 1px solid #1b2533;
}

h1 {
  margin: 0;
  font-size: 18px;
}

h2 {
  margin: 0 0 10px 0;
  font-size: 15px;
}

h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
}

.container {
  padding: 16px;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  max-width: 980px;
  margin: 0 auto;
}

.card {
  background: #0f1620;
  border: 1px solid #1b2533;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.field label {
  font-size: 12px;
  opacity: .9;
}

input, select, button, textarea {
  border-radius: 10px;
  border: 1px solid #243247;
  background: #0b111a;
  color: #e8eef7;
  padding: 8px 10px;
}

input[type="number"] { width: 110px; }

button { cursor: pointer; }
button.primary { background: #1a6cff; border-color: #1a6cff; }
button.danger  { background: #ff3b3b; border-color: #ff3b3b; }

.hint {
  font-size: 12px;
  opacity: .75;
  line-height: 1.5;
}

.tiny {
  font-size: 11px;
  opacity: .7;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.grid2 {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
}

/* Pads */
.pads {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0,1fr));
}

.pad {
  user-select: none;
  background: #111c2a;
  border: 1px solid #243247;
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  transition: transform .03s ease, background .08s ease;
}

.pad:active, .pad.active {
  transform: scale(0.98);
  background: #173055;
  border-color: #2f5ea8;
}

.kbd { font-size: 12px; opacity: .8; }
.name { font-weight: 700; }

.divider {
  border: 0;
  border-top: 1px solid #1b2533;
  margin: 14px 0;
}

/* Accuracy meter */
.meter { display: grid; gap: 10px; grid-template-columns: 1fr; }

.bar {
  height: 14px;
  background: #0b111a;
  border: 1px solid #243247;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.bar > div {
  height: 100%;
  width: 50%;
  background: #1a6cff;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  opacity: .95;
}

canvas {
  width: 100%;
  height: 90px;
  background: #0b111a;
  border: 1px solid #243247;
  border-radius: 12px;
}

/* Sequencer */
.seqWrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #243247;
  background: #0b111a;
  padding: 10px;
}

.seq { display: grid; gap: 6px; }

.seq-row {
  display: grid;
  gap: 6px;
  align-items: center;
}

.seq-label {
  font-size: 12px;
  opacity: .85;
  width: 64px;
}

.seq-steps {
  display: grid;
  gap: 6px;
}

.step {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid #243247;
  background: #0f1620;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.step.on  { background: #1a6cff; border-color: #1a6cff; }
.step.acc { background: #22c55e; border-color: #22c55e; }

.step.playhead::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 9px;
  border: 2px solid rgba(255,255,255,.35);
  pointer-events: none;
}

/* Export/Import textarea */
.textarea {
  width: 100%;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid #243247;
  background: #0b111a;
  color: #e8eef7;
  padding: 10px;
}

/* File button */
.filebtn input {
  display: none;
}

.filebtn-face {
  padding: 8px 10px;
  border: 1px solid #243247;
  border-radius: 10px;
  background: #0b111a;
  display: inline-block;
}
.filebtn-face:hover { filter: brightness(1.12); }
