:root {
  --bg-color: #0f0f1a;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.7);
  --accent: #05190c;
  --accent-glow: rgba(9, 10, 9, 0.4);
  --text-main: #89898d;
  --text-muted: #3d3d41;
  --rank-bg: linear-gradient(135deg, #6366f1, #22d3ee);
}

body {
  color: var(--text-main);
  font-family: "Inter", sans-serif;
}

h1 {
  text-align: center;
  margin: 2rem 0 1rem;
  font-size: 2rem;
}

.music-list {
  max-width: 700px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.music-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 14px 18px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.music-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px var(--accent-glow);
}

/* Poignée de drag */
.drag-handle {
  cursor: grab;
  font-size: 1.3rem;
  color: var(--text-muted);
  user-select: none;
  padding: 4px;
}

.drag-handle:active {
  cursor: grabbing;
}

.rank {
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--rank-bg);
  color: white;
  flex-shrink: 0;
}

.music-info {
  flex: 1;
  min-width: 0;
}

.music-info h2 {
  font-size: 1.05rem;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.music-info p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotify-button {
  flex-shrink: 0;
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

.spotify-button:hover {
  background: #17a94a;
  transform: scale(1.05);
}

/* États du drag SortableJS */
.music-card.sortable-ghost {
  opacity: 0.4;
  background: var(--accent-glow);
}

.music-card.sortable-chosen {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.music-card.sortable-drag {
  cursor: grabbing;
}

/* Toast de confirmation */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: white;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: #e11d48;
}
