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

:root {
  --bg: #0a0a0f;
  --card: #12121a;
  --card-border: rgba(255,255,255,0.06);
  --text: #e8e8ed;
  --text-dim: #8888a0;
  --green: #1db954;
  --green-glow: rgba(29,185,84,0.3);
  --accent: #1ed760;
  --purple: #7c3aed;
  --blue: #3b82f6;
  --orange: #f59e0b;
  --pink: #ec4899;
  --radius: 16px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(29,185,84,0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(124,58,237,0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  position: relative;
  z-index: 1;
}

header {
  margin-bottom: 48px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--green), var(--purple));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.logo-icon svg { width: 28px; height: 28px; }

header h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 2px;
}

.input-section {
  margin-bottom: 32px;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 6px 6px 6px 20px;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.input-icon {
  color: var(--green);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

#spotify-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

#spotify-input::placeholder { color: var(--text-dim); }

#analyze-btn {
  background: var(--green);
  color: #000;
  border: none;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#analyze-btn:hover { background: var(--accent); transform: translateY(-1px); }
#analyze-btn:active { transform: translateY(0); }
#analyze-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.demo-note {
  margin-top: 12px;
  padding: 10px 16px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-badge {
  background: var(--orange);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.demo-note a { color: var(--orange); }

.quick-links {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.quick-links a {
  color: var(--green);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(29,185,84,0.1);
  transition: all 0.15s;
}

.quick-links a:hover { background: rgba(29,185,84,0.2); }

.error-msg {
  padding: 14px 20px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 12px;
  color: #ef4444;
  font-size: 14px;
  margin-bottom: 24px;
}

.artist-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.artist-image-wrap {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--green);
  box-shadow: 0 0 20px var(--green-glow);
}

.artist-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artist-info { flex: 1; min-width: 200px; }

.artist-info h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.artist-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.meta-pill {
  padding: 4px 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}

.social-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.15s;
}

.social-link:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.catalog-value-badge {
  text-align: right;
  flex-shrink: 0;
  min-width: 180px;
}

.cv-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.cv-amount {
  font-size: 32px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.cv-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr; }
  .catalog-value-badge { text-align: left; }
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  animation: fadeUp 0.4s ease;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg { width: 20px; height: 20px; }

.earnings-card .card-icon { background: rgba(29,185,84,0.15); color: var(--green); }
.audience-card .card-icon { background: rgba(124,58,237,0.15); color: var(--purple); }
.merch-card .card-icon { background: rgba(236,72,153,0.15); color: var(--pink); }

.earnings-total {
  text-align: center;
  margin-bottom: 24px;
}

.earnings-total .label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.earnings-total .amount {
  font-size: 36px;
  font-weight: 900;
  color: var(--green);
  letter-spacing: -1px;
}

.platform-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.platform-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.platform-name {
  font-size: 13px;
  font-weight: 500;
  width: 100px;
  flex-shrink: 0;
}

.platform-bar-bg {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.platform-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.platform-amount {
  font-size: 13px;
  font-weight: 600;
  width: 80px;
  text-align: right;
  flex-shrink: 0;
}

.earnings-annual {
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
  font-size: 14px;
  font-weight: 600;
}

.earnings-annual span:last-child { color: var(--green); }

.score-ring-container {
  text-align: center;
  margin-bottom: 20px;
}

.score-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 8px;
}

.score-ring svg { width: 100%; height: 100%; }

.score-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
}

.score-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
}

.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--card-border);
}

.score-row:last-child { border-bottom: none; }
.score-row span:first-child { color: var(--text-dim); }
.score-row span:last-child { font-weight: 600; }

.merch-tier {
  text-align: center;
  padding: 20px;
  background: rgba(236,72,153,0.06);
  border-radius: 12px;
  margin-bottom: 20px;
}

.merch-tier-label {
  font-size: 24px;
  font-weight: 800;
  color: var(--pink);
  margin-bottom: 4px;
}

.merch-tier-desc {
  font-size: 13px;
  color: var(--text-dim);
}

.merch-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.merch-stat {
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  text-align: center;
}

.merch-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--pink);
}

.merch-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.merch-recs h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.merch-rec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 13px;
}

.merch-rec-item:last-child { border-bottom: none; }

.merch-rec-item .rec-margin {
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
}

.top-tracks-card {
  margin-bottom: 24px;
}

.tracks-table {
  overflow-x: auto;
}

.track-row {
  display: grid;
  grid-template-columns: 32px 1fr 120px 120px 100px;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 13px;
}

.track-row:last-child { border-bottom: none; }

.track-row.header {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.track-num {
  color: var(--text-dim);
  text-align: center;
  font-weight: 500;
}

.track-name { font-weight: 500; }

.track-streams { text-align: right; }

.track-est {
  text-align: right;
  color: var(--green);
  font-weight: 600;
}

.track-pop {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.pop-bar {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.pop-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
}

.methodology {
  margin-bottom: 40px;
}

.methodology summary {
  cursor: pointer;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  list-style: none;
  transition: color 0.15s;
}

.methodology summary:hover { color: var(--text); }
.methodology summary::-webkit-details-marker { display: none; }

.method-content {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
}

.method-content p { margin-bottom: 12px; }
.method-content p:last-child { margin-bottom: 0; }
.method-content strong { color: var(--text); }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  position: relative;
}

.modal-content h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.modal-content ol {
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dim);
}

.modal-content strong { color: var(--text); }

.modal-content code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.modal-content pre {
  background: rgba(0,0,0,0.4);
  padding: 12px;
  border-radius: 8px;
  margin: 8px 0;
  font-size: 12px;
  overflow-x: auto;
}

.modal-content p {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s;
}

.modal-close:hover { background: rgba(255,255,255,0.08); }

@media (max-width: 640px) {
  .container { padding: 20px 16px; }
  header h1 { font-size: 20px; }
  .input-wrapper { flex-direction: column; padding: 12px; }
  .input-icon { display: none; }
  #spotify-input { width: 100%; }
  #analyze-btn { width: 100%; justify-content: center; }
  .artist-hero { flex-direction: column; text-align: center; }
  .catalog-value-badge { text-align: center; }
  .track-row { grid-template-columns: 24px 1fr 80px; }
  .track-row .track-est, .track-row .track-pop { display: none; }
  .track-row.header .track-est, .track-row.header .track-pop { display: none; }
}
