:root{
  --bg:#0e0f12;
  --panel:#171a20;
  --panel2:#13161b;
  --text:#e9ecf1;
  --muted:#9aa3af;
  --line:#2a2f3a;
  --accent:#6ee7ff;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans JP", sans-serif;
  background:linear-gradient(180deg, #0b0c10, #0e0f12);
  color:var(--text);
}

.topbar{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  background:rgba(10,12,16,.7);
  backdrop-filter: blur(8px);
  position:sticky; top:0;
  z-index:10;
}
.title{ font-weight:700; letter-spacing:.4px; margin-right:8px; }
.status{ color:var(--muted); font-size:12px; }

.btn{
  border:1px solid var(--line);
  background:transparent;
  color:var(--text);
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
  line-height:1;
}
.btn.primary{
  border-color: rgba(110,231,255,.4);
  box-shadow: 0 0 0 2px rgba(110,231,255,.08) inset;
}

.layout{
  display:grid;
  grid-template-columns: 1fr 380px;
  gap:12px;
  padding:12px;
}
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
}

.panel{
  background:linear-gradient(180deg, var(--panel), var(--panel2));
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.panelTitle{
  font-weight:700;
  margin-bottom:10px;
  color:#f4f7fb;
}

.group{
  border:1px solid rgba(42,47,58,.9);
  border-radius:14px;
  padding:10px;
  margin:10px 0;
  background:rgba(0,0,0,.12);
}
.groupTitle{
  font-weight:700;
  font-size:12px;
  color:var(--muted);
  letter-spacing:.12em;
  margin-bottom:8px;
}
.row{
  display:grid;
  grid-template-columns: 100px 1fr 70px;
  align-items:center;
  gap:10px;
  padding:6px 0;
}
label{ color:#cfd6df; font-size:13px; }

select, input[type="range"], input[type="text"]{
  width:100%;
}

select{
  background:#0f1218;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:10px;
  padding:7px 10px;
}

input[type="text"]{
  background:#0f1218;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:10px;
  padding:7px 10px;
}

.val{
  text-align:right;
  font-variant-numeric: tabular-nums;
  color:var(--muted);
  font-size:12px;
}

.hint{ margin-top:10px; color:var(--muted); font-size:12px; }

/* preset buttons */
.presetBtns{
  display:flex;
  gap:8px;
  justify-content:flex-start;
  flex-wrap:wrap;
}

/* keyboard */
.keys{
  position:relative;
  height:240px;
  user-select:none;
  touch-action:none;
  border-radius:14px;
  border:1px solid var(--line);
  background:#0b0d12;
  overflow:hidden;
}

.key{
  position:absolute;
  bottom:0;
  border:1px solid rgba(0,0,0,.35);
  border-radius:0 0 10px 10px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding-bottom:10px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.02em;
  cursor:pointer;
}

.key.white{
  background:linear-gradient(180deg, #f4f6fb, #cfd6e3);
  color:#111827;
  height:100%;
  z-index:1;
}

.key.black{
  background:linear-gradient(180deg, #1a1f2a, #0b0e14);
  color:#dbe3ee;
  height:62%;
  z-index:2;
  border-color: rgba(0,0,0,.6);
}

.key.on.white{ box-shadow: 0 0 0 3px rgba(110,231,255,.28) inset; }
.key.on.black{ box-shadow: 0 0 0 3px rgba(110,231,255,.28) inset; }

/* small screens: reduce right column width */
@media (max-width: 420px){
  .row{ grid-template-columns: 92px 1fr 62px; }
  .keys{ height:220px; }
}
