/* ===== buttons ===== */
.btn-play {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: #000;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 8px rgba(0,0,0,.3);
  transition: transform .12s var(--ease-out), background-color .15s, opacity .2s;
  flex-shrink: 0;
}
.btn-play svg { width: 24px; height: 24px; }
.btn-play:hover { transform: scale(1.06); background: var(--accent-bright); }
.btn-play:active { transform: scale(1); background: var(--accent-press); }
.btn-play--lg { width: 56px; height: 56px; }
.btn-play--sm { width: 40px; height: 40px; }
.btn-play--sm svg { width: 20px; height: 20px; }

.btn-outline {
  border: 1px solid var(--decorative-subdued); color: var(--text-base);
  font-weight: 700; font-size: 14px; padding: 6px 15px; border-radius: 9999px;
  transition: border-color .15s, transform .1s;
}
.btn-outline:hover { border-color: #fff; transform: scale(1.04); }
.btn-outline.active { border-color: var(--accent); color: var(--accent); }
.btn-outline.active:hover { border-color: var(--accent-bright); color: var(--accent-bright); }

.btn-text { color: var(--text-subdued); font-weight: 700; font-size: 13.5px; padding: 6px 12px; border-radius: 4px; }
.btn-text:hover { color: #fff; }

.heart-btn { color: var(--text-subdued); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; transition: color .15s, transform .1s; flex-shrink: 0; position: relative; }
.heart-btn svg { width: 16px; height: 16px; }
.heart-btn:hover { color: #fff; }
.heart-btn:active { transform: scale(.92); }
.heart-btn.liked { color: var(--accent); }
.heart-btn.liked:hover { color: var(--accent-bright); }
.heart-btn--lg svg { width: 24px; height: 24px; }

/* ===== cards & shelves ===== */
.shelf { margin-bottom: 32px; }
.shelf__head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 32px 8px; margin-top: 8px; }
.shelf__title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.shelf__title a:hover { text-decoration: underline; }
.shelf__showall { font-size: 13px; font-weight: 700; color: var(--text-subdued); letter-spacing: .08em; text-transform: uppercase; }
.shelf__showall:hover { text-decoration: underline; color: #fff; }
.shelf__viewport { position: relative; }
.shelf__scroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(160px, 15vw, 200px);
  gap: 18px; overflow-x: auto; scroll-behavior: smooth;
  padding: 8px 32px 8px; scrollbar-width: none;
}
.shelf__scroll::-webkit-scrollbar { display: none; }
.shelf__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.85); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s; box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.shelf__arrow svg { width: 18px; height: 18px; }
.shelf__arrow--left { left: 20px; }
.shelf__arrow--right { right: 20px; }
.shelf__viewport:hover .shelf__arrow:not(:disabled) { opacity: 1; }
.shelf__arrow:disabled { opacity: 0; cursor: default; }
.shelf__arrow:hover:not(:disabled) { transform: translateY(-50%) scale(1.06); }

.card {
  background: var(--card-bg); border-radius: var(--card-radius);
  padding: 12px; position: relative;
  transition: background-color .25s var(--ease-out);
  min-width: 0;
}
.card:hover, .card:focus-within { background: var(--card-hover); }
.card__imgwrap { position: relative; margin-bottom: 12px; }
.card__img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.5); background: #333; }
.card__img.round { border-radius: 50%; }
.card__play {
  position: absolute; right: 8px; bottom: 8px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}
.card:hover .card__play, .card:focus-within .card__play { opacity: 1; transform: translateY(0); }
.card__name { font-size: 15px; font-weight: 600; padding-bottom: 4px; }
.card__sub { font-size: 13.5px; color: var(--text-subdued); line-height: 1.5; }
.card__sub a:hover { text-decoration: underline; }

/* greeting grid */
.greeting-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 8px; padding: 0 32px 16px; }
.greeting-card {
  display: flex; align-items: center; gap: 0; height: 64px;
  background: hsla(0,0%,100%,.07); border-radius: 4px; overflow: hidden;
  transition: background-color .2s; position: relative; text-align: left;
  padding: 0;
}
.greeting-card:hover { background: hsla(0,0%,100%,.14); }
.greeting-card:hover .btn-play { opacity: 1; }
.greeting-card img { width: 64px; height: 64px; object-fit: cover; flex-shrink: 0; box-shadow: 4px 0 12px rgba(0,0,0,.3); }
.greeting-card span { font-weight: 700; font-size: 15px; padding: 0 16px; flex: 1; min-width: 0; }
.greeting-card .btn-play { margin-right: 12px; width: 40px; height: 40px; opacity: 0; transition: opacity .2s; }
.greeting-card .btn-play svg { width: 20px; height: 20px; }
.greeting-card__heart { margin-right: 16px; width: 24px; height: 24px; color: var(--accent); flex-shrink: 0; }
.greeting-card__heart svg { width: 24px; height: 24px; }

/* ===== track rows ===== */
.tracklist { padding: 0 24px 24px; }
.tl-head, .track-row {
  display: grid; align-items: center; gap: 16px;
  grid-template-columns: [index] 24px [first] minmax(200px, 6fr) [album] minmax(140px, 4fr) [date] minmax(110px, 3fr) [last] minmax(90px, 1fr);
  padding: 0 16px;
}
.tl-head {
  height: 36px; border-bottom: 1px solid var(--border-subtle);
  color: var(--text-subdued); font-size: 13px; font-weight: 500;
  position: sticky; top: -1px; z-index: 6;
  background: var(--bg-panel);
  margin-bottom: 8px;
}
.detail-scroll .tl-head { top: calc(var(--topbar-h) + 87px); }
.tl-head .tl-dur { justify-self: end; margin-right: 30px; }
.tl-head svg { width: 16px; height: 16px; }
.tl-index { color: var(--text-subdued); font-size: 15px; text-align: center; }
.tl-dur { justify-self: end; display: flex; align-items: center; gap: 8px; min-width: 56px; justify-content: flex-end; }

.track-row {
  height: 56px; border-radius: 6px; position: relative;
  transition: background-color .1s;
  cursor: default;
}
.track-row:hover { background: hsla(0,0%,100%,.1); }
.track-row.playing .tr-title { color: var(--accent); }
.track-row.selected { background: hsla(0,0%,100%,.18); }
.tr-index { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; }
.tr-index .num { color: var(--text-subdued); font-size: 15px; font-variant-numeric: tabular-nums; }
.tr-index .play-ic, .tr-index .pause-ic { display: none; color: #fff; width: 14px; height: 14px; }
.tr-index .play-ic svg, .tr-index .pause-ic svg { width: 14px; height: 14px; }
.track-row:hover .tr-index .num { display: none; }
.track-row:hover .tr-index .play-ic { display: block; }
.tr-eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.tr-eq i { width: 3px; background: var(--accent); height: 100%; transform-origin: bottom; animation: eqbar 0.9s ease-in-out infinite; border-radius: 1px; }
.tr-eq i:nth-child(2) { animation-delay: .22s; }
.tr-eq i:nth-child(3) { animation-delay: .5s; }
.track-row.playing .tr-index .num { display: none; }
.track-row.playing .tr-eq { display: flex; }
.track-row.playing.paused .tr-eq i { animation-play-state: paused; }
.track-row.playing:hover .tr-eq { display: none; }
.track-row.playing:hover .tr-index .pause-ic { display: block; }

.tr-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tr-art { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: #333; }
.tr-text { min-width: 0; }
.tr-title { font-size: 15px; font-weight: 400; color: #fff; }
.tr-artists { font-size: 13.5px; color: var(--text-subdued); }
.track-row:hover .tr-artists { color: #fff; }
.tr-artists a:hover { text-decoration: underline; }
.tr-album { font-size: 13.5px; color: var(--text-subdued); }
.tr-album a:hover { color: #fff; text-decoration: underline; }
.tr-date { font-size: 13.5px; color: var(--text-subdued); }
.tr-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.tr-actions .heart-btn, .tr-actions .icon-btn { opacity: 0; }
.track-row:hover .tr-actions .heart-btn, .track-row:hover .tr-actions .icon-btn,
.track-row .heart-btn.liked { opacity: 1; }
.tr-dur-text { color: var(--text-subdued); font-size: 13.5px; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

/* compact rows (search results) */
.tracklist--compact .tl-head, .tracklist--compact .track-row { grid-template-columns: [first] minmax(200px, 8fr) [last] minmax(90px, 1fr); }
.tracklist--compact .track-row { height: 56px; }
.tracklist--compact .tr-index { display: none; }

/* ===== skeletons ===== */
.skel { position: relative; overflow: hidden; background: #242424; border-radius: 4px; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, hsla(0,0%,100%,.06), transparent); animation: shimmer 1.4s infinite; background-size: 400px 100%; }

/* ===== detail header ===== */
.detail-hero { position: relative; padding: 0 32px 24px; display: flex; align-items: flex-end; gap: 24px; min-height: 260px; }
.detail-hero__img { width: 232px; height: 232px; border-radius: 6px; object-fit: cover; box-shadow: 0 4px 60px rgba(0,0,0,.5); flex-shrink: 0; }
.detail-hero__img.round { border-radius: 50%; }
.detail-hero__type { font-size: 13px; font-weight: 700; text-transform: capitalize; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.detail-hero__type svg { width: 20px; height: 20px; color: #4cb3ff; }
.detail-hero__title { font-size: clamp(2rem, 6vw, 5.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin: 4px 0 12px; }
.detail-hero__meta { display: flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 500; flex-wrap: wrap; }
.detail-hero__meta img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.detail-hero__meta .m-strong { font-weight: 700; }
.detail-hero__meta .dot { color: var(--text-subdued); }
.detail-hero__meta .sub { color: hsla(0,0%,100%,.7); }
.detail-hero__desc { color: hsla(0,0%,100%,.7); font-size: 13.5px; margin-bottom: 10px; }
.detail-actions { display: flex; align-items: center; gap: 24px; padding: 24px 32px 8px; position: sticky; top: var(--topbar-h); z-index: 8; }
.detail-actions.stuck { background: inherit; }

/* ===== context menu / dropdown ===== */
.ctx-menu {
  position: fixed; z-index: 1000; min-width: 196px; max-width: 280px;
  background: #282828; border-radius: 4px; padding: 4px;
  box-shadow: 0 16px 24px rgba(0,0,0,.3), 0 6px 8px rgba(0,0,0,.2);
  animation: popin .1s var(--ease-out);
  max-height: 70vh; overflow-y: auto;
}
.ctx-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 3px; font-size: 13.5px; font-weight: 500;
  color: hsla(0,0%,100%,.9); text-align: left; position: relative;
}
.ctx-item svg { width: 16px; height: 16px; color: var(--text-subdued); flex-shrink: 0; }
.ctx-item:hover { background: hsla(0,0%,100%,.1); color: #fff; }
.ctx-item:hover svg { color: #fff; }
.ctx-item.danger { color: var(--danger); }
.ctx-item .ctx-check { margin-left: auto; color: var(--accent); }
.ctx-item .ctx-arrow { margin-left: auto; color: var(--text-subdued); }
.ctx-sep { height: 1px; background: hsla(0,0%,100%,.1); margin: 4px 8px; }
.ctx-label { padding: 8px 12px 4px; font-size: 11.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.ctx-item__img { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; }
.ctx-item__txt { min-width: 0; }
.ctx-item__txt .t { font-size: 13.5px; }
.ctx-item__txt .s { font-size: 11.5px; color: var(--text-subdued); }

/* ===== toasts ===== */
.toast-wrap { position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--accent); color: #000; font-weight: 600; font-size: 13.5px;
  padding: 10px 20px; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: toast-in .2s var(--ease-out);
  display: flex; align-items: center; gap: 10px;
}
.toast svg { width: 16px; height: 16px; }

/* ===== tooltip ===== */
.tooltip {
  position: fixed; z-index: 3000; pointer-events: none;
  background: #282828; color: #fff; font-size: 12.5px; font-weight: 500;
  padding: 6px 10px; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.4);
  max-width: 260px; animation: fadein .1s;
}

/* ===== modal ===== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1500; display: flex; align-items: center; justify-content: center; animation: fadein .15s; }
.modal { background: #282828; border-radius: 8px; padding: 24px; width: 524px; max-width: calc(100vw - 48px); box-shadow: 0 16px 48px rgba(0,0,0,.6); animation: popin .15s var(--ease-out); }
.modal h2 { font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.modal__row { display: flex; gap: 16px; margin-bottom: 20px; }
.modal__img { width: 180px; height: 180px; border-radius: 4px; object-fit: cover; background: #181818; flex-shrink: 0; position: relative; display: flex; align-items: center; justify-content: center; color: var(--text-subdued); overflow: hidden; }
.modal__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.modal__fields { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.field { background: #3e3e3e; border: 1px solid transparent; border-radius: 4px; padding: 10px 12px; }
.field:focus-within { border-color: #fff; }
.field label { display: block; font-size: 11px; font-weight: 700; color: var(--text-subdued); margin-bottom: 2px; }
.field input, .field textarea { width: 100%; background: none; border: 0; outline: 0; color: #fff; font-size: 14px; resize: none; font-family: inherit; }
.modal__actions { display: flex; justify-content: flex-end; gap: 12px; }
.modal__legal { font-size: 11px; color: var(--text-subdued); margin-top: 14px; line-height: 1.5; }

/* equalizer bars for now playing indicators */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 2.5px; background: var(--accent); height: 100%; transform-origin: bottom; animation: eqbar .8s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; }
.eq i:nth-child(3) { animation-delay: .45s; }
.eq.paused i { animation-play-state: paused; }
