* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #121212;
  color: #fff;
  min-height: 100vh;
}

header {
  background: #181818;
  border-bottom: 1px solid #282828;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-left { display: flex; align-items: center; gap: 16px; }
header h1 { font-size: 1.2rem; font-weight: 700; }

.back-link { color: #aaa; text-decoration: none; font-size: 0.9rem; }
.back-link:hover { color: #fff; }

.btn {
  border: none;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.8; }
.btn-refresh  { background: #282828; color: #aaa; }
.btn-spotify  { background: #1db954; color: #000; }
.btn-tidal    { background: #00FFFF; color: #000; }
.btn-lastfm   { background: #d51007; color: #fff; }
.btn-filter   { background: #282828; color: #aaa; font-size: 0.78rem; padding: 5px 12px; }
.btn-filter.active { background: #fff; color: #000; }

#type-nav, .type-nav {
  background: #181818;
  border-bottom: 1px solid #282828;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-type {
  background: transparent;
  color: #555;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  display: inline-block;
}
a.btn-type:hover { color: #ccc; background: #282828; }
.btn-type.active { background: #fff; color: #000; cursor: default; }

#search-bar {
  padding: 14px 24px;
  background: #181818;
  border-bottom: 1px solid #282828;
  display: flex;
  align-items: center;
  gap: 8px;
}
#search-bar input {
  flex: 1;
  max-width: 400px;
  padding: 9px 16px;
  border-radius: 24px;
  border: none;
  background: #282828;
  color: #fff;
  font-size: 0.95rem;
}
#search-bar input:focus { outline: 2px solid #aaa; }

#filter-bar {
  padding: 8px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  transition: opacity 0.15s;
}

#count { padding: 10px 24px; color: #aaa; font-size: 0.85rem; transition: opacity 0.15s; }

#status {
  text-align: center;
  padding: 60px 24px;
  color: #aaa;
  font-size: 1.05rem;
  line-height: 1.6;
}

#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 16px 24px 40px;
  transition: opacity 0.15s;
}

.card {
  background: #181818;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover { background: #282828; }
.card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  background: #282828;
}
.card.artist { text-align: center; }
.card.artist img { border-radius: 50%; }

.card-title {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-sub {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  margin-top: 2px;
  font-size: 0.75rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Shelf (horizontal scrolling row of album cards) --- */

.shelf-section { padding: 0 0 32px; }

.shelf-heading {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0 24px 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.shelf-heading a { color: inherit; text-decoration: none; }
.shelf-heading a:hover { text-decoration: underline; }

.shelf-meta { font-size: 0.8rem; font-weight: 400; color: #555; }

.shelf {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 24px 8px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.shelf::-webkit-scrollbar { height: 6px; }
.shelf::-webkit-scrollbar-track { background: transparent; }
.shelf::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.shelf-card { flex: 0 0 160px; width: 160px; }
.shelf-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; background: #282828; }

.shelf-empty { color: #555; font-size: 0.9rem; padding: 0 24px; }
