/* v6: floating singing trail and a dynamic pitch target; reserved lyric space. */
.sing-score[hidden], #sing-feedback[hidden], #sing-trail[hidden], #sing-points[hidden], #sing-party[hidden] { display:none !important; }
.sing-score {
  position: absolute; z-index: 800; left:50%; bottom:clamp(88px,10vh,148px);
  transform: translateX(-50%); pointer-events:none;
  display:flex; align-items:center; justify-content:center; gap:7px;
  padding:0; background:none; border:0; box-shadow:none;
  width:clamp(186px,19vw,295px); height:clamp(43px,4.5vw,72px);
}
.sing-trail { width: 80%; flex:0 0 80%; height:100%; display:block; }
/* The fixed MIDI piano roll remains at its original double-height position. */
.sing-score[data-plot-mode="midi80"]:not(.sing-score-final) {
  height:clamp(86px,9vw,144px);
}
/* Raise the compact graphs by half their height so their vertical centres
   align with MIDI's original centre. The full MIDI layout does not move. */
.sing-score[data-plot-mode="seven"]:not(.sing-score-final),
.sing-score[data-plot-mode="five"]:not(.sing-score-final) {
  bottom:calc(clamp(88px,10vh,148px) + clamp(21.5px,2.25vw,36px));
}
#sing-points { position:absolute; right:0; width:18%; text-align:right; white-space:nowrap; color:#ffe4a5; text-shadow:0 0 6px rgba(255,181,64,.6), 0 0 18px rgba(255,175,70,.35);
  font:800 clamp(16px,1.25vw,24px) system-ui,sans-serif; font-variant-numeric:tabular-nums;
  letter-spacing:.3px; }
/* Full MIDI's lyric clearance is the anchor for 5/7/MIDI. */
#screen[data-mode="karaoke"][data-singing="true"] .lyrics {
  bottom:clamp(250px,31vh,385px);
}
.sing-score-final {width:auto;height:auto;max-width:38vw;padding:7px 13px;border-radius:99px;
  white-space:nowrap;background:rgba(10,15,25,.82);border:1px solid rgba(255,255,255,.16);
  color:#fff;font:600 clamp(15px,1.2vw,21px) system-ui,sans-serif;}
@media (max-width:800px) { .sing-score-final {max-width:75vw;} }

/* TV scoreboard: scores are individual, never a blended song percentage. */
.sing-score.sing-score-party { width:clamp(410px,42vw,760px); height:clamp(76px,7vw,118px); gap:12px; }
.sing-score-party .sing-trail {flex:0 0 61%; width:61%;}
#sing-party {flex:1; min-width:0; align-self:center; display:grid; gap:2px;
  font:700 clamp(14px,1.05vw,21px) system-ui,sans-serif; font-variant-numeric:tabular-nums;
  white-space:nowrap; text-align:right; text-shadow:0 1px 7px #10151b;}
.sing-party-row {opacity:.75;}
.sing-party-row.active {opacity:1; font-weight:900;}
.sing-score-party.sing-score-final {height:auto; width:clamp(360px,37vw,710px);
  max-width:75vw; border-radius:16px; padding:14px 20px;}
.sing-score-party.sing-score-final #sing-party {font-size:clamp(15px,1.3vw,25px); text-align:left;}
.sing-score-party.sing-score-final #sing-feedback {display:block; font-size:clamp(13px,1vw,19px);}
/* Optional karaoke large-type presentation: current line dominates,
   only adjacent context remains and the score retains its reserved lane. */
#screen[data-mode="karaoke"][data-karaoke-large="true"] .context-far { display:none; }
#screen[data-mode="karaoke"][data-karaoke-large="true"] .current {
  font-size:clamp(56px,6.3vw,122px); line-height:1.11;
}
#screen[data-mode="karaoke"][data-karaoke-large="true"] .context {
  font-size:clamp(23px,1.9vw,38px); opacity:.66;
}
#screen[data-mode="karaoke"][data-karaoke-large="true"] .lyrics { gap:clamp(10px,1.6vh,21px); }

/* Plain (untimed) lyrics are valid lyrics. Do not overlay a missing-sync badge. */
#screen .unsynced-indicator { display: none !important; }
/* The third karaoke size is designed for tablets and distant living-room TVs. */
#screen[data-mode="karaoke"][data-karaoke-size="2"] .context,
#screen[data-mode="karaoke"][data-karaoke-size="2"] .context-far { display:none; }
#screen[data-mode="karaoke"][data-karaoke-size="2"] .current {
  font-size:clamp(68px,8.3vw,154px);line-height:1.08;
}
#screen[data-mode="karaoke"][data-karaoke-size="2"][data-lyrics-timed="false"] .unsynced-scroll-document {
  font-size:clamp(43px,4.5vw,83px);line-height:1.4;
}
#screen[data-mode="karaoke"][data-karaoke-size="1"][data-lyrics-timed="false"] .unsynced-scroll-document {
  font-size:clamp(35px,3.5vw,65px);
}

/* Sing Along: one preceding cue and up to two upcoming cues. Keep
   normal karaoke and manual/full lyrics layouts unchanged. */
#screen[data-mode="karaoke"][data-singing="true"] #previous-line-2 { display:none !important; }
/* Extra large lyrics reserve the space for the score and live voice trace. */
#screen[data-mode="karaoke"][data-singing="true"][data-karaoke-size="2"] #next-line-2 { display:none !important; }
/* Even at XL, keep one neighbouring cue on each side while singing. */
#screen[data-mode="karaoke"][data-singing="true"][data-karaoke-size="2"] #previous-line,
#screen[data-mode="karaoke"][data-singing="true"][data-karaoke-size="2"] #next-line {
  display:block !important; font-size:clamp(20px,1.9vw,35px);
}

/* A singer needs the next line even in extra-large karaoke text.
   The big cover stays in the mini-player; the TV header thumbnail is small. */
#screen[data-mode="karaoke"][data-karaoke-size="2"] #next-line {
  display:block; font-size:clamp(20px,1.9vw,35px); opacity:.72;
}
