:root {
  color-scheme: dark;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: #0f1117;
  color: #f5f5f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0f1117;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
}

.sidebar {
  border-right: 1px solid #1f2430;
  padding: 24px;
  background: #131721;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.sidebar__header h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.sidebar__header p {
  margin: 0;
  color: #9ca3b0;
  font-size: 14px;
}

.status {
  padding: 12px;
  background: #1b2230;
  border-radius: 8px;
  color: #cbd1dc;
  font-size: 14px;
}

.status--error {
  background: #2a1620;
  color: #f5b8c5;
}

.track-list {
  list-style: none;
  padding: 0;
  margin: 0;

  display: flex;
  flex-direction: column;
  gap: 12px;

  overflow-y: auto;
  flex: 1;          /* ← занимает всё доступное место */
  min-height: 0;    /* ← КРИТИЧНО для flex */
}

.track {
  padding: 12px 14px;
  border-radius: 10px;
  background: #1a2030;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.track:hover {
  background: #242b3a;
  transform: translateY(-1px);
}

.track--active {
  background: #2e3750;
  border: 1px solid #5b76ff;
}

.track__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.track__title {
  font-weight: 600;
}

.track__artist {
  color: #9ca3b0;
  font-size: 13px;
}

.track__duration {
  color: #9ca3b0;
  font-size: 13px;
}

.player {
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player__card {
  background: #151b26;
  border-radius: 20px;
  padding: 32px;
  max-width: 640px;
  width: 100%;
  display: grid;
  gap: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.player__art {
  width: 240px;
  height: 240px;
  border-radius: 18px;
  overflow: hidden;
  background: #1f2430;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: #7a8294;
}

.player__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player__info h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.player__info p {
  margin: 4px 0;
  color: #b3bccb;
}

.player__album {
  font-size: 14px;
  color: #9aa4b3;
}

.player__duration {
  font-size: 14px;
  color: #8c96a8;
}

.player__audio {
  width: 100%;
}

.player__empty {
  text-align: center;
  color: #9ca3b0;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh;
  }

  .sidebar {
    max-height: 50vh;
  }
}

.track-list::-webkit-scrollbar {
  width: 8px;
}

.track-list::-webkit-scrollbar-thumb {
  background: #2e3750;
  border-radius: 4px;
}

.track-list::-webkit-scrollbar-track {
  background: transparent;
}