/* ---------- buttons ---------- */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--text-2);
  transition: background .15s, color .15s, transform .15s var(--ease);
}
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.icon-btn:active:not(:disabled) { transform: scale(.92); }
.icon-btn:disabled { opacity: .35; }
.icon-btn.is-on { color: var(--accent); }

.play-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--text); color: var(--bg);
}
.play-btn:hover:not(:disabled) { background: #fff; color: var(--bg); transform: scale(1.05); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-elev-2); color: var(--text);
  font-weight: 600; transition: background .15s, transform .15s var(--ease);
}
.btn:hover { background: #20202a; }
.btn:active { transform: scale(.97); }
.btn--primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-ink); }
.btn--primary:hover { background: linear-gradient(135deg, var(--accent), var(--accent-2)); filter: brightness(1.08); }
.btn--ghost { background: transparent; }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(9, 9, 12, .25); border-top-color: var(--bg);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- artwork ---------- */
.artwork {
  --hue: 260;
  position: relative; overflow: hidden; flex: none;
  aspect-ratio: 1; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, hsl(var(--hue) 45% 34%), hsl(calc(var(--hue) + 50) 50% 18%));
}
.artwork--empty { background: var(--bg-elev-2); }
.artwork__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .55); }
.artwork img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.artwork img.is-loaded { opacity: 1; }

/* ---------- sliders ---------- */
.slider {
  --pct: 0%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; touch-action: none;
}
.slider:disabled { cursor: default; opacity: .5; }
.slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right, var(--text) var(--pct), rgba(255, 255, 255, .18) var(--pct));
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px;
  border-radius: 50%; background: #fff; border: 0; opacity: 0; transition: opacity .15s;
}
.slider::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .18); }
.slider::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--text); }
.slider::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; opacity: 0; }
.seekbar:hover .slider::-webkit-slider-thumb, .volume:hover .slider::-webkit-slider-thumb,
.slider:focus-visible::-webkit-slider-thumb, .slider:active::-webkit-slider-thumb { opacity: 1; }
.seekbar:hover .slider::-moz-range-thumb, .volume:hover .slider::-moz-range-thumb,
.slider:focus-visible::-moz-range-thumb, .slider:active::-moz-range-thumb { opacity: 1; }
@media (pointer: coarse) {
  .slider { height: 32px; }
  .slider::-webkit-slider-thumb { opacity: 1; width: 18px; height: 18px; margin-top: -7px; }
  .slider::-moz-range-thumb { opacity: 1; width: 18px; height: 18px; }
}
.accent-fill .slider { --fill: var(--accent); }

/* ---------- seekbar / volume ---------- */
.seekbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; }
.time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 36px; }
.time:last-child { text-align: right; }
.volume { display: flex; align-items: center; gap: 4px; }
.volume .slider { width: 110px; }

/* ---------- transport ---------- */
.transport { display: flex; align-items: center; justify-content: center; gap: 8px; }
.transport--full { gap: 14px; }

/* ---------- track info / text ---------- */
.track-info { display: flex; align-items: center; gap: 14px; min-width: 0; }
.track-info__art { width: 56px; border-radius: 8px; }
.track-text { min-width: 0; }
.track-text__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-text__artist { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-text__artist.is-error { color: var(--danger); }
.track-text--large { text-align: center; }
.track-text--large .track-text__title { font-size: 22px; line-height: 1.25; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.track-text--large .track-text__artist { font-size: 16px; margin-top: 4px; }

/* ---------- search box ---------- */
.searchbox {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 16px;
  background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-2); transition: border-color .15s, background .15s;
}
.searchbox:focus-within { border-color: var(--accent); background: var(--bg-elev); color: var(--text); }
.searchbox__input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.searchbox__input::placeholder { color: var(--text-3); }
.searchbox__input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- lists ---------- */
.queue-list { display: flex; flex-direction: column; gap: 2px; }
.queue-list:empty::after { content: "Nothing queued yet"; display: block; padding: 24px 8px; color: var(--text-3); text-align: center; }
.row { display: flex; align-items: center; border-radius: var(--radius-sm); }
.row:hover, .row.is-current { background: var(--hover); }
.row__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; background: transparent; text-align: left; border-radius: var(--radius-sm); }
.row__art-wrap { position: relative; width: 48px; flex: none; }
.row__art { width: 48px; }
.row__text { flex: 1; min-width: 0; }
.row__title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.is-current .row__title { color: var(--accent); }
.row__artist { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.row__action { width: 40px; height: 40px; opacity: 0; }
.row:hover .row__action, .row.is-current .row__action, .row__action:focus-visible { opacity: 1; }
@media (pointer: coarse) { .row__action { opacity: .75; } }

.eq { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 14px; background: rgba(0, 0, 0, .5); border-radius: var(--radius-sm); }
.eq i { width: 4px; height: 6px; background: var(--accent); border-radius: 2px; }
.eq.is-playing i { animation: eq 0.9s ease-in-out infinite; }
.eq.is-playing i:nth-child(2) { animation-delay: .2s; }
.eq.is-playing i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 18px; } }

/* ---------- empty states, cards, hero ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 16px; text-align: center; color: var(--text-2); }
.empty[hidden] { display: none; }
.empty h2 { font-size: 18px; color: var(--text); }
.empty p { max-width: 380px; }
.empty .btn { margin-top: 8px; }
.empty__icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--bg-elev-2); color: var(--text-3); }
.card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.card p { color: var(--text-2); }
.card__eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 600; }
.hero { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 28px; border-radius: var(--radius-lg); background: radial-gradient(120% 140% at 0% 0%, rgba(155, 140, 255, .28), transparent 60%), radial-gradient(100% 120% at 100% 100%, rgba(255, 122, 182, .2), transparent 55%), var(--bg-elev); border: 1px solid var(--line); margin-bottom: 20px; }
.hero__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: rgba(255, 255, 255, .08); color: var(--text); }
.hero h2 { font-size: clamp(22px, 4vw, 30px); line-height: 1.15; }
.hero p { color: var(--text-2); max-width: 520px; }
.hero__actions { margin-top: 8px; }

/* ---------- toast ---------- */
.toaster { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--player-h) + 20px); z-index: 80; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: var(--radius); background: var(--bg-elev-2); border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: toast-in .25s var(--ease); }
.toast--error { border-color: rgba(255, 122, 133, .5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- brand ---------- */
.brand, .topbar__brand { display: flex; align-items: center; min-height: 44px; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand__mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }

/* ---------- search ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.btn--small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.results-head, .recent__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 10px; }
.results-head h2, .recent__head h2 { font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-list { margin-bottom: 8px; }
.notice { margin-top: 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px dashed var(--line); color: var(--text-3); font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-elev-2); }
.chip__label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 6px 0 14px; border: 0; background: transparent; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip__label .icon { color: var(--text-3); }
.chip__remove { display: grid; place-items: center; width: 36px; height: 40px; border: 0; background: transparent; color: var(--text-3); border-radius: 0 999px 999px 0; }
.chip__remove:hover { color: var(--text); }

.skeleton-list { display: flex; flex-direction: column; gap: 2px; }
.skeleton-row { display: flex; align-items: center; gap: 12px; padding: 8px; }
.sk { display: block; background: linear-gradient(90deg, var(--bg-elev-2) 25%, #232330 50%, var(--bg-elev-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 6px; }
.sk--art { width: 48px; height: 48px; border-radius: var(--radius-sm); flex: none; }
.sk-text { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk--line { height: 12px; width: 70%; }
.sk--short { width: 40%; height: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- channels / artists ---------- */
.artwork--round { border-radius: 50%; }
.row--channel .row__art { width: 48px; }
.row__chev { display: grid; place-items: center; color: var(--text-3); }
.results-section + .results-section { margin-top: 22px; }
.results-section .results-head { margin-top: 0; }

.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin: 0 0 6px -6px; padding: 0 12px 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-weight: 600; }
.back-link:hover { background: var(--hover); color: var(--text); }
.back-link .icon { transform: rotate(90deg); }
.channel-hero { display: flex; align-items: center; gap: 24px; margin: 4px 0 24px; }
.channel-hero__art { width: 128px; flex: none; box-shadow: 0 12px 40px rgba(0, 0, 0, .45); }
.channel-hero__text { min-width: 0; }
.channel-hero h1 { font-size: clamp(24px, 4vw, 36px); line-height: 1.15; letter-spacing: -.02em; overflow-wrap: anywhere; }
.channel-hero__meta { margin-top: 4px; color: var(--text-2); font-size: 14px; }
.channel-hero__desc { margin-top: 8px; color: var(--text-3); font-size: 14px; max-width: 60ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.channel-hero__actions { margin-top: 14px; }
.sk--round { border-radius: 50%; }
.sk--hero { width: 128px; height: 128px; flex: none; }
@media (max-width: 599px) {
  .channel-hero { gap: 16px; }
  .channel-hero__art, .sk--hero { width: 88px; height: 88px; }
}
