/* ===== 기본 리셋 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== 별 배경 ===== */
body {
  min-height: 100vh;
  background: #050510;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle var(--d, 3s) ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.1; transform: scale(0.8); }
  to   { opacity: 0.8; transform: scale(1.2); }
}

/* ===== 레이아웃 ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ===== 헤더 ===== */
header {
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  margin-bottom: 14px;
}

h1 {
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #60a5fa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.subtitle {
  color: #94a3b8;
  font-size: 14px;
}

.headphone-tip {
  display: inline-block;
  margin-top: 6px;
  color: #7dd3fc;
  font-size: 13px;
}

/* ===== 카드 ===== */
.card {
  background: rgba(15, 15, 35, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 20px;
  padding: 28px;
  backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 20px 60px rgba(0,0,0,0.4);
}

/* ===== 업로드 영역 ===== */
.upload-area {
  border: 2px dashed rgba(139, 92, 246, 0.35);
  border-radius: 14px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(139, 92, 246, 0.04);
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: #a78bfa;
  background: rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}

.upload-icon {
  color: #a78bfa;
  margin-bottom: 14px;
  opacity: 0.8;
}

.upload-text {
  font-size: 15px;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.upload-hint {
  font-size: 12px;
  color: #64748b;
}

/* ===== 파일 미리보기 ===== */
.file-preview {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 12px;
  margin-top: 14px;
}

.file-preview.visible {
  display: flex;
}

.file-icon-wrap {
  color: #a78bfa;
  flex-shrink: 0;
}

.file-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 11px;
  color: #64748b;
}

.remove-btn {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.remove-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

/* ===== 버튼 ===== */
.convert-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 22px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.convert-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.6);
}

.convert-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ===== 처리 중 비주얼라이저 ===== */
.visualizer {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 24px;
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.ring-1 {
  border-color: rgba(167, 139, 250, 0.7);
  animation: spin 3s linear infinite;
  box-shadow: 0 0 16px rgba(167, 139, 250, 0.4);
}

.ring-2 {
  inset: 14px;
  border-color: rgba(96, 165, 250, 0.6);
  animation: spin 2s linear infinite reverse;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.3);
}

.ring-3 {
  inset: 28px;
  border-color: rgba(52, 211, 153, 0.5);
  animation: spin 1.5s linear infinite;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

.ring-4 {
  inset: 42px;
  border-color: rgba(248, 113, 113, 0.4);
  animation: spin 1s linear infinite reverse;
}

.center-dot {
  position: absolute;
  inset: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, #7c3aed, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.8);
  animation: pulse-dot 1s ease-in-out infinite alternate;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pulse-dot {
  from { box-shadow: 0 0 16px rgba(124, 58, 237, 0.6); }
  to   { box-shadow: 0 0 30px rgba(124, 58, 237, 1); }
}

.processing-label {
  text-align: center;
  font-size: 14px;
  color: #a78bfa;
  font-weight: 500;
  margin-bottom: 16px;
}

.progress-track {
  height: 6px;
  background: rgba(139, 92, 246, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #7c3aed, #60a5fa, #34d399);
  background-size: 200% 100%;
  transition: width 0.3s ease;
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-percent {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  margin-top: 10px;
}

/* ===== 결과 섹션 ===== */
#resultSection {
  text-align: center;
}

.success-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #059669, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #fff;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
  animation: bounce-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounce-in {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.result-title {
  font-size: 22px;
  font-weight: 800;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.result-hint {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 24px;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #059669, #0891b2);
  color: #fff;
  box-shadow: 0 4px 20px rgba(5, 150, 105, 0.4);
  transition: all 0.25s ease;
  margin-bottom: 12px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(5, 150, 105, 0.6);
}

.reset-btn {
  background: none;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  color: #94a3b8;
  font-size: 13px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.reset-btn:hover {
  border-color: #a78bfa;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.08);
}

/* ===== 푸터 ===== */
footer {
  text-align: center;
  font-size: 12px;
  color: #334155;
  line-height: 1.8;
}

.footer-sub {
  color: #1e293b;
}

/* ===== 반응형 ===== */
@media (max-width: 400px) {
  .container { padding: 24px 14px 50px; }
  .card { padding: 20px; }
  .option-label span:first-child { min-width: 90px; }
}
