:root {
  color-scheme: dark;

  --background: #0d1117;
  --panel: #161b22;
  --panel-hover: #1f2630;
  --border: #30363d;
  --border-focus: #58a6ff;

  --text: #f0f6fc;
  --muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --header-accent: #e3b341;

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
  scrollbar-gutter: stable;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 32px 18px;
  background:
    radial-gradient(circle at top, #172033 0, var(--background) 420px);
  color: var(--text);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px;
  background: rgba(22, 27, 34, 0.94);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.page-header {
  margin-bottom: 14px;
  text-align: center;
}

h1 {
  margin: 0;
  color: var(--header-accent);
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

#status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.search-container {
  margin-bottom: 24px;
}

.search-container label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#search {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: #0d1117;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

#search::placeholder {
  color: #6e7681;
}

#search:hover:not(:disabled) {
  border-color: #484f58;
}

#search:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.18);
  background: #10161f;
}

#search:disabled {
  cursor: wait;
  opacity: 0.55;
}

.song-list {
  display: grid;
  gap: 10px;
  overflow-anchor: none;
}

.song-list:not(.is-loading) {
  animation: song-list-reveal 180ms ease-out both;
}

.song-skeleton {
  min-height: 56px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(
      90deg,
      #0d1117 0%,
      #151b24 45%,
      #1c2430 50%,
      #151b24 55%,
      #0d1117 100%
    );
  background-size: 220% 100%;
  animation: song-skeleton-shimmer 1.2s ease-in-out infinite;
}

@keyframes song-skeleton-shimmer {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -120% 0;
  }
}

@keyframes song-list-reveal {
  from {
    opacity: 0.35;
  }

  to {
    opacity: 1;
  }
}

.song-link {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0d1117;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

.song-link::after {
  content: "›";
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 16px;
  color: var(--accent);
  font-size: 1.6rem;
  line-height: 1;
}

.song-link:hover,
.song-link:focus-visible {
  border-color: var(--accent);
  background: var(--panel-hover);
  color: var(--accent-hover);
  transform: translateY(-1px);
}

.song-link:focus-visible {
  outline: 3px solid rgba(88, 166, 255, 0.25);
  outline-offset: 2px;
}

.no-results {
  margin: 28px 0 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 600px) {
  body {
    padding: 0;
    background: var(--background);
  }

  .page {
    min-height: 100vh;
    padding: 24px 16px 40px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .page-header {
    margin-bottom: 12px;
  }

  .search-container {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0 -16px 20px;
    padding: 0 16px 14px;
    background: rgba(22, 27, 34, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
  }


  #search {
    min-height: 54px;
  }

  .song-link,
  .song-skeleton {
    min-height: 60px;
  }

  .song-link {
    padding: 15px;
    font-size: 1.05rem;
  }
}

.download-all {
  display: block;
  width: 100%;
  min-height: 54px;
  margin-top: 28px;
  padding: 14px 18px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: #0d1117;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.download-all:hover:not(:disabled) {
  background: var(--accent-hover);
}

.download-all:disabled {
  cursor: default;
  border-color: #484f58;
  background: #30363d;
  color: var(--muted);
  opacity: 1;
}




.delete-all {
  display: block;
  width: 100%;
  min-height: 54px;
  margin-top: 12px;
  padding: 14px 18px;
  border: 1px solid #8b949e;
  border-radius: 12px;
  background: #161b22;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.delete-all:hover:not(:disabled) {
  background: #1f2630;
}

.delete-all:disabled {
  cursor: default;
  border-color: #484f58;
  background: #30363d;
  color: var(--muted);
}


@media (prefers-reduced-motion: reduce) {
  .song-list:not(.is-loading),
  .song-skeleton {
    animation: none;
  }
}
