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

html, body {
  height: 100%;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
#header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #111;
  padding: 10px 16px;
  border-bottom: 1px solid #222;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#headerLogo {
  height: 44px;
  width: auto;
  border-radius: 2px;
}

#searchForm {
  width: 100%;
  display: flex;
  gap: 8px;
}

#searchInput {
  flex: 1;
  padding: 14px 16px;
  font-size: 18px;
  background: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 8px;
  outline: none;
  -webkit-appearance: none;
}

#searchInput:focus {
  border-color: #888;
  background: #2a2a2a;
}

#searchForm button {
  padding: 14px 20px;
  font-size: 16px;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

#searchForm button:active { background: #444; }

#micBtn {
  padding: 0 14px;
  flex-shrink: 0;
}

#micBtn.listening {
  background: #7a1a1a;
  border-color: #e05a5a;
  color: #ff8080;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Results panel ───────────────────────────────────────────────────────── */
#resultsPanel {
  background: #111;
  border-bottom: 1px solid #333;
  padding: 12px 16px;
}

#resultsPanel h2 {
  font-size: 13px;
  color: #888;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#resultsList { list-style: none; }

#resultsList li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid #222;
  cursor: pointer;
  border-radius: 6px;
}

#resultsList li:last-child { border-bottom: none; }
#resultsList li:active { background: #2a2a2a; }

#resultsList img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #333;
}

#resultsList .result-title { font-size: 17px; line-height: 1.3; }

/* ── Main content area ───────────────────────────────────────────────────── */
main {
  padding: 24px 20px;
  max-width: 800px;
  margin: 0 auto;
}

/* ── State messages ──────────────────────────────────────────────────────── */
.state-message {
  margin-top: 60px;
  text-align: center;
  font-size: 18px;
  color: #666;
  line-height: 1.6;
}

.state-message.error { color: #e05a5a; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid #444;
  border-top-color: #aaa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

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

/* ── Song meta ───────────────────────────────────────────────────────────── */
#songMeta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

#albumArt {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  background: #222;
  flex-shrink: 0;
}

#songTitle {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

/* ── Lyrics ──────────────────────────────────────────────────────────────── */
#lyricsText {
  font-family: inherit;
  font-size: 22px;
  line-height: 1.8;
  white-space: pre-wrap;
  color: #f0f0f0;
  word-break: break-word;
}

.hidden { display: none !important; }
