:root {
  --bg: #121a28;
  --bg2: #2c3442;
  --text: #f5f0e6;
  --muted: #b9b4aa;
  --accent: #e8cda0;
  --accent-ink: #1a1f2b;
  --line: rgba(245, 240, 230, 0.12);
  --surface: rgba(18, 26, 40, 0.72);
  --serif: "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(var(--bg), var(--bg2)) fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  word-break: keep-all;
}
.bg {
  position: fixed;
  inset: 0;
  background: url("../img/bg.jpg") center / cover no-repeat;
  opacity: 0.55;
  z-index: -1;
}
.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

.top { padding: 12px 4px 20px; }
.label { margin: 0 0 6px; color: var(--accent); font-size: 14px; letter-spacing: 0.08em; }
h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(26px, 7.4vw, 34px);
  line-height: 1.3;
}
.sub { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; color: var(--accent); }

/* 지금 재생 */
.now-meta { margin: 0; color: var(--accent); font-size: 13px; }
.now-title { margin: 4px 0 2px; font-family: var(--serif); font-size: 22px; line-height: 1.35; }
.now-line { margin: 0 0 14px; color: var(--muted); font-size: 14px; min-height: 1.55em; }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress.thin { height: 3px; margin: 4px 0 10px; }
.bar { height: 100%; width: 0; background: var(--accent); transition: width 0.3s linear; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }

.controls { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 10px 0 16px; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.icon-btn, .play-btn { border: 0; border-radius: 50%; display: grid; place-items: center; }
.icon-btn { width: 48px; height: 48px; background: transparent; }
.icon-btn svg { width: 26px; height: 26px; fill: var(--text); }
.play-btn { width: 68px; height: 68px; background: var(--accent); }
.play-btn svg { width: 32px; height: 32px; fill: var(--accent-ink); }
.play-btn .i-pause, .play-btn.playing .i-play { display: none; }
.play-btn.playing .i-pause { display: block; }

.seg { display: flex; background: rgba(0, 0, 0, 0.25); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}
.seg button[aria-checked="true"], .seg button[aria-selected="true"] { background: rgba(232, 205, 160, 0.16); color: var(--text); }

/* 믹서 */
.row { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.row-name { width: 82px; flex: none; font-size: 15px; }
.row-name.small { color: var(--muted); font-size: 14px; }
input[type="range"] { flex: 1; accent-color: var(--accent); height: 32px; margin: 0; }
.scale { display: flex; justify-content: space-between; margin: -6px 0 0 94px; color: var(--muted); font-size: 12px; }
.toggle {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  min-height: 40px;
  padding: 0 18px;
  font-size: 14px;
}
.toggle[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.toggle.wide { padding: 0 26px; }
.note { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }

/* 타이머 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.chips button {
  flex: 1 0 56px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 14px;
}
.chips button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.status { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.status strong { color: var(--text); font-variant-numeric: tabular-nums; }
.text-btn { border: 0; background: none; color: var(--accent); padding: 10px 0; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.big-clock { margin: 14px 0 6px; font-size: 44px; font-weight: 300; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.focus-btns { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

/* 곡 목록 */
.list-h { margin: 22px 4px 10px; }
.tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.track {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 2px 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.track .num { color: var(--muted); font-size: 13px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.track .t { font-size: 15.5px; font-weight: 600; line-height: 1.4; }
.track .meta { grid-column: 2 / 4; color: var(--muted); font-size: 13px; }
.track .meta b { color: var(--accent); font-weight: 500; }
.track .dur { color: var(--muted); font-size: 12px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.track .saved { display: none; color: var(--accent); font-size: 11px; margin-left: 6px; font-weight: 400; }
.track.cached .saved { display: inline; }
.track[aria-current="true"] { border-color: var(--accent); background: rgba(232, 205, 160, 0.1); }
.track.offline { opacity: 0.45; }

.foot { margin-top: 28px; padding: 18px 4px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.foot p { margin: 8px 0; }
.fine { font-size: 12px; }
.yt { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; }
.yt svg { width: 22px; height: 22px; fill: #e9706a; }
.foot a:not(.yt), .doc a { color: var(--muted); }

/* 개인정보처리방침 */
.doc { line-height: 1.7; }
.doc h1 { font-family: var(--serif); font-size: 26px; margin: 12px 0 4px; }
.doc h2 { font-size: 17px; margin: 26px 0 6px; color: var(--accent); }
.doc p, .doc li { color: var(--text); }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0 24px; }
.doc .back { display: inline-flex; align-items: center; min-height: 44px; }

@media (min-width: 900px) {
  .wrap { max-width: 980px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; align-items: start; }
  .top, .foot { grid-column: 1 / -1; }
  .wrap > section { grid-column: 1; }
  .wrap > section:nth-of-type(4) { grid-column: 2; grid-row: 2 / span 4; }
  .list-h { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bar { transition: none; }
}
