/* Note input (ui/noteinput.js): the caret on a staff, the bar along the bottom of the view
   (the passage bar's pill, score.css), and the card of its keys. */

/* ---------------------------------------------------------------- the caret */

.score-caret {
  position: absolute;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 3px;
  background: linear-gradient(180deg, transparent, #c9962a 14%, #e3b84a 50%, #c9962a 86%, transparent);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.55);
  pointer-events: none;
  animation: input-caret 1.1s ease-in-out infinite;
  z-index: 2;
}
.score-caret.chord {
  width: 7px;
  margin-left: -3.5px;
  background: linear-gradient(180deg, transparent, rgba(201, 150, 42, 0.85) 14%, rgba(201, 150, 42, 0.85) 86%, transparent);
}
/* Insert: the music after it moves on — an emerald caret with a wedge at its foot. */
.score-caret.insert {
  background: linear-gradient(180deg, transparent, #2f8f74 14%, #46a58b 50%, #2f8f74 86%, transparent);
  box-shadow: 0 0 10px rgba(70, 165, 139, 0.6);
}
.score-caret.insert::after {
  content: "";
  position: absolute;
  left: -4px;
  bottom: -6px;
  border: 5.5px solid transparent;
  border-top-color: #46a58b;
}
/* Re-pitch: the notes there change, their rhythm kept — a sapphire caret. */
.score-caret.repitch {
  background: linear-gradient(180deg, transparent, #4a6fa5 14%, #5b82c4 50%, #4a6fa5 86%, transparent);
  box-shadow: 0 0 10px rgba(91, 130, 196, 0.6);
}
@keyframes input-caret {
  50% {
    opacity: 0.55;
  }
}
/* The value it writes, above it. */
.score-caret-chip {
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  padding: 1px 6px 3px;
  border-radius: 999px;
  background: var(--metal);
  color: #251a06;
  font: 15px/1.2 "Bravura";
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- the input bar */

.hy-over {
  display: contents;
}
.hybrid {
  position: relative;
}
.input-bar {
  gap: 8px;
  padding: 6px 8px 6px 10px;
  z-index: 4;
  /* Centered by its sides (not the passage bar's left: 50%, which would give it half the width to
     lay out in); too wide for the view, a second row rather than a hidden end. */
  left: 12px;
  right: 12px;
  width: fit-content;
  margin: 0 auto;
  transform: none;
  animation: input-rise 0.18s ease-out;
  flex-wrap: wrap;
  justify-content: center;
  white-space: normal;
  border-radius: 24px;
}
@keyframes input-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.input-bar > * {
  flex: none;
}
/* The passage bar rises over it when both show. */
.score-main:has(.input-bar) .score-rangebar:not(.input-bar) {
  bottom: 64px;
}
.input-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--metal);
  color: #251a06;
  font: 700 10.5px/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.input-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8e3b46;
  box-shadow: 0 0 6px rgba(176, 40, 63, 0.8);
  animation: input-caret 1.1s ease-in-out infinite;
}
.input-where {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 92px;
}
.input-staff {
  font: italic 600 14px/1 var(--serif);
  color: var(--champagne);
}
.input-at {
  font: 500 10.5px/1 var(--sans);
  color: var(--muted);
  letter-spacing: 0.04em;
}
/* The key that does it, small under a button's face. */
.input-values .score-value {
  position: relative;
  height: 28px;
  padding-bottom: 6px;
}
.input-key {
  font: 600 8.5px/1 var(--mono);
  color: var(--dim);
  letter-spacing: 0;
}
.input-values .input-key {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
}
.input-values .score-value.on .input-key {
  color: rgba(37, 26, 6, 0.7);
}
.input-bar .btn .input-key {
  margin-left: 6px;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
}
.input-bar .btn.on .input-key {
  color: rgba(37, 26, 6, 0.75);
  border-color: rgba(37, 26, 6, 0.3);
}
.input-lands {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  font: 500 12px/1.2 var(--sans);
  color: var(--text);
}
.input-lands.shared {
  color: var(--gold-hi);
}
.input-lands.warn {
  color: var(--danger);
}
.input-arrow {
  margin-right: 5px;
  color: var(--gold-mid);
}

/* ---------------------------------------------------------------- the keys card */

.input-card {
  position: absolute;
  right: 18px;
  bottom: 72px;
  padding: 14px 16px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(36, 31, 42, 0.97), rgba(18, 16, 22, 0.97));
  border: 1px solid var(--line-3);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.6),
    var(--glow);
  z-index: 5;
  animation: score-rise 0.18s ease-out;
  /* A short pane scrolls it rather than cutting off its top. */
  max-height: calc(100% - 84px);
  max-width: calc(100% - 36px);
  overflow-y: auto;
}
.input-card-title {
  margin-bottom: 10px;
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-mid);
}
.input-card-rows {
  display: grid;
  grid-template-columns: auto auto;
  gap: 5px 14px;
  align-items: baseline;
}
.input-card-key {
  justify-self: end;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.3);
  font: 600 11px/1.2 var(--mono);
  color: var(--gold-hi);
  white-space: nowrap;
}
.input-card-what {
  font: 400 12.5px/1.3 var(--sans);
  color: var(--text);
}
/* A wide pane: two keys to a line, so the card stays short. */
@container (min-width: 900px) {
  .input-card-rows {
    grid-template-columns: auto minmax(0, 260px) auto minmax(0, 260px);
  }
}

.input-mode.on {
  box-shadow: inset 0 0 0 1px var(--line-3);
}

/* The input bar measures the view it is in: a narrow one (a small pane, a phone) keeps the buttons
   and leaves out the readout and the keys under them (the status line says where the caret is). */
.score-main,
.hybrid {
  container-type: inline-size;
}
@container (max-width: 820px) {
  .input-where,
  .input-lands,
  .input-bar .btn .input-key,
  .input-values .input-key {
    display: none;
  }
  .input-values .score-value {
    height: 24px;
    padding-bottom: 0;
  }
  .input-bar {
    gap: 5px;
  }
}

/* A phone: thumb-sized buttons. */
@media (max-width: 760px) {
  .input-bar {
    max-width: calc(100% - 12px);
    gap: 6px;
    padding: 6px;
  }
  .input-bar .btn,
  .input-values .score-value {
    min-height: 34px;
    min-width: 34px;
  }
}

/* The blank page's first tip waits above the input bar. */
.studio.blank .pane-top:has(.input-bar) > .blank-tip {
  bottom: 76px;
}
