/* What only the rhythm coach page needs, on top of style.css. */

.controls { display: flex; flex-direction: column; gap: 10px; }
.tempo { display: flex; gap: 10px; align-items: center; }
.tempo-value {
  width: 96px; height: 44px; padding: 0 6px; text-align: center;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--ink); border-radius: 0;
  font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
  appearance: textfield; -moz-appearance: textfield;
}
.tempo-value::-webkit-outer-spin-button, .tempo-value::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tempo .btn { height: 44px; min-width: 52px; font-family: var(--font-data); }
/* The beat lamp: fills on the beat and fades before the next. */
.lamp { flex: 1; height: 44px; min-width: 44px; border: 1px solid var(--ink); background: var(--sheet); }
.lamp.lit { animation: beat 220ms ease-out; }
@keyframes beat { from { background: var(--yellow); } to { background: var(--sheet); } }
/* The flash is the information, so it stays when other motion is turned off. */
@media (prefers-reduced-motion: reduce) { .lamp.lit { animation: beat 220ms steps(1, end) !important; } }

.tab { min-width: 0; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.box svg { display: block; width: 100%; height: auto; }
#meter { aspect-ratio: auto; }
svg text { font-family: var(--font-data); font-size: 11px; fill: var(--label); }
svg .axis { stroke: var(--rule); stroke-width: 1; }
svg .grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 1 3; }
svg .zero { stroke: var(--ink); stroke-width: 1; }
svg .band { fill: var(--yellow); opacity: 0.13; }
svg .dot { fill: var(--series-a); }
svg .dot.old { opacity: 0.35; }
svg .dot.off { fill: var(--series-b); }
svg .marker { fill: var(--ink); }
svg .bar { fill: var(--series-a); }
svg .end-label { fill: var(--text-2); }

.marker { transition: transform 120ms var(--snap); }
@media (prefers-reduced-motion: reduce) { .marker { transition: none; } }

/* ---- Views ---- */

/* A view's parts are the sheet's own flex items, like .main's. */
.view { display: contents; }
[hidden] { display: none !important; }

/* ---- Stickings ---- */

.field {
  height: 36px; padding: 0 8px; min-width: 0;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--ink); border-radius: 0;
  font-family: var(--font-data); font-size: 13px;
}

/* A picker in the site's own dress: a square button that opens a list. */
.dropdown { position: relative; }
.dropdown-button, .dropdown-option {
  width: 100%; min-height: 40px; padding: 0 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--sheet); color: var(--ink); border-radius: 0;
  font-family: var(--font-ui); font-size: 15px; font-weight: 700; text-align: left; cursor: pointer;
}
.dropdown-button { border: 1px solid var(--ink); box-shadow: var(--btn-shadow); }
.dropdown-button > span:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex: 1; min-width: 0; }
.dropdown-arrow { font-size: 12px; transition: transform 120ms var(--snap); }
.dropdown-button[aria-expanded='true'] .dropdown-arrow { transform: rotate(180deg); }
.dropdown-count { font-family: var(--font-data); font-size: 11px; font-weight: 400; color: var(--label); white-space: nowrap; }
.dropdown-list {
  position: absolute; z-index: 2; top: calc(100% + 4px); left: 0; right: 0;
  border: 1px solid var(--ink); background: var(--sheet); box-shadow: 3px 3px 0 var(--shadow);
}
.dropdown-option { border: 0; border-bottom: 1px solid var(--rule); }
.dropdown-option:last-child { border-bottom: 0; }
.dropdown-option:hover, .dropdown-option:focus-visible { background: var(--head-fill); }
.dropdown-option[aria-selected='true'] { background: var(--ink); color: var(--sheet); }
.dropdown-option[aria-selected='true'] .dropdown-count { color: var(--sheet); }

.st-list { max-height: 264px; overflow-y: auto; }
.st-row {
  grid-template-columns: 36px minmax(0, 1fr) 64px; width: 100%; min-height: 44px; padding: 0;
  background: var(--sheet); color: var(--ink); border-width: 0 0 1px; border-color: var(--rule); border-radius: 0;
  font: inherit; text-align: left; cursor: pointer;
}
.st-row:hover, .st-row[aria-current='true'] { background: var(--head-fill); }
.st-row-name { font-size: 15px; font-weight: 700; }
.st-row .row-meta { letter-spacing: 0.12em; }

.st-own { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.st-own .tabs { min-width: 260px; }
.st-own .tab, .st-own .btn { height: 36px; }
.st-error { font-family: var(--font-data); font-size: 11px; color: var(--red); min-height: 0; }
.st-error:empty { display: none; }
@media (max-width: 599px) {
  .st-own { grid-template-columns: minmax(0, 1fr) auto; }
  .st-own .field { grid-column: 1 / -1; }
  .st-own .tabs { min-width: 0; }
}

.st-bar { padding: 6px 4px; }

/* The bar as music. */
.notation .n-staff { stroke: var(--muted); stroke-width: 1; }
.notation .n-ink { fill: var(--ink); }
.notation .n-time { fill: var(--ink); font-family: var(--font-ui); font-size: 22px; font-weight: 800; }
.notation .n-tuplet { fill: var(--ink); font-family: var(--font-ui); font-size: 13px; font-weight: 700; font-style: italic; }
.notation .n-stem { stroke: var(--ink); stroke-width: 1.4; }
.notation .n-head { fill: var(--ink); }
.notation .n-hand { fill: var(--ink); font-family: var(--font-data); font-weight: 700; }
.notation .n-now { fill: var(--ink); }
.notation .ok { fill: var(--series-a); stroke: var(--series-a); }
.notation .off, .notation .extra, .notation .hand.n-head, .notation .hand.n-stem, .notation text.hand { fill: var(--series-b); stroke: var(--series-b); }
.notation .missed { fill: var(--red); stroke: var(--red); }
.notation text { stroke: none !important; }
.notation .n-head.missed { fill: none; stroke-width: 1.4; stroke-dasharray: 2 2; }

/* The practice popup. */
.popup {
  width: min(720px, calc(100vw - 16px)); max-height: calc(100vh - 16px); padding: 16px 14px;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--ink); border-radius: 0;
  box-shadow: 4px 4px 0 var(--shadow); overflow-y: auto;
}
.popup[open] { display: flex; flex-direction: column; gap: 12px; animation: rise 160ms var(--snap); }
.popup::backdrop { background: rgb(0 0 0 / 0.72); }
.popup-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.popup-title { font-size: 26px; font-weight: 800; font-stretch: 75%; text-transform: uppercase; line-height: 1.1; }
.popup-run { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: stretch; }
.popup-run .stat { border: 1px solid var(--ink); padding-right: 18px; }
.popup-run .lamp { height: auto; }
.popup .st-status { font-size: 15px; }
@media (min-width: 600px) { .popup { padding: 22px 24px; } .popup-title { font-size: 32px; } }

.st-bar-label { font-family: var(--font-data); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label); margin-bottom: 4px; }
.st-cells { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.st-beat { display: flex; gap: 3px; padding-bottom: 4px; border-bottom: 3px solid transparent; }
.st-beat.now { border-bottom-color: var(--ink); }
.st-cell {
  width: 34px; height: 42px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule); color: var(--text-2);
  font-family: var(--font-data); font-size: 20px; font-weight: 700;
}
.st-cells.small .st-cell { width: 24px; height: 28px; font-size: 13px; }
.st-cell.ok { background: var(--series-a); border-color: var(--series-a); color: #000; }
.st-cell.off, .st-cell.extra, .st-cell.hand { background: var(--series-b); border-color: var(--series-b); color: #000; }
.st-cell.missed { border: 1px dashed var(--red); color: var(--red); }
@media (max-width: 599px) {
  .st-cell { width: 26px; height: 36px; font-size: 16px; }
  .st-cells { gap: 6px 8px; }
}

.st-status { font-size: 13px; min-height: 1.4em; }

/* ---- The virtual pad: two big keys, one per hand ---- */

.vpad { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vpad-half {
  height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--head-fill); color: var(--ink); border: 1px solid var(--ink); border-radius: 0;
  box-shadow: var(--btn-shadow); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.vpad-half.down { transform: translate(2px, 2px); box-shadow: none; background: var(--ink); color: var(--sheet); }
.vpad-hand { font-size: 34px; font-weight: 800; font-stretch: 75%; line-height: 1; }
.vpad-key { font-family: var(--font-data); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label); }
.vpad-half.down .vpad-key { color: var(--sheet); }

/* What the view tests, under its tab. */
.intro { font-size: 14px; line-height: 1.45; color: var(--text-2); max-width: 62ch; }
