:root {
  font-family: sans-serif;
  font-size: 1.25rem;
  background-color: var(--bg);
  color: var(--text);

  --bg: oklch(20.32% 0.0132 314.5);
  --bg-editor: oklch(16% 0.012 314.5);
  --border: oklch(35% 0.03 314.5);
  --accent: oklch(67.03% 0.1119 335.5);
  --text: oklch(94.56% 0.0437 335.5);
}

html,
body {
  margin: 0;
  padding: 0;
}

main {
  max-width: 960px;
  padding: 1em;
  margin: 0 auto;
}

section {
  margin-bottom: 0.75em;
}

input[type="number"] {
  padding: 0.2em 0.25em;
  font: inherit;
  font-size: 1rem;
  width: 5ch;
  outline: none;
  border-radius: 0.25em;
  background-color: white;
  border: 2px solid white;
  color: oklch(20% 0 0);

  &:focus {
    border-color: var(--accent);
  }
}

.editor {
  position: relative;

  & .editor-backdrop,
  & textarea {
    font: inherit;
    font-size: 1rem;
    line-height: 1.6;
    font-family: monospace;
    padding: 0.6em 0.75em;
    white-space: pre-wrap;
    word-break: break-word;
    tab-size: 4;
    width: 100%;
    min-height: 12lh;
    box-sizing: border-box;
    overflow: auto;
  }

  & .editor-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
    color: var(--text);
    border: 1px solid transparent;
    user-select: none;
  }

  & textarea {
    position: relative;
    display: block;
    background: transparent;
    color: transparent;
    caret-color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    resize: vertical;
    outline: none;

    &:focus {
      border-color: oklch(55% 0.05 314.5);
    }
  }
}

.chord-wrap {
  color: transparent;

  .chord {
    position: absolute;
    display: inline-block;
    color: var(--accent);
    font-weight: bold;
    background-color: var(--bg-editor);
    padding: 0 0.25em;
    font-size: 0.8em;
    border-radius: 4px;
  }
}
