/* The transport bar (js/transport.js): Play or Pause, the loop's chords, and the band's volume, on one row at the
   bottom beside Full screen and Hide UI, on every screen. Starlight on glass, like the corner's buttons. Nick's side.
   --tbar-right (set by the script) keeps it just left of whichever corner buttons show. */

.tbar {
  position: fixed;
  right: var(--tbar-right, calc(var(--gutter) + 110px));
  bottom: var(--gutter);
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(440px, calc(100vw - var(--tbar-right, 120px) - var(--gutter)));
  height: 48px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background-color: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: opacity 300ms var(--ease-out);
}

.tb-play,
.tb-vol {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.tb-play {
  background: var(--starlight);
  color: var(--space);
}

.tb-play .ic,
.tb-vol .ic {
  width: 20px;
  height: 20px;
}

.tb-vol.is-muted {
  color: var(--dust);
}

/* The loop: its chords in a line, the one heard lit; it scrolls sideways when there are many. */
.tb-chords {
  display: flex;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 0 2px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}

.tb-chords::-webkit-scrollbar {
  display: none;
}

.tb-chord {
  flex: none;
  padding: 5px 9px;
  border-radius: var(--r-pill);
  color: var(--dust);
  font-family: var(--mono, "Geist Mono", ui-monospace, monospace);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 120ms linear, color 120ms linear;
}

.tb-chord.is-on {
  background: var(--starlight);
  color: var(--space);
}

/* The volume, above the bar. */
.tb-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  width: 240px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background-color: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.tb-panel[hidden] {
  display: none;
}

.tb-panel-h {
  grid-column: 1 / -1;
  color: var(--dust);
  font-size: 13px;
}

.tb-panel input {
  width: 100%;
  accent-color: var(--starlight);
}

.tb-vol-out {
  min-width: 3em;
  font-family: var(--mono, "Geist Mono", ui-monospace, monospace);
  font-size: 12.5px;
  text-align: right;
}

/* The home's own Play steps aside for the bar, and its starters end before it. */
body.has-tbar #play {
  display: none;
}

body.has-tbar .bottom {
  right: calc(var(--tbar-right, 120px) + var(--tbar-w, 300px) + 10px);
}

/* Full screen: the bar stays, quieter until it's wanted. */
body.is-display .tbar {
  opacity: .55;
}

body.is-display .tbar:is(:hover, :focus-within) {
  opacity: 1;
}

/* Phones: the starters move up a row, and sheets that come up from the bottom leave room for the bar. */
@media (max-width: 640px) {
  .tbar {
    height: 44px;
    padding: 2px;
  }

  .tb-play,
  .tb-vol {
    width: 38px;
    height: 38px;
  }

  body.has-tbar .bottom {
    right: var(--gutter);
    bottom: calc(var(--gutter) + 54px);
  }

  /* (The Menu was in this list while it took the whole screen. It's a sheet now and stops above the bar:
     v2/settings.css.) */
  body.has-tbar :is(.drill, .room) {
    padding-bottom: calc(env(safe-area-inset-bottom) + 64px);
  }
}
