/* The phone's hands-free deck (deck.js, docs/hands-free.md): a band between
   the view and the navigation bar. Its first row always; the rest while open.
   Targets are at least 40 px: a thumb, not a pointer.
   A phone on its side: `max-height: 479px`, under panes.js's COMPACT_H (see compact.css). */

.deck {
  grid-area: deck;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 5px 10px 5px;
  border-top: 1px solid var(--line-2);
  background: linear-gradient(180deg, #1a161d, #110f13);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 3;
  color: var(--text);
  font: 500 13px/1.2 var(--sans);
}
/* Open, it never takes more than about half the screen: the view stays usable above it. */
.deck.open {
  max-height: 52dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.deck.open::-webkit-scrollbar {
  display: none;
}
.deck.recording {
  border-top-color: rgba(224, 112, 126, 0.7);
}

/* Rows keep their height (the open deck scrolls instead of squeezing them onto each other). */
.deck > *,
.deck-alt > * {
  flex: none;
}
.deck-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.deck button {
  font: inherit;
  color: inherit;
}
.deck .glyph {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
}

/* ---------------------------------------------------------------- first row */

.deck-play,
.deck-sing,
.deck-fold,
.deck-expand,
.deck-send,
.deck-step {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--ob-2);
  color: var(--champagne);
}
.deck-play {
  width: 52px;
  border-color: var(--gold-lo);
  background: linear-gradient(180deg, #2a2216, #17130c);
  color: var(--gold-hi);
}
.deck-play.on {
  box-shadow: var(--glow);
}
.deck-fold {
  width: 40px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
/* The way to a full panel: its name, and the window sign. */
.deck-expand {
  width: auto;
  gap: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  height: 36px;
  border-color: var(--line-2);
  background: transparent;
  color: var(--champagne);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.deck-expand .glyph,
.deck-fold .glyph {
  width: 17px;
  height: 17px;
}
.deck-strip {
  flex: 1 1 0;
  min-width: 60px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  touch-action: none;
  cursor: pointer;
}
.deck-strip-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.deck-pos {
  flex: none;
  min-width: 42px;
  text-align: center;
  font: 600 15px/1 var(--mono);
  color: var(--gold-hi);
  font-variant-numeric: tabular-nums;
}

/* Sing: a red dot; while it records, its level fills it. */
.deck-sing {
  position: relative;
  overflow: hidden;
  border-color: rgba(224, 112, 126, 0.45);
  color: #f0a0aa;
}
.deck-sing.on {
  background: #3a1219;
  border-color: #e2717f;
  color: #fff;
}
.deck-sing.busy {
  opacity: 0.6;
}
.deck-sing .glyph {
  position: relative;
  z-index: 1;
}
.deck-level {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--level, 0) * 100%);
  background: rgba(226, 113, 127, 0.55);
  transition: height 80ms linear;
}

/* ---------------------------------------------------------------- transport */

.deck-transport {
  justify-content: space-between;
}
.deck-tb {
  flex: 1 1 0;
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--ob-1);
}
.deck-tb > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.deck-tb.on {
  border-color: var(--emerald);
  color: #9fe0c9;
}

/* ---------------------------------------------------------------- parts */

.deck-parts {
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
}
.deck-parts::-webkit-scrollbar {
  display: none;
}
.deck-chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  max-width: 150px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--ob-1);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.deck-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chip, var(--gold));
  flex: none;
}
.deck-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deck-chip.solo {
  border-color: var(--gold);
  background: #2a2216;
  color: var(--gold-hi);
}
.deck-chip.muted {
  opacity: 0.5;
}
.deck-chip.muted .deck-chip-name {
  text-decoration: line-through;
}
.deck-parts .deck-expand {
  flex: none;
}
/* The Loop chooser: every choice in sight, two rows of three. */
.deck-loops {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: visible;
}
.deck-loops .deck-chip {
  max-width: none;
  justify-content: center;
}

/* ---------------------------------------------------------------- alternatives */

.deck-seg {
  flex: 1 1 0;
  display: flex;
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
}
.deck-seg > button {
  flex: 1 1 0;
  min-width: 0;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.deck-seg > button + button {
  border-left: 1px solid var(--line-2);
}
.deck-seg > button.on {
  background: #2a2216;
  color: var(--gold-hi);
}
.deck-seg.small {
  flex: none;
}
.deck-seg.small > button {
  padding: 0 10px;
  font-size: 12px;
}

.deck-alt {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.deck-cards {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.deck-step {
  height: auto;
  min-height: 50px;
}
.deck-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 50px;
  padding: 6px 12px;
  border: 1px solid var(--gold-lo);
  border-radius: 12px;
  background: linear-gradient(180deg, #221c14, #15120d);
  touch-action: pan-y;
}
.deck-card {
  position: relative;
  overflow: hidden;
}
.deck-card > :not(canvas) {
  position: relative;
}
/* The reading's notes, faint, along the card's bottom (under the detail line, not the title). */
.deck-card-notes {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 3px;
  width: calc(100% - 16px);
  height: 14px;
  opacity: 0.45;
  pointer-events: none;
}
.deck-card.with-notes {
  padding-bottom: 18px;
}
.deck-meter {
  height: 8px;
  border-radius: 4px;
  background: var(--ob-0);
  overflow: hidden;
}
.deck-meter-v {
  display: block;
  height: 100%;
  width: calc(var(--level, 0) * 100%);
  background: linear-gradient(90deg, #46a58b, #e2c35a 70%, #e2717f);
  transition: width 80ms linear;
}
.deck-card-kicker {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.deck-card-title {
  color: var(--ivory);
  font: 600 16px/1.2 var(--sans);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deck-card-detail {
  color: var(--champagne);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deck-acts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.deck-acts::-webkit-scrollbar {
  display: none;
}
.deck-acts.wrap {
  flex-wrap: wrap;
  overflow: visible;
}
.deck .deck-act {
  flex: 1 0 auto;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--ob-1);
  color: var(--ivory);
  font-weight: 600;
  white-space: nowrap;
}
.deck .deck-act.gold {
  border-color: var(--gold);
  background: linear-gradient(180deg, #d9b54a, #a8861f);
  color: #1a1408;
}
/* On (playing, a variant chosen): dark, with a bright green edge and text. */
.deck .deck-act.on {
  border-color: var(--emerald);
  background: #10241e;
  color: #b8f0dc;
}
.deck .deck-act.done {
  border-color: var(--gold-lo);
  background: transparent;
  color: var(--gold-hi);
}
.deck .deck-act[disabled] {
  opacity: 0.6;
}
.deck .deck-act .glyph {
  width: 17px;
  height: 17px;
}
.deck-blocks {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.deck-block {
  flex: 1 0 auto;
  min-width: 56px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--ob-1);
  font-weight: 600;
}
.deck-block.on {
  border-color: var(--gold);
  color: var(--gold-hi);
  background: #2a2216;
}

/* ---------------------------------------------------------------- Maestro's line */

.deck-input {
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--ob-0);
  color: var(--text);
  font: 500 16px/1 var(--sans); /* 16 px: iOS does not zoom in on it */
}
.deck-input:focus {
  outline: none;
  border-color: var(--gold-lo);
}
.deck-send {
  border-color: var(--gold-lo);
  color: var(--gold-hi);
}
.deck-send[disabled] {
  opacity: 0.5;
}
.deck-said {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 4px;
  color: var(--champagne);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deck-said > span {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  line-height: 1.3;
}
.deck-said.busy {
  color: var(--muted);
}

/* A phone on its side: a little less padding (its two columns are below). */
@media (max-height: 479px) {
  .deck {
    padding-top: 4px;
    padding-bottom: 4px;
  }
}

/* A phone on its side: the open deck is a column of its own beside the view (compact.css), the full
   height between the top bar and the navigation bar, scrolling within itself. */
@media (max-height: 479px) {
  /* Play, the strip and Sing stay at the top while the rest scrolls. */
  .deck.open > .deck-main {
    position: sticky;
    top: -5px;
    z-index: 1;
    padding: 5px 0;
    background: #19151c;
  }
  .deck.open {
    max-height: none;
    height: 100%;
    border-top: none;
    border-left: 1px solid var(--line-2);
    box-shadow: -6px 0 18px rgba(0, 0, 0, 0.4);
  }
}

/* The parts a take can go on (its Part button). */
.deck-pick {
  flex-wrap: wrap;
  gap: 6px;
}
