:root {
  color-scheme: dark;
  --bg: #0f0f10;
  --surface: #1b1b1e;
  --surface-2: #26262b;
  --text: #f1f1f3;
  --muted: #a1a1aa;
  --accent: #ff0033;
  --border: #303036;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: inherit; }

.header,
main,
.footer { max-width: 820px; margin: 0 auto; padding: 0 16px; }

.header { padding-top: 28px; }

.header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1 { margin: 0; font-size: 1.6rem; }

.header__meta {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.search {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
}
.search:focus { outline: none; border-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: #34343b; }
.btn--accent { background: var(--accent); border-color: var(--accent); }
.btn--accent:hover { background: #d4002b; }
.btn--play { background: transparent; }

.list { list-style: none; margin: 16px 0 40px; padding: 0; }

.row {
  display: grid;
  grid-template-columns: 28px 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
}
.row:hover { background: var(--surface); }
.row--unavailable { opacity: 0.45; }

.row__num {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.row__thumb {
  width: 56px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-2);
}
.row__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.row__body { min-width: 0; display: flex; flex-direction: column; }
.row__title,
.row__artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__artist { color: var(--muted); font-size: 0.85rem; }

.row__actions { display: flex; gap: 6px; }

.status {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.status code {
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}

.player { max-width: 820px; margin: 16px auto 0; padding: 0 16px; }
.player__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}
.player__frame-wrap {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.player__frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.footer {
  padding: 24px 16px 40px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 520px) {
  .row {
    grid-template-columns: 22px 44px 1fr;
    grid-template-areas:
      "num thumb body"
      "num thumb actions";
    row-gap: 4px;
  }
  .row__num { grid-area: num; }
  .row__thumb { grid-area: thumb; width: 44px; height: 44px; }
  .row__body { grid-area: body; }
  .row__actions { grid-area: actions; }
}
