:root{
  --bg:#0b0f14;
  --card:#111823;
  --fg:#e7eef7;
  --muted:#a7b3c2;
  --line:#223044;
  --accent:#7dd3fc;
  --accent2:#a78bfa;
  --warn:#fb7185;
  --ok:#34d399;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Arial;
  background:linear-gradient(180deg, #070a0f, var(--bg));
  color:var(--fg);
}
.wrap{ max-width:1100px; margin:0 auto; padding:16px; }
h1{ margin:8px 0 0; font-size:20px; }
h2{ margin:0 0 12px; font-size:16px; }
.muted{ color:var(--muted); }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
.card{
  background:rgba(17,24,35,0.88);
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}
.span2{ grid-column: 1 / -1; }

.row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin:10px 0;
}
.label{ font-size:12px; color:var(--muted); margin-bottom:6px; }
.big{ font-size:22px; font-weight:700; letter-spacing:0.5px; }

select, input[type="number"]{
  background:#0d1320;
  border:1px solid var(--line);
  color:var(--fg);
  padding:8px 10px;
  border-radius:10px;
}
input[type="range"]{ width:180px; }

button{
  background:#0d1320;
  border:1px solid var(--line);
  color:var(--fg);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
}
button.primary{ border-color: rgba(125,211,252,0.6); }
button.on{ border-color: rgba(52,211,153,0.7); box-shadow: 0 0 0 2px rgba(52,211,153,0.15) inset; }
button.danger{ border-color: rgba(251,113,133,0.7); }

hr{
  border:0;
  border-top:1px solid var(--line);
  margin:12px 0;
}

.pillbox{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.pill{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#0d1320;
  font-size:13px;
}
.pill.scale{ border-color: rgba(125,211,252,0.5); }
.pill.chord{ border-color: rgba(167,139,250,0.5); }

.progression{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  padding:8px 0 0;
}
.chip{
  border:1px solid var(--line);
  background:#0d1320;
  padding:10px 12px;
  border-radius:14px;
  min-width:70px;
  text-align:center;
  font-weight:650;
}
.chip.playing{ outline:2px solid rgba(125,211,252,0.45); }

.keyboard{
  position:relative;
  height:180px;
  user-select:none;
  border:1px solid var(--line);
  border-radius:16px;
  background:#0d1320;
  overflow:hidden;
}
.key{
  position:absolute;
  bottom:0;
  border:1px solid rgba(0,0,0,0.35);
  border-bottom-left-radius:10px;
  border-bottom-right-radius:10px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding-bottom:8px;
  font-size:11px;
}
.key.white{
  background: linear-gradient(180deg, #eef2ff, #cbd5e1);
  color:#0b1220;
  width:60px;
  height:170px;
  z-index:1;
}
.key.black{
  background: linear-gradient(180deg, #1f2937, #0b1220);
  color:#e5e7eb;
  width:40px;
  height:105px;
  z-index:2;
  border-radius:10px;
}

.key.scaleTone{ box-shadow: 0 0 0 3px rgba(125,211,252,0.35) inset; }
.key.chordTone{ box-shadow: 0 0 0 3px rgba(167,139,250,0.35) inset; }
.key.down{ transform: translateY(2px); filter:brightness(0.92); }

@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
  .span2{ grid-column:auto; }
}
