@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0d0d14;
  --surface: #161625;
  --surface2: #1e1e35;
  --border: #2a2a45;
  --text: #e0e0f0;
  --text-dim: #7777aa;
  --primary: #6c5ce7;
  --primary-hover: #7f70f0;
  --danger: #ff4757;
  --danger-hover: #ff6b81;
  --radius: 10px;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Header */
.header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-left { display: flex; align-items: baseline; gap: 12px; }
.header-title {
  font-size: 18px; font-weight: 700;
  background: linear-gradient(90deg, #6c5ce7, #fd79a8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.header-sub { font-size: 12px; color: var(--text-dim); }
.header-right { display: flex; align-items: center; gap: 16px; }

.vol-label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.vol-slider { width: 100px; accent-color: var(--primary); }
.vol-val { font-size: 12px; color: var(--text-dim); min-width: 32px; }

/* Toolbar */
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
}
.toolbar-left, .toolbar-right { display: flex; gap: 8px; align-items: center; }
.search-input { width: 180px; }

/* Board */
.board {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Group */
.group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.group-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.group-title { font-size: 14px; font-weight: 700; }
.group-actions { display: flex; gap: 6px; }
.group-body {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

/* Sound Pad */
.pad {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  padding: 16px 10px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 90px;
  user-select: none;
  -webkit-user-select: none;
}
.pad:hover { transform: scale(1.03); filter: brightness(1.1); }
.pad:active { transform: scale(0.97); }
.pad.playing {
  border-color: rgba(255,255,255,0.5);
  box-shadow: 0 0 20px rgba(255,255,255,0.15);
}
.pad-name { font-size: 13px; font-weight: 600; text-align: center; line-height: 1.3; }
.pad-hotkey {
  font-size: 10px; color: rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.3); padding: 1px 6px; border-radius: 3px;
}
.pad.dragging { opacity: 0.4; transform: scale(0.95); }
.pad.drag-over { border-color: rgba(255,255,255,0.6); box-shadow: 0 0 16px rgba(108,92,231,0.4); }
.pad-menu {
  position: absolute; top: 4px; right: 4px;
  background: none; border: none; color: rgba(255,255,255,0.4);
  font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.pad-menu:hover { background: rgba(255,255,255,0.1); color: white; }

/* Context Menu */
.context-menu {
  position: fixed; z-index: 100;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px; min-width: 140px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.context-menu button {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; font-size: 13px; font-family: inherit;
  background: none; border: none; color: var(--text); cursor: pointer;
  border-radius: 4px;
}
.context-menu button:hover { background: var(--primary); color: white; }
.context-menu button.danger { color: var(--danger); }
.context-menu button.danger:hover { background: var(--danger); color: white; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; width: 440px; max-width: 90vw;
}
.modal-sm { width: 340px; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* Forms */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
.input, .select {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; color: var(--text);
  font-size: 14px; font-family: inherit;
}
.input:focus, .select:focus { outline: none; border-color: var(--primary); }
.input-sm { width: 120px; }
.hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.color-grid {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.color-swatch {
  width: 32px; height: 32px; border-radius: 6px; border: 2px solid transparent;
  cursor: pointer; transition: all 0.15s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: white; box-shadow: 0 0 8px rgba(255,255,255,0.3); }

/* Buttons */
.btn {
  padding: 8px 16px; border: none; border-radius: 8px;
  font-size: 13px; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-outline { background: none; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-dim);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
