/* The reading desk keeps printed coordinates intact in all three zoom modes. */
body[data-song] {
  --stand-deck-start: #172439;
  --stand-deck-end: #35435d;
  --stand-deck-haze: #8b668b66;
  --stand-wave-idle: #9aa5bc;
  --stand-wave-active: #fff0c9;
}
body[data-song="time-machine"] {
  --stand-deck-start: #172e49;
  --stand-deck-end: #3b607f;
  --stand-deck-haze: #658bb666;
  --stand-wave-idle: #a0b8ce;
  --stand-wave-active: #fff0c9;
}

body[data-song] .back {
  margin-top: .35rem;
}
body[data-song] .song-head {
  margin: 0 0 .85rem;
}
.song-head .song-description {
  display: flex;
  align-items: baseline;
  gap: .3rem 1.05rem;
  flex-wrap: wrap;
}
.song-head .song-description p {
  margin: 0;
}
.practice .reader {
  border-radius: 14px;
}
.reader-bar .mini-play {
  border-radius: 50%;
  color: var(--surface);
  background: var(--ink);
}
.reader-bar .mini-play:hover:not(:disabled) {
  color: var(--surface);
  background: var(--sub);
}
.reader-bar .mini-play .icon {
  width: 15px;
  height: 15px;
}
.reader-bar .transport {
  gap: 4px;
}
.reader-bar #bar-position {
  padding-left: 6px;
  color: var(--ink);
  font-weight: 590;
}
.reader-bar .view-controls {
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 7px;
}
.reader-bar .pagination {
  gap: 1px;
}
.reader-bar .stand-view-toggle {
  display: none;
}
.practice .sheet-frame {
  height: clamp(340px, calc(100dvh - 215px), 1100px);
}
.practice #note-cursor {
  background: rgb(255 195 80 / .35);
  outline: 1.5px solid #935800;
  box-shadow: inset 0 -3px #925200;
}

/* Only the audio controls take on the record's color. All tuning information
   stays on the same neutral surface as its controls. */
.practice .sound {
  --deck-inset: 18px;
  padding: 0 var(--deck-inset) 15px;
  border-radius: 14px;
}
.stand-deck {
  isolation: isolate;
  position: relative;
  padding: 13px var(--deck-inset) 11px;
  margin: 0 calc(-1 * var(--deck-inset)) 15px;
  border-radius: 13px 13px 0 0;
  color: #fff;
  background:
    radial-gradient(ellipse at 100% 0%, var(--stand-deck-haze), transparent 66%),
    linear-gradient(135deg, var(--stand-deck-start), var(--stand-deck-end));
}
.stand-deck .sound-heading {
  margin-bottom: 13px;
}
.stand-deck .sound-heading h2 {
  color: #e1e5ef;
  font-size: .81rem;
  font-weight: 600;
  letter-spacing: .055em;
}
.stand-deck .sound-heading > .icon {
  color: #d6deeb;
  width: 16px;
  height: 16px;
}
.stand-deck .player-identity {
  gap: 12px;
  margin: 0 0 9px;
}
.stand-deck .player-identity img {
  width: 56px;
  height: 56px;
  border-radius: 5px;
  outline: 1px solid rgb(255 255 255 / .24);
  outline-offset: -1px;
}
.stand-deck .player-identity strong {
  color: #fff;
  font-size: 1.22rem;
  letter-spacing: -.025em;
}
.stand-deck .player-identity span,
.stand-deck .clock {
  color: #e3e8f2;
}
.stand-deck .console {
  margin: 0;
}
.stand-waveform {
  position: relative;
  height: 44px;
}
.stand-waveform-ink {
  position: absolute;
  inset: 4px 2px;
  pointer-events: none;
  background: linear-gradient(90deg,
    var(--stand-wave-active) 0 var(--stand-progress, 0%),
    var(--stand-wave-idle) var(--stand-progress, 0%) 100%);
  -webkit-mask: var(--stand-mask) center / 100% 100% no-repeat;
  mask: var(--stand-mask) center / 100% 100% no-repeat;
}
.stand-waveform #seek {
  position: relative;
  z-index: 1;
  background: transparent;
}
.stand-waveform #seek::-webkit-slider-runnable-track {
  height: 2px;
  background: transparent;
}
.stand-waveform #seek::-webkit-slider-thumb {
  width: 3px;
  height: 38px;
  margin-top: -18px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .32);
}
.stand-waveform #seek::-moz-range-track,
.stand-waveform #seek::-moz-range-progress {
  height: 2px;
  background: transparent;
}
.stand-waveform #seek::-moz-range-thumb {
  width: 3px;
  height: 38px;
  border: 0;
  border-radius: 4px;
  background: #fff;
}
.stand-deck .console-buttons {
  gap: 11px;
  margin-top: 0;
}
.stand-deck .console-buttons button {
  color: #fff;
}
.stand-deck .console-buttons button:hover {
  background: rgb(255 255 255 / .13);
}
.stand-deck .console-buttons #audio-play {
  background: #fff;
  color: var(--stand-deck-start);
}
.stand-deck .console-buttons #audio-play:hover {
  background: #e3e8f1;
}
.stand-deck :focus-visible {
  outline-color: #ffdc89;
}
.stand-deck .clock {
  font-size: .72rem;
  margin: 1px 0 5px;
}

@media (max-width: 980px) {
  .practice .sound { --deck-inset: 14px; }
}
@media (max-width: 720px) {
  .practice .sheet-frame {
    height: clamp(330px, calc(100dvh - 195px), 680px);
  }
  .practice .sound { --deck-inset: 17px; }
}
@media (max-width: 560px) {
  body[data-song] .song-head { margin-bottom: 10px; }
  .song-head .song-description { gap: .22rem .6rem; }
  .reader-bar { column-gap: 0; padding-inline: 3px; }
  .reader-bar .transport { gap: 0; }
  .reader-bar #bar-position { padding-inline: 2px; }
  .reader-bar .stand-view-shell { position: relative; margin-inline-start: auto; }
  .reader-bar .stand-view-toggle {
    display: inline-flex;
    min-height: 44px;
    min-width: 44px;
    font-size: .78rem;
  }
  .reader-bar .stand-view-toggle[aria-expanded="true"] {
    background: var(--soft);
  }
  .stand-view-shell .view-controls {
    position: absolute;
    z-index: 4;
    right: -24px;
    top: calc(100% + 3px);
    padding: 3px;
    display: none;
    min-width: max-content;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgb(19 30 50 / .16);
  }
  .stand-view-shell.open .view-controls { display: flex; }
  .stand-view-shell .view-controls button { padding-inline: 12px; }
  .reader-bar .stand-view-shell #fit span { display: inline; }
  .reader-bar .pagination { margin-left: 0; gap: 0; }
  .pagination .page-word { position: absolute; clip-path: inset(100%); width: 1px; height: 1px; overflow: hidden; }
}
@media (forced-colors: active) {
  .stand-deck, .reader-bar .mini-play {
    color: CanvasText;
    background: Canvas;
  }
  .stand-waveform-ink { forced-color-adjust: none; background: GrayText; }
  .stand-waveform #seek::-webkit-slider-thumb { forced-color-adjust: none; background: Highlight; }
  .practice #note-cursor { outline: 2px solid Highlight; }
}
@media (max-width: 365px) {
  .reader-bar .transport {
    display: grid;
    grid-template-columns: 44px max-content;
    grid-template-rows: 22px minmax(22px, 1.35rem);
    flex: 0 1 auto;
  }
  .transport #sheet-play { grid-column: 1; grid-row: 1 / 3; }
  .transport #follow {
    grid-column: 2;
    grid-row: 1 / 3;
    min-width: 55px;
    align-items: flex-start;
    padding-top: 5px;
  }
  .transport #follow .icon { width: 15px; height: 15px; }
  .transport #bar-position {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    z-index: 1;
    padding-inline: 2px;
    font-size: .74rem;
    pointer-events: none;
  }
}
