:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --border: #dcdcdc;
  --accent: #2f6f4f;
  --accent-contrast: #ffffff;
  --danger: #a4322a;
  --card-bg: #f7f7f5;
  --slot: #e6e6e2;
  --radius: 6px;
  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --fg: #e8e8e6;
    --muted: #9a9a97;
    --border: #33363b;
    --accent: #5fae86;
    --accent-contrast: #0d130f;
    --danger: #e08a83;
    --card-bg: #1e2126;
    --slot: #262a30;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
}

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 0.75rem; }

a { color: var(--accent); }

button {
  font: inherit;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

input[type="text"] {
  font: inherit;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-header h1 { margin: 0; }

/* --- home ---------------------------------------------------------------- */

.intro { max-width: 40rem; }
.intro p { color: var(--muted); }

.artist-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.75rem;
}

.artist-card {
  text-decoration: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  text-align: left;
  background: var(--card-bg);
  color: var(--fg);
  border: 1px solid var(--border);
}

.artist-card:hover { border-color: var(--accent); }
.artist-name { font-weight: 600; }
.artist-meta { font-size: 0.8rem; color: var(--muted); }

/* --- play ---------------------------------------------------------------- */

.guess-form {
  display: flex;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.75rem 0;
  background: var(--bg);
}

.guess-form input { flex: 1; }

.scoreline {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.score { font-size: 2rem; font-weight: 700; }
.score-label { color: var(--muted); }

.unlocked-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--accent);
}

.feedback {
  margin: 0.25rem 0 1rem;
  font-size: 0.9rem;
  min-height: 1.4em;
}

.feedback.found { color: var(--accent); }
.feedback.dup { color: var(--muted); }
.feedback.miss { color: var(--danger); }
.feedback.placeholder { color: transparent; }

/* --- album board --------------------------------------------------------- */

.albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  align-items: start;
}

.album {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: 0.75rem 0.9rem 0.9rem;
}

/* The reveal: an unlocked album gets the accent treatment, which is the
   only visual reward the game has. */
.album.unlocked {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.album-header {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.album-title {
  font-size: 0.95rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.album.unlocked .album-title { color: var(--accent); }

.hidden-title {
  color: var(--muted);
  letter-spacing: 0.15em;
}

.album-year { font-size: 0.8rem; color: var(--muted); }

.album-progress {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tracks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  counter-reset: track;
}

.track {
  font-size: 0.85rem;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  overflow-wrap: anywhere;
}

/* An unguessed track is a visible empty slot, so the shape of the album --
   how many songs, and where the gaps are -- is legible without naming it. */
.track.blank {
  background: var(--slot);
  height: 1.35rem;
}

.track.found { background: transparent; }
.track.missed { color: var(--muted); background: var(--slot); }

/* --- results ------------------------------------------------------------- */

.result-card {
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.result-headline { font-size: 1.4rem; margin: 0 0 0.25rem; }
.result-headline strong { color: var(--accent); }
.result-detail { color: var(--muted); margin: 0 0 1rem; }
.result-share { margin: 0 0 0.75rem; }

.share-link {
  width: 100%;
  max-width: 28rem;
  margin-top: 0.25rem;
}

.reveal-heading { margin-top: 2rem; }
