:root {
  --bg: #0b1020;
  --panel: rgba(17, 24, 44, 0.86);
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2ff;
  --muted: #b7c1d9;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --ok: #34d399;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(124, 92, 255, 0.28), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(34, 211, 238, 0.16), transparent 50%),
    linear-gradient(180deg, #0b1020 0%, #070b16 100%);
}

.wrap { width: min(980px, calc(100% - 32px)); margin: 0 auto; }
.header, .footer { display: flex; align-items: center; justify-content: space-between; }
.header { padding: 28px 0 8px; }
.account { display: flex; align-items: center; }
.account-login { padding: 8px 14px; font-size: 14px; }
.account-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255,255,255,0.08);
}
.account-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.account-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.account-meta strong {
  font-size: 14px;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.level-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}
.level-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
}
.level-badge.member {
  color: #c9d2e6;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}
.level-badge.member::before { border-radius: 50%; }
.level-badge.vip1 {
  color: #7ef0ff;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.38);
}
.level-badge.vip1::before { transform: rotate(45deg); border-radius: 1px; }
.level-badge.vip2 {
  color: #d8c9ff;
  background: rgba(124, 92, 255, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.42);
}
.level-badge.vip2::before {
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  width: 8px;
  height: 8px;
  border-radius: 0;
}
.level-badge.vipmax {
  color: #ffe08a;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.16);
}
.level-badge.vipmax::before {
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  width: 8px;
  height: 8px;
}
.level-badge.admin {
  color: #ffb7c5;
  background: rgba(251, 113, 133, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.48);
}
.level-badge.admin::before {
  clip-path: polygon(50% 0, 100% 18%, 100% 62%, 50% 100%, 0 62%, 0 18%);
  width: 7px;
  height: 8px;
  border-radius: 0;
}
.account-meta small {
  color: var(--muted);
  font-size: 12px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-admin {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  white-space: nowrap;
}
.account-admin:hover {
  color: var(--accent-2);
  border-color: rgba(34, 211, 238, 0.35);
}
button.account-logout {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  color: #d7deef;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  box-shadow: none;
}
button.account-logout:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.24);
}
button.account-logout svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: currentColor;
}
.footer {
  padding: 48px 0 40px;
  color: var(--muted);
  font-size: 14px;
  gap: 16px;
  flex-wrap: wrap;
}
.footer p { margin: 0; }
.footer a, .footer-links a { color: var(--text); text-decoration: none; }
.footer a:hover, .footer-links a:hover { color: var(--accent-2); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.logo {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(124, 92, 255, 0.16);
}
nav { display: flex; gap: 18px; }
nav a, .link {
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}
nav a:hover, .link:hover { color: var(--text); }

.hero { padding: 24px 0 12px; }
.hero h1 {
  margin-bottom: 0;
  max-width: none;
  text-wrap: balance;
}
.tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.tab.active {
  background: linear-gradient(135deg, var(--accent), #5b3dff);
  color: #fff;
}
.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.28;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.panel, .card, .drop {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.panel { border-radius: var(--radius); padding: 22px; }

.drop {
  border-radius: 18px;
  padding: 56px 24px;
  text-align: center;
  border-style: dashed;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.drop:hover, .drop.drag, .drop:focus {
  border-color: rgba(124, 92, 255, 0.7);
  outline: none;
  background: rgba(124, 92, 255, 0.08);
}
.drop h2 { margin: 0 0 8px; font-size: 22px; }
.drop p { margin: 0 0 22px; color: var(--muted); }
.drop-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), transparent),
    linear-gradient(135deg, rgba(124, 92, 255, 0.9), rgba(34, 211, 238, 0.75));
  position: relative;
}
.drop-icon::before {
  content: "";
  position: absolute;
  inset: 20px 28px 18px;
  border: 3px solid #fff;
  border-top: 0;
  border-radius: 0 0 6px 6px;
}
.drop-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 3px;
  height: 22px;
  background: #fff;
  transform: translateX(-50%);
  box-shadow: -6px 8px 0 -1px #fff, 6px 8px 0 -1px #fff;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--accent), #5b3dff);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn:hover, .btn-ghost:hover { filter: brightness(1.08); }

.work { padding: 12px 8px 8px; }
.hidden { display: none !important; }
.file-row, .progress-top, .card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.file-name { margin: 0; font-weight: 700; }
.file-meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.progress-wrap { margin-top: 22px; }
.progress-top { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
#statusPct { color: var(--text); font-weight: 600; }
.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
#barFill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}
.work.error #statusText { color: var(--danger); }
.work.done .progress-wrap { display: none; }
#reset { display: none; }
.work.done #reset,
.work.error #reset { display: inline-flex; }

.mixer {
  margin-top: 16px;
  border-radius: 20px;
  overflow: hidden;
  background: #080810;
  border: 1px solid var(--line);
}
.mixer-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  flex-wrap: wrap;
}
.mixer-downloads { margin-left: auto; display: flex; gap: 8px; }
#timeLabel { color: var(--muted); font-variant-numeric: tabular-nums; }
.mixer audio { display: none; }
.track {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: stretch;
  min-height: 88px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.track-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 8px;
  color: #d7d7e8;
  font-size: 13px;
  font-weight: 600;
  background: #0b0b14;
}
.track-side input[type="range"] {
  appearance: none;
  width: 64px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  outline: none;
}
.track-side input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
  cursor: pointer;
}
.wave {
  width: 100%;
  height: 88px;
  display: block;
  cursor: pointer;
}
.track-music .wave { background: #07140f; }
.track-vocal .wave { background: #0c0b18; }

.analyze-wrap { margin-top: 16px; }
.pitch-studio {
  background: #080810;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.pitch-wave-wrap { position: relative; padding: 28px 16px 8px; }
.pitch-file {
  position: absolute;
  top: 10px;
  right: 16px;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}
.pitch-wave-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pitch-wave { height: 88px; background: transparent; flex: 1; min-width: 0; }
.pitch-time-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 58px 4px;
}
#analyzeTime {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.pitch-play {
  appearance: none;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #080810;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.pitch-play:hover { filter: brightness(0.94); }
.pitch-play:disabled { opacity: 0.55; cursor: wait; }
.pitch-play-icon {
  display: block;
  width: 0;
  height: 0;
  margin-left: 3px;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent currentColor;
}
.pitch-play.is-playing .pitch-play-icon {
  width: 12px;
  height: 14px;
  margin-left: 0;
  border: 0;
  background:
    linear-gradient(currentColor, currentColor) left / 4px 100% no-repeat,
    linear-gradient(currentColor, currentColor) right / 4px 100% no-repeat;
}
.pitch-dl-icon { width: 18px; height: 18px; display: block; }
.pitch-controls { padding: 18px 22px 22px; }
.pitch-row {
  display: grid;
  grid-template-columns: 64px 1fr 56px 148px;
  align-items: center;
  gap: 16px;
}
.pitch-row + .pitch-row { margin-top: 22px; }
.pitch-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.pitch-row input[type="range"] {
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  outline: none;
}
.pitch-row input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.08);
  cursor: pointer;
}
.pitch-num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 14px;
}
.pitch-box {
  background: #0c101c;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 72px;
}
.pitch-box > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.pitch-key,
.pitch-box strong {
  display: block;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.pitch-box strong { cursor: default; }
.pitch-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.pitch-box small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
#analyzeDownload:disabled { opacity: 0.55; cursor: wait; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 8, 16, 0.72);
  backdrop-filter: blur(10px);
}
.modal-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 24px 22px 20px;
}
.modal-card h3 { margin: 0 0 8px; font-size: 20px; }
.modal-card p { margin: 0; color: var(--muted); }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.card { border-radius: 20px; padding: 20px; }
.card h3 { margin: 0; font-size: 18px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 56px 0 24px;
}
.steps article {
  padding: 16px 8px 8px;
}
.steps span {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
}
.steps h3 { margin: 8px 0; }
.steps p { margin: 0; color: var(--muted); }

@media (max-width: 760px) {
  .account-meta small { display: none; }
  .account-meta strong { max-width: 92px; }
  .level-badge { height: 18px; padding: 0 6px; font-size: 9px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .pitch-row { grid-template-columns: 56px 1fr 48px; }
  .pitch-time-row { padding-left: 0; }
  .pitch-box { grid-column: 1 / -1; }
  .track { grid-template-columns: 72px 1fr; }
  .mixer-downloads { margin-left: 0; width: 100%; }
  nav { display: none; }
  .drop { padding: 36px 16px; }
  .hero { padding-top: 28px; }
}
