/* Shared look with the BPM counter tool (same class names); tool CSS only loads on pages that use this tool */
.bc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); }
.bc [hidden] { display: none !important; }
.bc-meter { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 16px 16px 24px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.bc-meter-top { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bc-source { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--muted); }
.bc-click { flex: none; height: 44px; padding: 0 16px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--card); color: var(--ink); font: 600 14px/1 var(--font-body); cursor: pointer; }
.bc-click[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.bc-metro { width: 120px; height: 140px; }
.bc-metro-body { fill: var(--accent); }
.bc-metro-face { fill: var(--card); }
.bc-metro-ticks { stroke: var(--muted); stroke-width: 2; stroke-linecap: round; fill: none; }
.bc-arm { transform-box: view-box; transform-origin: 60px 112px; }
.bc-arm-rod { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.bc-arm-weight { fill: var(--gold); stroke: var(--ink); stroke-width: 2; }
.bc-metro-pivot, .bc-metro-base { fill: var(--ink); }
.is-live .bc-arm { animation: bc-swing var(--beat, .5s) ease-in-out infinite alternate; }
@keyframes bc-swing { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@media (prefers-reduced-motion: reduce) { .is-live .bc-arm { animation: none; } }
.bc-readout { margin: 0; display: flex; align-items: baseline; gap: 8px; line-height: 1.2; }
.bc-num { min-width: 3ch; text-align: center; color: var(--ink); font: 700 48px/1.2 var(--font-head); font-variant-numeric: tabular-nums; }
.bc-unit { color: var(--muted); font: 600 18px/1 var(--font-body); }
.bc-note { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.bc-facts { align-self: stretch; margin: 8px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bc-facts > div { padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.bc-facts dt { font-size: 12px; color: var(--muted); }
.bc-facts dd { margin: 0; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bc-inputs { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bc-pad { flex: 1; min-height: 176px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; border: 0; border-radius: var(--radius); background: var(--accent); color: #fff; font-family: var(--font-body); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; transition: background-color .15s; }
.bc-pad:hover { background: var(--accent-deep); }
.bc-pad:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.bc-pad-main { font: 700 36px/1.2 var(--font-head); }
.bc-pad-sub { font-size: 14px; }
.bc-pad.is-hit { animation: bc-hit .2s ease-out; }
@keyframes bc-hit { from { box-shadow: 0 0 0 0 var(--gold); } to { box-shadow: 0 0 0 12px rgba(224, 160, 58, 0); } }
.bc-tapbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bc-tapinfo { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); }
.bc-btn { height: 44px; padding: 0 16px; border: 1px solid var(--ink); border-radius: var(--radius); background: transparent; color: var(--ink); font: 600 14px/1 var(--font-body); cursor: pointer; }
.bc-btn:hover:not(:disabled) { background: var(--ink); color: var(--card); }
.bc-btn:disabled, .bc-click:disabled { opacity: .5; cursor: not-allowed; }
.bc-btn:focus-visible, .bc-click:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Tap tempo extras: beat lights and metronome settings */
.tt-beats { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 16px; margin: 4px 0 0; padding: 0; }
.tt-beats li { width: 16px; height: 16px; border-radius: 50%; background: var(--line); }
.tt-beats li.is-bar { box-shadow: inset 0 0 0 2px var(--ink); }
.tt-beats li.is-group { box-shadow: inset 0 0 0 2px var(--muted); }
.tt-beats li.is-on { background: var(--accent); }
.tt-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tt-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.tt-field select { height: 44px; padding: 0 12px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--card); color: var(--ink); font: 600 16px/1 var(--font-body); }
.tt-field select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tt-hint { margin: 0; font-size: 14px; color: var(--muted); }

@media (max-width: 760px) {
  .bc { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
  /* Compact reading panel so the tap pad stays on the first screen of a phone */
  .bc-meter { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "top top" "metro read" "metro note" "beats beats" "facts facts"; column-gap: 12px; row-gap: 4px; align-items: center; padding: 12px; }
  .bc-meter-top { grid-area: top; }
  .bc-metro { grid-area: metro; width: 64px; height: 75px; }
  .bc-readout { grid-area: read; }
  .bc-note { grid-area: note; text-align: left; }
  .bc-num { min-width: 0; text-align: left; }
  .tt-beats { grid-area: beats; justify-content: flex-start; display: none; }
  .is-clicking .tt-beats { display: flex; }
  .bc-facts { grid-area: facts; margin-top: 4px; }
  .bc-facts > div { padding: 4px 8px; }
  .bc-click { height: 40px; }
  .bc-pad { min-height: 112px; }
  .bc-pad-main { font-size: 28px; }
}
