:root { --hue: 5; --bg: #0c0e13; --panel: #151821; --line: #262b38; --text: #e8eaf0; --dim: #8b92a5; --accent: hsl(var(--hue) 85% 60%); }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: radial-gradient(1200px 700px at 50% 30%, hsl(var(--hue) 40% 12%), var(--bg) 70%); color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif; overflow: hidden; user-select: none; display: flex; flex-direction: column; transition: background .4s; }
kbd { font: 600 11px "Segoe UI", sans-serif; background: #232836; border: 1px solid #343b4d; border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: #cfd4e2; white-space: nowrap; }
h2 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 0 0 8px; font-weight: 600; }
h2 small { float: right; letter-spacing: 0; }

header { display: flex; align-items: center; gap: 20px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: #0f1218cc; flex: none; }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.logo { width: 20px; height: 20px; border-radius: 4px; background:
  linear-gradient(var(--accent), var(--accent)) 0 0/9px 9px no-repeat, linear-gradient(#fff5, #fff5) 11px 0/9px 9px no-repeat,
  linear-gradient(#fff5, #fff5) 0 11px/9px 9px no-repeat, linear-gradient(var(--accent), var(--accent)) 11px 11px/9px 9px no-repeat; }
.now { flex: 1; display: flex; align-items: baseline; gap: 12px; min-width: 0; }
#kitName { font-size: 20px; font-weight: 700; color: var(--accent); white-space: nowrap; }
#kitTag { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp { font-size: 12px; color: var(--dim); padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px; white-space: nowrap; }
.gp.on { color: #7dffa8; border-color: #2c6b45; background: #12251a; }

main { flex: 1; min-height: 0; display: grid; grid-template-columns: 214px 1fr 270px; }
aside { padding: 14px; overflow-y: auto; background: #10131acc; }
aside.kits { border-right: 1px solid var(--line); }
aside.side { border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
aside::-webkit-scrollbar { width: 8px; } aside::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 4px; }

.kit { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: 1px solid transparent; color: var(--text);
  padding: 5px 8px; border-radius: 8px; cursor: pointer; font: inherit; }
.kit i { width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--h) 85% 60%); flex: none; }
.kit b { font-weight: 600; display: block; line-height: 1.2; }
.kit small { color: var(--dim); font-size: 11px; display: block; line-height: 1.2; }
.kit:hover { background: #1b1f2b; }
.kit.sel { background: hsl(var(--h) 50% 16%); border-color: hsl(var(--h) 70% 45%); }

.stage { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; padding: 16px; }
.grid { --s: min(calc(100vh - 86px), calc(100vw - 520px)); width: var(--s); height: var(--s); display: grid; grid-template: repeat(4, 1fr) / repeat(4, 1fr); gap: clamp(6px, 1.2vmin, 12px); }
.pad { --ph: 210; position: relative; border-radius: 12px; border: 1px solid hsl(var(--ph) 45% 32%); cursor: pointer; overflow: hidden; touch-action: none;
  background: linear-gradient(160deg, hsl(var(--ph) 42% 22%), hsl(var(--ph) 48% 12%)); box-shadow: inset 0 1px 0 #ffffff14, 0 4px 14px #0008;
  display: flex; align-items: center; justify-content: center; padding: 6px; }
.pad .nm { font-weight: 700; font-size: clamp(11px, 1.9vmin, 17px); text-align: center; line-height: 1.15; text-shadow: 0 1px 3px #000a; pointer-events: none; }
.pad .k { position: absolute; font-weight: 700; color: #ffffffc8; pointer-events: none; font-size: clamp(9px, 1.35vmin, 12px); }
.pad .k1 { top: 6px; left: 8px; font-size: clamp(11px, 1.9vmin, 17px); }
.pad .k1 em { font-style: normal; opacity: .45; margin-left: 5px; font-size: .8em; }
.pad .k2 { top: 7px; right: 8px; opacity: .6; }
.pad .k3 { bottom: 6px; right: 8px; opacity: .6; }
.pad .fl { position: absolute; inset: 0; background: radial-gradient(circle, #fff, hsl(var(--ph) 100% 65%) 60%); opacity: 0; pointer-events: none; }
.pad[data-c=kick] { --ph: 4; } .pad[data-c=snare] { --ph: 34; } .pad[data-c=hat] { --ph: 190; }
.pad[data-c=cym] { --ph: 52; } .pad[data-c=tom] { --ph: 135; } .pad[data-c=fx] { --ph: 275; }

button.big { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid hsl(var(--hue) 70% 45%);
  background: hsl(var(--hue) 55% 22%); color: var(--text); font: 600 14px "Segoe UI", sans-serif; cursor: pointer; }
button.big .lbl { flex: 1; text-align: left; }
button.big .ico { width: 18px; text-align: center; }
button.big.alt { background: #1b1f2b; border-color: var(--line); }
button.big.on { background: var(--accent); color: #0c0e13; border-color: var(--accent); }
button.big.on kbd { background: #0003; border-color: #0004; color: #0c0e13; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row label { color: var(--dim); }
.row input[type=range] { width: 150px; accent-color: var(--accent); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: #1b1f2b; color: var(--text); font-size: 16px; cursor: pointer; }
.stepper span { width: 46px; text-align: center; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.stage { position: relative; }
#count { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none;
  font: 800 min(38vh, 300px)/1 "Segoe UI", sans-serif; color: #fff; text-shadow: 0 0 60px #ff3b3b, 0 6px 30px #000; }
#count.show { display: flex; }
body.rec .grid { outline: 3px solid #ff4a4a; outline-offset: 8px; border-radius: 14px; }
.recorder { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.recorder h2 { margin: 0; }
button.big.recb { background: #3a1518; border-color: #a13a3a; }
button.big.recb .ico { color: #ff5a5a; }
button.big.recb.on { background: #ff4a4a; border-color: #ff4a4a; color: #fff; animation: pulse 1s infinite; }
button.big.recb.on .ico { color: #fff; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px #ff4a4a44; } }
button:disabled { opacity: .4; cursor: default; }
.bar { height: 6px; border-radius: 3px; background: #232836; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); }
body.rec .bar i { background: #ff4a4a; }
#loopInfo { font-size: 12px; color: var(--dim); min-height: 2.6em; }
.seg { display: flex; gap: 4px; }
.seg button, .row3 button { border: 1px solid var(--line); background: #1b1f2b; color: var(--text); border-radius: 7px; cursor: pointer; font: inherit; font-size: 12.5px; padding: 5px 0; }
.seg button { width: 30px; font-weight: 700; }
.seg button.sel { background: var(--accent); border-color: var(--accent); color: #0c0e13; opacity: 1; }
.row3 { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr; gap: 6px; }
.row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
.help { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 12px; color: #b9bfce; font-size: 12.5px; }
.help p { margin: 0 0 8px; } .help b { color: var(--text); }
.help .tip { background: hsl(var(--hue) 45% 15%); border: 1px solid hsl(var(--hue) 50% 30%); border-radius: 8px; padding: 8px 10px; }
@media (max-width: 900px) { main { grid-template-columns: 170px 1fr; } aside.side { display: none; } .grid { --s: min(calc(100vh - 86px), calc(100vw - 210px)); } }
