@media screen and (min-width: 0) and (max-width: 400px) {
  #outer.bpb5 {
    --width-rhythm-img: 3.8rem;
    --height-rhythm-img: 3.1rem;

    --width-rhythm-word: 3.8rem;
  }

  #outer.bpb6 {
    --width-rhythm-img: 3.2rem;
    --height-rhythm-img: 3.1rem;

    --width-rhythm-word: 3.2rem;
  }
}

@media screen and (min-width: 400px) and (max-width: 500px) {
  #outer.bpb6 {
    --width-rhythm-img: 3.4rem;
    --height-rhythm-img: 3.1rem;

    --width-rhythm-word: 3.4rem;
  }
}

@media screen and (min-width: 500px) and (max-width: 640px) {
  #outer.bpb6 {
    --width-rhythm-img: 3.8rem;
    --height-rhythm-img: 3.1rem;

    --width-rhythm-word: 3.8rem;
  }
}

#outer {
  min-height: auto;
  min-height: 100dvh;
}

.wrapper {
  position: relative;
  /* 5 columns. */
  grid-template-columns: 1fr 1fr 10fr 1fr 1fr;
  /* 9 rows. */
  grid-template-rows: minmax(min-content, max-content) minmax(3rem, max-content) minmax(min-content, max-content) minmax(min-content, max-content) minmax(min-content, max-content) minmax(min-content, max-content) auto 0 0;
}

#heading {
  grid-column: 1 / span 5;
}

div#messageWrapper {
  grid-column: 1 / span 5;
  grid-row: 2;

  display: grid;
  grid-template-columns: auto minmax(min-content, max-content);
  grid-template-rows: 1fr;
}

div#message {
  display: flex;
  align-items: flex-start;
  font-size: 1.2rem;
  margin-left: auto;
  margin-right: auto;
  border-width: 0 0 0.2rem 0;
}

div#score {
  display: flex;
  align-items: flex-end;
  margin-left: auto;
  margin-right: 0;
  font-size: 1rem;
  border-width: 0 0 0.2rem 0;
}

div#score.asking {
  border-color: var(--color-transparent);
}

div#score.yes,
div#score.no {
  border-bottom-width: 2rem;
  border-color: var(--color-emphasis-border);
  color: var(--color-emphasis-border);
  font-weight: bold;
}

#typeItNotesWrapper.retracted {
  display: none;
}

#typeItNotesWrapper {
  grid-column: 1 / span 5;
  grid-row: 4;

  display: grid;
  /* Match questionStaffWrapper. */
  grid-gap: 0;
  grid-template-columns: auto minmax(min-content, max-content) auto auto auto;
}

/* Like questionStaff. */
#typeItNotesStaff {
  position: relative; /* for guideBar */
  display: flex;
  justify-content: flex-end;
  min-width: var(--width-rhythm-word);
  height: calc(var(--height-rhythm-word) + var(--height-mark));
}

.typeItNotes.no {
  background-color: var(--color-primary-fill);
}

.typeItNotes.yes {
  background-color: var(--color-primary-fill);
  pointer-events: none;
  opacity: 0.3;
}

.dotWrapper {
  visibility: hidden;
}

.question.no > .dotWrapper {
  visibility: visible;
}

.question.no.blankAfterOneBeatRhythm > .dotWrapper {
  visibility: hidden;
}

.dot {
  display: inline-block;
  height: 0.4rem;
  width: 0.4rem;

  border: 0 solid var(--color-secondary-text);
  border-width: 0.25rem 0 0 0.25rem;
  transform: rotate(0.125turn);
  border-radius: 10%;

  opacity: 0.8;

  margin-top: 0.4rem;
  margin-bottom: 0;

  z-index: 2;
}

div#questionStaffWrapper {
  background-color: var(--color-transparent);
  grid-column: 1 / span 5;
  grid-row: 3;

  padding-top: 0;
  padding-bottom: 0;

  display: grid;
  /* 0 so it fits mobile.  margin-bottom: 0.5rem on cells to compensate. */
  grid-gap: 0;
  grid-template-columns: auto minmax(min-content, max-content) auto auto auto;
}

div.staffWrapperSide {
  grid-column: auto / span 1;
  grid-row: 1;
}

#choiceText {
  grid-column: 1 / span 5;

  margin-top: 0;
  margin-bottom: 1.5rem;

  display: flex;
  justify-content: center;

  /* clashes w beat guide clip path */
  visibility: hidden;
}

div#barAnswersWrapper.retracted {
  display: none;
}

div#answerStaffWrapper.retracted {
  display: none;
}

div#answerStaffWrapper {
  background-color: var(--color-transparent);
  grid-column: 1 / span 5;
  grid-row: 5 / span 1;

  padding-bottom: 0;
  margin-bottom: 1rem;

  display: grid;
  /* 0 so it fits mobile.  margin-bottom: 0.5rem; on cells to compensate. */
  grid-gap: 0;
  grid-template-columns: auto minmax(min-content, max-content) auto auto auto;
  grid-template-rows: 1fr;
}

div#answerStaff {
  position: relative; /* for guideBar */

  background-color: var(--color-primary-fill);

  display: flex;
  justify-content: flex-end;
  min-width: var(--width-rhythm-word);
  min-height: var(--height-rhythm-word);
}

div.playing {
  background-color: yellow;
}

div.noteAnswer {
  width: var(--width-rhythm-img);
  height: var(--height-rhythm-img);
}

div.noteQuestion.sysStaff,
div.noteQuestion.sysLine,
div.noteAnswer.sysStaff,
div.noteAnswer.sysLine,
div.noteBarAnswer.sysStaff,
div.noteBarAnswer.sysLine {
  height: max-content;
}

div.barAnswerStaffWrapper.sysStaff,
div.barAnswerStaffWrapper.sysLine {
  height: max-content;
}

div.barAnswerStaff.sysStaff,
div.barAnswerStaff.sysLine {
  height: auto;
}

div.wordAnswer {
  width: var(--width-rhythm-word);
  max-width: var(--width-rhythm-word);
  height: var(--height-rhythm-word);
}

div.wordAnswer.halfBeat {
  width: calc(var(--width-rhythm-word) / 2);
  max-width: calc(var(--width-rhythm-word) / 2);
}

div.answer {
  display: inline-block;
}

div.answer.asking {
  background-color: var(--color-primary-fill);
  border: 0 solid var(--color-transparent);
  border-width: 0.05rem 0.05rem 0.05rem 0.05rem;
  border-color: var(--color-transparent);
}

div.answer.asking.blankAfterOneBeatRhythm {
  border-width: 0;
}

div.answer.yes {
  background-color: var(--color-primary-fill);
  pointer-events: none;
  opacity: 0.3;
  border: 0 solid var(--color-transparent);
  border-width: 0 0 0.15rem 0;
}

div.answer.no {
  background-color: var(--color-primary-fill);
  border: 0 solid var(--color-transparent);
  border-width: 0 0 0.15rem 0;
}

.halfBlank > .bgLine,
.halfBlank > .bgStaff {
  /* Hack because the 1x8n in 1x4nd1x8n is twice the size and shifted left, so the bar lines would overlap and be darker */
  visibility: hidden;
}

.question.hbi > .bgLine,
.question.hbi > .bgStaff,
.answer.hbi > .bgLine,
.answer.hbi > .bgStaff,
.barAnswer.hbi > .bgLine,
.barAnswer.hbi > .bgStaff {
  width: 200%;
  transform: translateX(-50%);
}

.halfBeat.sysLine.hbi > div > img.rhythmImg,
.halfBeat.sysStaff.hbi > div > img.rhythmImg,
.halfBeat.sysLine.hbi > div > img.rhythmImgBox,
.halfBeat.sysStaff.hbi > div > img.rhythmImgBox {
  padding-top: 20%;
  padding-bottom: 20%;
  transform: translateX(25%);
}

#questionStaff {
  position: relative; /* for guideBar */

  background-color: var(--color-primary-fill);

  display: flex;
  justify-content: flex-end;
  min-width: var(--width-rhythm-word);
  height: calc(var(--height-rhythm-word) + var(--height-mark));
}

div.question.bar {
  margin: 0;
  margin-bottom: 0.1rem;
}

div.wordQuestion {
  width: var(--width-rhythm-word);
  height: var(--height-rhythm-word);
}

div.wordQuestion.halfBeat {
  width: calc(var(--width-rhythm-word) / 2);
  max-width: calc(var(--width-rhythm-word) / 2);
}

div.noteQuestion {
  height: var(--height-rhythm-img);
  width: var(--width-rhythm-img);
}

div.typeItNotes {
  width: var(--width-rhythm-word);
  height: var(--height-rhythm-img);
}

div.typeItNotes.halfBeat {
  width: calc(var(--width-rhythm-word) / 2);
  max-width: calc(var(--width-rhythm-word) / 2);
}

div.question {
  background-color: var(--color-primary-fill);
  display: inline-block;
}

div.wordAnswer,
div.question,
div.barAnswer,
div.noteAnswer,
div.typeItNotes {
  flex: 2;
}

div.wordAnswer.halfBeat,
div.question.halfBeat,
div.barAnswer.halfBeat,
div.noteAnswer.halfBeat,
div.typeItNotes.halfBeat {
  flex: 1;
}

div.wordAnswer.blankAfterOneBeatRhythm,
div.question.blankAfterOneBeatRhythm,
div.barAnswer.blankAfterOneBeatRhythm,
div.noteAnswer.blankAfterOneBeatRhythm,
div.typeItNotes.blankAfterOneBeatRhythm {
  flex: 0;
  width: 0;
}

div.question.asking {
  background-color: var(--color-primary-fill);
  border: 0 solid var(--color-transparent);
  border-width: 0 0 0.15rem 0;
}

div.question.yes {
  background-color: var(--color-primary-fill);
  pointer-events: none;
  opacity: 0.3;
  border: 0 solid var(--color-transparent);
  border-width: 0 0 0.15rem 0;
}

div.question.no {
  background-color: var(--color-primary-fill);
  border: 0 solid var(--color-transparent);
  border-width: 0 0 0.15rem 0;
}

#playQuestionsButton, #playAnswersButton, button.playBarButton.up, button.playBarButton.down {
  grid-column: 3 / span 1;
  grid-row: 1;

  margin-right: auto;
  transform: translate(-30%, -40%);

  --w: calc(var(--height-rhythm-img) * 1);
  height: var(--w);
  width: var(--w);
  min-height: var(--w);
  min-width: var(--w);

  background-color: inherit;
  border-radius: 50%;
  border: none;
  padding: 0;

  display: flex;
  justify-content: center;
  align-items: center;

  z-index: 2;
}

#playBarButton1, #gridCellFiller1 {
  grid-row: 2;
}

#playBarButton2, #gridCellFiller2 {
  grid-row: 3;
}

#playBarButton3, #gridCellFiller3 {
  grid-row: 4;
}

#playBarButton4, #gridCellFiller4 {
  grid-row: 5;
}

#playQuestionsButton.emphasis, #playAnswersButton.emphasis, button.playBarButton.emphasis.up {
  border: 0.16rem dotted var(--color-secondary-text);
  background-color: var(--color-primary-light);
}

#playAnswersButton.down, #playQuestionsButton.down, button.playBarButton.down {
  border: 0.16rem dotted var(--color-emphasis-border);
  background-color: var(--color-primary-light);
}

.playIcon, .nextIcon {
  max-height: 50%;
  max-width: 50%;
}

.playIcon > path, .nextIcon > path {
  stroke: var(--color-primary-text);
  fill: var(--color-primary-fill);
}

.emphasis > svg > path {
  fill: var(--color-emphasis-fill);
}

.down > svg > path {
  fill: var(--color-emphasis-border);
}

#buttonWrapper {
  grid-column: 1 / span 5;
  grid-row: 7 / span 1;

  display: grid;
  grid-gap: 0.5rem;
  grid-template-columns: 1fr 12fr 1fr;
  grid-template-rows: 1fr;
}

#nextButton,
#doneButton {
  grid-column: 3 / span 1;
  grid-row: 1;

  text-align: center;
  margin-left: auto;
}

#leftButtons {
  grid-column: 1 / span 2;
  grid-row: 1;

  display: flex;
}

#undoButton {
  margin-left: 0.5rem;
}

div#barAnswersWrapper {
  background-color: var(--color-transparent);
  grid-column: 1 / span 5;
  grid-row: 6 / span 1;

  padding-top: 0;

  display: grid;
  /* 0 so it fits mobile.  margin-bottom: 0.5rem on cells to compensate. */
  grid-gap: 0;
  grid-template-columns: auto minmax(min-content, max-content) auto auto auto;
}

@media screen and (min-width: 0) and (max-width: 400px) {
  div.barNumber {
    display: none;
  }
}

@media screen and (min-width: 401px) and (max-width: 1024px) {
  div.barNumber {
    display: flex;
  }
}

div.barNumber {
  width: 1.4rem;
  font-size: 1.3rem;
  align-items: center;
  justify-content: center;
}

div.barNumber.retracted {
  display: none;
  width: 0;
}

div.barAnswerStaff.button {
  margin: 0;
}

.barAnswerStaffGuideBar,
div.barAnswerStaff.yes,
div.barAnswerStaff.no {
  border: 0.12rem solid var(--color-transparent);
  opacity: 1;
}

div.barAnswer.no {
  background-color: var(--color-primary-fill);
}

div.barAnswer.yes {
  color: var(--color-primary-text);
  background-color: var(--color-primary-fill);
  opacity: 0.3;
}

div.barAnswer.yes > div.imgMiddler > img,
div.barAnswer.no > div.imgMiddler > img {
  /* NB match filter-color-emphasis-text */

  /* filter: invert(33%) sepia(99%) saturate(416%) hue-rotate(355deg) brightness(95%) contrast(92%); */
  filter: invert(38%) sepia(13%) saturate(466%) hue-rotate(138deg) brightness(96%) contrast(82%);
}

div.barAnswerStaff.out {
  border: 0.12rem solid var(--color-transparent);
  background-color: var(--color-primary-fill);
}

div.barAnswerStaff {
  text-align: left;

  margin: 0;
  padding: 0;

  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: var(--height-rhythm-img);
  min-width: var(--width-rhythm-word);
}

div.noteBarAnswer {
  height: var(--height-rhythm-img);
  width: var(--width-rhythm-img);
}

div.halfBeat.noteBarAnswer,
div.halfBeat.noteQuestion,
div.halfBeat.noteAnswer {
  width: calc(var(--width-rhythm-img) / 2);
}

div.wordBarAnswer {
  width: var(--width-rhythm-word);
  max-width: var(--width-rhythm-word);
  height: var(--height-rhythm-word);
}

div.wordBarAnswer.halfBeat {
  width: calc(var(--width-rhythm-word) / 2);
  max-width: calc(var(--width-rhythm-word) / 2);
}

div.barAnswer {
  display: inline-block;
}

div.imgMiddler {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

div.overlayWrapper {
  position: relative;
  pointer-events: none;
}

div.barOverlay {
  position: absolute;
  left: -0.35rem;
  top: -0.35rem;
  width: 2rem;
  height: 2rem;
  background-color: var(--color-primary-fill);
  border: 0.16rem dotted var(--color-emphasis-border);
  border-radius: 50%;

  display: flex;
  display: none; /* just too little space */
  justify-content: center;
  align-items: center;
}

div.guideOverlay {
  font-size: 1.2rem;
  position: absolute;
  right: 1rem;
  top: 40%;
  z-index: 999;
}

.barAnswerStaffWrapper {
  position: relative; /* for guideBar */
  grid-column: 3 / span 1;
  width: min-content;
}

.gridCellFillerNoMargin {
  grid-column: 3 / span 1;
  width: 100%;
}

.gridCellFiller {
  grid-column: 3 / span 1;
  width: 100%;
  margin-bottom: 1rem;
}

.questionCellFiller, .answerCellFiller {
  grid-row: 1;
  margin-bottom: 0;
}

div#rhythmButtonSpaceWrapper.retracted {
  display: none;
}

div#rhythmButtonSpaceWrapper {
  grid-column: 1 / span 5;
  grid-row: 6 / span 1;

  margin-top: 0.5rem;

  display: grid;
  grid-gap: 0;
  grid-template-columns: auto minmax(min-content, max-content) auto;
}

#systemDisplay {
  grid-column: 1 / span 3;
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
}

div.rhythmButtonWrapper {
  text-align: left;

  margin: 0;
  padding: 0;

  display: flex;
  flex-wrap: wrap;
}

.noteRhythmButton {
  height: var(--height-rhythm-img);
  width: var(--width-rhythm-img);
}

.wordRhythmButton {
  width: var(--width-rhythm-word);
  height: var(--height-rhythm-word);
}

.rhythmButton {
  border: 0.12rem solid var(--color-emphasis-border);
  color: var(--color-emphasis-border);

  display: inline-block;

  margin-left: 0.25rem;
  margin-right: 0.25rem;
  margin-bottom: 0.3rem;
}

.rhythmButton.up {
  background-color: var(--color-emphasis-fill);
}

#entranceWrapperX {
  display: grid;
  grid-gap: 0.5rem;
  grid-template-columns: auto minmax(min-content, max-content);
  grid-template-rows: 1fr;
}

#entranceWrapper {
  display: flex;
  align-items: center;
}

#entrance {
  width: 100%;
  height: 2.4rem;
  font-size: 2rem;
}

#readyButton {
  height: 3rem;
  margin-left: 0.5rem;
}

.barButton.enabled {
  background-color: var(--color-primary-fill);
}

.barButton.emphasis {
  border: 0.12rem solid var(--color-emphasis-border);
  color: var(--color-emphasis-border);
}

.barButton {
  color: var(--color-primary-text);
}

.barButton.emphasis.up {
  background-color: var(--color-emphasis-fill);
}

.barButton.emphasis.down {
  background-color: var(--color-emphasis-border);
}

#scoreWrapper {
  grid-column: 1 / span 5;
  grid-row: 8 / span 1;

  display: none;
}

#dataWrapper {
  grid-column: 1 / span 5;
  grid-row: 9 / span 1;
}

img#violin {
  width: 35%;
}

.nextIcon.retracted,
.playIcon.retracted,
.rhythmButton.retracted {
  display: none;
}
