/* One LED arc and one authoritative pulse-and-timeline Stage layout. */
.pulse-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.pulse-tools .quiet-button { padding: 8px 11px; font-size: 11px; }
#click-toggle[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; }
.stage-controls, .stage-position { display: none; }
.led-metronome { margin: 8px auto 0; width: 100%; max-width: 880px; }
#led-arc { display: block; width: 100%; height: auto; overflow: visible; }
.led-rail { fill: none; stroke: #59616d; stroke-width: 3; }
.led-dot { stroke: #ffffff70; stroke-width: 1.5; opacity: .5; }
.led-dot.green { fill: #37ff6c; }
.led-dot.amber { fill: #ffd326; }
.led-dot.red { fill: #ff3b40; }
.led-dot.lit { opacity: 1; stroke: #fff; stroke-width: 3; }
.led-dot.trail { opacity: .82; }
.led-traveler { stroke: #fff; stroke-width: 3; }
.led-traveler-halo { opacity: .25; }
.led-beat-number { fill: #fff; font-size: 150px; font-weight: 800; font-variant-numeric: tabular-nums; }
.led-beat-caption { fill: #e8edf5; font-size: 18px; font-weight: 650; letter-spacing: 2px; }
.led-end-label { fill: #37ff6c; font-size: 17px; font-weight: 750; letter-spacing: 1px; }
body[data-visual="led"] .pulse, body[data-visual="led"] .beat-dots, body[data-visual="led"] .sweep { display: none; }
body[data-visual="count"] .led-metronome { display: none; }
.timeline-segment-label { display: none; }

body.stage-view {
  --bg: #000;
  --surface: #000;
  --surface-2: #171717;
  --line: #8c8c8c;
  --text: #fff;
  --muted: #ededed;
  background: #000;
  overflow: hidden;
}
body.stage-view .app { max-width: none; height: 100dvh; padding: 16px; }
body.stage-view main { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 16px; height: 100%; }
body.stage-view .header,
body.stage-view .mode-bar,
body.stage-view .cue-panel,
body.stage-view .transport,
body.stage-view .song-gos,
body.stage-view .settings,
body.stage-view .show-rules,
body.stage-view footer,
body.stage-view .segment-list,
body.stage-view .scrub-label,
body.stage-view #seek { display: none; }
body.stage-view .performance { display: block; min-height: 0; }
body.stage-view .pulse-panel {
  height: 100%; min-height: 0; padding: 24px;
  display: flex; flex-direction: column;
  border: 2px solid #777; border-radius: 12px; background: #000;
  overflow: visible;
}
body.stage-view .pulse-panel:focus { outline: none; }
body.stage-view .song-heading { font-size: clamp(22px, 2.6vw, 42px); gap: 24px; }
body.stage-view .song-heading > #song-name { color: #fff; }
body.stage-view #tempo-readout { font-size: clamp(30px, 4vw, 60px); color: #fff; }
body.stage-view #tempo-readout small { color: #fff; font-size: 18px; }
body.stage-view .pulse-tools { margin: 12px 0 0; align-items: start; gap: 8px; }
body.stage-view .pulse-tools button, body.stage-view .stage-controls summary { background: #000; color: #fff; border: 1px solid #999; border-radius: 7px; padding: 9px 11px; font-size: 12px; }
body.stage-view .stage-controls { display: block; position: relative; }
body.stage-view .stage-controls summary { list-style: none; }
body.stage-view .stage-controls summary::-webkit-details-marker { display: none; }
.stage-control-menu { position: absolute; z-index: 5; top: 44px; right: 0; width: 215px; padding: 12px; background: #080808; border: 2px solid #fff; border-radius: 8px; display: grid; gap: 8px; box-shadow: 0 8px 30px #000; }
.stage-control-menu button { min-height: 44px; font-size: 14px; }
body.stage-view .led-metronome { flex: 1; min-height: 0; max-width: none; display: flex; margin: 8px 0 0; }
body.stage-view #led-arc { width: 100%; height: 100%; overflow: hidden; }
body.stage-view .led-dot { opacity: .7; stroke-width: 2; }
body.stage-view .led-dot.trail { opacity: .88; }
body.stage-view .led-dot.lit { opacity: 1; stroke-width: 3; }
body.stage-view .led-beat-number { font-size: 190px; }
body.stage-view .led-beat-caption { font-size: 21px; fill: #fff; }
body.stage-view .led-end-label { font-size: 20px; }
body.stage-view .pulse-footer { display: none; }
body.stage-view[data-visual="count"] .led-metronome { display: none; }
body.stage-view[data-visual="count"] .pulse { width: min(52dvh, 65vw, 560px); height: min(52dvh, 65vw, 560px); margin: auto; flex-shrink: 1; }
body.stage-view .pulse-core { width: 90%; height: 90%; border: 2px solid #aaa; background: #000; }
body.stage-view #beat-number { font-size: clamp(100px, 36dvh, 360px); color: #fff; }
body.stage-view #beat-caption { color: #fff; font-size: clamp(12px, 1.8vw, 22px); }
body.stage-view .pulse-halo { border: 4px solid #fff; }
body.stage-view .beat-dots { gap: clamp(12px, 1.7vw, 30px); margin: 12px 0; }
body.stage-view .beat-dot { width: 20px; height: 20px; border: 2px solid #aaa; background: #000; }
body.stage-view .beat-dot.active { background: #fff; border-color: #fff; box-shadow: none; }
body.stage-view .sweep { height: 14px; border: 1px solid #999; }
body.stage-view #sweep-head { height: 14px; background: #fff; }
body.stage-view .timeline-section { padding: 0 4px; }
body.stage-view .timeline-heading { margin-bottom: 12px; }
body.stage-view .timeline-heading h2, body.stage-view #progress-caption { display: none; }
body.stage-view .stage-position { display: block; color: #fff; font-size: clamp(18px, 2.4vw, 34px); font-weight: 750; font-variant-numeric: tabular-nums; }
body.stage-view .timeline { height: 62px; border: 2px solid #fff; border-radius: 6px; }
body.stage-view .timeline-segment { background: #303030; border-right: 3px solid #000; display: grid; place-items: center; }
body.stage-view .timeline-segment[data-song="purify"] { background: #a277ff; }
body.stage-view .timeline-segment[data-song="boots"] { background: #ffbd28; }
body.stage-view .timeline-segment[data-song="glorious"] { background: #21e6bc; }
body.stage-view .timeline-segment-label { display: block; color: #fff; font-size: clamp(14px, 1.7vw, 24px); font-weight: 850; }
body.stage-view .timeline-segment:not([data-song="none"]) .timeline-segment-label { color: #000; }
body.stage-view .timeline-cursor { width: 13px; background: #fff; border-left: 3px solid #000; border-right: 3px solid #000; box-shadow: none; }
body.stage-view .timeline-axis { margin: 10px 0 0; font-size: clamp(11px, 1.35vw, 20px); color: #fff; font-weight: 650; }

@media (max-width: 700px) {
  .pulse-tools { justify-content: flex-start; }
  body.stage-view .app { padding: 10px; }
  body.stage-view main { gap: 12px; }
  body.stage-view .pulse-panel { padding: 16px; }
  body.stage-view .song-heading { padding: 0; gap: 12px; font-size: 20px; }
  body.stage-view #tempo-readout { font-size: 30px; }
  body.stage-view #tempo-readout small { font-size: 12px; }
  body.stage-view .pulse-tools { position: static; margin: 12px 0 0; justify-content: flex-end; }
  body.stage-view[data-visual="count"] .pulse { width: min(42dvh, 80vw); height: min(42dvh, 80vw); }
  body.stage-view #beat-number { font-size: min(29dvh, 56vw); }
  body.stage-view .timeline { height: 52px; }
  body.stage-view .timeline-axis { font-size: 9px; }
  body.stage-view .timeline-segment-label { font-size: 11px; }
}
@media (max-height: 520px) and (min-width: 701px) {
  body.stage-view .app { padding: 8px; }
  body.stage-view main { gap: 8px; }
  body.stage-view .pulse-panel { padding: 12px; }
  body.stage-view .song-heading { font-size: 22px; }
  body.stage-view #tempo-readout { font-size: 30px; }
  body.stage-view .timeline { height: 40px; }
  body.stage-view .timeline-heading, body.stage-view .timeline-axis { margin-top: 4px; margin-bottom: 4px; }
  body.stage-view .stage-position { font-size: 20px; }
  body.stage-view .timeline-axis { font-size: 12px; }
  body.stage-view[data-visual="count"] .pulse { width: 42dvh; height: 42dvh; }
  body.stage-view #beat-number { font-size: 29dvh; }
  body.stage-view .beat-dots, body.stage-view .sweep { display: none; }
}

@media (max-width: 700px) and (orientation: portrait) {
  body.stage-view .led-beat-number { font-size: 360px; }
  body.stage-view .led-beat-caption { font-size: 32px; }
}

.show-rules .stage-guide { grid-column: 1 / -1; }
