/* yt.picell.biz 스타일: 차 안에서 보기 좋게 어두운 배경 + 큰 터치 영역 */
:root {
  --bg: #111317; --panel: #1b1e24; --line: #2a2e36; --text: #eceef2; --muted: #9aa1ad;
  --accent: #ff5a36; --accent-2: #3d8bff; --ok: #34c77b; --err: #ff6b6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  padding-bottom: env(safe-area-inset-bottom); -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 10px; min-height: 44px; padding: 0 14px;
  background: var(--accent); color: #fff; font-weight: 600; }
button:disabled { opacity: .5; }
.btn-sub { background: var(--line); color: var(--text); }
.btn-link { background: none; color: var(--muted); text-decoration: underline; min-height: 36px; }

/* 로그인 */
.login { max-width: 360px; margin: 18vh auto 0; padding: 0 16px; }
.login h1 { font-size: 24px; margin: 0 0 24px; }
.login form { display: grid; gap: 10px; }
.login input { height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.err { color: var(--err); margin: 0; }

/* 지금 재생 (상단 고정) */
.now { position: sticky; top: 0; z-index: 10; background: rgba(17,19,23,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.now-info { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1 1 260px; }
.now-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { flex: none; font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--line); color: var(--muted); }
.badge[data-state="playing"] { background: var(--ok); color: #06210f; }
.badge[data-state="paused"] { background: #e2b33c; color: #2a1f00; }
.ctrl { display: flex; gap: 6px; }
.ctrl button { background: var(--line); color: var(--text); min-width: 48px; font-size: 18px; padding: 0 10px; }

.wrap { max-width: 820px; margin: 0 auto; padding: 16px; }

/* VLC 연결 */
.stream { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.btn-vlc { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 10px;
  background: var(--accent-2); color: #fff; font-weight: 700; text-decoration: none; }
.btn-vlc.video { background: #8a5cff; }
.switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }
.switch small { color: var(--muted); }
.hint { flex-basis: 100%; margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* 검색 */
.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); font-size: 17px; }
.msg { min-height: 1.4em; color: var(--muted); margin: 10px 0; }
.msg.err { color: var(--err); }

/* 결과 목록 */
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 128px 1fr auto; gap: 12px; align-items: center;
  background: var(--panel); border-radius: 12px; padding: 8px; }
.item img { width: 128px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--line); }
.info { min-width: 0; }
.title { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.acts { display: flex; flex-direction: column; gap: 6px; }
.acts button { min-width: 72px; }

/* 재생목록 */
.queue { margin-top: 20px; background: var(--panel); border-radius: 12px; padding: 12px 14px; }
.queue summary { cursor: pointer; font-weight: 600; }
.queue ol { padding-left: 22px; color: var(--muted); }
.queue li.cur { color: var(--ok); font-weight: 600; }
.logout { text-align: center; margin-top: 24px; }

/* 휴대폰 세로: 썸네일을 작게, 버튼은 가로로 */
@media (max-width: 560px) {
  .item { grid-template-columns: 96px 1fr; }
  .item img { width: 96px; }
  .acts { grid-column: 1 / -1; flex-direction: row; }
  .acts button { flex: 1; }
  .ctrl { width: 100%; }
  .ctrl button { flex: 1; }
}
