:root {
  --bg: #0b1016;
  --surface: rgba(16, 27, 40, 0.78);
  --surface-strong: rgba(22, 35, 51, 0.92);
  --text: #e8f3ff;
  --muted: #9db6cc;
  --accent: #29d3a1;
  --accent-2: #ffc857;
  --danger: #ff7676;
  --border: rgba(145, 178, 204, 0.2);
  --shadow: 0 20px 40px rgba(2, 7, 14, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(41, 211, 161, 0.14), transparent 34%),
    radial-gradient(circle at 78% 2%, rgba(255, 200, 87, 0.16), transparent 26%),
    linear-gradient(150deg, #05080d 0%, #0b1119 55%, #121b27 100%);
}

.bg-glow {
  position: fixed;
  inset: -20%;
  background: conic-gradient(from 120deg, rgba(41, 211, 161, 0.12), transparent 45%, rgba(255, 200, 87, 0.08), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.layout {
  position: relative;
  z-index: 2;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 18px 54px;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
}

.hero h1 span {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--accent-2);
}

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

.subtitle {
  color: var(--muted);
  margin: 12px 0 6px;
  max-width: 72ch;
}

.dj-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

h2 {
  margin-top: 0;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.grid-form input,
.grid-form textarea,
button {
  width: 100%;
  border: 1px solid rgba(150, 180, 205, 0.28);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
}

.grid-form input:focus,
.grid-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.full-width {
  grid-column: 1 / -1;
}

button {
  cursor: pointer;
  background: linear-gradient(120deg, var(--accent), #31e3b0);
  color: #04281e;
  font-weight: 700;
}

button.secondary {
  background: transparent;
  color: var(--text);
}

button.danger {
  background: linear-gradient(120deg, #ff8f8f, #ff7676);
  color: #2f0808;
}

.status {
  margin-bottom: 0;
  min-height: 1.2em;
  color: var(--accent-2);
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.toolbar {
  display: flex;
  gap: 10px;
}

.badge {
  display: inline-block;
  background: rgba(41, 211, 161, 0.18);
  color: var(--accent);
  border: 1px solid rgba(41, 211, 161, 0.28);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.queue-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.queue-list li {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(7, 13, 20, 0.55);
}

.queue-list li.song-item {
  cursor: default;
}

body.dragging-song {
  cursor: grabbing;
  user-select: none;
}

body.dragging-song * {
  cursor: grabbing !important;
}

body > li.song-item.dragging {
  list-style: none;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.queue-list li.song-item.dragging,
body > li.song-item.dragging {
  border-color: rgba(41, 211, 161, 0.78);
  background: rgba(18, 32, 46, 0.96);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.42),
    0 10px 24px rgba(41, 211, 161, 0.16),
    0 0 0 1px rgba(41, 211, 161, 0.18);
  filter: none;
  opacity: 0.98;
  transform-origin: center;
  will-change: transform;
}

.queue-list.reordering li.song-item {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.queue-list.saving {
  opacity: 0.72;
  pointer-events: none;
}

.queue-list li.song-placeholder {
  border: 1px dashed rgba(41, 211, 161, 0.55);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(41, 211, 161, 0.12), rgba(255, 200, 87, 0.08)),
    rgba(7, 13, 20, 0.28);
  box-shadow: inset 0 0 0 1px rgba(41, 211, 161, 0.08);
}

.queue-list li.queue-divider {
  border: 0;
  border-radius: 0;
  padding: 8px 2px 2px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.queue-list li.played {
  border-style: dashed;
  opacity: 0.52;
  background: rgba(7, 13, 20, 0.3);
  filter: grayscale(0.25);
}

.queue-list li.played.dragging {
  opacity: 0.98;
  filter: none;
}

body > li.played.dragging {
  border-style: dashed;
}

.song-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.song-row.draggable-row {
  position: relative;
  align-items: stretch;
}

.song-row.draggable-row .song-main {
  flex: 1;
}

.drag-handle {
  flex: 0 0 34px;
  width: 34px;
  min-height: 100%;
  border-radius: 10px;
  padding: 0;
  background: rgba(157, 182, 204, 0.1);
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}

.drag-handle::before {
  content: "::";
  display: block;
  font-weight: 700;
  letter-spacing: 2px;
  transform: rotate(90deg);
}

.queue-list.reordering .drag-handle,
.drag-handle:active {
  cursor: grabbing;
}

.song-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.song-actions {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.song-actions button {
  pointer-events: auto;
}

.played-action {
  position: absolute;
  right: 0;
  bottom: 0;
  width: auto;
  min-width: 180px;
}

.song-row.queued-row .song-main {
  padding-bottom: 52px;
}

.song-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.note-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.note-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 2px solid rgba(41, 211, 161, 0.54);
  border-radius: 10px;
  background: rgba(41, 211, 161, 0.08);
  color: #bdd1e3;
  overflow-wrap: anywhere;
}

.note-display.empty-note {
  border-left-color: rgba(157, 182, 204, 0.3);
  background: rgba(157, 182, 204, 0.06);
  color: var(--muted);
}

.note-display-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.note-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.note-input {
  width: 100%;
  border: 1px solid rgba(150, 180, 205, 0.28);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  min-height: 74px;
  resize: vertical;
}

.note-input:focus {
  border-color: var(--accent);
  outline: none;
}

.note-save {
  align-self: end;
  width: auto;
  min-width: 110px;
}

.note-save.saved {
  border-color: rgba(41, 211, 161, 0.5);
  color: var(--accent);
}

.inline-icon-button {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.inline-icon-button:hover,
.inline-icon-button:focus-visible,
.inline-icon-button.active {
  background: rgba(41, 211, 161, 0.16);
  color: var(--accent);
}

.inline-icon-button:focus-visible {
  outline: 2px solid rgba(41, 211, 161, 0.45);
  outline-offset: 2px;
}

.copy-song::before,
.copy-song::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.copy-song::before {
  top: 5px;
  left: 10px;
  opacity: 0.58;
}

.copy-song::after {
  top: 9px;
  left: 6px;
  background: var(--surface-strong);
}

.edit-note::before,
.edit-note::after {
  content: "";
  position: absolute;
  display: block;
}

.edit-note::before {
  top: 13px;
  left: 6px;
  width: 16px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-42deg);
}

.edit-note::after {
  top: 7px;
  left: 19px;
  width: 0;
  height: 0;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-left: 6px solid currentColor;
  transform: rotate(-42deg);
  transform-origin: left center;
}

.inline-icon-button.copied {
  background: rgba(41, 211, 161, 0.22);
  color: var(--accent);
}

.song-title {
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.song-artist {
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.78rem;
  border-radius: 999px;
  border: 1px solid rgba(157, 182, 204, 0.22);
  padding: 4px 8px;
  color: #d4e6f7;
}

.tag.genre {
  border-color: rgba(41, 211, 161, 0.4);
  color: #8ff8d8;
}

.tag.vibe {
  border-color: rgba(255, 200, 87, 0.44);
  color: #ffe0a3;
}

.meta {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #90a8bf;
}

.empty {
  margin: 14px 0 0;
  color: var(--muted);
}

.hidden {
  display: none;
}

.animate-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.45s ease forwards;
}

.delay-1 {
  animation-delay: 0.08s;
}

.delay-2 {
  animation-delay: 0.16s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .grid-form {
    grid-template-columns: 1fr;
  }

  .song-row {
    flex-direction: column;
  }

  .song-row.draggable-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .song-row.draggable-row > div:last-child {
    grid-column: 2;
  }

  .note-editor {
    grid-template-columns: 1fr;
  }

  .note-save {
    width: 100%;
  }

  .toolbar {
    width: 100%;
    justify-content: space-between;
  }
}
