:root {
  --bg: #0e0e0e;
  --card: #1a1a1a;
  --text: #eaeaea;
  --brand: #0f62fe;
  --border: #2a2a2a;
}

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

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial;
  background: var(--bg);
  color: var(--text);
}

header {
  padding: 24px 16px;
  background: #000;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
header img { height: 72px; }
header h1 { margin: 8px 0 0; color: #8ab4f8; font-weight: 700; }

main { max-width: 1000px; margin: 32px auto; padding: 0 16px; }

.section { margin-bottom: 36px; }
.section h2 {
  margin-bottom: 16px;
  font-size: 22px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* Ultima uscita */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.hero .cover {
  width: 260px; height: 260px;
  border-radius: 12px;
  object-fit: cover;
  background: #111;
}
.hero .title { font-size: 18px; font-weight: 600; }
.hero audio { width: 100%; }
.hero .links { margin-top: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* Lista canzoni */
.list { display: flex; flex-direction: column; gap: 12px; }
.item {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  align-items: flex-start;
}
.item:hover { border-color: #3a3a3a; }
.thumb {
  width: 70px; height: 70px;
  border-radius: 8px;
  object-fit: cover;
  background: #111;
  flex-shrink: 0;
}
.meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 12px; /* <-- distanza tra copertina e testo */
}
.title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

/* Riga superiore: link + pulsante */
.row-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px; /* <-- leggero respiro sotto al titolo */
}

/* Icone link */
.links a, .small-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  text-decoration: none;
  color: #fff;
}
.links a:hover, .small-links a:hover { opacity: 0.8; }
.links img, .small-links img {
  height: 20px;
  width: auto;
  vertical-align: middle;
}

/* Pulsante Scarica – piccolo e a destra */
.scarica-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid #0f62fe;
  color: #8ab4f8;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 16px;
  transition: all 0.2s ease-in-out;
}
.scarica-btn::before {
  content: "↓";
  font-size: 12px;
  line-height: 1;
}
.scarica-btn:hover {
  background: #0f62fe;
  color: #fff;
  border-color: #0f62fe;
  transform: scale(1.05);
}

/* Popup */
#overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  z-index: 999;
}
#popup {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 480px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: none;
  z-index: 1000;
}
#popup h3 { margin-bottom: 10px; font-size: 20px; }
#popup img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
  background: #111;
}
#popup audio { width: 100%; margin: 12px 0; }
#popup .links {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
#popup .links img {
  height: 24px;
  width: auto;
}
#popup .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
#popup .close {
  background: #2b2b2b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
