@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400&display=swap');

:root {
  --surface: #f8f7f4;
  --surface-raised: #ffffff;
  --surface-inset: #f0eee9;
  --border: #e8e5de;
  --border-focus: #c9c5bb;
  --text-primary: #1a1a1a;
  --text-secondary: #6b6560;
  --text-tertiary: #9e9890;
  --accent: #e8590c;
  --accent-hover: #d14b08;
  --accent-soft: rgba(232, 89, 12, 0.08);
  --danger: #dc2626;
  --success: #16a34a;
}

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

body {
  background: var(--surface);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  -webkit-font-smoothing: antialiased;
}

.overlay {
  position: fixed;
  inset: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 24px rgba(0, 0, 0, 0.03);
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-mark {
  width: 44px;
  height: 44px;
  background: var(--text-primary);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.logo-mark svg {
  fill: var(--surface-raised);
  width: 20px;
  height: 20px;
}

.header h1 {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.field-group {
  margin-bottom: 1rem;
}

.field-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.text-input {
  width: 100%;
  padding: 0.75rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input::placeholder {
  color: var(--text-tertiary);
}

.text-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.03);
}

.btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--surface-raised);
}

.btn-primary:hover {
  background: #2d2d2d;
}

.btn-primary:active {
  transform: scale(0.985);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-accent:active {
  transform: scale(0.985);
}

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

.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

.track-preview {
  display: none;
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.track-preview.visible {
  display: block;
}

.track-hero {
  position: relative;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: var(--surface-inset);
}

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

.track-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff;
}

.track-hero-overlay h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  line-height: 1.3;
}

.track-hero-overlay span {
  font-size: 0.8rem;
  opacity: 0.85;
}

.type-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  opacity: 1;
}

.track-actions {
  padding: 1rem;
  display: flex;
  gap: 0.5rem;
}

.track-actions .btn {
  flex: 1;
}

.console {
  margin-top: 1rem;
  background: var(--text-primary);
  border-radius: 10px;
  overflow: hidden;
  display: none;
}

.console.visible {
  display: block;
}

.console-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid #2a2a2a;
}

.console-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a3a3a;
}

.console-dot:nth-child(1) { background: #ff5f57; }
.console-dot:nth-child(2) { background: #febc2e; }
.console-dot:nth-child(3) { background: #28c840; }

.console-body {
  padding: 0.75rem 0.875rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  line-height: 1.65;
  color: #8a8a8a;
  max-height: 140px;
  overflow-y: auto;
}

.console-body .ln {
  margin-bottom: 0.125rem;
}

.console-body .ln.ok {
  color: #4ade80;
}

.console-body .ln.warn {
  color: #fbbf24;
}

.console-body .ln.fail {
  color: #f87171;
}

.toast {
  font-size: 0.8rem;
  color: var(--danger);
  text-align: center;
  margin-top: 1rem;
}

.spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.preview-player-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}

.btn-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.btn-play:hover {
  border-color: var(--border-focus);
  background: var(--surface-inset);
}

.btn-play svg {
  width: 16px;
  height: 16px;
  fill: var(--text-primary);
}

.play-progress-container {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.play-progress-bar {
  height: 100%;
  background: var(--text-primary);
  width: 0%;
}

.info-note {
  margin-top: 1.25rem;
  padding: 0.75rem 0.875rem;
  background: var(--surface-raised);
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.info-note p {
  font-size: 0.725rem;
  color: var(--text-secondary);
  line-height: 1.45;
  text-align: center;
}
