:root {
  --bg: #131a24;
  --panel: #1f2a3a;
  --panel-alt: #283747;
  --accent: #4aaaeb;
  --text: #eef2f7;
  --muted: #9fb0c4;
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: radial-gradient(circle at top, #1a2533 0%, #0f141c 65%);
  color: var(--text);
  overflow: hidden;
}

.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 12px;
}

.main-area {
  flex: 1;
  display: flex;
  gap: 12px;
  min-height: 0;
}

.canvas-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.canvas-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

button,
select {
  background: #1f2a3a;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

button:hover,
select:hover {
  border-color: var(--accent);
}

button:disabled,
input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:disabled:hover {
  border-color: var(--border);
}

.tool-btn.is-active {
  background: var(--accent);
  color: #0c1320;
  border-color: var(--accent);
}

input[type="range"] {
  width: 100%;
}

.canvas-wrapper {
  flex: 1;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #1c4a2d;
  min-height: 0;
}

#pitchCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
}

.side-panel {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.panel-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.panel-block h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1rem;
}

.panel-block p,
.panel-block li,
.panel-block div {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

ul {
  margin: 0;
  padding-left: 18px;
}

.timeline-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.timeline-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.timeline-labels {
  display: flex;
  gap: 18px;
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.timeline-slider-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 14px 0 4px;
}

.timeline-slider-wrap input[type="range"] {
  width: 100%;
  margin: 0;
  position: relative;
  z-index: 1;
}

.keyframe-markers {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
  z-index: 2;
}

.keyframe-marker {
  position: absolute;
  top: 0;
  height: 14px;
  width: 10px;
  margin-left: -5px;
  border-radius: 3px;
  background: var(--accent);
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  transition: background 0.1s, transform 0.1s;
}

.keyframe-marker:hover {
  background: #7ec5f5;
  transform: scaleY(1.15);
}

.keyframe-marker.is-active {
  background: #ffd24a;
}

.keyframe-marker.is-selected {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.play-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.play-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}

.play-list li.is-active {
  border-color: var(--accent);
  background: rgba(74, 170, 235, 0.12);
}

.play-list .play-name {
  flex: 1;
  cursor: pointer;
  color: var(--text);
}

.play-list button {
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.play-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.play-actions button {
  padding: 6px 10px;
  font-size: 0.85rem;
  flex: 1;
  min-width: 0;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 10px;
}
