/* =========================================================
   MusicShare — 다크 + 라벤더 디자인 시스템
   ========================================================= */
:root {
  --bg: #060509;
  --bg-2: #0c0a12;
  --surface: rgba(255,255,255,.035);
  --surface-2: rgba(255,255,255,.06);
  --surface-3: rgba(255,255,255,.09);
  --hair: rgba(255,255,255,.07);
  --hair-2: rgba(255,255,255,.12);
  --fg: #f3f0fa;
  --fg-2: #aaa3bf;
  --fg-3: #6f6886;
  --acc: #a68cff;
  --acc-2: #7b5cf0;
  --acc-deep: #5a3dc4;
  --acc-soft: rgba(166,140,255,.14);
  --glow: rgba(140,110,255,.35);
  --rose: #ff7aa8;
  --danger: #ff6b8b;
  --radius: 18px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --font: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Malgun Gothic", sans-serif;
  --display: "Outfit", var(--font);
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--fg); background: var(--bg);
  font: 16px/1.6 var(--font); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; padding-bottom: 140px;
}
/* 은은한 보라 빛 번짐 */
body::before {
  content: ""; position: fixed; inset: -20vh -10vw auto; height: 90vh; z-index: -2; pointer-events: none;
  background:
    radial-gradient(40vw 40vw at 18% 20%, rgba(106,75,216,.28), transparent 65%),
    radial-gradient(35vw 35vw at 85% 0%, rgba(166,140,255,.14), transparent 65%);
  filter: blur(20px);
}
/* 미세한 필름 노이즈 */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--acc-2); color: #fff; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 99px; border: 3px solid var(--bg); }

.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- 버튼 ---------- */
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .5; cursor: wait; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--hair); color: var(--fg);
  transition: background .2s var(--ease), border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn:hover { background: var(--surface-3); border-color: var(--hair-2); }
.btn:active { transform: scale(.97); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--acc-2), var(--acc));
  box-shadow: 0 8px 24px -8px var(--glow), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 15.5px; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.block { width: 100%; height: 50px; font-size: 16px; }
.btn.danger:hover, .btn.arming { color: var(--danger); border-color: rgba(255,107,139,.45); background: rgba(255,107,139,.08); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--fg-2);
  transition: background .2s, color .2s, transform .2s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.liked { color: var(--rose); }
.icon-btn.liked .ic { fill: currentColor; }
.icon-btn.danger:hover { color: var(--danger); background: rgba(255,107,139,.08); }
.icon-btn.arming { width: auto; padding: 0 12px; border-radius: 999px; color: var(--danger); background: rgba(255,107,139,.1); font-size: 13px; font-weight: 600; }
.like-btn { width: auto; padding: 0 12px 0 10px; border-radius: 999px; gap: 6px; display: inline-flex; align-items: center; font-size: 13.5px; font-family: var(--display); }

.txt-btn {
  height: 32px; padding: 0 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--fg-2);
  border: 1px solid var(--hair); transition: all .2s;
}
.txt-btn:hover { color: var(--fg); border-color: var(--hair-2); background: var(--surface); }
.txt-btn.on { color: var(--acc); border-color: rgba(166,140,255,.4); background: var(--acc-soft); }
.txt-btn.arming { color: var(--danger); border-color: rgba(255,107,139,.45); }

.back-link { color: var(--fg-2); font-size: 14px; margin-bottom: 18px; transition: color .2s; }
.back-link:hover { color: var(--fg); }

/* ---------- 헤더 ---------- */
header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(6,5,9,.72); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--hair);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; height: 68px; padding: 0 24px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 11px; }
.logo-mark { width: 32px; height: 32px; flex: none; filter: drop-shadow(0 0 12px rgba(166,140,255,.45)); }
.logo-mark.lg { width: 52px; height: 52px; }
.logo-text {
  font-family: var(--display); font-size: 21px; letter-spacing: .03em; line-height: 1;
  background: linear-gradient(100deg, #fff 0%, #e6deff 45%, #a68cff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo-text .light { font-weight: 200; }
.logo-text .bold { font-weight: 600; }

nav {
  display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--hair);
}
nav button {
  height: 36px; padding: 0 18px; border-radius: 999px; font-size: 14.5px; font-weight: 500;
  color: var(--fg-2); white-space: nowrap; transition: color .2s, background .25s var(--ease);
}
nav button:hover { color: var(--fg); }
nav button.active { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }

#auth-area { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.me-chip { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--fg-2); }
.me-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: radial-gradient(circle at 30% 25%, #c7b6ff, var(--acc-2) 55%, var(--acc-deep));
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px rgba(166,140,255,.35);
}

/* ---------- 페이지 공통 ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 40px 24px 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head.center { justify-content: center; text-align: center; }
.eyebrow {
  display: inline-block; font-family: var(--display); font-size: 12px; font-weight: 600;
  letter-spacing: .22em; color: var(--acc); text-transform: uppercase;
}
.page-title { margin: 6px 0 0; font-size: 40px; line-height: 1.15; font-weight: 700; letter-spacing: -.035em; }
.page-sub { margin: 6px 0 0; color: var(--fg-2); font-size: 15px; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; }
.seg {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--hair);
}
.seg button {
  height: 32px; padding: 0 15px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--fg-2);
  white-space: nowrap; transition: all .22s var(--ease);
}
.seg button:hover { color: var(--fg); }
.seg button.active { color: #fff; background: linear-gradient(135deg, var(--acc-2), var(--acc)); box-shadow: 0 6px 16px -6px var(--glow); }
.footnote { color: var(--fg-3); font-size: 12.5px; margin: 18px 4px 0; }
.hint, .empty { color: var(--fg-3); font-size: 14px; }
.empty { list-style: none; text-align: center; padding: 56px 16px; border: 1px dashed var(--hair-2); border-radius: var(--radius); }
.msg { color: var(--fg-2); font-size: 15px; min-height: 0; margin: 14px 2px 0; }
.msg:empty { display: none; }
.msg.err { color: var(--danger); }

/* ---------- 1위 히어로 ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 32px; padding: 32px;
  border-radius: 26px; border: 1px solid var(--hair); margin-bottom: 28px;
  background: linear-gradient(135deg, rgba(30,22,52,.9), rgba(12,10,18,.9));
}
.hero-bg {
  position: absolute; inset: -40px; z-index: -1; width: calc(100% + 80px); height: calc(100% + 80px);
  object-fit: cover; filter: blur(60px) saturate(1.3); opacity: .38; transform: scale(1.15);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(6,5,9,.55) 0%, rgba(6,5,9,.2) 60%, rgba(6,5,9,.5) 100%);
}
.hero-cover {
  width: 184px; height: 184px; flex: none; border-radius: 16px; object-fit: cover;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.08);
}
.hero-cover { grid-row: 1 / span 2; align-self: center; }
.hero-head { min-width: 0; align-self: end; }
.hero-foot { min-width: 0; align-self: start; }
.hero-rank { font-family: var(--display); font-weight: 700; font-size: 15px; color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.hero-rank .crown { color: #ffd98a; }
.hero-title { margin: 10px 0 6px; font-size: 30px; line-height: 1.25; font-weight: 700; letter-spacing: -.03em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { margin: 0; color: rgba(243,240,250,.72); font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 8px; margin: 16px 0 22px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: 13px; font-family: var(--display); color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(8px);
}
.chip .ic { width: 14px; height: 14px; }
.chip.acc { color: #fff; background: rgba(166,140,255,.22); border-color: rgba(166,140,255,.35); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 곡 목록 ---------- */
.songs { list-style: none; padding: 0; margin: 0; }
.song {
  position: relative; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 14px; transition: background .2s;
}
.song + .song::before { content: ""; position: absolute; top: 0; left: 14px; right: 14px; height: 1px; background: var(--hair); }
.song:hover { background: var(--surface); }
.song[data-id] { cursor: pointer; }
.song[data-id]:hover .cover-play { opacity: 1; }
.song .add-panel, .song .pts, .song .actions { cursor: default; }
.song .actions button { cursor: pointer; }
.song:hover::before, .song:hover + .song::before { opacity: 0; }
.song.playing { background: linear-gradient(90deg, var(--acc-soft), transparent 70%); }
.song.playing .title { color: #cbbcff; }

.rank { width: 40px; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.rank b { font-family: var(--display); font-size: 22px; font-weight: 300; color: var(--fg); }
.song.top .rank b { font-weight: 700; background: linear-gradient(180deg, #fff, var(--acc)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chg { font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--fg-3); margin-top: 3px; white-space: nowrap; }
.chg.up { color: #8ff0c0; }
.chg.down { color: #8b9bd6; }
.chg.new { color: #fff; font-weight: 700; letter-spacing: .06em; font-size: 9.5px; padding: 1px 5px; border-radius: 4px; background: linear-gradient(135deg, var(--acc-2), var(--acc)); }

.cover-wrap { position: relative; width: 56px; height: 56px; flex: none; border-radius: 10px; overflow: hidden; cursor: pointer;
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06); }
.cover { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--bg-2); }
.cover-play {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  background: rgba(6,5,9,.55); opacity: 0; transition: opacity .2s;
}
.cover-play .ic { width: 22px; height: 22px; }
.cover-wrap:hover .cover-play { opacity: 1; }
.eq { position: absolute; inset: 0; display: none; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 17px; background: rgba(6,5,9,.55); }
.eq span { width: 3px; border-radius: 2px; background: #fff; animation: eq 1s ease-in-out infinite; }
.eq span:nth-child(1) { height: 10px; animation-delay: -.4s; }
.eq span:nth-child(2) { height: 18px; animation-delay: -.2s; }
.eq span:nth-child(3) { height: 13px; animation-delay: -.6s; }
@keyframes eq { 0%,100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.song.playing .eq { display: flex; }
.song.playing:hover .eq { display: none; }

.info { flex: 1; min-width: 160px; }
.title { font-size: 15.5px; font-weight: 600; line-height: 1.4; letter-spacing: -.015em;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.meta { color: var(--fg-2); font-size: 13.5px; margin-top: 2px; display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }
.meta .dot { color: var(--fg-3); }
.meta2 { color: var(--fg-3); font-size: 12.5px; margin-top: 2px; display: flex; align-items: center; flex-wrap: wrap; gap: 0 10px; font-family: var(--display); }
.meta2 .ic { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }
.badge { display: inline-block; vertical-align: 2px; margin-left: 8px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; color: var(--fg-3); border: 1px solid var(--hair-2); }
.badge.pub { color: var(--acc); border-color: rgba(166,140,255,.4); background: var(--acc-soft); }

.pts { width: 72px; flex: none; text-align: right; line-height: 1.2; }
.pts b { display: block; font-family: var(--display); font-size: 19px; font-weight: 600; }
.pts small { font-size: 11px; color: var(--fg-3); white-space: nowrap; }
.actions { display: flex; align-items: center; gap: 2px; }

/* 공유자 뱃지 */
.tier { display: inline-flex; align-items: center; font-family: var(--display); font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  padding: 1px 8px; border-radius: 99px; margin-left: 6px; text-transform: uppercase; }
.tier.bronze { color: #f0b38a; background: rgba(240,179,138,.1); border: 1px solid rgba(240,179,138,.35); }
.tier.silver { color: #e2e5ef; background: rgba(226,229,239,.08); border: 1px solid rgba(226,229,239,.3); }
.tier.gold { color: #ffd98a; background: rgba(255,217,138,.1); border: 1px solid rgba(255,217,138,.4); }
.tier.diamond { color: #fff; background: linear-gradient(135deg, rgba(123,92,240,.6), rgba(166,140,255,.35)); border: 1px solid rgba(200,185,255,.5); box-shadow: 0 0 14px var(--glow); }

/* 공유자 행 */
.avatar {
  width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 21px; font-weight: 700; color: #fff;
  background: radial-gradient(circle at 30% 25%, #c7b6ff, var(--acc-2) 55%, var(--acc-deep));
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ring, rgba(166,140,255,.35));
}
.avatar.bronze { --ring: #c98a5e; } .avatar.silver { --ring: #c9ccd8; } .avatar.gold { --ring: #ffd98a; } .avatar.diamond { --ring: #c8b8ff; }

/* "+ 담기" 펼침 패널 */
.add-panel {
  flex-basis: 100%; margin: 6px 0 4px; padding: 16px; border-radius: 16px; display: grid; gap: 12px;
  background: rgba(16,13,26,.92); border: 1px solid var(--hair-2); box-shadow: 0 20px 40px -20px rgba(0,0,0,.7);
  animation: drop .25s var(--ease);
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.add-head { display: flex; justify-content: space-between; align-items: center; font-size: 14.5px; }
.add-head button { color: var(--fg-3); font-size: 13px; }
.add-head button:hover { color: var(--fg); }
.add-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; }
.choice {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left;
  padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--hair); transition: all .2s;
}
.choice:hover { background: var(--acc-soft); border-color: rgba(166,140,255,.4); }
.choice span:last-child { color: var(--fg-3); font-size: 12.5px; font-family: var(--display); flex: none; }
.add-note { color: var(--fg-3); font-size: 13.5px; margin: 0; }

/* ---------- 입력칸 ---------- */
input[type=url], input[type=password], input[type=text], input:not([type]) {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; font: inherit; font-size: 15.5px; color: var(--fg);
  background: rgba(255,255,255,.04); border: 1px solid var(--hair-2); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder { color: var(--fg-3); }
input:focus { border-color: rgba(166,140,255,.7); background: rgba(255,255,255,.06); box-shadow: 0 0 0 4px rgba(166,140,255,.15); }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { flex: 1; min-width: 0; }

/* ---------- 플레이리스트 ---------- */
.pl-create {
  display: flex; align-items: center; justify-content: space-between; gap: 18px 24px; flex-wrap: wrap;
  padding: 20px 22px; margin-bottom: 28px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(123,92,240,.14), rgba(255,255,255,.02)); border: 1px solid var(--hair);
}
.pl-create-text { display: grid; gap: 2px; }
.pl-create-text b { font-size: 16px; }
.pl-create-text span { color: var(--fg-2); font-size: 13.5px; }
.pl-create-text em { font-style: normal; color: var(--acc); font-weight: 600; }
.pl-create .inline-form { flex: 1 1 340px; max-width: 480px; }
.pl-create .inline-form input { height: 44px; }
.pl-create .inline-form .btn { height: 44px; }

.pl-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px; }
.pl-card { cursor: pointer; }
.pl-card .mosaic-wrap { position: relative; margin-bottom: 12px; }
.pl-card .mosaic { transition: transform .35s var(--ease), box-shadow .35s; }
.pl-card:hover .mosaic { transform: translateY(-4px); box-shadow: 0 24px 40px -18px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.1); }
.pl-play {
  position: absolute; right: 12px; bottom: 12px; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--acc-2), var(--acc)); box-shadow: 0 10px 24px -6px var(--glow);
  opacity: 0; transform: translateY(8px); transition: all .3s var(--ease);
}
.pl-play .ic { width: 20px; height: 20px; }
.pl-card:hover .pl-play { opacity: 1; transform: translateY(-4px); }
.pl-card .title { font-size: 15.5px; }
.pl-card .meta { font-size: 13px; }
.mosaic {
  aspect-ratio: 1; border-radius: 16px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, #241a40, #0e0b16); box-shadow: 0 12px 30px -16px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.06);
  font-family: var(--display); font-size: 44px; color: rgba(166,140,255,.7);
}
.mosaic.grid4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; place-items: stretch; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pl-hero {
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: flex-end; gap: 30px; flex-wrap: wrap;
  padding: 32px; margin-bottom: 22px; border-radius: 26px; border: 1px solid var(--hair);
  background: linear-gradient(135deg, rgba(30,22,52,.9), rgba(12,10,18,.9));
}
.pl-hero-bg { position: absolute; inset: -40px; z-index: -1; background-size: cover; background-position: center; filter: blur(60px) saturate(1.3); opacity: .38; }
.pl-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(6,5,9,.55) 0%, rgba(6,5,9,.25) 60%, rgba(6,5,9,.55) 100%);
}
#pl-cover-wrap .mosaic { width: 200px; }
.pl-hero-body { flex: 1; min-width: 220px; }
#pl-title { margin: 8px 0 6px; font-size: 38px; line-height: 1.15; font-weight: 700; letter-spacing: -.035em; word-break: break-all; }
#pl-title .inline-form input { font-size: 20px; height: 48px; }
#pl-meta { margin: 0 0 20px; color: rgba(243,240,250,.72); font-size: 15px; display: flex; gap: 6px; flex-wrap: wrap; }
.dot { opacity: .6; }

/* ---------- 변환 ---------- */
.convert-wrap { max-width: 660px; margin: 0 auto; }
#convert-form {
  display: grid; gap: 26px; padding: 30px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border: 1px solid var(--hair); box-shadow: 0 30px 80px -40px rgba(0,0,0,.8);
}
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-no {
  flex: none; width: 30px; height: 30px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--acc);
  border: 1px solid rgba(166,140,255,.45); background: var(--acc-soft);
}
.step-body { flex: 1; min-width: 0; }
.step-label { display: block; font-size: 17px; font-weight: 700; margin-bottom: 12px; letter-spacing: -.02em; }
.field { position: relative; }
.field .ic { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--fg-3); width: 20px; height: 20px; }
.field input { height: 58px; padding-left: 48px; font-size: 16.5px; border-radius: 16px; }
.quality { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quality button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; border-radius: 16px;
  background: rgba(255,255,255,.03); border: 1px solid var(--hair-2); transition: all .22s var(--ease);
}
.quality button:hover { border-color: rgba(166,140,255,.4); }
.quality button b { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.quality button b i { font-style: normal; font-size: 12px; font-weight: 400; color: var(--fg-3); margin-left: 2px; }
.quality button small { color: var(--fg-3); font-size: 12.5px; }
.quality button.active {
  border-color: rgba(166,140,255,.75); background: linear-gradient(160deg, rgba(123,92,240,.35), rgba(166,140,255,.12));
  box-shadow: 0 10px 30px -14px var(--glow), inset 0 1px 0 rgba(255,255,255,.12);
}
.quality button.active b i, .quality button.active small { color: #ddd3ff; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer;
  padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid var(--hair-2);
}
.switch-text b { display: block; font-size: 16px; }
.switch-text small { color: var(--fg-3); font-size: 13px; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 50px; height: 30px; margin: 0;
  border-radius: 99px; background: rgba(255,255,255,.12); cursor: pointer; transition: background .25s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform .25s var(--ease);
}
.switch:checked { background: linear-gradient(135deg, var(--acc-2), var(--acc)); }
.switch:checked::after { transform: translateX(20px); }
.big-btn {
  position: relative; overflow: hidden; height: 60px; border-radius: 18px; font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -.01em;
  background: linear-gradient(135deg, var(--acc-deep), var(--acc-2) 45%, var(--acc));
  box-shadow: 0 18px 40px -16px var(--glow), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .2s var(--ease), filter .2s;
}
.big-btn::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%);
  transition: transform .8s var(--ease);
}
.big-btn:hover { filter: brightness(1.06); }
.big-btn:hover::after { transform: translateX(120%); }
.big-btn:active { transform: scale(.985); }
.progress-top { display: flex; justify-content: space-between; font-size: 14px; color: var(--fg-2); margin-bottom: 8px; }
#progress-pct { font-family: var(--display); color: var(--fg); }
.bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .5s var(--ease);
  background: linear-gradient(90deg, var(--acc-2), #d2c4ff); box-shadow: 0 0 14px var(--glow); }
.bar i.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
#convert-result { margin-top: 12px; }

/* ---------- 로그인 창 ---------- */
dialog {
  width: min(400px, calc(100vw - 32px)); padding: 0; border-radius: 26px; color: var(--fg);
  background: linear-gradient(180deg, #15111f, #0c0a12); border: 1px solid var(--hair-2);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), 0 0 80px -30px var(--glow);
}
dialog[open] { animation: pop .3s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
dialog::backdrop { background: rgba(3,2,6,.7); backdrop-filter: blur(6px); }
#auth-form { position: relative; padding: 34px 30px 26px; display: grid; }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; color: var(--fg-3); font-size: 14px; }
.dialog-close:hover { background: var(--surface-2); color: var(--fg); }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head h3 { margin: 12px 0 4px; font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.auth-sub { margin: 0; color: var(--fg-2); font-size: 14px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--fg-2); margin: 0 0 7px 2px; }
#auth-form input { margin-bottom: 14px; }
/* 비밀번호 칸: 입력칸과 눈 버튼을 하나의 테두리 안에 묶는다 */
.pw-field {
  display: flex; align-items: center; height: 50px; margin-bottom: 14px; padding-right: 6px;
  border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--hair-2);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.pw-field:hover { border-color: rgba(255,255,255,.18); }
.pw-field:focus-within { border-color: rgba(166,140,255,.7); background: rgba(255,255,255,.06); box-shadow: 0 0 0 4px rgba(166,140,255,.15); }
#auth-form .pw-field input {
  flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0 4px 0 16px;
  border: 0; border-radius: 14px 0 0 14px; background: transparent; box-shadow: none;
  color: var(--fg); font: inherit; font-size: 15.5px; outline: none;
}
#auth-form .pw-field input[type=password] { letter-spacing: .12em; }
#auth-form .pw-field input[type=password]::placeholder { letter-spacing: normal; }
.pw-toggle {
  flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--fg-3); transition: color .2s, background .2s, transform .15s var(--ease);
}
.pw-toggle:hover { color: var(--fg); background: var(--surface-2); }
.pw-toggle:active { transform: scale(.9); }
.pw-toggle.on { color: var(--acc); background: var(--acc-soft); }
.pw-toggle .ic { width: 18px; height: 18px; animation: eye-swap .22s var(--ease); }
@keyframes eye-swap { from { opacity: 0; transform: scale(.7); } }

/* 브라우저 자동완성 시 노란/흰 배경 대신 사이트 색 유지 */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg); caret-color: var(--fg);
  -webkit-box-shadow: 0 0 0 1000px #17131f inset; transition: background-color 9999s;
}
#auth-form .msg { margin: -4px 2px 12px; font-size: 13.5px; }
.auth-switch { margin-top: 14px; color: var(--fg-2); font-size: 14px; }
.auth-switch:hover { color: var(--fg); }

/* ---------- 하단 플레이어 ---------- */
#player-bar {
  position: fixed; z-index: 30; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: min(980px, calc(100vw - 24px));
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1.4fr); align-items: center; gap: 18px;
  padding: 12px 20px 12px 12px; border-radius: 22px;
  background: rgba(18,15,28,.78); backdrop-filter: saturate(170%) blur(22px); -webkit-backdrop-filter: saturate(170%) blur(22px);
  border: 1px solid var(--hair-2); box-shadow: 0 24px 60px -20px rgba(0,0,0,.85);
  animation: rise .4s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 20px); } }
#player-bar[hidden] { display: none; }
#pb-cover { width: 50px; height: 50px; border-radius: 12px; object-fit: cover; box-shadow: 0 6px 16px -4px rgba(0,0,0,.6); }
.pb-info { min-width: 0; }
#pb-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pb-sub { color: var(--fg-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-ctrl { display: flex; align-items: center; gap: 6px; }
.pb-ctrl .icon-btn { color: var(--fg); }
.pb-play {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--bg);
  background: #fff; box-shadow: 0 6px 20px -4px rgba(255,255,255,.25); transition: transform .2s var(--ease);
}
.pb-play:hover { transform: scale(1.06); }
.pb-play .ic { width: 20px; height: 20px; }
.pb-progress { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 12px; color: var(--fg-3); }
#pb-seek {
  flex: 1; height: 4px; -webkit-appearance: none; appearance: none; border-radius: 99px; cursor: pointer;
  background: linear-gradient(90deg, var(--acc) var(--p, 0%), rgba(255,255,255,.14) var(--p, 0%));
}
#pb-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(166,140,255,.25); }
#pb-seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }

#toast {
  position: fixed; z-index: 40; left: 50%; bottom: 112px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: rgba(30,24,46,.92); border: 1px solid var(--hair-2); backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.8); transition: all .3s var(--ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 반응형 ---------- */
@media (max-width: 900px) {
  .header-inner { grid-template-columns: 1fr auto; height: auto; padding: 12px 16px; row-gap: 10px; }
  nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; overflow-x: auto; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav button { flex: 1; padding: 0 14px; }
  .pts { display: none; }
  #player-bar { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 8px; }
  .pb-progress { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  main { padding: 26px 16px 0; }
  .page-title { font-size: 30px; }
  .page-head { margin-bottom: 20px; }
  /* 1위 헤더: 커버와 제목을 나란히, 점수·버튼은 아랫줄 전체 폭 */
  .hero { column-gap: 16px; row-gap: 16px; padding: 18px; border-radius: 22px; align-items: center; }
  .hero-cover { grid-row: 1; width: 96px; height: 96px; border-radius: 12px; }
  .hero-head { align-self: center; }
  .hero-foot { grid-column: 1 / -1; }
  .hero-title { font-size: 19px; margin: 6px 0 4px; }
  .hero-meta { font-size: 13.5px; }
  .hero-stats { margin: 0 0 14px; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-actions .btn.lg { height: 46px; padding: 0 12px; font-size: 14.5px; }
  nav button { padding: 0 10px; font-size: 14px; }
  .song { gap: 12px; padding: 12px 6px; }
  .song + .song::before { left: 6px; right: 6px; }
  .rank { width: 28px; }
  .rank b { font-size: 18px; }
  .cover-wrap { width: 50px; height: 50px; }
  .info { min-width: 0; }
  .actions { flex-basis: 100%; padding-left: calc(50px + 12px); margin-top: -4px; }
  .song .rank + .cover-wrap ~ .actions { padding-left: calc(28px + 50px + 24px); }
  .pl-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .pl-hero { padding: 22px; gap: 18px; }
  #pl-cover-wrap .mosaic { width: 140px; }
  #pl-title { font-size: 28px; }
  #convert-form { padding: 20px; gap: 22px; border-radius: 20px; }
  .step { gap: 12px; }
  .quality button b { font-size: 17px; }
  .logo-text { font-size: 19px; }
  .me-chip .me-name { display: none; }
  #player-bar { bottom: 10px; padding: 10px 14px 10px 10px; border-radius: 18px; }
  #toast { bottom: 150px; }
}
