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

:root {
  --ink-0: #100f11;
  --ink-1: #222326;
  --ink-2: #303235;
  --ink-3: #45474d;
  --ink-4: #6f7374;
  --grey-1: #a3a1a1;
  --grey-2: #cccbcb;
  --off-white: #f6f6f6;
  --accent: #e84f57;
}

body {
  font-family: 'Saira Stencil', sans-serif;
  min-height: 100dvh;
}

a {
  color: inherit;
}

/* ── Shelf page ────────────────────────────────────── */

.shelf-page {
  background: #ffffff;
  color: var(--ink-0);
}

.shelf-header {
  padding: clamp(48px, 8vw, 96px) clamp(24px, 6vw, 96px) clamp(24px, 4vw, 48px);
}

.shelf-title {
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(32px, 4vw, 64px);
  padding: 0 clamp(24px, 6vw, 96px) clamp(64px, 8vw, 120px);
}

.record {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}

.record-cover {
  border-radius: 2px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.record-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.record:hover .record-cover {
  transform: translateY(-4px);
}

.record-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.record-title {
  font-size: 16px;
  font-weight: 600;
  color: #000000;
}

.record-meta {
  font-size: 16px;
  font-weight: 400;
  color: #000000;
}

.record-meta--muted {
  color: rgba(0, 0, 0, 0.5);
}

/* ── Player page ───────────────────────────────────── */

.player-page {
  background: var(--ink-0);
  color: var(--off-white);
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  padding-bottom: 100px;
}

.player-hero {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.vinyl-decor {
  position: absolute;
  top: 50%;
  left: -10%;
  width: min(70vw, 900px);
  aspect-ratio: 1 / 1;
  transform: translateY(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--ink-0) 0 4%, transparent 4.2%),
    repeating-radial-gradient(circle at center, var(--ink-2) 0, var(--ink-2) 1px, transparent 1px, transparent 14px),
    radial-gradient(circle at center, var(--ink-3) 0 18%, var(--ink-1) 18% 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  opacity: 0.9;
}

.player-panel {
  position: relative;
  z-index: 1;
  margin: clamp(40px, 6vw, 80px) clamp(24px, 6vw, 80px) 0 auto;
  width: min(560px, calc(100vw - 48px));
  background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 32px;
  padding: clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

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

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--off-white);
  font-weight: 600;
  font-size: 16px;
}

.panel-icons {
  display: flex;
  gap: 16px;
  color: var(--grey-1);
}

.panel-icons button {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.panel-icons button:hover,
.panel-icons button.active {
  opacity: 1;
  color: var(--off-white);
}

.album-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.album-cover-wrap {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink-1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.album-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.album-title {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  line-height: 1;
}

.album-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: var(--grey-1);
  flex-wrap: wrap;
}

.track-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 40vh;
  overflow-y: auto;
}

.track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

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

.track-row.playing {
  background: rgba(255, 255, 255, 0.1);
}

.track-row.unavailable {
  opacity: 0.45;
}

.track-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.track-index {
  width: 24px;
  flex-shrink: 0;
  font-size: 14px;
  color: var(--grey-1);
  text-align: center;
}

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

.track-title {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-duration {
  font-size: 14px;
  color: var(--grey-1);
  flex-shrink: 0;
}

/* ── Mini player bar ───────────────────────────────── */

.mini-player {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--off-white);
  color: var(--ink-0);
  border-radius: 20px;
  padding: 10px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  width: min(600px, calc(100vw - 32px));
}

.mini-cover {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--ink-1);
}

.mini-track {
  display: flex;
  flex-direction: column;
  min-width: 90px;
  overflow: hidden;
}

.mini-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-artist {
  font-size: 12px;
  color: var(--ink-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.mini-controls button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-0);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
}

.mini-controls button#play-btn {
  font-size: 22px;
}

.mini-seek {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mini-seek input[type="range"] {
  flex: 1;
  accent-color: var(--ink-0);
}

.mini-time {
  font-size: 12px;
  color: var(--ink-4);
  flex-shrink: 0;
  min-width: 32px;
}

@media (max-width: 720px) {
  .player-panel {
    margin: 24px auto 0;
  }

  .vinyl-decor {
    display: none;
  }

  .mini-track,
  .mini-seek {
    display: none;
  }
}
