/* ============================================
   CONTINUOUS SETLIST PLAYER
   - One floating bottom bar that plays every song's primary reference
     recording in setlist order, back to back.
   - Self-contained: removing this file + its JS + the "Play All" button
     leaves the per-song reference player (archive-player.css) untouched.
   ============================================ */

.continuous-player {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(720px, 100%);
  background: #1b1f1b;
  color: #e8efe8;
  border: 1px solid #3a463a;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: none;
  padding: 10px 14px 12px;
  font-family: inherit;
}

.continuous-player.is-open {
  display: block;
}

.continuous-player__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* Collapse toggle on the header row. Pushed to the far right. */
.continuous-player__collapse {
  margin-left: auto;
  appearance: none;
  border: 1px solid #3a463a;
  background: #2a322a;
  color: #e8efe8;
  width: 30px;
  height: 26px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.continuous-player__collapse:hover {
  background: #344034;
}

/* Collapsed: hide the media element and the control buttons, keep just the
   slim title strip so you still see what's playing. Playback continues. */
.continuous-player.is-collapsed {
  padding-bottom: 8px;
}
.continuous-player.is-collapsed .continuous-player__media,
.continuous-player.is-collapsed .continuous-player__controls {
  display: none;
}
.continuous-player.is-collapsed .continuous-player__row {
  margin-bottom: 0;
}

.continuous-player__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: #9bbf9b;
  background: rgba(107, 138, 107, 0.18);
  padding: 2px 8px;
  border-radius: 4px;
}

.continuous-player__title {
  font-weight: 600;
  font-size: 15px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continuous-player__note {
  font-size: 12px;
  color: #c9a14a;
  white-space: nowrap;
}

.continuous-player__media {
  margin-bottom: 8px;
}

.continuous-player__audio {
  width: 100%;
  display: block;
}

.continuous-player__iframe {
  width: 100%;
  border-radius: 6px;
  background: #000;
}

/* YouTube IFrame API host. Collapsed to an audio-style strip so it plays
   inline (no bounce to the YouTube site on mobile) but reads as an audio
   player, not a video. */
.continuous-player__yt {
  width: 100%;
  position: relative;
}
.continuous-player__yt-host,
.continuous-player__yt-host iframe {
  width: 100%;
  height: 80px;
  border-radius: 6px;
}
/* Transparent shield over the YouTube embed: blocks all taps from reaching
   YouTube's surface (logo / title / links that bounce to the YT app on
   mobile). Playback is driven entirely by our bar buttons via the API. */
.continuous-player__yt-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  background: transparent;
  cursor: default;
}

.continuous-player__controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.continuous-player__btn {
  appearance: none;
  border: 1px solid #3a463a;
  background: #2a322a;
  color: #e8efe8;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.continuous-player__btn:hover {
  background: #344034;
}

.continuous-player__btn.cp-close {
  margin-left: auto;
}

.continuous-player__btn.cp-scroll.is-on {
  background: #6b8a6b;
  color: #fff;
  border-color: #6b8a6b;
}

.continuous-player__btn.cp-crawl.is-on {
  background: #b5762e;
  color: #fff;
  border-color: #b5762e;
}

/* Highlight the song currently playing so the eye matches the audio.
   scroll-margin-top keeps the song clear of sticky chrome on auto-scroll. */
.setlist-song-wrapper.continuous-now-playing {
  outline: 3px solid #6b8a6b;
  outline-offset: 4px;
  border-radius: 6px;
  scroll-margin-top: 24px;
}

/* Mobile: full-width bar, no centering math. */
@media (max-width: 600px) {
  .continuous-player {
    left: 0;
    transform: none;
    width: 100%;
    border-radius: 0;
  }
  .continuous-player__controls {
    justify-content: space-between;
  }
}

/* ── Tap-to-sync calibration ───────────────────────────────────────────────
   The Sync button lives in the player bar; the panel is a fixed card the
   musician taps against while the reference plays. Matches the player chrome. */
.continuous-player__btn.cp-sync.is-on { background:#d9c48a; color:#16130d; }

.cp-sync-panel {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 10001;
  width: min(440px, calc(100% - 24px));
  background: #16130d;
  border: 1px solid rgba(217, 196, 138, 0.4);
  border-radius: 10px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
  padding: 16px 18px;
  text-align: center;
  color: #f1ead8;
  font-family: inherit;
}
.cp-sync-msg { font-size: 14px; line-height: 1.45; color: rgba(241, 234, 216, 0.85); }
.cp-sync-msg b { color: #d9c48a; }
.cp-sync-count {
  margin: 12px 0;
  font-size: 26px;
  font-weight: 600;
  color: #f1ead8;
  font-variant-numeric: tabular-nums;
}
.cp-sync-actions { display: flex; gap: 10px; justify-content: center; }
.cp-sync-actions button {
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  border-radius: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
}
.cp-sync-tap { flex: 1; background: #d9c48a; color: #16130d; font-weight: 600; }
.cp-sync-tap:hover { background: #e8d49a; }
.cp-sync-save { background: #6aa377; color: #0f140f; font-weight: 600; }
.cp-sync-save:hover { background: #7bb588; }
.cp-sync-cancel { background: transparent; color: rgba(241,234,216,0.75); border-color: rgba(255,255,255,0.25); }
.cp-sync-cancel:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

/* Compact ▲/▼ alignment nudges in the player bar */
.continuous-player__btn.cp-nudge-up,
.continuous-player__btn.cp-nudge-down { padding-left: 10px; padding-right: 10px; font-size: 13px; }

/* ── Crawl position slider (vertical, right edge) ──────────────────────────
   Maps top-of-page → bottom-of-page. The thumb rides along as the crawl
   scrolls; grab it to re-align (pauses the crawl, resumes from the new spot). */
.cp-crawl-slider {
  position: fixed;
  top: 84px;
  bottom: 150px;
  right: 8px;
  width: 22px;
  z-index: 10000;
  border-radius: 11px;
  background: rgba(220, 40, 40, 0.85); /* DEPLOY-TEST MARKER: bright red = new file is live */
  border: 2px solid #ff3030;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  touch-action: none;            /* we handle the drag ourselves */
  cursor: pointer;
}
.cp-crawl-slider.is-grabbed { background: rgba(22, 19, 13, 0.8); border-color: rgba(217, 196, 138, 0.7); }
.cp-crawl-thumb {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #d9c48a;
  border: 2px solid #16130d;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;          /* the track owns the pointer events */
}
.cp-crawl-slider.is-grabbed .cp-crawl-thumb { background: #f1d99a; }
