/* style-lyrics.css — 歌詞表示(JSは player-lyrics.js)。Textパネルの行一覧/タップ打ちと、シークバー下の現在行(#pcV2Lyrics)。色はトークンのみ */

/* ---- シークバー下 ---- */
/* 行は絶対配置の5本(out/prev/cur/next/in)。役割(data-r)が変わると、位置・大きさ・濃さがtransitionで動き、歌詞が上へ送られていく。JSは役割を回すだけ(player-lyrics.js) */
#pcV2Lyrics {
  --lyd-cur: clamp(16px, 2.2vw, 22px); --lyd-sm: var(--lyd-cur); /* 文字サイズは前後の行も同じ(現在行は太さと色で区別) */ --lyd-gap: 2px;
  --lyd-sm-h: calc(var(--lyd-sm) * 1.35); --lyd-cur-h: calc(var(--lyd-cur) * 1.35); --lyd-prev-h: var(--lyd-sm-h);
  --lyd-y-prev: 0px;
  --lyd-y-cur: calc(var(--lyd-prev-h) + var(--lyd-gap));
  --lyd-y-next: calc(var(--lyd-y-cur) + var(--lyd-cur-h) + var(--lyd-gap));
  --lyd-ease: cubic-bezier(0.22, 0.9, 0.3, 1);
  flex: 0 0 auto; position: relative; box-sizing: content-box;
  height: calc(var(--lyd-prev-h) + var(--lyd-cur-h) + var(--lyd-sm-h) + var(--lyd-gap) * 2);
  padding: 6px 4px 2px; text-align: center; overflow: hidden; pointer-events: none;
}
#pcV2Lyrics[hidden] { display: none; }
.qn-lyd-line {
  position: absolute; left: 32px; right: 32px; top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35;
  font-size: var(--lyd-sm); font-weight: 400; color: var(--icon-muted); opacity: 0;
  transform: translateY(var(--lyd-y-prev)); will-change: transform, opacity;
  transition: transform 0.45s var(--lyd-ease), opacity 0.35s ease, font-size 0.45s var(--lyd-ease), color 0.35s ease;
}
.qn-lyd-line.is-jump { transition: none; }
.qn-lyd-line[data-r="out"] { opacity: 0; transform: translateY(calc(var(--lyd-y-prev) - var(--lyd-sm-h))); }
.qn-lyd-line[data-r="prev"] { opacity: 0.75; transform: translateY(var(--lyd-y-prev)); }
.qn-lyd-line[data-r="cur"] { opacity: 1; font-size: var(--lyd-cur); font-weight: 700; color: var(--text-bright); transform: translateY(var(--lyd-y-cur)); }
.qn-lyd-line[data-r="next"] { opacity: 0.75; transform: translateY(var(--lyd-y-next)); }
.qn-lyd-line[data-r="in"] { opacity: 0; transform: translateY(calc(var(--lyd-y-next) + var(--lyd-sm-h))); }
#pcV2Lyrics.is-pre .qn-lyd-line[data-r="next"] { opacity: 0.55; }
@media (max-width: 900px) {
  /* 狭い幅は現在行+次の行だけ(前の行は高さを取らず、上へ消える) */
  #pcV2Lyrics { --lyd-prev-h: 0px; }
  .qn-lyd-line[data-r="prev"] { opacity: 0; }
  #pcV2Lyrics { --lyd-cur: 16px; }
}
/* 広い表示: 波形と1:1。全行を同じ大きさで並べ、現在行を中央へ */
.qn-lyd-exp { position: absolute; top: 4px; right: 2px; z-index: 2; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--icon-muted); cursor: pointer; pointer-events: auto; }
@media (hover: hover) { .qn-lyd-exp:hover { background: var(--bg-hover-subtle); color: var(--text-bright); } }
.qn-lyd-wide { display: none; }
#pcV2Lyrics.is-wide { flex: 1 1 0; min-height: 0; height: auto; display: flex; flex-direction: column; margin-top: 8px; border-top: 1px solid var(--border-subtle, rgba(var(--ov), 0.08)); }
#pcV2Lyrics.is-wide[hidden] { display: none; }
#pcV2Lyrics.is-wide .qn-lyd-line { display: none; }
#pcV2Lyrics.is-wide .qn-lyd-wide {
  display: block; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 32px; pointer-events: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
}
#pcV2Lyrics.is-wide .qn-lyd-wide::-webkit-scrollbar { display: none; }
.qn-lyd-row { font-size: var(--lyd-cur); line-height: 1.5; padding: 4px 0; color: var(--icon-muted); opacity: 0.7; cursor: pointer; overflow-wrap: anywhere; transition: color 0.35s ease, opacity 0.35s ease; }
.qn-lyd-row.is-untimed { cursor: default; opacity: 0.45; }
.qn-lyd-row.is-cur { color: var(--text-bright); font-weight: 700; opacity: 1; }
@media (prefers-reduced-motion: reduce) { :root:not([data-qn-motion="on"]) .qn-lyd-row { transition: none; } }
@media (prefers-reduced-motion: reduce) { :root:not([data-qn-motion="on"]) .qn-lyd-line { transition: none; } }

/* ---- Textパネル ---- */
#qnLyBox { display: none; flex-direction: column; flex: 1; min-height: 0; gap: 8px; }
.qn-ly-view #qnLyBox { display: flex; }
.qn-ly-view .note-textarea { display: none; }
.qn-ly-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 2px; }
.qn-ly-switch { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: var(--fs-small); color: var(--icon-muted); cursor: pointer; }
.qn-ly-switch input { accent-color: var(--accent-primary); }
.qn-ly-btn {
  height: 30px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: none;
  color: var(--text-bright); font: inherit; font-size: var(--fs-small); cursor: pointer;
}
.qn-ly-btn:active { background: var(--bg-hover-subtle); }
.qn-ly-btn.is-on { background: var(--accent-primary); border-color: transparent; color: #fff; }
#qnLyList { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 96px; }
.qn-ly-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 8px; border-radius: 8px; line-height: 1.45; color: var(--text-bright); cursor: pointer; }
.qn-ly-row.is-plain { color: var(--icon-muted); cursor: default; }
.qn-ly-row.is-blank { padding: 0; min-height: 10px; }
.qn-ly-t { flex: none; width: 3.4em; text-align: right; font-variant-numeric: tabular-nums; font-size: var(--fs-small); color: var(--icon-muted); }
.qn-ly-row.is-timed .qn-ly-t { color: var(--accent-primary); }
.qn-ly-s { min-width: 0; overflow-wrap: anywhere; }
.qn-ly-row.is-ptr { background: var(--bg-hover-subtle); box-shadow: inset 3px 0 0 var(--accent-primary); }
.qn-ly-empty { padding: 24px 8px; color: var(--icon-muted); font-size: var(--fs-small); }
.qn-ly-tapbar { position: absolute; left: 16px; right: 150px; bottom: 20px; display: flex; gap: 10px; z-index: 6; }
.qn-ly-tapbar[hidden] { display: none; }
.qn-ly-tap {
  flex: 1; height: 52px; border-radius: var(--radius-pill); border: 0; background: var(--accent-primary); color: #fff;
  font: inherit; font-size: var(--fs-heading); font-weight: 700; cursor: pointer;
}
.qn-ly-tap:active { filter: brightness(0.85); }
.qn-ly-undo { height: 52px; padding: 0 20px; background: var(--bg-16161b); }
