* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
}

/* ── Page shell ──────────────────────────────────── */
body {
  background: #07091c;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Geologica', sans-serif;
}

/* Wave canvas — home screen background animation */
#wave-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* Album art backdrop — kept in DOM but never activated */
#backdrop { display: none; }

/* Deep-space gradient — permanent full-screen background */
#backdrop-tint {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse at 60% 40%, rgba(35, 8, 80, 0.55) 0%, transparent 65%),
              radial-gradient(ellipse at 25% 70%, rgba(8, 16, 72, 0.45) 0%, transparent 60%),
              linear-gradient(160deg, #07091c 0%, #0b0618 50%, #080c1e 100%);
  pointer-events: none;
  opacity: 1;
}

#app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
  transition: opacity 0.25s ease;
}

/* ── Logo / header ───────────────────────────────── */
.site-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
  margin-bottom: 28px;
  width: 100%;
  max-width: 480px;
}

.site-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
  margin: 0;
}

.site-header p {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 4px 0 0;
}

.header-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ── Back button — left side of title bar ───────────────── */
.back-btn {
  position: absolute;
  left: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 22px;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.15s;
}

.back-btn:hover {
  color: #fff;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.input-card.animate-in {
  animation: slideDown 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Input card ──────────────────────────────────── */
.input-card {
  width: 100%;
  max-width: 480px;
  background: rgba(30, 40, 120, 0.22);
  border: 1px solid rgba(100, 120, 255, 0.22);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 26px;
}

.url-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(40, 50, 160, 0.18);
  border: 1px solid rgba(100, 120, 255, 0.18);
  border-radius: 12px;
  padding: 0 14px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.url-input-wrap:focus-within {
  border-color: rgba(80, 120, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(60, 100, 255, 0.1);
}

.url-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.9rem;
  padding: 13px 10px;
  font-family: inherit;
}

.url-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.url-input-wrap .clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.3);
  padding: 0;
  display: flex;
  align-items: center;
}

.url-input-wrap .clear-btn:hover {
  color: rgba(255, 255, 255, 0.7);
}

.convert-btn {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(45deg, #1a5eff 0%, #7733ee 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    filter 0.15s,
    transform 0.1s,
    opacity 0.15s;
  font-family: inherit;
}

.convert-btn:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.convert-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.error-msg {
  color: #ff6b6b;
  font-size: 0.78rem;
  margin-top: 10px;
  text-align: center;
}
.error-msg:empty {
  display: none;
}

/* ── Result card ─────────────────────────────────── */
.result-card {
  width: 100%;
  max-width: 360px;
  background: rgba(8, 10, 38, 0.88);
  border: 1px solid rgba(100, 120, 255, 0.18);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Skeleton loader ─────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.sk-art,
.sk-line,
.sk-icon {
  background: linear-gradient(
    90deg,
    rgba(60, 80, 200, 0.08) 25%,
    rgba(100, 120, 255, 0.14) 50%,
    rgba(60, 80, 200, 0.08) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

.sk-art {
  width: 100%;
  aspect-ratio: 1 / 1;
}

/* mirrors result-meta: padding 18px 20px 14px, center-aligned */
.sk-meta {
  padding: 18px 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* mirrors service-list */
.sk-rows {
  padding-bottom: 8px;
}

/* mirrors service-row: 40px icon + 12px top/bottom padding = 64px per row */
.sk-row {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  gap: 14px;
}

.sk-row + .sk-row {
  border-top: 1px solid rgba(80, 100, 255, 0.12);
}

.sk-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* Album art — full card width, slightly portrait-cropped */
.result-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.result-art-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(30, 40, 120, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Track info */
.result-meta {
  padding: 18px 20px 14px;
  text-align: center;
}

.result-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 4px;
}

.result-artist {
  font-size: 0.85rem;
  color: rgba(180, 200, 255, 0.55);
  margin-bottom: 6px;
}

.result-type-badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(160, 180, 255, 0.6);
  background: rgba(80, 100, 255, 0.14);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Service list */
.service-list {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
}

.service-row {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  gap: 14px;
  position: relative;
  transition: background 0.12s;
}

.service-row:not(.disabled) {
  cursor: pointer;
}

.service-row:not(.disabled):hover {
  background: rgba(80, 100, 255, 0.08);
}

.service-row.disabled {
  opacity: 0.2;
}

.service-row + .service-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: rgba(80, 100, 255, 0.12);
}

/* Circular service icon */
.svc-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 800;
}

.svc-label-wrap {
  flex: 1;
  min-width: 0;
}

.svc-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc-sublabel {
  font-size: 0.7rem;
  color: rgba(160, 180, 255, 0.45);
  margin-top: 1px;
}

/* Copy button */
.copy-btn {
  background: rgba(80, 100, 255, 0.14);
  border: none;
  border-radius: 8px;
  color: rgba(180, 200, 255, 0.55);
  cursor: pointer;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background 0.15s,
    color 0.15s;
  font-family: inherit;
}

.copy-btn:hover {
  background: rgba(80, 100, 255, 0.26);
  color: rgba(255, 255, 255, 0.95);
}

.copy-btn.copied {
  background: rgba(80, 100, 255, 0.18);
  color: #4ade80;
}

/* Source badge in the row */
.source-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  margin-right: -6px;
}

/* Status icons row */
.status-bar {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.status-chip {
  display: flex;
  align-items: center;
}
.status-chip.ok {
  opacity: 0.45;
}
.status-chip.missing {
  opacity: 0.18;
}
.status-chip.found {
  opacity: 0.72;
}
.status-chip.no-result {
  opacity: 0.15;
}


/* Copied toast */
.toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(8, 10, 38, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(100, 120, 255, 0.22);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.18s,
    transform 0.18s;
  white-space: nowrap;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── Mobile overrides ────────────────────────────── */
@media (max-width: 600px) {
  .site-header h1 {
    font-size: 1.45rem;
  }

  .result-card {
    max-width: 88vw;
  }
}
