:root {
  --bg: #0a0a0f;
  --card: #12121d;
  --card-hover: #181826;
  --border: #1f1f30;
  --accent: #ec4899;
  --accent2: #8b5cf6;
  --accent3: #38bdf8;
  --ok: #34d399;
  --err: #f87171;
  --text: #e8e6e3;
  --muted: #8a8a9a;
  --dim: #555;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: clip; margin: 0; padding: 0; width: 100%; }
body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  padding-top: 56px;
  min-height: 100vh;
}

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,10,15,0.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 12px;
}
.nav .logo {
  color: var(--text); text-decoration: none; font-weight: 900; font-size: 15px;
  letter-spacing: 0.05em;
}
.nav .badge {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 700; font-size: 10px;
  padding: 2px 10px; border-radius: 20px;
}
.nav .version { color: var(--dim); font-size: 11px; }
.nav-spacer { flex: 1; }
.user-box { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.user-box img { width: 28px; height: 28px; border-radius: 50%; }
.user-box .quota {
  background: var(--card); padding: 4px 10px; border-radius: 12px;
  font-size: 12px; color: var(--accent3); font-weight: 700;
}

/* Hero */
.hero {
  text-align: center; padding: 48px 20px 32px;
  background: linear-gradient(180deg, #14111f 0%, #0a0a0f 100%);
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(236,72,153,0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(139,92,246,0.06) 0%, transparent 50%);
  pointer-events: none;
}
.hero h1 {
  font-size: 28px; font-weight: 900; margin: 0 0 8px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6, #38bdf8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--muted); font-size: 13px; margin: 0; }

/* Section / Card */
.section {
  max-width: 640px; margin: 0 auto; padding: 24px 16px 40px;
  display: flex; flex-direction: column; gap: 16px;
}
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
}
.card.center { text-align: center; }
.card h2 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--accent3); }
.card.error { border-color: var(--err); }
.card.error h3 { color: var(--err); }
.muted { color: var(--muted); }
.muted.small { font-size: 12px; line-height: 1.6; margin: 6px 0 14px; }
.hint { color: var(--dim); font-size: 11px; margin-top: 16px; }
.hidden { display: none !important; }

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; border-radius: 10px;
  padding: 14px 32px; font-size: 14px; font-weight: 800;
  font-family: inherit; cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.btn-primary:disabled {
  opacity: 0.4; cursor: not-allowed;
}
.btn-primary:not(:disabled):active { transform: scale(0.98); }
.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 14px; font-size: 12px; font-family: inherit;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--text); }

/* Login */
#gsiButton { display: flex; justify-content: center; margin: 20px 0 8px; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 36px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent2);
  background: rgba(139, 92, 246, 0.05);
}
.dz-icon {
  font-size: 32px; margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dz-main { margin: 4px 0; font-size: 14px; font-weight: 600; }
.dz-sub { margin: 0; font-size: 11px; color: var(--muted); }

.file-info {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding: 12px; background: var(--card-hover);
  border-radius: 8px; font-size: 13px;
}
.fi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-size { color: var(--muted); font-size: 11px; }

/* Presets */
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 480px) { .presets { grid-template-columns: repeat(3, 1fr); } }
.preset {
  background: var(--card-hover); color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 6px; font-size: 12px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  transition: all 0.15s;
}
.preset:hover { color: var(--text); border-color: var(--accent2); }
.preset.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border-color: transparent;
}

/* EQ bands */
.eq-bands {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px; margin: 12px 0 16px;
}
.eq-band { flex: 1; display: flex; flex-direction: column; align-items: center; }
.eq-slider {
  -webkit-appearance: slider-vertical;
  writing-mode: bt-lr;
  width: 28px; height: 120px;
  margin: 8px 0;
}
.eq-val { font-size: 11px; color: var(--accent3); font-weight: 700; min-height: 1em; }
.eq-freq { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* Vertical slider polyfill (modern browsers) */
.eq-slider {
  appearance: slider-vertical;
}

/* Toggle */
.toggle {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; user-select: none;
}
.toggle input { display: none; }
.toggle-track {
  width: 44px; height: 24px;
  background: var(--border); border-radius: 12px;
  position: relative; transition: background 0.2s;
}
.toggle-track::after {
  content: ''; position: absolute;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  top: 3px; left: 3px;
  transition: left 0.2s;
}
.toggle input:checked + .toggle-track {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.toggle input:checked + .toggle-track::after { left: 23px; }
.toggle-label { font-size: 13px; font-weight: 600; }

/* Progress */
.progress-info {
  display: flex; justify-content: space-between;
  font-size: 12px; margin-bottom: 8px;
}
.progress-info span:last-child { color: var(--accent3); font-weight: 700; }
.progress-bar {
  height: 8px; background: var(--border); border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent3));
  width: 0%; transition: width 0.3s;
}

/* Downloads */
.downloads { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.dl-btn {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-hover); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
  padding: 12px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  transition: border-color 0.15s;
}
.dl-btn:hover { border-color: var(--accent2); }
.dl-btn .dl-format { color: var(--accent3); font-weight: 800; }
.dl-btn .dl-meta { color: var(--muted); font-size: 11px; }

/* Footer */
.footer {
  text-align: center; padding: 32px 16px 48px;
  color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--border); margin-top: 24px;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }
