/* ===== MDTW-Music — dark streaming UI ===== */
:root {
  --bg: #0b0b10;
  --bg-elevated: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-player: #0f0f16ee;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f4f4f8;
  --text-muted: #9a9aab;
  --text-dim: #6b6b7b;
  --accent: #a78bfa;
  --accent-2: #22d3ee;
  --accent-glow: rgba(167, 139, 250, 0.35);
  --spotify: #1db954;
  --spotify-hover: #1ed760;
  --youtube: #ff0033;
  --youtube-hover: #ff2d55;
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 240px;
  --player-h: 96px;
  --topbar-h: 64px;
  --font: "Outfit", system-ui, sans-serif;
  --font-display: "Space Grotesk", var(--font);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --transition: 180ms ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(167, 139, 250, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(34, 211, 238, 0.1), transparent 45%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(167, 139, 250, 0.08), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ===== Layout ===== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--player-h);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  grid-row: 1 / 2;
  background: rgba(12, 12, 18, 0.85);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: calc(100vh - var(--player-h));
  z-index: 30;
}

.main-wrap {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100vh - var(--player-h));
}

.player {
  grid-column: 1 / -1;
  grid-row: 2;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-h);
  background: var(--bg-player);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  z-index: 40;
}

/* ===== Brand ===== */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem 1.75rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  color: #0b0b10;
  font-weight: 700;
  box-shadow: 0 0 24px var(--accent-glow);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* ===== Nav ===== */
.nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-align: left;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-item.active {
  background: rgba(167, 139, 250, 0.12);
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 0.5rem 0;
}

.sidebar-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.45;
}

/* ===== Top bar ===== */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(11, 11, 16, 0.92), rgba(11, 11, 16, 0.7) 70%, transparent);
  backdrop-filter: blur(8px);
}

.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem;
  color: var(--text);
  cursor: pointer;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.profile-wrap {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.profile-pic {
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid rgba(167, 139, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.12), 0 4px 14px rgba(0, 0, 0, 0.35);
  background: var(--bg-card);
  display: block;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.profile-wrap--hero {
  margin-left: 0;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
}

.profile-pic--hero {
  width: 180px;
  height: 180px;
  border-width: 3px;
  box-shadow:
    0 0 0 4px rgba(167, 139, 250, 0.18),
    0 16px 40px rgba(0, 0, 0, 0.45),
    0 0 48px rgba(167, 139, 250, 0.2);
}

.profile-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin: 0;
}

.profile-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: -0.35rem 0 0;
}

.profile-pic:hover {
  transform: scale(1.04);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.28), 0 10px 28px rgba(0, 0, 0, 0.45);
}

.hero-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.12);
}

/* ===== Content ===== */
.content {
  padding: 0.5rem 1.75rem calc(var(--player-h) + 2rem);
  flex: 1;
}

.view[hidden] {
  display: none !important;
}

.view-active {
  animation: fadeIn 0.28s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2.5rem;
  padding: 1.5rem 0 0.5rem;
}

.hero-kicker {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 1.02rem;
}

.hero-stats {
  display: flex;
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  min-width: 100px;
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

/* Section heads */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-sub {
  font-size: 0.875rem;
  color: var(--text-dim);
}

/* Album grid */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

.album-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  text-align: left;
  width: 100%;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.album-card:hover,
.album-card:focus-visible {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  outline: none;
}

.album-card:focus-visible {
  box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}

.album-cover-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1a24;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.album-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.album-card:hover .album-cover-wrap img {
  transform: scale(1.05);
}

.album-play-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 4px 16px var(--accent-glow);
  pointer-events: none;
}

.album-card:hover .album-play-badge {
  opacity: 1;
  transform: none;
}

.album-meta h3 {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-meta .artist {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-meta .meta-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.genre-pill {
  background: rgba(167, 139, 250, 0.12);
  color: var(--accent);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 500;
}

/* Album detail */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0;
  margin-bottom: 1.5rem;
  font-weight: 500;
  transition: color var(--transition);
}

.back-btn:hover {
  color: var(--text);
}

.album-detail {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.12), rgba(34, 211, 238, 0.06) 50%, transparent);
  border: 1px solid var(--border);
}

.detail-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.detail-info {
  min-width: 0;
  padding-bottom: 0.25rem;
}

.detail-type {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.detail-info h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.detail-artist {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.35rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: transform var(--transition), filter var(--transition);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: scale(1.02);
}

.btn-primary:active {
  transform: scale(0.98);
}

.ext-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.ext-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
}

.ext-spotify {
  color: var(--spotify);
}

.ext-spotify:hover {
  border-color: rgba(29, 185, 84, 0.4);
  background: rgba(29, 185, 84, 0.1);
  color: var(--spotify-hover);
}

.ext-youtube {
  color: var(--youtube);
}

.ext-youtube:hover {
  border-color: rgba(255, 0, 51, 0.4);
  background: rgba(255, 0, 51, 0.1);
  color: var(--youtube-hover);
}

/* Track list */
.track-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.track-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto 36px;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  background: transparent;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  outline: none;
}

.track-row:focus-visible {
  background: rgba(167, 139, 250, 0.08);
  box-shadow: inset 0 0 0 2px rgba(167, 139, 250, 0.45);
}

.track-row:last-child {
  border-bottom: none;
}

.track-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.track-row.playing {
  background: rgba(167, 139, 250, 0.1);
}

.track-row.playing .track-num,
.track-row.playing .track-title {
  color: var(--accent);
}

.track-num {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.track-num .eq {
  display: none;
  gap: 2px;
  justify-content: center;
  align-items: flex-end;
  height: 14px;
}

.track-row.playing .track-num .num {
  display: none;
}

.track-row.playing .track-num .eq {
  display: flex;
}

.eq span {
  width: 3px;
  background: var(--accent);
  border-radius: 1px;
  animation: eq 0.8s ease-in-out infinite alternate;
}

.eq span:nth-child(1) {
  height: 40%;
  animation-delay: 0s;
}
.eq span:nth-child(2) {
  height: 80%;
  animation-delay: 0.15s;
}
.eq span:nth-child(3) {
  height: 55%;
  animation-delay: 0.3s;
}

@keyframes eq {
  from {
    transform: scaleY(0.4);
  }
  to {
    transform: scaleY(1);
  }
}

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

.track-title {
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-duration {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
  text-align: right;
}

.track-ext {
  display: flex;
  gap: 0.35rem;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.track-row:hover .track-ext {
  opacity: 1;
}

.track-ext a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}

.track-ext a:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

.track-ext .spot {
  color: var(--spotify);
}

.track-more {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.track-more:hover,
.track-more[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.track-menu {
  position: fixed;
  z-index: 55;
  min-width: 180px;
  padding: 0.35rem;
  background: #1a1a24;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.track-menu[hidden] {
  display: none;
}

.track-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.85rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
}

.track-menu-item:hover,
.track-menu-item:focus-visible {
  background: rgba(167, 139, 250, 0.16);
  outline: none;
}

.credits-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(5, 5, 10, 0.72);
  display: grid;
  place-items: center;
  padding: 1.25rem;
  backdrop-filter: blur(8px);
}

.credits-overlay[hidden] {
  display: none;
}

.credits-dialog {
  width: min(420px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: var(--shadow);
}

.credits-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.credits-dialog-head h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.credits-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.credits-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.credits-song {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.credits-fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.credits-fields > div {
  display: grid;
  gap: 0.15rem;
}

.credits-fields dt {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

.credits-fields dd {
  font-size: 1rem;
  font-weight: 500;
}

.credits-names {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.track-ext .yt {
  color: var(--youtube);
}

/* No results */
.no-results {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

/* ===== Player ===== */
.player-inner {
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(280px, 1.4fr) minmax(160px, 1fr);
  align-items: center;
  gap: 1rem;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.np-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #1a1a24;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  display: block;
}

/* Idle state: brand profile photo when nothing is playing */
.np-cover--idle {
  object-position: center top;
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.np-meta {
  min-width: 0;
}

.np-title {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

.ctrl-btn:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.ctrl-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ctrl-play {
  width: 42px;
  height: 42px;
  background: var(--text);
  color: var(--bg);
  position: relative;
}

.ctrl-play .play-icon {
  display: block;
  pointer-events: none;
}

.ctrl-play .play-icon.is-hidden {
  display: none !important;
}

.ctrl-play:hover:not(:disabled) {
  background: #fff;
  color: var(--bg);
  transform: scale(1.05);
}

.ctrl-play:disabled {
  background: var(--text-dim);
  color: var(--bg);
  opacity: 0.5;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 520px;
}

.time {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 2.4rem;
}

.time:last-child {
  text-align: right;
}

.seek,
.volume {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

.seek {
  flex: 1;
}

.seek::-webkit-slider-thumb,
.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow var(--transition);
}

.seek:hover::-webkit-slider-thumb,
.volume:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.25);
}

.seek::-moz-range-thumb,
.volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--text);
}

.seek:disabled,
.volume:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.player-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  min-width: 0;
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.volume {
  width: 88px;
}

.player-actions .ext-links {
  display: flex;
  gap: 0.4rem;
}

.player-actions .ext-btn {
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
}

.player-actions .ext-btn[hidden] {
  display: none;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 25;
}

.sidebar-overlay[hidden] {
  display: none;
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: var(--player-h);
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    height: auto;
  }

  .sidebar.open {
    transform: none;
  }

  .main-wrap {
    grid-column: 1;
  }

  .menu-btn {
    display: grid;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-aside {
    order: -1;
    width: 100%;
  }

  .profile-pic--hero {
    width: 140px;
    height: 140px;
  }

  .hero-stats {
    flex-wrap: wrap;
    justify-content: center;
  }

  .album-detail {
    grid-template-columns: 160px 1fr;
    gap: 1.25rem;
  }

  .player-inner {
    grid-template-columns: 1fr 1.2fr auto;
  }

  .volume-wrap {
    display: none;
  }

  .player-actions .ext-btn span {
    display: none;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 0.25rem 1rem calc(var(--player-h) + 1.5rem);
  }

  .topbar {
    padding: 0 1rem;
  }

  .album-detail {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .detail-cover {
    max-width: 200px;
    margin: 0 auto;
  }

  .detail-actions {
    justify-content: center;
  }

  .detail-meta {
    justify-content: center;
  }

  .track-row {
    grid-template-columns: 32px 1fr auto 36px;
  }

  .track-duration {
    display: none;
  }

  .player {
    --player-h: 110px;
    height: var(--player-h);
  }

  .player-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    padding: 0.5rem 0.85rem 0.6rem;
    gap: 0.25rem;
  }

  .now-playing {
    order: 1;
  }

  .player-controls {
    order: 2;
  }

  .player-actions {
    position: absolute;
    right: 0.75rem;
    top: 0.65rem;
    justify-content: flex-end;
  }

  .np-cover {
    width: 44px;
    height: 44px;
  }

  .hero h1 {
    font-size: 1.65rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
