:root {
  color-scheme: dark;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111316;
  color: #e9ece8;
  font-synthesis: none;
  --display-size: clamp(34px, 9vw, 44px);
  --note-size: clamp(9px, 2.65vw, 11px);
  --highlight: #ff5a00;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { overscroll-behavior: none; }

.app {
  height: 100vh;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom);
  display: grid;
  place-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  cursor: pointer;
}

.app:focus-visible { outline: 2px solid var(--highlight); outline-offset: -4px; }

.scale-view {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(23px, 4vh, 34px);
  pointer-events: none;
}

.scale-name {
  font-size: var(--display-size);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.04em;
  text-align: center;
}

.scale-name.is-major-minor { color: #fbb087; }

.mode-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.step-pattern {
  display: flex;
  align-items: center;
  gap: 9px;
}

.step {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.step.is-full { background: currentColor; }

.step.is-root {
  width: 6px;
  height: 6px;
  flex-basis: 6px;
  border: 0;
  background: currentColor;
  opacity: .35;
}

.keyboard {
  position: relative;
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  column-gap: 1px;
  width: 100%;
  max-width: 480px;
  height: clamp(124px, 22vh, 170px);
  background: #111316;
}

.white-key {
  position: relative;
  min-width: 0;
  border-radius: 4px;
  background: #f2f2ee;
  color: #251607;
}

.white-key.is-active { background: var(--highlight); }

.black-key {
  position: absolute;
  z-index: 1;
  top: 0;
  width: 4.8%;
  height: 58%;
  transform: translateX(-50%);
  border: 1px solid #111316;
  border-top: 0;
  border-radius: 0 0 4px 4px;
  background: #17191c;
  color: #251607;
}

.black-key.is-active { background: var(--highlight); }

.key-label {
  position: absolute;
  right: 0;
  bottom: 11px;
  left: 0;
  font-size: var(--note-size);
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.black-key .key-label { bottom: 8px; }
