#outer {
  /* ff breaks if just 0 */
  --header-height: 0rem; /* stylelint-disable-line length-zero-no-unit */
  --height-pi: 3rem;
}

#headingWrapper {
  padding: 0;
  background-color: var(--color-primary-light);
}

#heading {
  padding: 0.5rem 0.5rem 0 0.5rem;
  max-width: 100%;
  grid-template-rows: minmax(min-content, max-content);
}

#site {
  display: none;
}

#logoWrapper {
  z-index: 2;
}

#title {
  margin-left: 0;
  grid-column: 1 / span 4;
  text-align: center;
}

#wrapper {
  background-color: var(--color-primary-fill);
}

#messageWrapper {
  padding-top: 0;
  padding-bottom: 0;

  pointer-events: none;
  position: absolute;
  top: 0.5rem;
  left: 0;
  width: 100%;
  min-height: 2rem;
  height: auto;
  z-index: 10;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#planeW {
  padding: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

#planeW.disabled {
  opacity: 0.1;
}

#icons :first-child {
  margin-left: auto;
}

#icons {
  width: 100%;
  max-width: 100%;
  min-height: calc(var(--height-pi) + 1.5rem);
  overflow-x: scroll;
  overflow-y: hidden;

  background-color: var(--color-primary-light);
  border-bottom: 0.05rem solid var(--color-emphasis-fill);

  display: flex;
}

#plane {
  position: relative; /* for fullscreenW */
  width: 100%;
  max-width: 100%;
  min-height: calc(100% - var(--height-pi) - 1.5rem);
  max-height: 100%;
  background-color: var(--color-primary-fill);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  overflow-y: scroll;
}

#addButton, .pi {
  width: var(--height-pi);
  min-width: var(--height-pi);
  height: var(--height-pi);
  min-height: var(--height-pi);
  margin: 0.25rem;
  margin-top: 0.5rem;
  border-radius: 50%;
  border-color: var(--color-emphasis-fill);
}

#addButton {
  position: relative;
  font-size: 1.4rem;
  margin-right: auto;
}

#addButton.emphasis {
  border-color: var(--color-emphasis-border);
}

#hint {
  cursor: auto;
  pointer-events: none;

  position: absolute;
  top: 0;
  left: 0;

  padding-right: 1rem;
  width: max-content;
  transform: translateX(-100%);
  height: 100%;

  display: flex;
  align-items: center;
}

.pi {
  background-color: var(--color-primary-fill);
  border-style: dashed;
}

.pi.on {
  border-style: solid;
  border-color: var(--color-emphasis-fill);
}

.piIcon {
  pointer-events: none;
  max-width: 100%;
  opacity: 0.7;
}

.pi.on > .piIcon {
  opacity: 1;
}

.pe {
  --pe-menu-top: -0.8rem;
  --pe-menu-height: 2rem;
  --pe-menu-gap: 0.8rem;
  --pe-menu-distance: calc(var(--pe-menu-height) + var(--pe-menu-gap));
  position: relative; /* for surfamin */
  margin: 1rem;
  padding: 1rem;
  border: 0.05rem solid var(--color-emphasis-border);
  border-radius: 1rem;
  background-color: var(--color-primary-light);
  max-width: 100%;
  align-self: flex-start;
  resize: both;
}

.peMenu {
  cursor: pointer;
  position: absolute;
  top: var(--pe-menu-top);
  left: -0.8rem;
  width: var(--pe-menu-height);
  height: var(--pe-menu-height);
  border: 0.05rem solid var(--color-emphasis-border);
  border-radius: 50%;
  background-color: var(--color-primary-light);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

.peMenuImg {
  pointer-events: none;
  width: 80%;
}

.peMenuRoot > .peMenuImg {
  width: 60%;
}

.peMenuRem > .peMenuImg {
  width: 60%;
}

.peMenuLoo > .peMenuImg {
  width: 90%;
}

.peMenuHid {
  top: calc(var(--pe-menu-top));
}

.peMenuLoo {
  /* display: none; */
  top: calc(var(--pe-menu-top) + 2 * var(--pe-menu-distance));
}

.peMenuRem {
  top: calc(var(--pe-menu-top) + 1 * var(--pe-menu-distance));
}

.peMenuItem {
  user-select: none;
  cursor: pointer;
  z-index: 3;
}

.peRoot {
  display: flex;
}

.peRoot:focus-visible {
  outline: none;
}

.pe.building {
  border: 0.05rem solid var(--color-secondary-text);
}

.pe.building::before {
  color: var(--color-secondary-text);
  content: "Building...";
}

.peDrummer {
  width: min(calc(100% - 2rem), 40rem);
}

.peFrum {
  width: min(calc(100% - 2rem), 22rem);
}

.peMetronome {
  width: min(calc(100% - 2rem), 20rem);
}

.pePloop {
  width: min(calc(100% - 2rem), 20rem);
}

.peGenerator {
  width: min(calc(100% - 2rem), 30rem);
}

.peGenerator > .peRoot.setupActive {
  min-height: 40rem;
}

.peSurfamin {
  width: min(100%, 20rem);
  min-height: 20rem;
}

.peBass, .peGuitarelectric, .peGuitaracoustic, .peGuitarclassical {
  width: min(100%, 30rem);
  min-height: 20rem;
}

.peXylophonesoprano, .peXylophonealto, .peXylophonebass,
.peMetallophonesoprano, .peMetallophonealto, .peMetallophonebass {
  width: min(100%, 50rem);
  min-height: 20rem;
}

.peGlockenspielsoprano, .peGlockenspielalto {
  width: min(100%, 40rem);
  min-height: 20rem;
}

.peBeeper {
  width: min(calc(100% - 2rem), 20rem);
}

#addWW {
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 2;
}

#addW {
  position: relative; /* for #pickApp */
  margin-top: 2rem;
  width: 100%;
  padding: 0.5rem;
  max-height: calc(100% - 3rem);

  display: flex;
  flex-direction: column;
  align-items: center;
}

#addersW {
  cursor: auto;
  padding: 0.5rem;
  background-color: var(--color-primary-light);
  max-width: min(calc(100% - 2rem), 30rem);
  max-height: 100%;
  overflow-y: scroll;
  border: var(--dialog-border-width) solid var(--color-emphasis-border);

  display: flex;
  flex-direction: column;
}

.adders {
  padding-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
}

.adders:last-child {
  padding-bottom: 0;
}

.addButton, .addButtonX {
  margin: 0.5rem;
  width: 40%;
  max-width: 8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.addButtonX > .addButton {
  width: 100%;
  margin-bottom: 0;
}

.addIcon {
  pointer-events: none;
  width: 3rem;
  margin-bottom: 0.5rem;
}

.addBHW {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
}

.addSubIcon {
  pointer-events: none;
  width: 2rem;
  margin-left: 0.5rem;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

#fullscreenW {
  position: absolute;
  top: 0;
  right: 0;

  padding: 0.5rem;

  display: flex;
  justify-content: flex-end;
}

#fullscreenButton {
  width: 2rem;
  height: 2rem;

  display: flex;
  align-items: center;
}

#fullscreenIcon {
  pointer-events: none;
  height: 100%;
  max-width: 100%;
}

#loopsW {
  pointer-events: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;

  overflow-x: hidden;

  display: flex;
  justify-content: center;

  z-index: 4;
}

#loops {
  position: relative;
  width: 100%;
  max-width: 50rem;

  display: flex;
  flex-direction: column;
}

.loopLine, .loopGarage {
  width: 100%;
  height: 2rem;
  background-color: var(--color-primary-light);
  display: flex;
}

.loopLine {
  pointer-events: auto; /* because parent none */
}

.loopGarage {
  background-color: var(--color-transparent);
}

.lineI {
  width: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lineIImg {
  width: 80%;
}

.clearI {
  cursor: pointer;
}

.loopRoll {
  position: relative;
  width: 100%;
  border-top: 0.2rem solid var(--color-primary-fill);
  border-bottom: 0.2rem solid var(--color-primary-fill);

  display: flex;
}

.beat, .subbeat {
  pointer-events: none;
  position: absolute;
  top: 10%;
  width: 0.1rem;
  height: 80%;
  background-color: var(--color-primary-text);
  display: flex;
}

.subbeat {
  top: 20%;
  width: 0.05rem;
  height: 60%;
  background-color: var(--color-primary-text);
}

.noteDot {
  cursor: pointer;
  position: absolute;
  top: 0;
  width: 2rem;
  height: 100%;
  background-color: var(--color-transparent);
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateX(-0.5rem); /* gap between noteDot and noteDotShown */
}

.noteDotShown {
  pointer-events: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background-color: var(--color-emphasis-fill);
  display: flex;
}

.mark {
  clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%, 0 0);
  position: absolute;
  top: -2.8rem;
  width: 0.8rem;
  height: 2.5rem;
  background-color: var(--color-secondary-text);
  border: none;
  display: none;
  transform: translateX(0.1rem); /* point to middle of noteDotShown */
}

.mark.moving {
  display: flex;
}

.noteDot.moving > .noteDotShown {
  border: 0.15rem dotted var(--color-secondary-text);
}

#indicator {
  pointer-events: auto; /* because parent none */
  align-self: flex-start;
  color: var(--color-secondary-text);
  font-size: 0.7rem;
  font-weight: bold;
  padding: 0.2rem;

  z-index: 2;
}

#playB {
  --w: 2.4rem;

  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;
}

#playB.emphasis {
  border: 0.16rem dotted var(--color-secondary-text);
  /* background-color: var(--color-primary-light); */
}

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

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

#playI, #stopI {
  max-height: 50%;
  max-width: 50%;
}

#needle {
  position: absolute;
  top: 0;
  left: 2rem;
  bottom: 0;
  background-color: var(--color-emphasis-fill);
  width: 0.5rem;
}

.peMenu.disabled {
  opacity: 0;
}

#splash {
  border-radius: 1rem;
  margin-top: 2rem;
  width: 100%;
  max-width: min(20rem, 100%);
  background-color: var(--color-primary-light);
  border: 0.05rem solid var(--color-emphasis-border);
}

#splashI {
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 0;
}

.tutW {
  width: 100%;
  margin-left: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

#pickApp {
  position: absolute;
  top: calc(-1 * (1.5rem + var(--dialog-border-width)));
  display: flex;
  font-size: 1rem;
  background-color: var(--color-primary-light);
  padding: 0.4rem;
}

.pickH {
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;

  display: flex;
  justify-content: center;
}

#pickInstr {
  margin-top: 1rem;
}

@media screen and (max-width: 30rem) {
  #fullscreenButton {
    width: 1.2rem;
    height: 1.2rem;
    padding: 0.1rem;
  }

  .pickH {
    margin-bottom: 0;
  }

  .addButton {
    flex-direction: row;
    align-items: center;
  }

  .addButton, .addButtonX {
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    width: 100%;
    max-width: calc(50% - 0.25rem);
    padding: 0.15rem;
  }

  .addButton:nth-child(odd), .addButtonX:nth-child(odd) {
    margin-right: 0.5rem;
  }

  .addButtonX > .addButton, .addButtonX > .addButton:nth-child(odd) {
    margin-right: 0;
    max-width: 100%;
  }

  .addIcon {
    width: 1.8rem;
    margin: 0;
  }

  .addButtonName {
    margin-left: 0.3rem;
    width: 100%;
    text-align: center;
  }
}

#hint.retracted,
#loopsW.retracted,
#loops.retracted,
.loopGarage.retracted,
.loopLine.retracted,
.peMenuHid.retracted,
.peMenuLoo.retracted,
.peMenuRem.retracted,
#addWW.retracted {
  display: none;
}
