/* Learn's fretboard games: Learn the fretboard (js/learn-fretboard.js) and Find the band's notes
   (js/learn-bandnotes.js), on the neck (js/fretneck.js), and on the keys (js/pianokeys.js, which the readers' lesson,
   js/learn-readers.js, plays on too). Nick's side. They open in the drill-through's sheet or panel
   (drill.css), starlight on glass like the lessons, and use the lessons' buttons (learn.css). Colour only means music:
   a note's colour is its own (or its step from home, gold, once the band's key is found); everything you tap is
   starlight and hairlines. The neck fits a 390px phone, open to fret 12, with nothing spilling sideways. */

.fb {
  container-type: inline-size;
  padding-bottom: 4px;
}

.fb :focus-visible {
  outline: 2px solid var(--starlight);
  outline-offset: 2px;
}

/* The top: the game's name and the instrument, then the game and the level, each row named (Nick, 2026-11-16: "it's
   tough to tell [...] what the two sets of numbers are"). */
.fb-head {
  display: flex;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 8px;
}

.fb-title {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
}

.fb-setbtn {
  flex: none;
}

.fb-picks {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: start;
  margin: 0 0 6px;
}

.fb-picklabel {
  display: flex;
  align-items: center;
  min-height: 36px;
  color: var(--dust);
  font-size: 12.5px;
}

/* the game row's buttons are 40px, the levels' 36px: each label is centred on its row */
.fb-picks .fb-picklabel:first-child,
.fb-picks .ln-path ol {
  min-height: 40px;
}

.fb-picks .fb-levelbar {
  min-height: 36px;
}

/* On a laptop the Game row names every game; on a phone it's their numbers, under the game's name. */
.fb .ln-pname {
  display: inline;
}

.fb .ln-p {
  padding-right: 12px;
}

.fb-stage {
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

@container (max-width: 520px) {
  .fb-stage {
    padding: 0 0 12px;
    border: 0;
  }

  .fb-stage > .fb-ask:first-child {
    margin-top: 12px;
  }

  .fb .ln-path ol {
    gap: 0;
  }

  /* On a phone the path is its numbers, and the game's name is the title over them. */
  .fb .ln-pname {
    display: none;
  }

  .fb .ln-p,
  .fb .ln-p.on {
    padding-right: 3px;
  }

  /* While a round is on, the neck and the answers get the room. */
  .fb:is([data-phase="ask"], [data-phase="between"], [data-phase="play"], [data-phase="run"], [data-phase="found"], [data-phase="done"]) > :is(.ln-lede, .ln-info) {
    display: none;
  }
}

/* ---------- levels ---------- */

.fb-levelbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}

.fb-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fb-lv {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--dust);
  font-family: var(--mono);
  font-size: 13px;
}

.fb-lv[aria-pressed="true"] {
  border-color: var(--starlight);
  background: var(--starlight);
  color: var(--space);
}

.fb-lv.is-shut {
  border-style: dashed;
  opacity: .5;
}

.fb-lvname {
  flex: 1 1 150px;
  margin: 0;
  color: var(--dust);
  font-size: 13.5px;
  line-height: 1.35;
}

.fb-best,
.fb-fine {
  margin: 6px 0 0;
  color: var(--dust);
  font-size: 13px;
  line-height: 1.45;
}

.fb-levelbar .fb-best {
  flex-basis: 100%;
  margin: 0;
}

/* ---------- the question ---------- */

/* what a game asks of you, before a round */
.fb-ask.fb-how {
  font-size: 17px;
}

.fb-ask {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.35;
}

.fb-where,
.fb-step {
  min-height: 18px;
  margin: 2px 0 6px;
  color: var(--dust);
  font-size: 13px;
  line-height: 1.45;
}

/* what just happened, in Riff's voice, where the question's second line was */
.fb-where.is-say {
  min-height: 22px;
  color: var(--starlight);
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.4;
}

.fb-step {
  margin: 14px 0 -10px;
  font-family: var(--mono);
  font-size: 12px;
}

/* after a miss, Next waits for you, at the end of the progress row */
.fb-goon {
  min-height: 34px;
  margin-left: auto;
  padding: 0 20px;
}

.fb-teach {
  max-width: 56ch;
  margin: 6px 0 4px;
  color: color-mix(in srgb, var(--starlight) 86%, transparent);
  font-size: 14.5px;
  line-height: 1.5;
}

/* ---------- the neck: high strings at the top, as tab has them; the open strings left of the nut ----------
   The board is a lighter panel from the nut to the last fret shown, with a real neck's dots on it, between the strings.
   The open strings are rings, each with its string's letter, and no string runs through them (Nick, 2026-11-16). */

.fb-neck {
  position: relative;
  margin: 6px 0 4px;
  --fret: color-mix(in srgb, var(--starlight) 22%, transparent);
}

.fb-grid {
  display: grid;
  grid-template-columns: minmax(32px, .9fr) repeat(var(--frets, 12), minmax(0, 1fr));
}

.fb-board {
  border-left: 4px solid color-mix(in srgb, var(--starlight) 70%, transparent);
  border-radius: 0 4px 4px 0;
  background: color-mix(in srgb, var(--starlight) 6%, transparent);
}

.fb-inlay {
  position: relative;
  pointer-events: none;
}

.fb-inlay i {
  position: absolute;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--starlight) 26%, transparent);
}

.fb-num {
  display: grid;
  place-items: center;
  color: var(--dust);
  font-family: var(--mono);
  font-size: 11px;
}

.fb-spot {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  height: 34px;
  padding: 0;
  border-right: 1.5px solid var(--fret);
  border-radius: 0;
}

/* the string */
.fb-spot::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: var(--w, 1.5px);
  margin-top: calc(var(--w, 1.5px) / -2);
  background: color-mix(in srgb, var(--starlight) 48%, transparent);
  content: "";
}

/* the open strings: a ring each, left of the nut, with no string through it */
.fb-spot.is-open {
  border-right: 0;
}

.fb-spot.is-open::before {
  display: none;
}

.fb-spot.is-open[data-state=""] .fb-dot {
  border: 1.5px solid color-mix(in srgb, var(--starlight) 45%, transparent);
}

.fb-str {
  color: color-mix(in srgb, var(--starlight) 80%, transparent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.fb-spot.is-off {
  opacity: .32;
}

.fb-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(28px, 94%);
  aspect-ratio: 1;
  border-radius: 50%;
  color: var(--space);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

/* A sharp or flat, drawn larger than the letter: at its size it was too small to read (Nick, 2026-11-16). */
.fb-acc {
  margin-left: .02em;
  font-family: "Noto Music", var(--ui);
  font-size: 1.3em;
  font-weight: 400;
  line-height: 0;
}

.fb-neck[data-tap="on"] .fb-spot:not(.is-off) {
  cursor: pointer;
}

@media (hover: hover) {
  .fb-neck[data-tap="on"] .fb-spot:not(.is-off):not([data-state]):hover .fb-dot,
  .fb-neck[data-tap="on"] .fb-spot:not(.is-off)[data-state=""]:hover .fb-dot {
    background: color-mix(in srgb, var(--starlight) 14%, transparent);
  }
}

.fb-spot[data-state="ask"] .fb-dot {
  border: 2px solid var(--starlight);
  background: color-mix(in srgb, var(--c, var(--starlight)) 18%, var(--space));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--starlight) 16%, transparent);
  color: var(--starlight);
  animation: fb-breathe 1.6s ease-in-out infinite;
}

.fb-spot[data-state="hit"] .fb-dot,
.fb-spot[data-state="home"] .fb-dot {
  background: var(--c);
}

.fb-spot[data-state="home"] .fb-dot {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent);
}

.fb-spot[data-state="miss"] .fb-dot {
  border: 2px dashed var(--c);
  background: var(--space);
  color: color-mix(in oklab, var(--c) 70%, var(--starlight));
}

.fb-spot[data-state="slip"] .fb-dot {
  border: 1px solid var(--dust);
  background: var(--space);
  color: var(--dust);
  font-weight: 500;
}

.fb-spot[data-state="lit"] .fb-dot {
  border: 1px solid var(--c);
  background: color-mix(in srgb, var(--c) 30%, var(--space));
  color: var(--starlight);
}

.fb-spot[data-state="soft"] .fb-dot {
  width: min(16px, 70%);
  border: 1px solid color-mix(in srgb, var(--c) 70%, transparent);
  background: color-mix(in srgb, var(--c) 16%, var(--space));
}

/* a note tried over the band, before home is found: no colour, which would give the key away */
.fb-spot[data-state="tried"] .fb-dot {
  width: min(14px, 60%);
  background: var(--starlight);
}

.fb-spot[data-state="tried"][data-warm="2"] .fb-dot {
  width: min(18px, 76%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--starlight) 22%, transparent);
}

.fb-spot[data-state="tried"][data-warm="3"] .fb-dot {
  width: min(22px, 88%);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--starlight) 32%, transparent), 0 0 14px 4px color-mix(in srgb, var(--starlight) 30%, transparent);
}

.fb-spot[data-state="clash"] .fb-dot {
  width: min(14px, 60%);
  border: 1.5px solid var(--dust);
  background: var(--space);
}

@keyframes fb-breathe {
  50% {
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--starlight) 6%, transparent);
  }
}

/* the fret numbers, above the board, so you see them first (Nick, 17 November) */
.fb-num {
  align-items: end;
  height: 20px;
  padding-bottom: 4px;
  font-size: 11px;
}

/* Up the neck (a scale's box up close): no nut, the board starts at a fret, and each string's letter stands where its
   open string would be. */
.fb-board.is-up {
  border-left: 1.5px solid var(--fret);
  border-radius: 0 4px 4px 0;
}

.fb-sname {
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--starlight) 80%, transparent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.fb-sname.is-off {
  opacity: .32;
}

/* how notes connect: octave shapes, and the same note in two places */
.fb-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.fb-line {
  stroke: color-mix(in srgb, var(--starlight) 70%, transparent);
  stroke-linecap: round;
  stroke-width: 2;
}

.fb-line.is-same {
  stroke-dasharray: 2 4;
}

/* ---------- the note names, laid out as a keyboard ---------- */

.fb-keys {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 6px 4px;
  max-width: 520px;
  margin: 10px auto 0;
}

.fb-key {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  grid-column: var(--at) / span 2;
  min-width: 0;
  min-height: 46px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--starlight);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.1;
  transition: background-color var(--t) ease, border-color var(--t) ease, scale var(--t) ease;
}

.fb-kname {
  display: block;
}

.fb-key.is-white {
  grid-row: 2;
}

/* the two names a sharp has: the sharp first, the flat under it */
.fb-key.is-black {
  grid-row: 1;
  min-height: 52px;
  background: color-mix(in srgb, var(--starlight) 7%, transparent);
  font-size: 15.5px;
}

.fb-key.is-black .fb-kname + .fb-kname {
  color: color-mix(in srgb, var(--starlight) 72%, transparent);
  font-size: 14px;
}

/* From level 3 of Name the spot: the names mixed up, six to a row, so there's nothing to count along. */
.fb-keys.is-mixed {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.fb-keys.is-mixed .fb-key {
  grid-row: auto;
  grid-column: auto;
  min-height: 52px;
}

.fb-key:disabled {
  opacity: .5;
}

.fb-key.is-right,
.fb-key.is-right:disabled {
  border-color: var(--starlight);
  background: color-mix(in srgb, var(--starlight) 20%, transparent);
  opacity: 1;
}

.fb-key.is-wrong,
.fb-key.is-wrong:disabled {
  border-style: dashed;
  border-color: var(--dust);
  opacity: .85;
}

@media (hover: hover) {
  .fb-key:hover:not(:disabled),
  .fb-lv:hover:not([aria-pressed="true"]):not(.is-shut) {
    border-color: var(--hair-hi);
    background-color: var(--lift);
  }
}

:is(.fb-key, .fb-lv, .fb-mic):active:not(:disabled) {
  scale: .97;
}

/* ---------- what happened, the progress, the end of a round ---------- */

.fb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

.fb-say {
  min-height: 52px;
  margin-top: 12px;
}

.fb-say p {
  font-size: 17px;
}

.fb-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  min-height: 34px;
  margin: 0 0 2px;
}

.fb-pips {
  display: flex;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fb-pips li {
  width: 9px;
  height: 9px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.fb-pips li.is-hit {
  border-color: var(--starlight);
  background: var(--starlight);
}

.fb-pips li.is-miss {
  border: 1.5px dashed var(--dust);
}

.fb-pips li.is-now {
  border-color: var(--starlight);
}

.fb-count {
  color: var(--dust);
  font-size: 12.5px;
}

.fb-center {
  margin: 8px 0 0;
  text-align: center;
}

.fb-after {
  margin-top: 14px;
  text-align: center;
}

.fb-score {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.35;
}

.fb-newbest,
.fb-opened {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 500;
}

.fb-newbest {
  display: inline-block;
  padding: 4px 14px;
  border: 1px solid var(--starlight);
  border-radius: var(--r-pill);
  animation: fb-moment 900ms var(--ease-out) both;
}

@keyframes fb-moment {
  from {
    opacity: 0;
    transform: scale(.9);
  }
}

/* ---------- the microphone, the needle and tuning up ---------- */

.fb-micbox {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.fb-mic {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--starlight);
  font-size: 14px;
  font-weight: 500;
}

.fb-mic-dot {
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--dust);
  border-radius: 50%;
}

.fb-mic.is-on {
  border-color: var(--starlight);
}

.fb-mic.is-on .fb-mic-dot {
  border-color: var(--starlight);
  background: var(--starlight);
  animation: fb-listen 1.4s ease-in-out infinite;
}

@keyframes fb-listen {
  50% {
    opacity: .35;
  }
}

.fb-micline a {
  color: var(--starlight);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--starlight) 40%, transparent);
  text-underline-offset: 3px;
}

.fb-needle {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.fb-needle-scale {
  position: relative;
  height: 14px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--starlight) 10%, transparent) 30% 70%, transparent);
}

.fb-needle-mid,
.fb-needle-mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
}

.fb-needle-mid {
  left: 50%;
  background: color-mix(in srgb, var(--starlight) 40%, transparent);
}

.fb-needle-mark {
  left: 50%;
  width: 6px;
  margin-left: -3px;
  background: var(--starlight);
  transition: left 120ms linear;
}

.fb-needle[data-state="quiet"] .fb-needle-mark {
  opacity: 0;
}

.fb-needle[data-state="near"] .fb-needle-mark,
.fb-needle[data-state="off"] .fb-needle-mark {
  background: var(--dust);
}

.fb-needle-say {
  color: var(--dust);
  font-size: 13px;
  text-align: center;
}

.fb-needle[data-state="tune"] .fb-needle-say {
  color: var(--starlight);
}

.fb-tune {
  margin-top: 10px;
}

.fb-strings {
  justify-content: flex-start;
  margin-top: 6px;
}

.fb-tunestr {
  min-width: 44px;
  font-family: var(--mono);
}

/* ---------- Find the band's notes ---------- */

.bn-band {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

.bn-beats {
  display: inline-flex;
  gap: 6px;
}

.bn-beats i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.bn-beats i.on {
  background: var(--starlight);
}

.bn-chords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.bn-chords li {
  min-width: 52px;
  padding: 6px 10px;
  border: 1px solid var(--c);
  border-radius: 10px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.bn-chords li small {
  display: block;
  color: var(--dust);
  font-size: 11.5px;
  font-weight: 500;
}

.bn-key {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 20px;
  text-align: center;
}

/* ---------- the keys: Find the band's notes on piano or keys, and the readers' lesson (js/pianokeys.js) ----------
   White keys white and black keys black, from a C, as the app's piano picture is (shared/chords pianoSvg). On a phone
   the two octaves are two rows, the higher on top as the neck has its high strings on top, so a white key is about
   50px wide and a black one 30px; on a wide screen they're one row. A key's light sits low on it, where the neck's dot
   would be, and means what the neck's does. The key itself takes a little of the colour too, so a lit key reads from
   across the room. */

.pk {
  --kw: #FBFAF6; /* the piano picture's white */
  --kb: #171614; /* and its black */
  display: flex;
  margin: 8px 0 4px;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.pk-oct {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  height: 150px;
}

.pk-key {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  padding: 0 0 8px;
  border-radius: 0 0 6px 6px;
  transition: background-color var(--t) ease, translate 90ms ease;
}

.pk-key.is-white {
  --on: var(--kb);
  flex: 1 1 0;
  border: 1px solid color-mix(in srgb, var(--kb) 45%, transparent);
  border-top: 0;
  background: var(--kw);
  color: var(--kb);
}

/* black keys are solid, over the line between two white keys, as on a piano */
.pk-key.is-black {
  --on: var(--starlight);
  position: absolute;
  z-index: 2;
  top: 0;
  left: calc(var(--line) * 100% / 7 - 100% / 7 * .31);
  width: calc(100% / 7 * .62);
  height: 62%;
  padding-bottom: 6px;
  border: 1px solid #000;
  border-top: 0;
  border-radius: 0 0 5px 5px;
  background: var(--kb);
  color: var(--starlight);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--starlight) 12%, transparent);
}

.pk-oct:first-child .pk-key.is-white:first-child {
  border-left: 1px solid color-mix(in srgb, var(--kb) 45%, transparent);
}

.pk-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(30px, 84%);
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.pk-key.is-black .pk-dot {
  width: min(24px, 86%);
  font-size: 11px;
}

/* the Cs, to find your place; middle C has a dot under its letter */
.pk-c {
  color: color-mix(in srgb, var(--kb) 50%, transparent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.pk-key.is-mid .pk-c {
  position: relative;
}

.pk-key.is-mid .pk-c::after {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.pk[data-tap="on"] .pk-key {
  cursor: pointer;
}

.pk-key.is-down,
.pk-key:active {
  translate: 0 1px;
}

.pk-key.is-white.is-down {
  background-color: color-mix(in srgb, var(--kb) 10%, var(--kw));
}

.pk-key.is-black.is-down {
  background-color: color-mix(in srgb, var(--starlight) 16%, var(--kb));
}

.pk-key.is-white:focus-visible {
  outline: 2px solid var(--kb);
  outline-offset: -5px;
}

.pk-key.is-black:focus-visible {
  outline: 2px solid var(--starlight);
  outline-offset: -4px;
}

@media (hover: hover) {
  .pk[data-tap="on"] .pk-key.is-white[data-state=""]:hover {
    background-color: color-mix(in srgb, var(--kb) 6%, var(--kw));
  }
}

/* what a key says: as the neck's dots, on white keys and black ones alike */
.pk-key[data-state="lit"].is-white,
.pk-key[data-state="home"].is-white,
.pk-key[data-state="hit"].is-white {
  background-color: color-mix(in srgb, var(--c) 22%, var(--kw));
}

.pk-key[data-state="lit"].is-black,
.pk-key[data-state="home"].is-black,
.pk-key[data-state="hit"].is-black {
  background-color: color-mix(in srgb, var(--c) 34%, var(--kb));
}

.pk-key[data-state="soft"].is-white {
  background-color: color-mix(in srgb, var(--c) 9%, var(--kw));
}

.pk-key[data-state="lit"] .pk-dot {
  border: 1.5px solid var(--c);
  background: color-mix(in srgb, var(--c) 30%, var(--space));
  color: var(--starlight);
}

.pk-key[data-state="hit"] .pk-dot,
.pk-key[data-state="home"] .pk-dot {
  background: var(--c);
  color: var(--space);
}

.pk-key[data-state="home"] .pk-dot {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 40%, transparent);
}

.pk-key[data-state="soft"] .pk-dot {
  width: min(14px, 50%);
  border: 1px solid var(--c);
  background: color-mix(in srgb, var(--c) 40%, transparent);
}

.pk-key[data-state="ask"] .pk-dot {
  border: 2px solid var(--on);
  animation: fb-breathe 1.6s ease-in-out infinite;
}

.pk-key[data-state="miss"] .pk-dot {
  border: 2px dashed var(--c);
  background: var(--space);
  color: color-mix(in oklab, var(--c) 70%, var(--starlight));
}

.pk-key[data-state="slip"] .pk-dot {
  border: 1px solid var(--dust);
  color: var(--dust);
  font-weight: 500;
}

/* a note tried over the band, before home is found: no colour, which would give the key away */
.pk-key[data-state="tried"] .pk-dot {
  width: min(13px, 50%);
  background: var(--on);
}

.pk-key[data-state="tried"][data-warm="2"] .pk-dot {
  width: min(17px, 62%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--on) 22%, transparent);
}

.pk-key[data-state="tried"][data-warm="3"] .pk-dot {
  width: min(21px, 74%);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--on) 30%, transparent), 0 0 12px 4px color-mix(in srgb, var(--on) 26%, transparent);
}

.pk-key[data-state="clash"] .pk-dot {
  width: min(13px, 50%);
  border: 1.5px solid var(--dust);
}

/* a chord's own notes, while the band plays it (the readers' jam): a ring round the light */
.pk-key[data-mark] .pk-dot {
  outline: 2px solid var(--on);
  outline-offset: 3px;
}

.pk-key[data-mark][data-state=""] .pk-dot,
.pk-key[data-mark]:not([data-state]) .pk-dot {
  width: min(14px, 50%);
}

@container (max-width: 520px) {
  /* a phone: the two octaves as two rows, the higher on top */
  .pk {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .pk-oct {
    flex: none;
    height: 116px;
  }

  .pk-key.is-white:first-child {
    border-left: 1px solid color-mix(in srgb, var(--kb) 45%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fb-spot[data-state="ask"] .fb-dot,
  .pk-key[data-state="ask"] .pk-dot,
  .fb-mic.is-on .fb-mic-dot,
  .fb-newbest {
    animation: none;
  }

  .pk-key {
    transition: none;
  }

  .fb-needle-mark {
    transition: none;
  }
}
