:root {
  --bg: #121212;
  --card: #1c1c1e;
  --accent: #1db954;
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --border: #2e2e30;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background:
    radial-gradient(circle at 12% 8%, rgba(29, 185, 84, 0.09), transparent 40%),
    radial-gradient(circle at 88% 92%, rgba(29, 185, 84, 0.06), transparent 45%),
    linear-gradient(165deg, #0d0d0f 0%, #17171a 50%, #101012 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 1.25rem;
  padding-top: max(2rem, env(safe-area-inset-top));
}

.card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(165deg, #202022 0%, #19191b 100%);
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

h1 {
  font-size: 1.35rem;
  margin: 0 0 0.4rem;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.optional {
  font-weight: normal;
  opacity: 0.7;
}

input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.85rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f0f10;
  color: var(--text);
  font-size: 16px; /* prevents iOS auto-zoom on focus */
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.queue-widget {
  margin-bottom: 1.5rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: #0f0f10;
  border: 1px solid var(--border);
}

.queue-label {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
}

.queue-item img,
.queue-item .art-placeholder {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: #2a2a2a;
  flex-shrink: 0;
}

.queue-text {
  min-width: 0;
}

.queue-name {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-artist {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-past {
  opacity: 0.55;
}

.queue-current {
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid rgba(29, 185, 84, 0.3);
}

.queue-current .queue-name {
  color: var(--accent);
  font-weight: 600;
}

.queue-next {
  opacity: 0.9;
}

.results {
  list-style: none;
  margin: -0.5rem 0 1rem;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
}

.result {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem;
  background: #0f0f10;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.result:last-child {
  border-bottom: none;
}

.result:active {
  background: #191919;
}

.result img,
.art-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  background: #2a2a2a;
  flex-shrink: 0;
}

.result-text {
  min-width: 0;
}

.result-name {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-artist {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manual-fallback {
  margin: -0.5rem 0 1rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: #0f0f10;
  border: 1px dashed var(--border);
}

.manual-fallback p {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.manual-fallback button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.85rem;
  width: 100%;
}

button[type="submit"] {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button[type="submit"]:disabled {
  background: #2e2e30;
  color: var(--muted);
  cursor: not-allowed;
}

.confirmation {
  text-align: center;
}

.confirmation h2 {
  margin-bottom: 0.4rem;
}

.confirmation p {
  color: var(--muted);
  margin-top: 0;
}

.again-btn {
  margin-top: 1rem;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}
