/*
 * 예배 프로젝트 리모트(조종) 화면.
 *
 * 악보 앱 안에 오버레이로 뜨기도 하고 project.php에서 전체 화면으로 뜨기도 한다.
 * 앱은 Tailwind를 쓰므로 .item, .btn 같은 흔한 이름이 새어 나가면 안 된다.
 * 모든 선택자를 .ccm-remote 아래에 둔다.
 */
.ccm-remote{
  --ground:#0B1020; --surface:#141A2E; --surface-2:#1B2338; --surface-3:#232C45;
  --line:rgba(255,255,255,.10);
  --ink:#EEF1F8; --ink-2:#AEB7CC; --muted:#7F8AA3;
  --accent:#E5A54B; --accent-soft:rgba(229,165,75,.14); --accent-line:rgba(229,165,75,.42);
  --live:#4ADE80; --live-soft:rgba(74,222,128,.14); --live-line:rgba(74,222,128,.45);
  --stop:#F0857A; --stop-soft:rgba(240,133,122,.14);
  --chord:#8FC7FF;

  position:fixed; inset:0; z-index:9000;
  display:flex; flex-direction:column;
  background:var(--ground); color:var(--ink);
  font-family:'Pretendard Variable',Pretendard,-apple-system,BlinkMacSystemFont,
    'Apple SD Gothic Neo','Noto Sans KR','Malgun Gothic',system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
}
.ccm-remote[hidden]{display:none}
.ccm-remote *{box-sizing:border-box}
.ccm-remote button{font-family:inherit}

.ccm-remote .topbar{
  display:flex; align-items:center; gap:12px; padding:12px 16px;
  border-bottom:1px solid var(--line); background:var(--surface-2); flex:none;
}
.ccm-remote .back{
  width:34px; height:34px; border-radius:9px; display:grid; place-items:center;
  background:var(--surface-3); border:1px solid var(--line); color:var(--ink-2);
  text-decoration:none; font-size:15px; flex:none; cursor:pointer;
}
.ccm-remote .ttl{
  font-size:15px; font-weight:800; letter-spacing:-.02em; flex:1;
  min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.ccm-remote .chip{
  font-size:10.5px; font-weight:800; letter-spacing:.14em; text-transform:uppercase;
  padding:5px 10px; border-radius:999px; flex:none;
  background:var(--live-soft); color:var(--live); border:1px solid var(--live-line);
}
.ccm-remote .chip.wait{background:var(--accent-soft); color:var(--accent); border-color:var(--accent-line)}

.ccm-remote .body{flex:1; display:grid; grid-template-columns:224px 1fr; min-height:0}
@media (max-width:820px){
  .ccm-remote .body{grid-template-columns:1fr}
  .ccm-remote .rail{display:none}
}

.ccm-remote .rail{border-right:1px solid var(--line); background:var(--surface-2); overflow:auto; padding:8px}
.ccm-remote .railhead{
  font-size:10px; font-weight:800; letter-spacing:.18em; text-transform:uppercase;
  color:var(--muted); padding:6px 8px 10px;
}
.ccm-remote .item{
  display:flex; align-items:center; gap:9px; padding:9px 10px; border-radius:9px;
  border:1px solid transparent; cursor:pointer; margin-bottom:4px;
}
.ccm-remote .item:hover{background:var(--surface-3)}
.ccm-remote .item.live{
  background:var(--live-soft); border-color:var(--live-line);
  box-shadow:0 0 0 1px var(--live-line), 0 4px 16px -6px rgba(74,222,128,.5);
}
.ccm-remote .item .ico{
  width:22px; height:22px; border-radius:6px; flex:none; display:grid; place-items:center;
  font-size:10px; font-weight:800; background:var(--surface-3); color:var(--ink-2);
}
.ccm-remote .item.live .ico{background:var(--live); color:#06240F}
.ccm-remote .item .nm{
  font-size:13.5px; font-weight:600; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.ccm-remote .item .ky{
  font-size:10.5px; font-weight:800; color:var(--accent); flex:none;
  background:var(--accent-soft); border:1px solid var(--accent-line); border-radius:6px; padding:1px 6px;
}
.ccm-remote .empty{padding:22px 10px; text-align:center; color:var(--muted); font-size:13px; line-height:1.7}

.ccm-remote .main{display:flex; flex-direction:column; min-width:0; min-height:0}
.ccm-remote .nowbar{
  display:flex; align-items:center; gap:10px; padding:11px 14px;
  border-bottom:1px solid var(--line); background:var(--surface-2); flex:none;
}
.ccm-remote .nowbar .lbl{
  font-size:9.5px; font-weight:800; letter-spacing:.18em; text-transform:uppercase;
  color:var(--muted); flex:none;
}
.ccm-remote .nowname{
  font-size:14px; font-weight:800; letter-spacing:-.02em; flex:1; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.ccm-remote .nowname.none{color:var(--muted); font-weight:600}
.ccm-remote .outlink{
  display:inline-flex; align-items:center; gap:7px; padding:8px 11px; border-radius:9px;
  background:var(--surface-3); border:1px solid var(--line); color:var(--ink-2);
  font-size:12px; font-weight:700; cursor:pointer; text-decoration:none; flex:none;
}

.ccm-remote .preview{
  flex:1; min-height:0; overflow:hidden; position:relative;
  background:#05070E; margin:14px; border-radius:14px; border:1px solid var(--line);
}
/* 손가락·마우스로 직접 밀어 위치를 잡을 수 있어야 한다.
   touch-action:pan-y로 세로 스크롤만 브라우저에 넘긴다. */
.ccm-remote .preview .inner{
  height:100%; overflow-y:auto; overflow-x:hidden;
  -webkit-overflow-scrolling:touch; touch-action:pan-y;
  scrollbar-width:none; overscroll-behavior:contain; outline:none;
}
.ccm-remote .preview .inner::-webkit-scrollbar{display:none}
.ccm-remote .preview .pad{
  padding:0 8%; text-align:center; line-height:1.5;
  font-size:22px; font-weight:700; letter-spacing:-.02em;
}
.ccm-remote .preview.black .pad{visibility:hidden}
.ccm-remote .preview .blackmark{
  position:absolute; inset:0; display:none; place-items:center;
  font-size:11px; font-weight:800; letter-spacing:.3em; color:rgba(255,255,255,.22);
}
.ccm-remote .preview.black .blackmark{display:grid}
/* 이 선에 걸린 줄이 회중 화면 맨 위에 보인다.
   높이는 lyrics_render.js의 ANCHOR와 같아야 하며 JS가 직접 넣는다. */
.ccm-remote .preview .marker{
  position:absolute; left:0; right:0; top:8%; height:1px; pointer-events:none;
  background:linear-gradient(to right, transparent, var(--accent-line) 12%, var(--accent-line) 88%, transparent);
}
.ccm-remote .preview .marker::after{
  content:'TV 맨 위'; position:absolute; right:10px; top:-15px;
  font-size:8.5px; font-weight:800; letter-spacing:.14em; color:var(--accent); opacity:.75;
}

.ccm-remote .chord-lyrics-line,
.ccm-remote .chord-lyrics-plain,
.ccm-remote .chord-lyrics-empty{
  display:flex; flex-wrap:wrap; justify-content:center; align-items:flex-end;
  margin:.12em 0; min-height:1em;
}
.ccm-remote .chord-lyrics-plain{display:block}
.ccm-remote .chord-lyrics-segment{display:inline-flex; flex-direction:column; align-items:flex-start}
.ccm-remote .chord-lyrics-text{white-space:pre}
.ccm-remote .chord-lyrics-code{
  display:block; font-size:14px; font-weight:800; line-height:1.2;
  color:var(--chord); text-align:left; white-space:pre;
}
.ccm-remote .chord-lyrics-code sup{font-size:.68em; vertical-align:super; line-height:0}
.ccm-remote .chord-slash{margin:0 .06em; opacity:.75}
/* 코드를 꺼도 자리는 남긴다. 높이가 달라지면 자동 스크롤이 어긋난다. */
.ccm-remote .preview.no-chords .chord-lyrics-code{visibility:hidden}
.ccm-remote .pad.has-chords .chord-lyrics-plain::before{content:''; display:block; height:17px}
.ccm-remote .lyrics-section-badge{
  flex-basis:100%; font-size:9.5px; font-weight:800; letter-spacing:.2em;
  color:var(--muted); margin-bottom:2px;
}

.ccm-remote .controls{
  flex:none; display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  padding:12px 14px 16px; border-top:1px solid var(--line); background:var(--surface-2);
}
.ccm-remote .btn{
  display:inline-flex; align-items:center; gap:7px; padding:10px 14px; border-radius:10px;
  background:var(--surface-3); border:1px solid var(--line); color:var(--ink);
  font-size:13.5px; font-weight:700; cursor:pointer; position:relative;
}
.ccm-remote .btn:hover{border-color:rgba(255,255,255,.2)}
.ccm-remote .btn:disabled{opacity:.35; cursor:default}
.ccm-remote .btn.play{background:var(--live); color:#06240F; border-color:transparent; min-width:96px; justify-content:center}
.ccm-remote .btn.play.on{background:var(--accent); color:#2A1B03}
.ccm-remote .btn.tog.on{background:var(--accent-soft); border-color:var(--accent-line); color:var(--accent)}
.ccm-remote .btn.black.on{background:var(--stop-soft); border-color:var(--stop); color:var(--stop)}
.ccm-remote .btn .kbd{
  position:absolute; top:-7px; right:-5px; font-size:8.5px; font-weight:800;
  background:var(--surface); border:1px solid var(--line); border-radius:5px;
  padding:1px 4px; color:var(--muted);
}
.ccm-remote .spacer{flex:1}
.ccm-remote .speed{display:inline-flex; align-items:center; gap:4px}
.ccm-remote .speed .val{
  min-width:30px; text-align:right; font-size:13px; font-weight:800;
  font-variant-numeric:tabular-nums; color:var(--ink-2);
}
.ccm-remote .speed .unit{font-size:10px; font-weight:700; color:var(--muted); margin:0 4px 0 3px}

.ccm-remote .gate{max-width:340px; margin:12vh auto; padding:0 20px; text-align:center}
.ccm-remote .gate h1{font-size:20px; font-weight:800; margin:0 0 8px}
.ccm-remote .gate p{color:var(--muted); font-size:14px; margin:0 0 20px}
.ccm-remote .gate input{
  width:100%; padding:13px; border-radius:12px; text-align:center;
  font-size:24px; font-weight:800; letter-spacing:.45em; font-family:inherit;
  background:var(--surface); border:1px solid var(--line); color:var(--ink); outline:none;
}
.ccm-remote .gate input:focus{border-color:var(--accent)}
.ccm-remote .gate button{
  width:100%; margin-top:12px; padding:13px; border-radius:12px; cursor:pointer;
  background:var(--accent); color:#2A1B03; border:0; font-size:15px; font-weight:800;
}
.ccm-remote .gate .err{color:var(--stop); font-size:13px; font-weight:700; margin-top:10px; min-height:18px}
