/* =========================
   Beatbar v4: line track + floating chord
   ========================= */

#songcontent .lyricsline.has-beatbar{
  padding-top: 46px; /* room for chord ABOVE bar */
}


/* Beatbar container: more vertical room for chord above the line */
#songcontent .tc-beatbar{
  position: absolute;
  left: 0;
  right: 0;

  /* place the bar just above the lyric text */
  top: 18px;

  height: 18px;

  display: grid;
  gap: 10px;
  align-items: center;
  pointer-events: auto;
}


/* Each beat becomes a thin track line */
#songcontent .tc-beat{
  position: relative;

  /* don't center children; we will absolutely position chord */
  display: block;

  /* "track" line dimensions */
  height: 10px;
  border-radius: 999px;

  /* subtle base line */
  background: rgba(0,0,0,.10);

  /* remove old pill look */
  border: 0;
  box-shadow: none;
  overflow: visible;

  /* keep fill var */
  --tc-fill: 0%;
}

/* Yellow fill is the progress line */
#songcontent .tc-beat .tc-fill{
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);

  height: 6px;
  width: var(--tc-fill);
  border-radius: 999px;

  background: linear-gradient(90deg, rgba(255,241,118,.95), rgba(255,238,88,.95));

  /* visible only for active beat */
  opacity: 0;

  transition: width 0.12s linear;
  z-index: 2;
}

#songcontent .tc-beat.is-active .tc-fill{
  opacity: 1;
}

/* Beat number: small, tucked to the left */
#songcontent .tc-beat:before{
  content: attr(data-beat);
  position: absolute;
  left: 0;
  bottom: -2px;
  transform: translateY(100%);

  z-index: 3;
  font-size: 11px;
  font-weight: 900;
  color: rgba(0,0,0,.20);
}

/* Chord floats above line, centered */
#songcontent .tc-beat .tc-chord{
  position: absolute;
  left: 50%;

  /* sits above the bar */
  top: -70px;

  transform: translateX(-50%);
  z-index: 5;

  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  pointer-events: auto;
}


/* Empty beat dot can be hidden or made subtle */
#songcontent .tc-beat .tc-empty{
  display: none;
}

/* Active beat: make track slightly stronger (not a pill) */
#songcontent .tc-beat.is-active{
  background: rgba(255,235,59,.28);
  box-shadow: 0 0 0 2px rgba(255,235,59,.22);
  animation: tcLinePop .18s ease;
}

@keyframes tcLinePop{
  0%{ transform: scaleX(.985); }
  100%{ transform: scaleX(1); }
}

/* NEXT warning: orange pulse on the track line */
#songcontent .tc-beat.is-time-for-next{
  background: rgba(255,156,0,.22);
  box-shadow: 0 0 0 0 rgba(255,156,0,.0);
  animation: tcNextLinePulse .35s ease-in-out infinite;
}

@keyframes tcNextLinePulse{
  0%{
    box-shadow: 0 0 0 0 rgba(255,156,0,.0);
    transform: scaleX(1);
  }
  50%{
    box-shadow: 0 0 0 8px rgba(255,156,0,.18);
    transform: scaleX(1.02);
  }
  100%{
    box-shadow: 0 0 0 0 rgba(255,156,0,.0);
    transform: scaleX(1);
  }
}

/* Optional: make the chord pop when its beat is active */
#songcontent .tc-beat.is-active .tc-chord{
  border-color: rgba(255,235,59,.45);
}

/* Optional: make the chord hint orange when time-for-next */
#songcontent .tc-beat.is-time-for-next .tc-chord{
  border-color: rgba(255,156,0,.35);
  box-shadow: 0 10px 22px rgba(255,156,0,.18);
}

@media (max-width:480px){
  #songcontent .lyricsline.has-beatbar{ padding-top: 42px; }

  #songcontent .tc-beatbar{ top: 16px; height: 16px; gap: 8px; }

  #songcontent .tc-beat{ height: 9px; }
  #songcontent .tc-beat .tc-fill{ height: 5px; }

  #songcontent .tc-beat .tc-chord{
    font-size: 13px;
    padding: 3px 7px;
  }

  #songcontent .tc-beat:before{ font-size: 10px; }
  #songcontent .tc-songmeta{ font-size: 12px; }
}

