* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, #1e293b 0%, #0f172a 35%, #020617 100%);
  color: #f8fafc;
}

body {
  min-height: 100vh;
}

.page {
  width: min(1450px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
}

.hero {
  text-align: center;
  margin-bottom: 34px;
  padding: 28px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 0;
  color: #cbd5e1;
  font-size: 1.05rem;
}

.library-section {
  margin-top: 8px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.45rem;
  color: #ffffff;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}

.song-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.song-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border-color: rgba(96, 165, 250, 0.35);
}

.thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0f172a;
}

.thumb-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.7), rgba(2, 6, 23, 0.05));
  pointer-events: none;
}

.song-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 0.28s ease, filter 0.28s ease;
}

.song-card:hover .song-thumb {
  transform: scale(1.05);
  filter: brightness(1.05);
}

.song-info {
  padding: 18px 18px 16px;
}

.song-title {
  margin: 0 0 14px;
  font-size: 1.08rem;
  line-height: 1.4;
  color: #ffffff;
  min-height: 2.8em;
}

.progress-wrap {
  margin: 0 0 14px;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 10px;
  border: none;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  cursor: pointer;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
  transition: width 0.1s linear;
}

.time-row {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
  color: #cbd5e1;
}

.song-controls {
  display: flex;
  gap: 10px;
}

.song-controls button {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, filter 0.16s ease;
}

.song-controls button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.song-controls button:active {
  transform: translateY(0);
}

.play-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #04130a;
}

.stop-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
}

.empty-message,
.error-message,
.loading-message {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  border-radius: 20px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 1450px);
    padding: 22px 0 34px;
  }

  .hero {
    padding: 22px 16px;
    border-radius: 22px;
  }

  .music-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}