:root {
  color-scheme: dark;
  --bg: #101318;
  --panel: #191f29;
  --panel-soft: #202837;
  --text: #f2f5f8;
  --muted: #a9b2c3;
  --accent: #1ed760;
  --accent-strong: #18b650;
  --danger: #ff6b6b;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(30, 215, 96, 0.2), transparent 28rem),
    linear-gradient(135deg, #101318, #121923 48%, #0c1016);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.hero h1 {
  max-width: 780px;
  margin: 0.3rem 0;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero-text {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.15rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-card,
.panel,
.controls-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(25, 31, 41, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 1.3rem;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(30, 215, 96, 0.14);
  color: var(--accent);
  font-weight: 700;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  color: #08110c;
  background: var(--accent);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--panel-soft);
}

.danger-button {
  color: white;
  background: rgba(255, 107, 107, 0.28);
  border: 1px solid rgba(255, 107, 107, 0.45);
}

.controls-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: end;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.search-row {
  display: grid;
  gap: 0.45rem;
}

.search-row label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.search-row input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.search-row input:focus {
  border-color: rgba(30, 215, 96, 0.7);
}

.content-grid {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 1.5rem;
}

.panel {
  min-height: 360px;
  padding: 1rem;
}

.panel h2 {
  margin: 0 0 1rem;
}

.playlist-list {
  display: grid;
  gap: 0.65rem;
}

.playlist-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 0.65rem;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.playlist-item:hover,
.playlist-item.active {
  border-color: rgba(30, 215, 96, 0.55);
  background: rgba(30, 215, 96, 0.1);
}

.playlist-item img,
.playlist-placeholder,
.detail-header img,
.detail-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--panel-soft);
}

.playlist-placeholder,
.detail-placeholder {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 900;
}

.playlist-item strong,
.playlist-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-item small {
  margin-top: 0.2rem;
  color: var(--muted);
}

.detail-header {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.detail-header img,
.detail-placeholder {
  width: 132px;
  height: 132px;
  border-radius: 24px;
}

.detail-header h2 {
  margin: 0.25rem 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
}

.description {
  color: var(--muted);
}

.track-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding-left: 1.2rem;
}

.track-list li {
  padding: 0.8rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.track-list li::marker {
  color: var(--accent);
  font-weight: 800;
}

.track-list li {
  display: list-item;
}

.track-list span {
  display: inline-grid;
  width: calc(100% - 4.5rem);
  gap: 0.15rem;
}

.track-list small {
  color: var(--muted);
}

.track-list time {
  float: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.empty-state,
.loading,
.error-box {
  display: grid;
  min-height: 160px;
  place-items: center;
  border-radius: 22px;
  padding: 1.5rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
}

.error-box {
  color: #ffd5d5;
  background: rgba(255, 107, 107, 0.16);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10;
  max-width: min(420px, calc(100vw - 2rem));
  border-radius: 18px;
  padding: 1rem 1.2rem;
  color: #08110c;
  background: var(--accent);
  box-shadow: var(--shadow);
  font-weight: 800;
}

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

@media (max-width: 840px) {
  .app-shell {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .hero,
  .content-grid,
  .controls-card {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(2.3rem, 13vw, 4.5rem);
  }

  .controls-card {
    align-items: stretch;
  }

  .detail-header {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .detail-header img,
  .detail-placeholder {
    width: 88px;
    height: 88px;
    border-radius: 18px;
  }
}
