/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
  border: 1px solid transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn-accent {
  background: var(--accent);
  color: var(--text-on-accent);
}

.btn-accent:hover {
  box-shadow: var(--shadow-accent);
}

.btn-dark {
  background: #0b0b0b;
  color: var(--accent);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  height: auto;
  padding: var(--space-2) var(--space-3);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--text-on-accent);
}

.btn-sm {
  height: 36px;
  padding: 0 var(--space-4);
  font-size: var(--text-xs);
}

.icon-btn {
  width: 40px;
  height: 40px;
  /* Every real use of .icon-btn sits inside a flex or grid row (topbar,
     track-row actions, player controls) that can run short on space. Flex/grid
     items shrink by default, and a 40px circular tap target quietly compressing
     to a sliver is worse than the row overflowing — overflow is at least
     visible and fixable per-container, a squashed button just looks broken. */
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn.is-active {
  color: var(--accent);
}

.icon-btn[disabled] {
  opacity: 0.35;
  pointer-events: none;
}

.lang-switch {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  font-family: var(--font-body);
  direction: ltr;
  border: 1px solid var(--border-strong);
}

/* ---------- Chips / Pills ---------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.chip {
  padding: 10px var(--space-5);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  background: transparent;
  transition: all var(--dur-fast) var(--ease-out);
}

.chip:hover {
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
  font-weight: 600;
}

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-head h2 {
  font-size: var(--text-lg);
}

.section-link {
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Track table ---------- */
.track-table {
  width: 100%;
  border-collapse: collapse;
}

.track-row {
  display: grid;
  grid-template-columns: 32px 1fr 180px 90px 88px;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) var(--ease-out);
}

.track-row:hover {
  background: var(--surface-2);
}

.track-row.is-playing .track-row__index {
  color: var(--accent);
}

.track-row__index {
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.track-row__play,
.track-row__eq {
  display: none;
  color: var(--accent);
}

/* hover on any row: reveal a start button over the index number */
.track-row:hover .track-row__index-num {
  display: none;
}

.track-row:hover .track-row__play--start {
  display: inline-flex;
}

/* current track, loaded but paused: always show the resume button */
.track-row.is-playing .track-row__index-num {
  display: none;
}

.track-row.is-playing .track-row__play--start {
  display: inline-flex;
}

.track-row.is-playing .track-row__eq,
.track-row.is-playing .track-row__play--pause {
  display: none;
}

/* current track, actually playing: show the animated equalizer by default */
body.is-playing .track-row.is-playing .track-row__play--start {
  display: none;
}

body.is-playing .track-row.is-playing .track-row__eq {
  display: flex;
}

/* ...and swap it for a pause control on hover */
body.is-playing .track-row.is-playing:hover .track-row__eq {
  display: none;
}

body.is-playing .track-row.is-playing:hover .track-row__play--pause {
  display: inline-flex;
}

.track-row__eq {
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 14px;
}

.track-row__eq span {
  width: 3px;
  background: currentColor;
  border-radius: 1px;
  animation: eq-bounce 0.9s ease-in-out infinite;
}

.track-row__eq span:nth-child(1) {
  animation-delay: -0.6s;
}

.track-row__eq span:nth-child(2) {
  animation-delay: -0.3s;
}

.track-row__eq span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes eq-bounce {
  0%, 100% {
    height: 4px;
  }
  50% {
    height: 14px;
  }
}

.track-row__main {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.track-art {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  background-size: cover;
}

.track-art svg {
  width: 18px;
  height: 18px;
}

.track-row__title,
.track-row__artist {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  text-align: inherit;
  cursor: pointer;
  max-width: 100%;
  /* These are anchors now; inline boxes ignore max-width, overflow and
     text-overflow, so long titles would stop truncating without this. */
  display: block;
}

.track-row__title {
  font-weight: 600;
  font-size: inherit;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-row__title:hover,
.track-row__title:focus-visible {
  text-decoration: underline;
}

.track-row__artist {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--text-sm);
}

.track-row__artist:hover,
.track-row__artist:focus-visible {
  text-decoration: underline;
  color: var(--text-primary);
}

.track-row__duration {
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
}

.track-row__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: flex-end;
}

.like-btn svg {
  transition: transform var(--dur-fast) var(--ease-out);
}

.like-btn.is-liked {
  color: var(--accent);
}

.like-btn.is-liked svg {
  fill: currentColor;
}

.like-btn:active svg {
  transform: scale(1.25);
}

/* ---------- Grid cards (artists / albums / radio / podcast) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-5);
}

/*
 * Mood/playlist cards want more visual weight than artist/album cards, hence
 * the wider minmax — but it was previously inlined as a raw style attribute
 * in playlist.js, which no responsive.css breakpoint could reach. At a
 * 390px-wide phone that inline 200px minimum meant exactly one column of
 * ~358x420px cards: four playlists became ~1700px of scrolling. This class
 * carries the same 200px desktop default while still yielding to the
 * .card-grid mobile overrides below (equal specificity, later in the
 * cascade — see responsive.css), which is the point: same shrink behaviour
 * as every other grid on the site, just a wider starting point.
 */
.card-grid--moods {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/*
 * Cascading entrance for grids/lists of cover art (media cards, track rows,
 * artist/album strips) — cards fade/slide in one after another via a small
 * per-item delay instead of all popping in at once whenever their images
 * happen to finish downloading. Purely cosmetic: the images themselves still
 * load in parallel at full browser speed, this only staggers each card's
 * reveal. animation-delay uses --stagger (set inline per item, capped so a
 * long list's tail doesn't wait forever) rather than nth-child, since
 * infinite-scroll appends only animate the newly-inserted batch — existing
 * cards must not replay. html.reduce-motion already collapses any
 * animation-duration to ~0 (see base.css), so this needs no separate opt-out.
 */
@keyframes revealIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  animation: revealIn 360ms var(--ease-out) both;
  animation-delay: calc(var(--stagger, 0) * 45ms);
}

.media-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  transition: background var(--dur-fast) var(--ease-out);
  position: relative;
}

.media-card:hover {
  background: var(--surface-2);
}

.media-card__art {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  overflow: hidden;
}

.media-card__art.is-round {
  border-radius: 50%;
}

.media-card__art svg {
  width: 30%;
  height: 30%;
}

.media-card__play {
  position: absolute;
  inset-inline-end: 8px;
  bottom: 8px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(6px);
  transition: all var(--dur-base) var(--ease-out);
  box-shadow: var(--shadow-md);
}

.media-card:hover .media-card__play {
  opacity: 1;
  transform: translateY(0);
}

.media-card__title {
  /* Rendered as <a> when the card has a detail page, <div> otherwise — block
     keeps the ellipsis working in both cases. */
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card__sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Popular artist row (horizontal) ---------- */
.artist-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: var(--space-5);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.artist-strip__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.artist-strip__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.artist-strip__category {
  width: fit-content;
  transition: color var(--dur-fast) var(--ease-out);
}

.artist-strip__category:hover {
  color: var(--accent);
  text-decoration: underline;
}

.artist-strip__art {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.artist-strip__art img,
.media-card__art img,
.track-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Right rail ---------- */
.album-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.album-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) var(--ease-out);
}

.album-row:hover {
  background: var(--surface-2);
}

.album-row__art {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  overflow: hidden;
}

/*
 * flex:1 + min-width:0 so this is the ONLY column that grows/shrinks — without
 * it, a flex item defaults to min-width:auto, so a long title's natural
 * (unwrapped) width could stretch the row past its container instead of
 * ellipsizing, pushing the chevron (margin-inline-start:auto) out to wherever
 * that overflow ended rather than the row's actual edge. That's what made
 * chevrons land at different horizontal positions depending on title length.
 */
.album-row__body {
  flex: 1;
  min-width: 0;
}

.album-row__title {
  font-weight: 600;
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-row__sub {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.album-row__chevron {
  margin-inline-start: auto;
  color: var(--text-tertiary);
}

/* ---------- Toggle switch (settings) ---------- */
.switch {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
  transition: background var(--dur-base) var(--ease-out);
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}

.switch.is-on {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.switch.is-on::after {
  transform: translateX(20px);
  background: var(--accent);
}

/* ---------- Form fields (settings) ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.field label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.field input[type='text'],
.field input[type='email'],
.field input[type='password'],
.field select {
  height: 46px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  transition: border-color var(--dur-fast) var(--ease-out);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--border-accent);
}

.field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.field-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  gap: var(--space-4);
}

.field-row__text strong {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
}

.field-row__text span {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.profile-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.settings-card h1,
.settings-card h2 {
  font-size: var(--text-md);
  margin-bottom: var(--space-1);
}

.settings-card > p {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

/* ---------- Auth (login/register) ---------- */
.auth-wrap {
  max-width: 420px;
  margin: var(--space-10) auto;
}

.auth-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.auth-tab {
  flex: 1;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.auth-tab.is-active {
  background: var(--accent);
  color: var(--text-on-accent);
}

.auth-error {
  color: var(--danger);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.auth-submit {
  width: 100%;
  justify-content: center;
}

.range-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.range-row input[type='range'] {
  flex: 1;
  accent-color: var(--accent);
}

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed;
  /* env(safe-area-inset-*) is physical, not logical, so it can't follow
     inset-inline-end automatically. The app is RTL-only today (English is
     disabled in js/i18n.js), where inline-end is the physical left edge —
     revisit this pairing if 'en' (LTR) ships. */
  inset-inline-end: calc(var(--space-6) + var(--safe-left));
  bottom: var(--player-clearance);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: bottom var(--dur-base) var(--ease-out);
}

body:not(.has-player) .toast-stack {
  bottom: calc(var(--space-6) + var(--safe-bottom));
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  animation: toast-in var(--dur-base) var(--ease-out);
  color: var(--text-primary);
}

.toast--success svg {
  color: var(--accent);
}

.toast--error {
  border-color: var(--danger);
}

.toast--error svg {
  color: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Context menu ---------- */
.context-menu {
  min-width: 190px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  animation: toast-in var(--dur-fast) var(--ease-out);
}

.context-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: start;
  width: 100%;
}

.context-menu__item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.context-menu__item svg {
  color: var(--text-tertiary);
}

.context-menu__chevron {
  margin-inline-start: auto;
  color: var(--text-muted);
}

/* ---------- Empty state ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-tertiary);
  gap: var(--space-3);
}

.empty-state svg {
  color: var(--text-muted);
}

.empty-state h3 {
  color: var(--text-secondary);
  font-size: var(--text-md);
}

/* ---------- Track (song) detail page ---------- */
.track-hero {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.track-hero__cover {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
  box-shadow: var(--shadow-md);
}

.track-hero__cover:hover,
.track-hero__cover:focus-visible {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.track-hero__cover svg {
  width: 30%;
  height: 30%;
}

.track-hero__info {
  min-width: 0;
}

.track-hero__info h1 {
  font-size: var(--text-3xl);
  margin: var(--space-2) 0 var(--space-3);
}

.track-hero__meta {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.track-hero__link {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

.track-hero__link:hover,
.track-hero__link:focus-visible {
  text-decoration: underline;
}

.track-hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.lyrics-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.lyrics-text {
  position: relative;
  white-space: pre-wrap;
  line-height: 2;
  font-size: var(--text-md);
  color: var(--text-secondary);
  max-height: 320px;
  overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease-out);
}

.lyrics-card.is-collapsible .lyrics-text::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 72px;
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
}

.lyrics-card.is-expanded .lyrics-text {
  max-height: none;
}

.lyrics-card.is-expanded .lyrics-text::after {
  display: none;
}

@media (max-width: 760px) {
  .track-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-5);
  }
  .track-hero__cover {
    width: 100%;
    max-width: 280px;
    height: auto;
    aspect-ratio: 1;
  }
}

/* ---------- Image modal (full-size cover) ---------- */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.image-modal.is-visible {
  opacity: 1;
}

.image-modal__art {
  width: min(70vmin, 480px);
  height: min(70vmin, 480px);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-lg);
  transform: scale(0.94);
  transition: transform var(--dur-base) var(--ease-out);
}

.image-modal.is-visible .image-modal__art {
  transform: scale(1);
}

.image-modal__caption {
  color: var(--text-primary);
  font-weight: 600;
}

.image-modal__close {
  position: absolute;
  /* .image-modal is position:fixed; inset:0 with no safe-area padding of its
     own, so these offsets are measured from the true physical screen edge —
     on a notched phone, an unadjusted 24px top would sit the button partly
     under the status bar. inset-inline-end pairs with --safe-left because the
     app is RTL-only today; see the toast-stack comment above for the caveat. */
  top: calc(var(--space-6) + var(--safe-top));
  inset-inline-end: calc(var(--space-6) + var(--safe-left));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--surface-3);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}

.image-modal__close:hover {
  background: var(--surface-hover);
}

/* ---------- Lyrics modal (player bar quick view) ---------- */
.lyrics-modal__box {
  position: relative;
  width: min(90vw, 480px);
  max-height: min(80vh, 640px);
  overflow-y: auto;
  background: var(--surface-3);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transform: scale(0.96);
  transition: transform var(--dur-base) var(--ease-out);
}

.lyrics-modal.is-visible .lyrics-modal__box {
  transform: scale(1);
}

.lyrics-modal__header {
  margin-bottom: var(--space-6);
  padding-inline-end: var(--space-10);
}

.lyrics-modal__header h3 {
  font-size: var(--text-xl);
  margin: var(--space-1) 0 var(--space-1);
}

.lyrics-modal__text {
  white-space: pre-wrap;
  line-height: 2;
  color: var(--text-secondary);
}

/* ---------- Prompt modal (create playlist, etc.) ---------- */
.prompt-modal__box {
  width: min(90vw, 380px);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: transform var(--dur-base) var(--ease-out);
}

.prompt-modal.is-visible .prompt-modal__box {
  transform: scale(1);
}

.prompt-modal__box h3 {
  font-size: var(--text-md);
  margin-bottom: var(--space-4);
}

.confirm-modal__message {
  line-height: 1.7;
}

.prompt-modal__input {
  width: 100%;
  height: 46px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.prompt-modal__input:focus {
  outline: none;
  border-color: var(--border-accent);
}

.prompt-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.confirm-modal .prompt-modal__actions {
  margin-top: var(--space-6);
}

/* ---------- Detail hero card (album / mood playlist) ----------
 * Was rendering with zero styling at all beyond the inline background —
 * .hero-card/.hero-card--primary/.hero-card__eyebrow had no CSS anywhere,
 * so album and mood-playlist pages showed raw unstyled text crammed against
 * a flat gradient rectangle. Modeled on .artist-hero's treatment (overlay
 * for legibility, big clamped title, eyebrow badge) but as a contained,
 * rounded card rather than a full-bleed banner — matches what "hero-card"
 * as a name actually implies, and fits these pages' layout better. */
.hero-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  min-height: 260px;
  padding: var(--space-10) var(--space-8) var(--space-8);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow-lg);
}

.hero-card--primary {
  /* The overlay/gradient background is always dark-toned regardless of the
     current theme, so text on top must stay light in both — same reasoning
     as .artist-hero's own override just below. */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.78);
}

.hero-card--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.14) 0%, transparent 55%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.5) 100%);
  z-index: 0;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.hero-card__eyebrow {
  display: inline-block;
  margin-bottom: var(--space-3);
}

.hero-card h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.1;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.hero-card p {
  color: var(--text-secondary);
  font-size: var(--text-md);
  margin-bottom: var(--space-6);
}

.hero-card .btn {
  width: fit-content;
}

@media (max-width: 760px) {
  .hero-card {
    min-height: 200px;
    padding: var(--space-6) var(--space-5) var(--space-5);
  }
}

/* ---------- Artist page (Spotify-style) ---------- */
.artist-hero {
  /* The darkening ::before overlay below is always black-based (it sits on
     top of the artist's own colorful gradient background, not the page
     surface), so the text on top of it must stay light in both themes —
     var(--text-primary)/--text-secondary flip to dark in light mode and
     would otherwise read as dark-on-dark here. */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.72);
  position: relative;
  min-height: 360px;
  margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-8)) var(--space-8);
  padding: var(--space-10) var(--space-8) var(--space-8);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
  overflow: hidden;
}

.artist-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.55) 75%, rgba(0, 0, 0, 0.85) 100%);
  z-index: 1;
}

.artist-hero__icon {
  position: absolute;
  inset-inline-end: var(--space-8);
  top: var(--space-8);
  opacity: 0.18;
  width: 160px;
  height: 160px;
}

.artist-hero__icon svg {
  width: 100%;
  height: 100%;
}

.artist-hero__content {
  position: relative;
  z-index: 2;
}

.artist-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.artist-hero__badge svg {
  color: var(--accent);
}

.artist-hero__name {
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.05;
  margin-bottom: var(--space-3);
}

.artist-hero__listeners {
  color: var(--text-secondary);
  font-size: var(--text-md);
}

.artist-actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.artist-actions .play-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-accent);
}

.artist-actions .play-fab:hover {
  transform: scale(1.05);
}

.artist-actions .play-fab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.artist-actions .play-fab:disabled:hover {
  transform: none;
}

.follow-btn {
  height: 40px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all var(--dur-fast) var(--ease-out);
}

.follow-btn:hover {
  border-color: var(--text-primary);
}

.follow-btn.is-following {
  background: var(--surface-3);
  border-color: transparent;
  color: var(--text-secondary);
}

.artist-strip--albums .artist-strip__art {
  border-radius: var(--radius-md);
}

.show-more-btn {
  margin-top: var(--space-3);
}

.about-card {
  background: var(--card-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

.about-card h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.about-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-6);
  max-width: 640px;
}

.about-card__stats {
  display: flex;
  gap: var(--space-8);
}

.about-card__stat strong {
  display: block;
  font-size: var(--text-xl);
  font-family: var(--font-heading);
}

.about-card__stat span {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

@media (max-width: 760px) {
  .artist-hero {
    min-height: 260px;
    margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-6);
    padding: var(--space-6) var(--space-4) var(--space-6);
  }
  .artist-hero__icon {
    display: none;
  }
  .artist-actions {
    gap: var(--space-3);
  }
}
