:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --text: #1c1a17;
  --muted: #6d675e;
  --line: #e2ddd2;
  --accent: #d9480f;
  --accent-text: #ffffff;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110;
    --surface: #1c1b19;
    --text: #f1ede6;
    --muted: #9a948a;
    --line: #2e2c29;
    --accent: #ff7a3d;
    --accent-text: #1a0d05;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 96px;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 16px; align-items: center;
  padding: 14px max(16px, calc((100vw - 1100px) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -0.02em; white-space: nowrap; }
#search {
  flex: 1; min-width: 0; max-width: 420px; margin-left: auto;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }

/* Grid */
.intro h1 { margin: 8px 0 4px; font-size: clamp(28px, 5vw, 44px); letter-spacing: -0.03em; }
.intro p { margin: 0 0 28px; color: var(--muted); }
.grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.card { text-decoration: none; display: block; }
.card:hover .cover { transform: translateY(-3px); box-shadow: 0 10px 24px rgb(0 0 0 / .18); }
.card h3 { margin: 10px 0 0; font-size: 16px; line-height: 1.3; }
.card .sub { color: var(--muted); font-size: 14px; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 2px 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted);
}

.cover {
  aspect-ratio: 1; width: 100%; border-radius: var(--radius); overflow: hidden;
  background: var(--line); transition: transform .15s, box-shadow .15s;
  display: grid; place-items: center;
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.fake { color: #fff; font-weight: 800; font-size: 42px; letter-spacing: -0.04em; text-shadow: 0 2px 8px rgb(0 0 0 / .25); }

/* Album page */
.back { display: inline-block; margin-bottom: 18px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--text); }
.album { display: grid; grid-template-columns: 320px 1fr; gap: 36px; align-items: start; }
.album-head h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; line-height: 1.1; }
.album-head .sub { color: var(--muted); margin: 6px 0 12px; }
.album-head p { margin: 0 0 20px; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 22px;
}
.panel h2 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.formats { display: grid; gap: 8px; }
.fmt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border-radius: 8px;
  border: 1.5px solid var(--line); background: transparent;
}
.fmt:hover { border-color: var(--muted); }
.fmt[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.fmt .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.fmt[aria-checked="true"] .dot { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.fmt .name { font-weight: 700; }
.fmt .label { color: var(--muted); font-size: 14px; }
.fmt .size { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }

.dl-btn {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  margin-top: 14px; padding: 13px; border-radius: 8px;
  background: var(--accent); color: var(--accent-text);
  font-weight: 700; text-decoration: none;
}
.dl-btn:hover { filter: brightness(1.08); }

.tracks { list-style: none; margin: 0; padding: 0; }
.track {
  display: grid; grid-template-columns: 36px 1fr auto auto; gap: 10px; align-items: center;
  padding: 8px 6px; border-radius: 6px;
}
.track + .track { border-top: 1px solid var(--line); }
.track:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.track.playing .t-title { color: var(--accent); font-weight: 700; }
.t-num { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.t-len { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.play-btn, .icon-btn, .t-dl {
  border: 0; background: transparent; border-radius: 50%;
  width: 32px; height: 32px; display: grid; place-items: center; text-decoration: none;
}
.play-btn:hover, .icon-btn:hover, .t-dl:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.t-dl { color: var(--muted); font-size: 15px; }
.t-dl.off { visibility: hidden; }
.track .play-btn .n { display: inline; }
.track .play-btn .p { display: none; }
.track:hover .play-btn .n, .track.playing .play-btn .n { display: none; }
.track:hover .play-btn .p, .track.playing .play-btn .p { display: inline; color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* Player */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: 10px max(16px, calc((100vw - 1100px) / 2));
  background: var(--surface); border-top: 1px solid var(--line);
}
.player[hidden] { display: none; }
.icon-btn.big { width: 44px; height: 44px; background: var(--accent); color: var(--accent-text); font-size: 18px; }
.icon-btn.big:hover { background: var(--accent); filter: brightness(1.08); }
.now { flex: 1; min-width: 0; margin-left: 8px; }
.now-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#seek { width: 100%; accent-color: var(--accent); margin: 4px 0 0; }
.time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; min-width: 84px; text-align: right; }

@media (max-width: 720px) {
  .album { grid-template-columns: 1fr; gap: 20px; }
  .album .cover { max-width: 340px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
  .time { display: none; }
  .fmt { flex-wrap: wrap; }
}

.disc { list-style: none; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 14px 6px 6px; }
.disc:first-child { padding-top: 0; }
.t-artist { color: var(--muted); font-weight: 400; }
