:root {
  --bg: #140f0c;
  --bg-2: #1c1512;
  --surface: rgba(38, 28, 22, 0.72);
  --surface-solid: #241a15;
  --border: rgba(224, 164, 88, 0.16);
  --border-strong: rgba(224, 164, 88, 0.4);
  --text: #f6ead9;
  --text-dim: #c9b49c;
  --text-faint: #8f7a66;
  --gold: #e6a94e;
  --gold-soft: #f0c07a;
  --rose: #d97a5a;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --radius: 22px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 50% -10%, #3a2415 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, #2a1a22 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px 300px at 15% 20%, rgba(230, 169, 78, 0.10), transparent 70%),
    radial-gradient(500px 300px at 85% 40%, rgba(217, 122, 90, 0.10), transparent 70%);
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(3.5rem, 9vw, 6rem) 1.25rem 1.5rem;
  max-width: 720px;
  margin: 0 auto;
}
.site-header__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.site-header__title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.8rem, 9vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff5e6 0%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.site-header__sub {
  margin: 1rem auto 0;
  max-width: 34rem;
  color: var(--text-dim);
  font-size: 1.02rem;
  line-height: 1.6;
}

/* ---------- Track list ---------- */
.tracks {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 1.5rem auto 0;
  padding: 0 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ---------- Card ---------- */
.card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(1.25rem, 3vw, 2rem);
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}
.card.is-active {
  border-color: var(--border-strong);
  box-shadow: var(--shadow), 0 0 0 1px rgba(230, 169, 78, 0.15), 0 0 50px -18px rgba(230, 169, 78, 0.5);
}

/* ---------- Cover ---------- */
.card__cover {
  position: relative;
  align-self: start;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.8);
}
.card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.card.is-active .card__cover img { transform: scale(1.05); }

.cover-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card__cover:hover .cover-play,
.card.is-active .cover-play { opacity: 1; }
.cover-play svg {
  width: 34px;
  height: 34px;
  fill: #fff;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  transform: translateZ(0);
  transition: transform 0.2s ease;
}
.cover-play:hover svg { transform: scale(1.12); }

/* Play/pause icon swap (shared) */
.ico-pause { display: none; }
.is-playing .ico-play { display: none; }
.is-playing .ico-pause { display: block; }

/* ---------- Card body ---------- */
.card__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.card__head { display: flex; flex-direction: column; gap: 0.5rem; }
.badge {
  align-self: flex-start;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold-soft);
  background: rgba(230, 169, 78, 0.12);
  border: 1px solid var(--border);
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
}
.card__title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.55rem, 3.5vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.card__desc {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ---------- Versions ---------- */
.versions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.version {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.version:hover { color: var(--text); border-color: var(--border-strong); }
.version.is-active {
  color: #2a1a10;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border-color: transparent;
  font-weight: 600;
}

/* ---------- Player ---------- */
.player {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.player__btn {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #2a1a10;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  box-shadow: 0 8px 20px -6px rgba(230, 169, 78, 0.6);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.player__btn:hover { transform: scale(1.06); }
.player__btn:active { transform: scale(0.97); }
.player__btn svg { width: 24px; height: 24px; fill: #2a1a10; }

.player__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.player__times {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* Range inputs */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  outline: none;
}
.player__seek {
  background: linear-gradient(to right, var(--gold) 0%, var(--gold) var(--progress, 0%), rgba(255, 255, 255, 0.12) var(--progress, 0%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff5e6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff5e6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
input[type="range"]:focus-visible { box-shadow: 0 0 0 3px rgba(230, 169, 78, 0.35); }

/* ---------- Lyrics ---------- */
.lyrics-toggle,
.explain-toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-soft);
  background: none;
  border: 0;
  padding: 0.3rem 0;
  cursor: pointer;
}
.lyrics-toggle svg,
.explain-toggle svg { width: 18px; height: 18px; fill: currentColor; transition: transform 0.3s ease; }
.lyrics-toggle[aria-expanded="true"] svg,
.explain-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.lyrics-toggle:hover,
.explain-toggle:hover { color: #fff; }

.lyrics[hidden] { display: none; }
.lyrics {
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
  margin-top: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  animation: lyrics-in 0.4s ease both;
}
@keyframes lyrics-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.lyric-part { display: flex; flex-direction: column; gap: 1.05rem; }
.lyric-part[hidden] { display: none; }
.lyric-part:not([hidden]) + .lyric-part:not([hidden]) {
  border-top: 1px dashed var(--border);
  padding-top: 1.05rem;
}
.lyric-block { display: flex; flex-direction: column; gap: 0.3rem; }
.lyric-tag {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.lyric-tag em {
  font-style: normal;
  color: var(--text-faint);
  font-weight: 500;
  margin-left: 0.4rem;
}
.lyric-block p {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--text);
}
.line {
  display: block;
  border-radius: 8px;
  padding: 0.12rem 0.6rem;
  margin: 0 -0.6rem;
  transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
/* Enquanto toca, as outras linhas ficam legíveis porém secundárias */
.lyrics.is-syncing .line { color: var(--text-dim); }
/* Linha atual: fundo destacado + texto claro = contraste alto */
.line.is-singing {
  color: #fff8ee;
  background: rgba(230, 169, 78, 0.22);
  box-shadow: inset 3px 0 0 0 var(--gold);
  text-shadow: 0 0 16px rgba(230, 169, 78, 0.3);
}
.lyric-block--note { opacity: 0.75; }
.lyric-note {
  font-style: italic;
  color: var(--text-faint);
  font-size: 0.9rem;
}

/* ---------- Explanation ---------- */
.explain[hidden] { display: none; }
.explain {
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
  margin-top: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: lyrics-in 0.4s ease both;
}
.explain-h {
  margin: 0.6rem 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.12rem;
  color: var(--gold-soft);
}
.explain-h:first-child { margin-top: 0; }
.explain-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-left: 2px solid var(--border-strong);
  padding-left: 0.9rem;
}
.explain-quote {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  color: var(--gold-soft);
  font-size: 1rem;
  line-height: 1.5;
}
.explain-quote::before { content: "\201C"; }
.explain-quote::after { content: "\201D"; }
.explain-text {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.65;
}
.explain-text em { color: var(--gold-soft); font-style: italic; }
.explain-outro {
  margin: 0.5rem 0 0;
  padding-top: 0.95rem;
  border-top: 1px dashed var(--border);
  font-family: "Fraunces", Georgia, serif;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.6;
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .card {
    grid-template-columns: 1fr;
  }
  .card__cover {
    max-width: 300px;
    margin: 0 auto;
    width: 100%;
  }
  .cover-play { opacity: 1; background: linear-gradient(0deg, rgba(0,0,0,0.35), transparent 55%); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
