/* 노래상자 web player — same palette as the app (Daangn SEED) */
:root {
  --accent: #FF6600; --accent-weak: #FFF2EA; --dark: #1A1C20; --dark2: #2A2D33;
  --bg: #FFFFFF; --surface: #F3F4F5; --line: #EAEBEE;
  --text: #1A1C20; --text2: #555D6D; --text3: #8B919B; --on-dark: #FFFFFF;
  --font: 'Pretendard', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px;
  -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: var(--text); }
[hidden] { display: none !important; }
.muted { color: var(--text3); }
.err { color: #FA342C; font-size: 14px; margin: 0; }

.btn { height: 40px; padding: 0 16px; border-radius: 10px; background: var(--surface); font-weight: 600; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn:hover { filter: brightness(0.97); }
.link { color: var(--text2); font-size: 13px; text-decoration: underline; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; font-size: 20px; }
.icon-btn:hover { background: var(--surface); }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--surface); }
.login-card { width: min(380px, 100%); background: #fff; border-radius: 20px; padding: 36px 28px; text-align: center; }
.login-icon { width: 72px; height: 72px; border-radius: 18px; }
.login h1 { margin: 14px 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.login form { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.login input { height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface); }
.login .btn { height: 50px; margin-top: 6px; font-size: 16px; }

/* layout: sidebar | list | now playing ; bar at the bottom */
.app { height: 100%; display: grid; grid-template-columns: 220px minmax(0, 0.9fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 84px; grid-template-areas: "side main now" "bar bar bar"; }
.side { grid-area: side; background: var(--surface); display: flex; flex-direction: column; padding: 20px 12px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; font-weight: 800; font-size: 18px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; font-weight: 600; color: var(--text2); }
.nav.active, .nav:hover { background: #fff; color: var(--text); }
.side-label { margin: 22px 12px 6px; font-size: 12px; color: var(--text3); font-weight: 600; }
.side-pls { overflow-y: auto; flex: 1; min-height: 0; }
.side-pls button { display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: 8px;
  color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-pls button:hover, .side-pls button.active { background: #fff; color: var(--text); }
.side-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 8px 0; font-size: 13px; }

.main { grid-area: main; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.top { display: flex; align-items: center; gap: 8px; padding: 20px 24px 8px; }
.top h2 { margin: 0; font-size: 24px; font-weight: 800; flex: 1; letter-spacing: -0.3px; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-tools { display: flex; gap: 8px; }
.top input, .top select { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface); }
.top input { width: 220px; }
.actions { display: flex; align-items: center; gap: 8px; padding: 4px 24px 10px; }
.actions .muted { flex: 1; font-size: 14px; }
.list { overflow-y: auto; flex: 1; min-height: 0; padding: 0 12px 16px; }

.row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 56px; align-items: center; gap: 14px;
  padding: 8px 12px; border-radius: 12px; cursor: pointer; }
.row:hover { background: var(--surface); }
.row.playing .r-title { color: var(--accent); }
.row img, .ph { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--surface); }
.ph { display: grid; place-items: center; color: var(--text3); font-size: 20px; }
.r-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-sub { font-size: 13px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: var(--accent-weak); color: var(--accent); }
.badge.plain { background: var(--surface); color: var(--text3); }
.r-time { font-size: 13px; color: var(--text3); text-align: right; font-variant-numeric: tabular-nums; }
.group { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; }
.empty { padding: 60px 20px; text-align: center; color: var(--text3); }

/* now playing */
.now { grid-area: now; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 24px 32px; gap: 14px; }
.now-art { width: 100%; aspect-ratio: 16 / 9; max-width: 100%; max-height: 32vh; border-radius: 16px; overflow: hidden; background: var(--surface); flex-shrink: 0; }
.now-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.now-title { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.from { font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 6px; }
.chapters { flex-shrink: 0; border: 1px solid var(--line); border-radius: 12px; }
.chapters summary { cursor: pointer; padding: 10px 14px; font-size: 14px; font-weight: 700; list-style: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapters summary::before { content: '▸ '; color: var(--text3); }
.chapters[open] summary::before { content: '▾ '; }
.chapters ol { position: relative; list-style: none; margin: 0; padding: 0 0 8px; overflow-y: auto; max-height: 36vh; border-top: 1px solid var(--line); }
.chapters li { display: flex; gap: 12px; padding: 7px 14px; cursor: pointer; font-size: 14px; color: var(--text2); }
.chapters li:hover { background: var(--surface); }
.chapters li .ct { width: 56px; flex-shrink: 0; color: var(--text3); font-variant-numeric: tabular-nums; }
.chapters li .cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapters li.on { color: var(--accent); font-weight: 700; }
.chapters li.on .ct { color: var(--accent); }
.lyrics { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; padding: 8px 0 40%; }
.lyrics p { margin: 0; padding: 8px 0; font-size: 20px; line-height: 1.5; color: var(--text3); font-weight: 600; transition: color .2s, transform .2s; transform-origin: left; }
.lyrics p.on { color: var(--text); transform: scale(1.04); }
.lyrics.plain p { color: var(--text2); font-weight: 500; }
.lyrics p.click { cursor: pointer; }
.lyrics p.click:hover { color: var(--text2); }

/* player bar */
.bar { grid-area: bar; background: var(--dark); color: var(--on-dark); display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; padding: 0 20px; gap: 16px; }
.bar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bar-left img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--dark2); }
.bar-meta { min-width: 0; }
.bar-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-artist { font-size: 13px; color: #A8ADB5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-mid { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.controls { display: flex; align-items: center; gap: 10px; }
.ctl { width: 38px; height: 38px; border-radius: 50%; font-size: 17px; color: #C9CDD3; }
.ctl:hover { color: #fff; background: var(--dark2); }
.ctl.on { color: var(--accent); }
.ctl.play { width: 44px; height: 44px; background: #fff; color: var(--dark); font-size: 18px; }
.ctl.play:hover { background: #fff; transform: scale(1.05); }
.seek { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 12px; color: #A8ADB5; font-variant-numeric: tabular-nums; }
.seek input { flex: 1; }
.bar-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.bar-right input { width: 110px; }
input[type=range] { accent-color: var(--accent); height: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* narrow screens: list + bar only */
@media (max-width: 1100px) {
  .app { grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: "side main" "bar bar"; }
  .now { display: none; }
}
@media (max-width: 700px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "bar"; grid-template-rows: minmax(0, 1fr) 120px; }
  .side { display: none; }
  .top { flex-wrap: wrap; padding: 16px 16px 8px; }
  .top input { width: 100%; }
  .top-tools { width: 100%; }
  .actions { padding: 4px 16px 10px; }
  .list { padding: 0 4px 16px; }
  .bar { grid-template-columns: minmax(0, 1fr); padding: 8px 16px; gap: 6px; }
  .bar-right { display: none; }
  .row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .row .r-time { display: none; }
}
