:root {
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(0, 0, 0, 0.05);
  --text-color: #222;
  --muted: rgba(0, 0, 0, 0.6);
  --card-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  --grad-bg: linear-gradient(135deg, #eef2f5 0%, #dfe5ea 100%);
  --bar-blue: linear-gradient(90deg, #84bdfd, #5a9bfa);
  --bar-green: linear-gradient(90deg, #9be2b7, #4ac59c);
  --bar-orange: linear-gradient(90deg, #ffdca3, #ffb86c);
}

[data-theme="dark"] {
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-color: #f4f4f4;
  --muted: rgba(255, 255, 255, 0.7);
  --card-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
  --grad-bg: linear-gradient(135deg, #0f141a 0%, #181e26 100%);
  --bar-blue: linear-gradient(90deg, #66a6ff, #3d7afc);
  --bar-green: linear-gradient(90deg, #75e1a0, #24b585);
  --bar-orange: linear-gradient(90deg, #ffd08b, #ff985e);
}

html, body {
  height: 100%;
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background: var(--grad-bg);
  color: var(--text-color);
  transition: background 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1400px;
  padding-top: 40px;
  padding-bottom: 60px;
}

.header {
  text-align: center;
  margin-bottom: 26px;
}

.header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}

.sub {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Grid layout */
#songList {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  transition: all 0.3s ease;
}

@media (min-width: 992px) {
  #songList {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px) saturate(130%);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
}

.glass:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.65);
}

[data-theme="dark"] .glass:hover {
  background: rgba(255, 255, 255, 0.1);
}

.song-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.song-meta { flex: 1; }

.song-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
}

.song-title:hover {
  text-decoration: underline;
}

.song-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge-link {
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--muted);
  text-decoration: none;
  transition: all 0.25s ease;
}

.badge-link:hover {
  background: var(--glass-border);
  color: var(--text-color);
}

.score-row {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.score-label {
  width: 90px;
  font-weight: 600;
}

.score-value {
  min-width: 38px;
  text-align: right;
  font-weight: 700;
  color: var(--text-color);
}

.progress {
  height: 8px;
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .progress {
  background: rgba(255, 255, 255, 0.07);
}

.progress-bar-custom { background: var(--bar-blue); height: 100%; }
.progress-bar-alt { background: var(--bar-green); height: 100%; }
.progress-bar-warn { background: var(--bar-orange); height: 100%; }

/* Theme toggle */
.theme-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  transform: scale(1.05);
}

.theme-toggle i {
  font-size: 1.25rem;
  color: var(--muted);
  transition: color 0.3s ease;
}

.theme-toggle:hover i {
  color: var(--text-color);
}

@media (max-width: 640px) {
  .song-row { flex-direction: column; align-items: stretch; }
  .song-actions { justify-content: space-between; }
}
