:root {
  color-scheme: light;
  --bg: #f7f4ed;
  --bg-accent: #e8f0e5;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #fff;
  --surface-soft: #f1eee7;
  --text: #172019;
  --muted: #697069;
  --border: rgba(31, 53, 37, 0.12);
  --primary: #28643d;
  --primary-strong: #174a2b;
  --primary-soft: #e1f0e5;
  --youtube: #c83232;
  --youtube-soft: #fbe7e5;
  --focus: #177a42;
  --shadow: 0 14px 42px rgba(36, 50, 39, 0.09);
  --shadow-soft: 0 5px 18px rgba(36, 50, 39, 0.07);
  --header-bg: rgba(247, 244, 237, 0.86);
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 11px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111713;
  --bg-accent: #17251b;
  --surface: rgba(28, 37, 31, 0.92);
  --surface-solid: #1c251f;
  --surface-soft: #222d26;
  --text: #f2f6f1;
  --muted: #aeb9b0;
  --border: rgba(226, 241, 229, 0.11);
  --primary: #7ac491;
  --primary-strong: #a8dfb9;
  --primary-soft: #233d2b;
  --youtube: #ff7c73;
  --youtube-soft: #3e2929;
  --focus: #8bdca4;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 6px 22px rgba(0, 0, 0, 0.18);
  --header-bg: rgba(17, 23, 19, 0.88);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 150px;
}

body {
  min-width: 280px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 4%, var(--bg-accent), transparent 28rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 58%, transparent);
  outline-offset: 2px;
}

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

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.header-inner,
.main-content,
footer {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(330px, 1.28fr);
  align-items: center;
  gap: 24px;
  min-height: 84px;
  padding-block: 12px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--surface-solid);
  border-radius: 14px;
  background: var(--primary);
  box-shadow: var(--shadow-soft);
}

.brand-mark svg,
.search-icon,
.clear-search svg,
.empty-state svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  overflow: hidden;
  font-size: 1rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.78rem;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.icon-button:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
  background: var(--primary-soft);
}

.icon-button:active {
  transform: scale(0.96);
}

.theme-icon {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

:root:not([data-theme="dark"]) .theme-icon::after {
  position: absolute;
  inset: -5px;
  content: "";
  background: repeating-conic-gradient(currentColor 0 4deg, transparent 4deg 45deg);
  -webkit-mask: radial-gradient(circle, transparent 0 10px, #000 10.5px);
  mask: radial-gradient(circle, transparent 0 10px, #000 10.5px);
}

:root[data-theme="dark"] .theme-icon {
  border: 0;
  background: currentColor;
  box-shadow: -6px -3px 0 1px var(--surface-solid);
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-area {
  min-width: 0;
}

.search-wrap input {
  width: 100%;
  height: 52px;
  padding: 0 86px 0 48px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: 0;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-wrap input::placeholder {
  color: var(--muted);
}

/* O botão próprio é usado em todos os navegadores; oculta o “X” nativo do campo. */
.search-wrap input::-webkit-search-cancel-button,
.search-wrap input::-webkit-search-decoration,
.search-wrap input::-webkit-search-results-button,
.search-wrap input::-webkit-search-results-decoration {
  appearance: none;
  -webkit-appearance: none;
}

.search-wrap input::-ms-clear,
.search-wrap input::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

.search-wrap input:focus {
  border-color: color-mix(in srgb, var(--primary) 64%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent), var(--shadow-soft);
}

.search-icon {
  position: absolute;
  z-index: 1;
  left: 16px;
  width: 21px;
  color: var(--muted);
  pointer-events: none;
}

.clear-search {
  position: absolute;
  right: 4px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  border: 0;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
}

.clear-search[hidden] {
  display: none;
}

.clear-search:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.clear-search svg {
  width: 20px;
}

.search-shortcut {
  position: absolute;
  right: 14px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 0.78rem;
  pointer-events: none;
}

.search-wrap:focus-within .search-shortcut,
.search-wrap.has-value .search-shortcut {
  display: none;
}

.search-result-summary {
  margin: 5px 5px 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: right;
}

.search-result-summary strong {
  color: var(--primary);
  font-size: 0.76rem;
}

.main-content {
  min-height: calc(100vh - 190px);
  padding-block: 22px 64px;
}

h1,
h2,
p {
  margin-top: 0;
}



.artist-grid {
  column-count: 2;
  column-gap: 22px;
}

.artist-group {
  display: inline-block;
  overflow: hidden;
  width: 100%;
  margin: 0 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  break-inside: avoid;
}

.artist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 67px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(120deg, var(--primary-soft), transparent 78%);
}

.artist-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.artist-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--primary-strong);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-solid) 74%, transparent);
  font-size: 0.93rem;
  font-weight: 800;
}

.artist-header h2 {
  overflow: hidden;
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.artist-total {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.74rem;
  font-weight: 800;
}

.song-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.song-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 75px;
  padding: 12px 14px 12px 18px;
}

.song-item + .song-item {
  border-top: 1px solid var(--border);
}

.song-info {
  min-width: 0;
}

.song-title {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 750;
  line-height: 1.35;
}

.song-artist {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.77rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.song-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.action-button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: var(--primary-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-solid);
  font-size: 0.79rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.action-button:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: var(--primary-soft);
}

.action-button:active {
  transform: scale(0.97);
}

.action-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.youtube-button {
  color: var(--youtube);
}

.youtube-button:hover {
  border-color: color-mix(in srgb, var(--youtube) 34%, var(--border));
  background: var(--youtube-soft);
}

.copy-button.is-copied {
  color: var(--primary-strong);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: var(--primary-soft);
}

.empty-state {
  max-width: 520px;
  margin: 80px auto;
  padding: 38px 24px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.empty-state > span {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  place-items: center;
  color: var(--primary);
  border-radius: 17px;
  background: var(--primary-soft);
}

.empty-state h2 {
  margin-bottom: 7px;
  font-size: 1.25rem;
}

.empty-state p {
  margin-bottom: 20px;
  color: var(--muted);
}

.secondary-button {
  min-height: 44px;
  padding: 0 18px;
  color: var(--surface-solid);
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  font-weight: 750;
  cursor: pointer;
}

.copy-status {
  position: fixed;
  z-index: 40;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  max-width: min(360px, calc(100% - 36px));
  padding: 12px 16px;
  color: #fff;
  border-radius: 12px;
  background: #1f5f36;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
  font-size: 0.86rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.copy-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

footer {
  padding-block: 4px 32px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

footer p {
  margin: 0;
}

@media (max-width: 820px) {
  .header-inner {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-block: 10px 12px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .search-wrap input {
    height: 50px;
  }

  .main-content {
    padding-top: 18px;
  }

  .artist-grid {
    column-count: 1;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .main-content,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .brand small {
    font-size: 0.73rem;
  }

  .search-wrap input {
    padding-right: 56px;
    font-size: 16px;
  }

  .search-shortcut {
    display: none;
  }

  .artist-grid {
    column-gap: 16px;
  }

  .artist-group {
    margin-bottom: 16px;
    border-radius: 18px;
  }

  .artist-header {
    padding-inline: 14px;
  }

  .song-item {
    align-items: start;
    grid-template-columns: 1fr;
    gap: 11px;
    padding: 14px;
  }

  .song-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .action-button {
    padding-inline: 10px;
  }

  .copy-status {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
