@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --page-bg: none;
  --ink: #111118;
  --paper: #f7f5f0;
  --accent: #e44b39;
  --border: #d7ccc3;
  --card: rgba(255, 255, 255, 0.9);
  --card-contrast: rgba(255, 255, 255, 0.86);
  --glass: rgba(20, 18, 22, 0.54);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.12);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.04);
  --overlay-tone: rgba(8, 8, 12, 0.97);
  --bg-opacity: 0.12;
  --nav-height: 64px;
  --muted: #40352c;
  --eyebrow: #6c5b4d;
  --subtitle: #5a4d43;
  --hero-copy: #3c2f2a;
  --nav-surface: rgba(247, 245, 240, 0.75);
  --nav-border: rgba(0, 0, 0, 0.06);
  --control-surface: rgba(255, 255, 255, 0.88);
  --ghost-surface: rgba(255, 255, 255, 0.92);
  --panel-surface: rgba(255, 255, 255, 0.9);
  --hero-surface: linear-gradient(135deg, rgba(231, 221, 211, 0.96), rgba(255, 252, 247, 0.96));
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Manrope', system-ui, sans-serif;
  padding: 0;
  margin: 0;
  transition: background-color 0.8s ease;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  padding-bottom: 86px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.dark-mode {
  --ink: #f4eefc;
  --paper: #0f0c14;
  --accent: #ff9b73;
  --border: #2f2436;
  --card: rgba(26, 21, 32, 0.92);
  --card-contrast: rgba(34, 27, 42, 0.88);
  --glass: rgba(6, 4, 12, 0.76);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.38);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -1px 0 rgba(0, 0, 0, 0.45);
  --overlay-tone: rgba(6, 6, 10, 0.94);
  --bg-opacity: 0.08;
  --nav-surface: rgba(18, 14, 24, 0.9);
  --nav-border: rgba(255, 255, 255, 0.05);
  --control-surface: rgba(30, 24, 36, 0.92);
  --ghost-surface: rgba(28, 22, 34, 0.9);
  --panel-surface: rgba(18, 15, 25, 0.92);
  --hero-surface: linear-gradient(135deg, rgba(30, 24, 40, 0.94), rgba(20, 16, 30, 0.9));
  --muted: #d6c7e8;
  --eyebrow: #c7b6e0;
  --subtitle: #d3c6e8;
  --hero-copy: #e8def5;
}

.hidden {
  display: none !important;
}

body::before {
  content: '';
  background-image: var(--page-bg);
  opacity: var(--bg-opacity);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: saturate(0.6);
  transition: opacity 0.6s ease;
}

body.theme-switching::before {
  opacity: 0;
}

.sr-only {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #a22c5d;
}

body.dark-mode a:hover {
  color: #ffb48a;
}

h1,
h2,
h3 {
  font-family: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
  margin: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  position: sticky;
  top: 0;
  z-index: 6;
  backdrop-filter: blur(12px);
  background: var(--nav-surface);
  border-bottom: 1px solid var(--nav-border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.nav-brand:hover {
  color: inherit;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, #111118, #e44b39);
  box-shadow: var(--shadow-inset);
  background-size: cover;
  background-position: center;
}

.brand-mark.has-image {
  background-repeat: no-repeat;
  box-shadow: none;
}

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--control-surface);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.theme-toggle input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.nav-link {
  border: 1px solid var(--border);
  background: var(--control-surface);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-link,
.ghost-button.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-link.icon-only,
.ghost-button.icon-only {
  padding: 10px;
  width: 44px;
  height: 44px;
}

.nav-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.ghost-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--ghost-surface);
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}


.player-hero {
  padding: 16px 24px 0;
}

.player-hero.minimal h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #15151c;
  margin: 0;
}

.album-heading {
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--eyebrow);
  margin-bottom: 8px;
}

.lede {
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 12px auto 0;
  color: var(--muted);
}

.album-shelf {
  padding: 6px 24px 16px;
}

.shelf-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}


.album-button {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  background: #fdfbf6;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border 0.22s ease;
  display: block;
  min-height: 0;
  aspect-ratio: 1 / 1;
  position: relative;
  box-shadow: var(--shadow-soft);
}

.album-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(0.98);
}

.album-button:hover {
  transform: translateY(-2px);
  border-color: #c6a88b;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.12);
}

.refresh-button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fffdf8 url('/img/icons8-refresh-52.png') center/62% no-repeat;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.refresh-button.loading {
  transform: rotate(260deg);
}

.player-layout {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 14px 24px 30px;
}

@media (min-width: 721px) {
  body.tracks-first .album-gallery-view {
    order: 2;
  }

  body.tracks-first .album-detail-view {
    order: 3;
  }

  body.tracks-first .player-pane {
    order: 1;
  }
}

.album-gallery-view,
.album-detail-view,
.player-pane {
  background: var(--panel-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.album-gallery-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gallery-subtitle {
  margin: 6px 0 0;
  color: var(--subtitle);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.welcome-state .player-layout {
  min-height: calc(100vh - 70px);
}

.album-gallery-view.welcome-state {
  min-height: calc(100vh - 140px);
  justify-content: center;
}

.album-gallery-view.welcome-state .gallery-header h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.album-gallery-view.welcome-state .album-gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  overflow: visible;
  padding-bottom: 0;
}

.welcome-hero {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 24px;
  align-items: center;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
  background: var(--hero-surface);
  margin-top: 4px;
}

.welcome-hero__media {
  position: relative;
  width: 100%;
}

.welcome-hero__cover {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  border: 8px solid rgba(255, 255, 255, 0.8);
  background: #f5f1eb;
  object-fit: cover;
  aspect-ratio: 1;
}

.welcome-hero__body {
  display: grid;
  gap: 10px;
}

.welcome-hero__label {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--eyebrow);
  margin: 0;
}

.welcome-hero__title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0;
}

.welcome-hero__copy {
  margin: 0;
  font-size: 1rem;
  color: var(--hero-copy);
  line-height: 1.6;
  max-width: 46ch;
}

.welcome-hero__actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.welcome-hero .pill.primary {
  background: #7b5a49;
  color: #fff9ef;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
  letter-spacing: 0.06em;
  text-decoration: none;
}

.welcome-hero .pill.primary:hover {
  background: #6d4f40;
}

@media (max-width: 960px) {
  .welcome-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .welcome-hero__media {
    max-width: 320px;
    margin: 0 auto;
  }
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.about-site-link {
  order: -1;
  width: 100%;
  color: var(--subtitle);
  font-weight: 700;
  text-decoration: none;
  text-transform: lowercase;
}

.about-site-link:hover,
.about-site-link:focus-visible {
  text-decoration: underline;
  color: var(--text-primary);
}

.gallery-filters .filter-search {
  flex: 1 1 260px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  font-size: 1rem;
}

.album-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.album-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--card), var(--card-contrast));
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.album-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.album-card-cover {
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
}

.album-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 12px;
  flex: 1;
  height: auto;
}

.album-card-meta h3 {
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.album-card-meta p {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 721px) {
  .album-card {
    height: 100%;
  }

  .album-card-meta {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100%;
  }
}

.album-detail-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-title h2 {
  font-size: 1.8rem;
}

.album-length {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.detail-body {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(260px, 420px) 1fr;
  align-items: start;
}

.detail-cover {
  border-radius: 18px;
  border: 1px solid var(--border);
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-soft);
}

.player-pane {
  border: 1px solid var(--border);
}

.track-panel {
  background: var(--panel-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 14px 18px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#trackListToggle {
  display: none;
}

.icon-button {
  border: 1px solid var(--border);
  background: var(--control-surface);
  padding: 6px 12px;
  border-radius: 18px;
  cursor: pointer;
}

.track-list-container {
  max-height: 520px;
  overflow: auto;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding-right: 6px;
}

.track-list-container::-webkit-scrollbar {
  width: 8px;
}

.track-list-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

body.dark-mode .track-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
}

.track-list-container::-webkit-scrollbar-track {
  background: transparent;
}

.track-list-container.collapsed {
  max-height: 0;
  padding: 0;
  overflow: hidden;
}

.track-panel.collapsed {
  border-color: rgba(0, 0, 0, 0.08);
}

.track-panel.collapsed .panel-header {
  margin-bottom: 0;
}

.track-panel.collapsed .track-list-container {
  padding: 0;
}

#tracksList {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.track-item {
  cursor: pointer;
  padding: 12px 14px;
  text-transform: uppercase;
  border-radius: 10px;
  background: var(--control-surface);
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.track-item div:first-child {
  text-align: center;
}

.track-item div:last-child {
  text-align: center;
  word-break: break-word;
}

.track-item:hover {
  color: var(--accent);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.track-item.active {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.22), rgba(228, 75, 57, 0.16));
  border-color: rgba(228, 75, 57, 0.7);
  color: #1f1111;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 10px 16px rgba(0, 0, 0, 0.12);
}

body.dark-mode .track-item {
  color: var(--ink);
}

body.dark-mode .track-item.active {
  background: linear-gradient(120deg, rgba(64, 46, 74, 0.8), rgba(228, 75, 57, 0.26));
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 18px rgba(0, 0, 0, 0.35);
}

.track-item.empty {
  justify-content: center;
  font-style: italic;
  color: var(--eyebrow);
}


.player-pane {
  background: var(--panel-surface);
  border-radius: 18px;
  padding: 6px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.player-stage {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-soft);
  background-size: cover;
  background-position: center;
  transition: background 0.6s ease, box-shadow 0.6s ease;
}

.stage-visual {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: 18px;
  align-items: center;
}

.track-artwork {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
  object-fit: cover;
  background: #f3ede2;
}

.overlay-art {
  border-radius: 16px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2);
  background: #f3ede2;
  object-fit: cover;
}

.media-loading {
  position: relative;
  background: linear-gradient(120deg, #f1e9dd 0%, #e0d5c9 50%, #f1e9dd 100%) !important;
  background-size: 200% 200% !important;
  animation: shimmer 1.4s ease infinite;
}

.media-error {
  background-color: #e7dbd0 !important;
}

.stage-meta {
  padding: 8px 10px;
  background: var(--control-surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-inset);
  transition: background-color 0.6s ease, box-shadow 0.6s ease;
}

.track-title {
  font-size: clamp(2rem, 4vw, 2.4rem);
  margin: 8px 0 6px;
}

.track-artist,
.album-title {
  margin: 4px 0;
  letter-spacing: 0.04em;
}

.player-controls {
  display: grid;
  grid-template-columns: repeat(5, auto) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 10px;
}

.volume-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.circle {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.circle.primary {
  background: linear-gradient(135deg, #ff7b5f, var(--accent));
  color: #fff;
  border: none;
  box-shadow: 0 12px 22px rgba(228, 75, 57, 0.35);
}

.circle:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.circle.ghost.active {
  background: rgba(142, 97, 68, 0.14);
  border-color: rgba(142, 97, 68, 0.6);
  color: #3b2922;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.1);
}

.time-control {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  gap: 10px;
  align-items: center;
}

#seek-bar {
  width: 100%;
  accent-color: var(--accent);
}

.timestamp {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.player-actions {
  display: flex;
  gap: 12px;
  padding: 4px 10px 6px;
}

.pill {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #111118, #222230);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pill.ghost {
  background: var(--control-surface);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
}

.pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.14);
}

.stage-verse {
  background: var(--panel-surface);
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  text-align: center;
  margin-top: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.morealbums {
  padding: 10px 24px 40px;
  text-align: center;
}

.album-buttons-fallback {
  margin: 10px auto 0;
  max-width: 1080px;
}

.rul {
  max-width: 240px;
  border: none;
  border-top: 1px solid var(--border);
}

footer {
  text-align: center;
  padding: 25px;
  font-size: 1rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05), var(--paper) 10px, var(--paper));
  color: var(--ink);
}

.footer-disclosure {
  max-width: 980px;
  margin: 0 auto;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--panel-surface);
  box-shadow: var(--shadow-soft);
}

.footer-disclosure summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.footer-disclosure summary::-webkit-details-marker {
  display: none;
}

.footer-disclosure[open] {
  border-color: #d4c8bf;
}

.default-footer {
  font-size: 0.95rem;
}

@media (max-width: 920px) {
  .detail-body {
    grid-template-columns: 1fr;
  }

  .album-gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .stage-visual {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  body:not(.welcome-state) .album-gallery-grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 1fr);
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    gap: 10px;
  }

  body:not(.welcome-state) .album-card {
    min-width: 200px;
    scroll-snap-align: start;
  }

  body.welcome-state .album-gallery-grid {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow-x: visible;
    scroll-snap-type: none;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
  }

  .detail-cover {
    max-width: 360px;
  }

  .track-title {
    font-size: 1.6rem;
  }
}

.now-playing {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(90deg, rgba(20, 18, 22, 0.92), rgba(20, 18, 22, 0.82));
  color: #f8f7f5;
  backdrop-filter: blur(16px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 16px 18px;
  gap: 18px;
  z-index: 10;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  align-items: center;
}

.now-playing.inactive {
  display: none;
}

.np-meta {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.np-art {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.5s ease, box-shadow 0.5s ease;
  background-color: #f3ede2;
}

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

.np-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  opacity: 0.8;
}

.np-title,
.np-artist {
  margin: 0;
  line-height: 1.2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
}

.np-title {
  font-weight: 700;
}

.np-title.marquee {
  display: inline-block;
  animation: np-marquee 11s ease-in-out infinite alternate;
  transform: translateX(0);
  will-change: transform;
}

@keyframes np-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(var(--marquee-offset, 0));
  }
}

.np-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  justify-self: center;
  align-items: center;
  flex-wrap: nowrap;
}

.np-controls button {
  cursor: pointer;
}

.np-secondary {
  display: none;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.track-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 32%), var(--overlay-tone);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  z-index: 12;
  transform: translateY(100%);
  transition: transform 0.35s ease, opacity 0.35s ease, background 0.6s ease;
  opacity: 0;
  pointer-events: none;
}

.track-overlay.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.overlay-content {
  width: min(1100px, 100vw);
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: relative;
  padding: 46px 18px 24px;
  overflow: hidden;
}

.close-overlay {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.overlay-visual img {
  width: min(540px, 92vw);
  max-height: 60vh;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.overlay-meta {
  text-align: center;
  color: #f7f7f7;
  padding: 0 12px;
}

.overlay-meta h2 {
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.overlay-meta p {
  margin: 4px 0;
  opacity: 0.9;
}

.overlay-controls {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

.overlay-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: min(640px, 90vw);
  color: #f7f7f7;
}

.overlay-progress input[type='range'] {
  width: 100%;
}

.overlay-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.icon-pill {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 10px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-pill.ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.icon-pill.ghost.active,
.icon-pill.active {
  background: rgba(255, 255, 255, 0.2);
  color: #111118;
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 720px) {
  :root {
    --nav-height: 64px;
    --np-height: 96px;
  }

  body {
    padding-bottom: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    background: var(--nav-surface);
  }

  .player-layout {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    gap: 0;
    padding: 8px 14px 12px;
  }

    body:not(.welcome-state) .album-gallery-view,
    .album-detail-view {
      background: transparent;
      border: none;
      box-shadow: none;
    }

    body:not(.welcome-state) .album-gallery-view {
      position: sticky;
      z-index: 11;
      padding: 6px 0 10px;
      background: transparent;
      border-bottom: none;
    }

    body.welcome-state .album-gallery-view {
      padding-top: 12px;
    }

    body:not(.welcome-state) .gallery-header,
    body:not(.welcome-state) .gallery-filters,
    body:not(.welcome-state) .album-card-meta {
      display: none;
    }

    body.welcome-state .gallery-header,
    body.welcome-state .gallery-filters,
    body.welcome-state .album-card-meta {
      display: flex;
    }

    body:not(.welcome-state) .gallery-header {
      align-items: center;
      justify-content: space-between;
    }

    body:not(.welcome-state) .album-gallery-grid {
      display: flex;
      gap: 12px;
      overflow-x: auto;
      padding: 0 0 10px;
      scroll-snap-type: x mandatory;
    }

    body:not(.welcome-state) .album-card {
      flex: 0 0 72px;
      min-width: 72px;
      max-width: 72px;
      scroll-snap-align: start;
      padding: 0;
      border-radius: 14px;
      box-shadow: none;
      border: none;
      background: transparent;
    }

  .album-card-cover {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  }

  body.welcome-state .album-card-cover {
    width: 95%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    margin: 10px auto;
  }

  .album-detail-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 4px 0 8px;
    min-height: 0;
  }

  .detail-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: transparent;
    padding: 8px 0 4px;
    border-bottom: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
  }

  #backToAlbums {
    display: none;
  }

  .detail-title {
    text-align: center;
  }

  .detail-title h2 {
    font-size: 1.3rem;
  }

  .detail-title .eyebrow,
  .album-length {
    color: rgba(255, 255, 255, 0.85);
  }

  .album-length,
  .track-item,
  .panel-header h3 {
    font-size: 0.95rem;
  }

  .detail-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
  }

  .detail-cover {
    width: min(360px, 100%);
    margin: 0 auto;
  }

  .track-panel {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 0 12px;
    box-shadow: none;
  }

  .track-list-container {
    max-height: none;
  }

  .player-pane {
    display: none !important;
  }

  .now-playing {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.14);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
    max-width: 100%;
    box-sizing: border-box;
  }

  .np-meta {
    grid-template-columns: 44px 1fr;
    align-items: center;
    width: 100%;
    gap: 10px;
  }

  .np-text {
    text-align: left;
    min-width: 0;
    overflow: hidden;
  }

  .np-label,
  .np-artist {
    display: none;
  }

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

  .np-title {
    display: inline-block;
  }

  .np-controls {
    justify-content: flex-end;
    width: auto;
    align-items: center;
    gap: 10px;
  }

  .np-controls .circle {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .np-secondary {
    display: none;
  }

  #navAlbums {
    display: none;
  }

  footer,
  .footer-disclosure {
    display: none;
  }

  .track-overlay {
    padding: 0 0 10px;
  }

  .overlay-content {
    height: 100vh;
    max-height: 100vh;
    padding: 54px 18px 18px;
    justify-content: center;
    gap: 16px;
    width: min(640px, 100%);
    margin: 0 auto;
  }

  .overlay-visual img {
    width: 240px;
    height: 240px;
    max-height: 52vh;
    object-fit: cover;
  }

  .overlay-meta {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .overlay-title,
  .overlay-artist,
  .overlay-album {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
    text-align: center;
    max-width: 100%;
  }

  .overlay-title {
    font-size: 1.2rem;
    line-height: 1.2;
  }

  .overlay-artist,
  .overlay-album {
    font-size: 0.9rem;
    line-height: 1.3;
  }

  .overlay-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
  }

  .overlay-progress {
    width: 100%;
  }

  .overlay-controls .icon-pill {
    justify-self: end;
    width: auto;
  }

  .overlay-actions {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  .overlay-controls .transport {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .overlay-controls .transport > .circle {
    flex: 0 0 auto;
  }
}
