* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #0e0e0e;
  color: #f0f0f0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── 리스트 뷰 ─────────────────────────────────────── */
.list-view {
  min-height: 100vh;
  padding-bottom: 60px;
}

.list-header {
  padding: 48px 48px 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.list-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}

.list-header p {
  font-size: 13px;
  color: #555;
  margin-top: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-btn {
  background: #00EE6F;
  border: none;
  color: #0e0e0e;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.add-btn:hover {
  background: #00cc5e;
}

/* ── 카드 그리드 ───────────────────────────────────── */
.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 0 48px 48px;
}

.song-card {
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  background: #161616;
  aspect-ratio: 1 / 1;
  position: relative;
  transition: transform 0.2s;
}

.song-card:hover {
  transform: translateY(-4px);
}

.card-cover {
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  color: #2a2a2a;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-info-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.97) 0%, rgba(0,0,0,0.7) 55%, transparent 100%);
}

.card-info-bottom .card-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-info-bottom .card-meta {
  font-size: 11px;
  color: #bbb;
  margin-top: 2px;
}


/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 100px 48px;
  color: #444;
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 20px;
}

.empty-state button {
  background: none;
  border: 1px solid #333;
  color: #666;
  padding: 10px 24px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.empty-state button:hover {
  border-color: #00EE6F;
  color: #00EE6F;
}

/* ── 딤 ────────────────────────────────────────────── */
.dim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 50;
}

.dim.visible {
  display: block;
}

/* ── 드로어 ────────────────────────────────────────── */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 520px;
  height: 100vh;
  background: #141414;
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border-left: 1px solid #1e1e1e;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-top-btns {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 0;
  flex-shrink: 0;
}

.drawer-top-right {
  display: flex;
  gap: 4px;
}

.icon-btn {
  background: none;
  border: none;
  color: #555;
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.icon-btn:hover {
  color: #fff;
  background: #222;
}

.edit-icon-btn:hover {
  color: #00EE6F;
}

.delete-icon-btn:hover {
  color: #ff4d4d;
  background: rgba(255, 77, 77, 0.1);
}

.drawer-inner {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 24px 32px 40px;
  gap: 28px;
}

.drawer-inner::-webkit-scrollbar { width: 3px; }
.drawer-inner::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

/* ── 플레이어 패널 ─────────────────────────────────── */
.player-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.cover-wrap {
  width: 220px;
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
  background: #1e1e1e;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

#audio {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.cover-placeholder {
  font-size: 64px;
  color: #2a2a2a;
}

.player-info {
  text-align: center;
  width: 100%;
}

.player-info h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

#song-meta {
  font-size: 12px;
  color: #555;
  margin-top: 6px;
}

#song-desc {
  font-size: 13px;
  color: #777;
  margin-top: 10px;
  line-height: 1.6;
}

.controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seekbar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #555;
}

#seekbar {
  flex: 1;
  -webkit-appearance: none;
  height: 3px;
  border-radius: 2px;
  background: #2a2a2a;
  cursor: pointer;
  outline: none;
}

#seekbar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #00EE6F;
  cursor: pointer;
}

.buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.buttons button {
  background: none;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.buttons button:hover {
  color: #fff;
  background: #222;
}

#btn-play {
  font-size: 20px;
  color: #0e0e0e;
  background: #00EE6F;
  width: 52px;
  height: 52px;
}

#btn-play:hover {
  background: #00cc5e;
  color: #0e0e0e;
}

.repeat-row {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

#btn-repeat {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 12px;
  border: 1px solid #2a2a2a;
  color: #3a3a3a;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

#btn-repeat:hover {
  border-color: #444;
  color: #666;
}

#btn-repeat.active {
  border-color: rgba(0, 238, 111, 0.35);
  color: #00EE6F;
}

/* ── 정렬 바 ────────────────────────────────────────── */
.sort-bar {
  padding: 0 48px 20px;
}

#sort-select {
  background: #1a1a1a;
  border: 1px solid #222;
  color: #555;
  font-size: 12px;
  font-family: inherit;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23444'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

#sort-select:focus {
  border-color: #333;
  color: #888;
}

/* ── 가사 패널 ─────────────────────────────────────── */
.lyrics-panel {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #1e1e1e;
  padding-top: 24px;
}

.lyrics-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #00EE6F;
  margin-bottom: 20px;
}

.lyric-line {
  font-size: 18px;
  font-weight: 500;
  color: #2a2a2a;
  line-height: 1.6;
  padding: 5px 0;
  transition: color 0.3s, font-size 0.3s;
}

.lyric-line.active {
  color: #fff;
  font-size: 22px;
}

.lyric-line.past {
  color: #444;
}

/* 타임스탬프 없는 가사 */
.lyric-line.plain {
  color: #aaa;
  font-size: 16px;
}

.no-lyrics {
  font-size: 14px;
  color: #333;
  padding: 12px 0;
}

/* ── 업로드 모달 ────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.open {
  display: flex;
}

.upload-modal-box {
  background: #181818;
  border-radius: 16px;
  width: 820px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.upload-modal-box::-webkit-scrollbar { width: 3px; }
.upload-modal-box::-webkit-scrollbar-thumb { background: #2a2a2a; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px 0;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.modal-x {
  background: none;
  border: none;
  color: #555;
  font-size: 16px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}

.modal-x:hover {
  color: #fff;
  background: #222;
}

.form-body {
  display: flex;
  gap: 32px;
  padding: 28px 32px;
  flex: 1;
}

/* 폼 왼쪽 */
.form-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 200px;
  flex-shrink: 0;
}

.cover-upload {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  background: #222;
  border: 2px dashed #2e2e2e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s;
}

.cover-upload:hover {
  border-color: #00EE6F;
}

#cover-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  position: absolute;
  inset: 0;
}

.cover-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #444;
}

.cover-plus {
  font-size: 28px;
  color: #333;
}

.cover-hint p {
  font-size: 13px;
}

.cover-sub-hint {
  font-size: 11px;
  color: #3a3a3a;
  text-align: center;
  line-height: 1.4;
}

.audio-upload {
  width: 100%;
  padding: 12px 16px;
  background: #222;
  border: 2px dashed #2e2e2e;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s;
}

.audio-upload:hover {
  border-color: #00EE6F;
}

#audio-label {
  font-size: 13px;
  color: #555;
  pointer-events: none;
}

/* 폼 오른쪽 */
.form-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.req {
  color: #00EE6F;
}

.label-hint {
  font-size: 11px;
  color: #444;
  font-weight: 400;
  margin-left: 6px;
}

.credit-chips {
  display: flex;
  gap: 8px;
}

.credit-chip {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid #2a2a2a;
  background: #222;
  color: #555;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.credit-chip:hover {
  border-color: #444;
  color: #aaa;
}

.credit-chip.selected {
  border-color: #00EE6F;
  background: rgba(0, 238, 111, 0.08);
  color: #00EE6F;
}

.field input,
.field textarea {
  background: #222;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #f0f0f0;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  resize: none;
  transition: border-color 0.15s;
}

.field input:focus,
.field textarea:focus {
  border-color: #00EE6F;
}

.field input[readonly] {
  color: #555;
  cursor: default;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
}

/* 폼 하단 */
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 32px 28px;
  flex-shrink: 0;
}

.btn-cancel {
  background: none;
  border: 1px solid #2a2a2a;
  color: #666;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-cancel:hover {
  border-color: #444;
  color: #aaa;
}

#btn-submit {
  background: #00EE6F;
  border: none;
  color: #0e0e0e;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 28px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

#btn-submit:hover {
  background: #00cc5e;
}


::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }
