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

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #120008 0%, #06000a 60%, #000 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-family: 'Cinzel', serif;
  color: #e8d5d5;
  padding: 1.75rem 1rem;
}

@media (min-width: 768px) {
  body { padding: 3rem 1.5rem; }
}

#wrap {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--red-strong);
  text-shadow: 0 0 25px var(--red-glow), 0 2px 4px rgba(0,0,0,0.8);
  font-weight: 400;
  text-align: center;
}

@media (min-width: 480px) {
  h1 { font-size: 2.2rem; }
}

img.deco {
  height: 22px;
  width: auto;
  opacity: 0.7;
  filter: drop-shadow(0 0 6px rgba(140, 80, 0, 0.3));
}

.subtitle {
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: rgba(200, 170, 170, 0.6);
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(180, 140, 120, 0.7);
}

.optional {
  color: rgba(140, 110, 90, 0.5);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.72rem;
}

input[type="text"] {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(120, 20, 10, 0.4);
  border-radius: 2px;
  color: #d4bfaf;
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  padding: 0.7rem 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
input[type="text"]:focus { border-color: rgba(160, 10, 10, 0.7); }

/* ── Autocomplete ── */
.autocomplete {
  position: relative;
}

.song-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
  background: #0d0009;
  border: 1px solid rgba(160, 120, 0, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.song-results.hidden { display: none; }

.song-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}
.song-result:hover { background: rgba(160, 120, 0, 0.08); }

.no-results {
  padding: 0.9rem;
  font-size: 0.85rem;
  color: rgba(180, 130, 130, 0.45);
  font-style: italic;
  text-align: center;
}

.song-art {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  object-fit: cover;
  border: 1px solid rgba(120, 20, 10, 0.3);
}

.song-art--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(50, 0, 0, 0.3);
  color: rgba(180, 100, 60, 0.6);
  font-size: 1.2rem;
}

.song-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.song-name {
  font-size: 0.9rem;
  color: #c8b4a0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-artist {
  font-size: 0.75rem;
  color: rgba(180, 140, 120, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Selected track ── */
.selected-track {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(160, 10, 10, 0.35);
  background: rgba(255, 20, 20, 0.04);
}
.selected-track.hidden { display: none; }

.clear-track-btn {
  background: transparent;
  border: none;
  color: rgba(180, 130, 130, 0.5);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  flex-shrink: 0;
  transition: color 0.2s;
}
.clear-track-btn:hover { color: rgba(220, 80, 80, 0.9); }

/* ── Submit ── */
button[type="submit"] {
  background: transparent;
  border: 1px solid var(--red-dim);
  color: var(--red-soft);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.75rem 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}
button[type="submit"]:hover:not(:disabled) {
  border-color: var(--red-soft);
  color: var(--red-strong);
  background: rgba(255, 20, 20, 0.08);
}
button[type="submit"]:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Status ── */
.status {
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.status.ok  { color: rgba(130, 180, 100, 0.85); }
.status.err { color: rgba(220, 70, 70, 0.85); }
.status.hidden { display: none; }
