:root {
  color-scheme: dark;
}

body {
  margin: 0;
  padding: 1.5rem;
  font-family: system-ui, sans-serif;
  line-height: 1.6;
  color: #f2f2f2;
  background: #12141c;
}

header nav {
  font-size: 0.85rem;
  opacity: 0.7;
}

main {
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

h1 {
  margin: 0.5rem 0 0;
}

a {
  color: #7fb2ff;
}

kbd {
  display: inline-block;
  padding: 0.05em 0.4em;
  border: 1px solid #555;
  border-bottom-width: 2px;
  border-radius: 0.3em;
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  background: #24273a;
}

.explainer {
  max-width: 34rem;
  font-size: 1rem;
  color: #e4e4ee;
}

.instructions {
  max-width: 40rem;
  font-size: 0.95rem;
  color: #c9c9d6;
  transition: opacity 0.6s ease;
}

.tonnetz {
  position: relative;
  touch-action: none;
  user-select: none;
  max-width: 100%;
  overflow-x: auto;
}

.node {
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: #101018;
  background: hsl(var(--hue, 0), 65%, 65%);
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.node.highlight {
  box-shadow: 0 0 0 4px hsl(var(--hue, 0), 90%, 80%);
}

.node.playing {
  box-shadow: 0 0 0 4px #ffffff;
}

.node.chord {
  box-shadow: 0 0 0 5px #ffd76a;
}

.node.bass {
  box-shadow: 0 0 0 6px #6ab8ff;
}

.comet {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  margin: -7px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 16px 6px rgba(255, 255, 255, 0.85);
  opacity: 0;
  pointer-events: none;
}

.node.pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 hsla(var(--hue, 0), 90%, 80%, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px hsla(var(--hue, 0), 90%, 80%, 0);
  }
}

.status {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: #c9c9d6;
}

.instrument-picker {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.instrument-group {
  border: 1px solid #33364a;
  border-radius: 0.6rem;
  padding: 0.5rem 0.75rem 0.75rem;
}

.instrument-group legend {
  padding: 0 0.4rem;
  font-size: 0.8rem;
  color: #9a9db3;
}

.instruments {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.instruments button {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #555;
  background: #1c1f2e;
  color: #f2f2f2;
  cursor: pointer;
}

.instruments button.active {
  border-color: #7fb2ff;
  background: #2a3a5c;
  color: #ffffff;
}
