/* 곡 상세 — 데스크톱: 왼쪽 영상·컨트롤 / 오른쪽 콜 시트, 모바일: 영상 위 고정 + 시트 + 하단 컨트롤 */

.song { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-md); overflow: hidden; }
.video > div, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

.meta { padding: 16px 0 8px; }
@media (min-width: 960px) { .player-wrap .lane { margin: 16px 0; } .stage { display: flex; flex-direction: column; } .player-wrap { order: 0; } }
.meta p { margin: 4px 0 0; }
.note-more a { color: var(--accent); font-weight: 600; font-size: 14px; }
.share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.share a.chip { text-decoration: none; }

/* ---- 다가오는 콜 레인 ---- */
.lane {
  position: relative; height: 48px; margin: 8px 0 16px; overflow: hidden;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.lane .hit { position: absolute; left: 48px; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.lane .notes { position: absolute; inset: 0; }
.note-dot {
  position: absolute; left: 0; top: 50%; display: flex; align-items: center; gap: 6px;
  transform: translate(-6px, -50%); white-space: nowrap; will-change: transform;
  font-size: 13px; font-weight: 600; color: var(--text-2);
}
.note-dot::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); flex: none; }
.note-dot.soon { color: var(--text); }
.note-dot.soon::before { background: var(--accent); }
.note-dot.past { opacity: .35; }

/* ---- 컨트롤 ---- */
.controls { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding-bottom: 16px; }
.ctl { display: flex; align-items: center; gap: 8px; }
.icon-btn.small { width: 28px; height: 28px; margin-right: -6px; }
.loop-status .chip { background: var(--accent-weak); color: var(--accent); border-color: transparent; }
.hint { width: 100%; margin: 0; font-size: 12px; }

/* ---- 콜 시트 ---- */
.sheet { padding-bottom: 96px; }
.sec { padding: 8px 0 16px; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: center; gap: 4px; min-height: 48px; }
.sec-title { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text-2); margin: 0; }
.sec-time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; margin-left: 8px; }
.sec-head .spacer { flex: 1; }

.lines { list-style: none; margin: 0; padding: 0; }
.line-btn {
  display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 8px 12px; margin: 0 -12px; border-radius: var(--r-sm); width: calc(100% + 24px);
  font-size: 22px; line-height: 30px; font-weight: 700; color: var(--text);
  transition: color .2s var(--ease), opacity .2s var(--ease);
}
.line-btn:hover { background: var(--surface); }
.w { display: inline-flex; flex-direction: column; vertical-align: top; margin: 0 .3em 2px 0; }
.w .ko { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--text-3); }
body.no-ko .w .ko { display: none; }

/* 상태: 지나간 줄은 흐리게, 현재 줄은 강조, 현재 줄의 단어는 불러진 만큼 강조 */
.line.past .line-btn { opacity: .4; }
.line.now .line-btn { color: var(--text-3); }
.line.now .w.sung { color: var(--accent); }
.line.now .w.sung .ko { color: var(--accent); opacity: .8; }

.sheet-end { font-size: 12px; padding: 16px 0; margin: 0; }

.to-now {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 30;
  background: var(--text); color: var(--bg); border-color: var(--text); border-radius: 20px;
}
.to-now:hover { background: var(--text); opacity: .9; }

/* ---- 설명 패널 (Genius) ---- */
.note {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 0; background: var(--bg); color: var(--text);
  width: min(420px, calc(100vw - 32px)); max-height: 80vh;
}
.note::backdrop { background: #0006; }
.note-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); }
.note-body { padding: 16px 20px 20px; overflow: auto; }
.note-body h3 { font-size: 16px; line-height: 24px; margin: 0 0 4px; }
.note-body p { margin: 0 0 16px; color: var(--text-2); font-size: 15px; line-height: 24px; }

/* ---- 콜 제보 폼 ---- */
.fb-label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 8px; padding: 0; }
.fb-input {
  display: block; width: 100%; box-sizing: border-box; margin: 0 0 16px; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line); border-radius: var(--r-sm, 8px); background: var(--bg); color: var(--text); font: inherit; font-size: 16px;
}
textarea.fb-input { resize: vertical; line-height: 1.5; }
.fb-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fb-kinds { border: 0; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fb-kinds legend { margin-bottom: 8px; }
.fb-kinds .chip { cursor: pointer; }
.fb-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.fb-kinds .chip:has(input:checked) { background: var(--accent-weak); border-color: transparent; color: var(--accent); }
.fb-kinds .chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.note-body p.fb-privacy { font-size: 13px; line-height: 20px; margin: -8px 0 16px; }
.fb-note { margin: -8px 0 16px; }
.note-body .fb-note p { font-size: 13px; line-height: 20px; margin: 0; color: var(--text-3); }
.fb-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fb-status { font-size: 14px; color: var(--text-2); }

/* ---- 데스크톱: 2단 ---- */
@media (min-width: 960px) {
  .song { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; padding-top: 24px; }
  .stage { position: sticky; top: 80px; align-self: start; }
  .sheet { max-height: calc(100vh - 80px); overflow: auto; padding-right: 8px; scrollbar-gutter: stable; }
  .note { margin-right: 24px; }
}

/* ---- 모바일: 영상 고정 + 하단 컨트롤 바 ---- */
@media (max-width: 959px) {
  /* 영상과 레인을 함께 상단 고정 (시트를 스크롤해도 다가오는 콜이 보이게) */
  .player-wrap { position: sticky; top: 56px; z-index: 10; background: var(--bg); margin: 0 calc(var(--gutter) * -1); }
  .player-wrap .video { border-radius: 0; }
  .player-wrap .lane { margin: 0; }
  .controls {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--bg);
    border-top: 1px solid var(--line); padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
    gap: 8px 16px;
  }
  .controls .label { display: none; }
  .segmented button { min-width: 48px; padding: 0 10px; }
  .sheet { padding-bottom: 160px; }
  .to-now { bottom: 132px; }
  .line-btn { font-size: 20px; line-height: 28px; }
  .note { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: var(--r-md) var(--r-md) 0 0; }
  .site-footer { padding-bottom: 140px; }
}
.w .ko:empty { display: none; }

/* ---- 지금 외칠 콜: 콜 순간 작게 시작해 커지며 튀어나오고 1초 뒤 사라짐 ---- */
.callout {
  height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; overflow: hidden; border-bottom: 1px solid var(--line);
}
.callout-jp { font-size: 40px; line-height: 48px; font-weight: 800; color: var(--accent); letter-spacing: -.01em; white-space: nowrap; }
.callout-ko { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text-2); min-height: 20px; }
body.no-ko .callout-ko { visibility: hidden; }
/* 멤버 이름 콜: 멤버 색 그대로. 흰 배경에서 안 보이는 색(노랑·흰색)만 groups.json의 onLight 색을 쓴다 */
.mc { --mc-fg: var(--mc-light, var(--mc)); }
@media (prefers-color-scheme: dark) { .mc { --mc-fg: var(--mc); } }
.callout.mc .callout-jp { color: var(--mc-fg); }
.line.now .w.mc.sung, .line.now .w.mc.sung .ko { color: var(--mc-fg); }
.w.mc .jp { text-decoration: underline 2px var(--mc); text-underline-offset: 4px; }
.note-dot.mc::before, .note-dot.mc.soon::before { background: var(--mc); }
.callout.pop .callout-jp { animation: callout-grow .32s cubic-bezier(.2, .9, .3, 1.2); }
.callout.pop .callout-ko { animation: callout-fade .32s ease-out; }
@keyframes callout-grow {
  0% { transform: scale(.55); opacity: .2; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes callout-fade { from { opacity: 0; } to { opacity: 1; } }
.callout.fade .callout-jp, .callout.fade .callout-ko { opacity: 0; transition: opacity .25s ease-out; }
@media (min-width: 960px) { .player-wrap .lane { margin-bottom: 0; } }
@media (max-width: 959px) {
  .callout { height: 72px; }
  .callout-jp { font-size: 30px; line-height: 38px; }
  .callout-ko { font-size: 12px; line-height: 16px; min-height: 16px; }
}

/* 박자선: 태고의 달인 마디선처럼 노트와 함께 흘러감 */
.lane .beats { position: absolute; inset: 0; }
.beat-line { position: absolute; left: 0; top: 10px; bottom: 10px; width: 1px; background: var(--line); will-change: transform; }

/* 싱크 조정 */
.sync-row { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; }
.sync-out { min-width: 80px; text-align: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
