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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0d0d0d;
  color: #f0f0f0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 480px;
  padding: 20px 16px 40px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffd700;
}

.subtitle {
  color: #999;
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Form */
.field {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ccc;
  margin-bottom: 6px;
}

.optional {
  color: #666;
  font-weight: 400;
}

input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.1rem;
  border: 2px solid #333;
  border-radius: 12px;
  background: #1a1a1a;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: #ffd700;
}

input::placeholder {
  color: #555;
}

#search-btn {
  width: 100%;
  padding: 16px;
  font-size: 1.2rem;
  font-weight: 700;
  background: #ffd700;
  color: #0d0d0d;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 8px;
}

#search-btn:active {
  transform: scale(0.97);
}

#search-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading */
#loading {
  text-align: center;
  margin-top: 40px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #333;
  border-top-color: #ffd700;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* Result Card */
#result {
  margin-top: 24px;
}

.card {
  background: #1a1a1a;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #2a2a2a;
}

.card h2 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.card .artist {
  color: #999;
  font-size: 1rem;
  margin-bottom: 20px;
}

.original-key {
  text-align: center;
  margin-bottom: 24px;
}

.original-key .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  margin-bottom: 4px;
}

.original-key .key-badge {
  display: inline-block;
  font-size: 2.4rem;
  font-weight: 800;
  background: #ffd700;
  color: #0d0d0d;
  padding: 8px 24px;
  border-radius: 12px;
}

.suggestions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.suggestion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #252525;
  border-radius: 12px;
  padding: 14px 18px;
}

.suggestion .tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  font-weight: 600;
}

.suggestion .key {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffd700;
}

.suggestion .offset {
  font-size: 0.75rem;
  color: #666;
  margin-top: 2px;
}

.band-note {
  background: #222;
  border-radius: 10px;
  padding: 14px;
  font-size: 0.85rem;
  color: #bbb;
  text-align: center;
  line-height: 1.5;
}

.band-note strong {
  color: #ffd700;
}

/* Ambiguous matches */
.ambiguous h3 {
  font-size: 1rem;
  color: #ffa500;
  margin-bottom: 12px;
}

.ambiguous ul {
  list-style: none;
}

.ambiguous li {
  padding: 10px 14px;
  background: #252525;
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ambiguous li .match-title {
  font-weight: 600;
}

.ambiguous li .match-key {
  color: #ffd700;
  font-weight: 700;
}

/* Attribution footer */
.attribution {
  margin-top: 24px;
  padding: 16px;
  text-align: center;
  font-size: 12px;
  opacity: 0.75;
}

.attribution a {
  color: inherit;
  text-decoration: underline;
}

/* Error states */
#error {
  margin-top: 24px;
  padding: 16px;
  background: #2a1515;
  border: 1px solid #5a2020;
  border-radius: 12px;
  color: #ff6b6b;
  font-size: 0.95rem;
  text-align: center;
}

/* Utilities */
.hidden { display: none; }
