* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: system-ui, "Malgun Gothic", sans-serif; background: #111318; color: #e8e8ec; }
h1 { margin: 0 0 8px; }
.muted { color: #8b8f9a; }
.center { max-width: 520px; margin: 10vh auto; padding: 24px; text-align: center; }
.center section { text-align: left; margin-top: 24px; display: grid; gap: 8px; }
label { font-size: 13px; color: #8b8f9a; }
input, textarea { width: 100%; background: #1b1e25; color: inherit; border: 1px solid #2c303a; border-radius: 8px; padding: 10px; font: inherit; }
textarea { min-height: 160px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
button, .btn { background: #2c303a; color: inherit; border: 0; border-radius: 8px; padding: 10px 16px; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
button:hover, .btn:hover { filter: brightness(1.2); }
.primary { background: #5b6cff; color: #fff; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }

.layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; max-width: 1200px; margin: 0 auto; padding: 20px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
header.top { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 16px 20px 0; gap: 12px; flex-wrap: wrap; }
.badge { background: #1b1e25; border: 1px solid #2c303a; border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.badge.admin { border-color: #5b6cff; color: #aab3ff; }

.player-wrap { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.player-wrap iframe, #player { position: absolute; inset: 0; width: 100%; height: 100%; }
.shield { position: absolute; inset: 0; } /* 영상 클릭으로 일시정지 못 하게 */
.empty { position: absolute; inset: 0; display: grid; place-items: center; color: #8b8f9a; }

.panel { background: #171a20; border: 1px solid #23262e; border-radius: 12px; padding: 16px; margin-top: 16px; display: grid; gap: 10px; }
.controls { display: flex; align-items: center; gap: 10px; }
.controls input[type=range] { flex: 1; padding: 0; }
.time { font-variant-numeric: tabular-nums; font-size: 13px; color: #8b8f9a; min-width: 96px; text-align: right; }
.status { font-size: 13px; color: #8b8f9a; }
.error { color: #ff7b7b; font-size: 13px; }

.lyrics { background: #171a20; border: 1px solid #23262e; border-radius: 12px; padding: 24px; height: calc(100vh - 110px); min-height: 360px; overflow-y: auto; scroll-behavior: smooth; }
.lyrics p { margin: 0; padding: 6px 0; font-size: 18px; line-height: 1.5; color: #6c707b; transition: color .2s, transform .2s; transform-origin: left center; }
.lyrics p.active { color: #fff; transform: scale(1.06); font-weight: 600; }
.lyrics.plain p { color: #d6d7dc; }
.lyrics .none { color: #6c707b; }

.small { font-size: 13px; }
.now { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; }
.now-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.check { display: flex; align-items: center; gap: 8px; color: inherit; font-size: 14px; }
.check input { width: auto; }

.playlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; max-height: 340px; overflow-y: auto; overflow-x: hidden; }
.song { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.song:hover { background: #1d2028; }
.song.current { background: #22264a; }
.song-no { width: 22px; text-align: center; color: #8b8f9a; font-size: 13px; flex: none; }
.song.current .song-no { color: #aab3ff; }
.song-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-tools { display: flex; gap: 4px; flex: none; }
.song-tools button { padding: 4px 8px; font-size: 13px; }
.song-tools button:disabled { opacity: .3; cursor: default; }
.song-tools .pub { background: #1f3b2c; color: #7ee2a8; }
.song-tools .priv { background: #3b1f24; color: #ff9aa6; }

.gate { position: fixed; inset: 0; background: rgba(10,11,14,.92); display: grid; place-items: center; z-index: 10; text-align: center; }
.gate button { font-size: 18px; padding: 14px 28px; }

/* --- 연결 상태 / 내 방 목록 --- */
.conn { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #3b1f24; color: #ff9aa6; }
.conn.ok { display: none; }
.myrooms { margin-top: 32px; text-align: left; }
.myrooms ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.myrooms a { color: #aab3ff; text-decoration: none; }
.myrooms li { display: flex; justify-content: space-between; gap: 8px; background: #171a20; border: 1px solid #23262e; border-radius: 8px; padding: 8px 12px; }
