:root {
    --bg:        #0e0e10;
    --bg-2:      #121212;
    --card:      #1a1a1c;
    --card-2:    #202023;
    --panel:     #171719;
    --text:      #f5f5f5;
    --muted:     #b0b0b8;
    --green:     #1DB954;
    --green-d:   #15883e;
    --border:    #2a2a2e;
    --shadow:    0 6px 24px rgba(0,0,0,0.35);
    --radius:    16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
    font-family: 'Sora', 'Inter', sans-serif;
    letter-spacing: -0.02em;
}

a { color: var(--green); text-decoration: none; }

.container {
    max-width: 1100px;
    margin: auto;
    padding: 34px 20px;
}

/* ---------- Top navigation ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
    background: rgba(14,14,16,0.72);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.topbar .brand {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    color: var(--green);
    font-size: 18px;
}

.topbar a.nav {
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    transition: color 0.15s ease;
}

.topbar a.nav:hover { color: var(--text); }

/* ---------- Section headers ---------- */
.section-title {
    font-size: 26px;
    margin: 8px 0 22px;
    font-weight: 700;
}

.section-title .accent {
    display: inline-block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--green);
    margin-right: 12px;
    vertical-align: middle;
}

/* ---------- Score badge ---------- */
.score-badge {
    display: inline-block;
    min-width: 52px;
    text-align: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    color: #0e0e10;
    font-size: 14px;
}

.score-badge.lg {
    font-size: 22px;
    padding: 8px 18px;
    min-width: 80px;
}

/* ---------- Controls (search/sort/filter) ---------- */
.controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.search-box, .select-box {
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    outline: none;
    background: var(--card);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

.search-box { flex: 1; min-width: 220px; }
.search-box:focus, .select-box:focus { border-color: var(--green); }

.select-box { cursor: pointer; }

/* ---------- Card grids ---------- */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px;
}

.album-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.album-card:hover {
    transform: translateY(-5px);
    border-color: var(--green);
}

.cover-wrap { position: relative; }

.album-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--card-2);
    display: block;
}

.rank-chip {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.66);
    backdrop-filter: blur(4px);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
}

.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

.album-info { padding: 16px; }

.album-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    font-family: 'Sora', sans-serif;
}

.album-artist { color: var(--muted); font-size: 14px; }

.type-tag {
    display: inline-block;
    margin-top: 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 7px;
}

/* ---------- Tables ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

th, td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    color: var(--muted);
    background: var(--panel);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:last-child td { border-bottom: none; }

td.rank { width: 64px; color: var(--muted); font-weight: 700; }
td.num  { text-align: right; }

/* Score-tinted left edge on song rows */
tr.song-row td:first-child {
    border-left: 4px solid var(--row-color, transparent);
}

/* ---------- Album detail hero (blurred cover bg) ---------- */
.album-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

.album-hero .bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.4) saturate(1.2);
    transform: scale(1.2);
    z-index: 0;
}

.album-hero .bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(14,14,16,0.4), rgba(14,14,16,0.92));
}

.album-hero .inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: center;
    padding: 32px;
}

.album-hero .cover {
    width: 240px;
    height: 240px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 10px 36px rgba(0,0,0,0.6);
}

.album-hero h1 { margin: 0; font-size: 38px; }
.album-hero .artist { color: var(--muted); font-size: 21px; margin-top: 6px; }
.album-hero .meta { margin-top: 16px; color: var(--muted); line-height: 1.7; font-size: 14px; }
.album-hero .score-row { margin-top: 18px; }

/* ---------- Landing hero ---------- */
.landing-hero {
    min-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background:
        radial-gradient(circle at 25% 15%, rgba(29,185,84,0.18), transparent 38%),
        radial-gradient(circle at 80% 80%, rgba(29,185,84,0.10), transparent 34%),
        var(--bg);
}

.landing-hero h1 {
    margin: 0;
    font-size: 76px;
    font-weight: 800;
    background: linear-gradient(120deg, #1DB954, #4ade80);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.landing-hero .subtitle {
    margin-top: 18px;
    font-size: 21px;
    color: var(--muted);
}

.button {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 34px;
    border-radius: 999px;
    background: var(--green);
    color: #06210f;
    font-size: 16px;
    font-weight: 700;
    transition: transform 0.15s ease, background 0.15s ease;
}

.button.secondary {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}

.button:hover { transform: translateY(-2px); }

/* ---------- Stat + feature cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-top: 46px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.stat-number {
    font-size: 36px;
    font-weight: 800;
    font-family: 'Sora', sans-serif;
    color: var(--green);
    margin-bottom: 6px;
}

.stat-label { color: var(--muted); font-size: 15px; }

.featured {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: left;
}

.feature-card h2 { margin: 0 0 8px; color: var(--green); font-size: 20px; }

/* ---------- Distribution chart ---------- */
.dist-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 140px;
    margin-top: 18px;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.dist-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 6px;
}

.dist-bar {
    width: 100%;
    border-radius: 5px 5px 0 0;
    min-height: 3px;
    transition: height 0.3s ease;
}

.dist-axis { color: var(--muted); font-size: 11px; }

/* ---------- Back link / hero (artist) ---------- */
.back { display: inline-block; margin-bottom: 22px; color: var(--muted); font-weight: 600; }

.artist-hero {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 28px;
}

.artist-hero h1 { margin: 0; font-size: 42px; color: var(--green); }

footer {
    text-align: center;
    padding: 30px 20px;
    color: #6a6a72;
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .landing-hero h1 { font-size: 50px; }
    .landing-hero .subtitle { font-size: 17px; }
    .album-hero .inner { grid-template-columns: 1fr; text-align: center; gap: 18px; padding: 22px; }
    .album-hero .cover { width: 100%; max-width: 300px; height: auto; aspect-ratio: 1/1; margin: auto; }
    .album-hero h1 { font-size: 30px; }
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
    .container { padding: 24px 14px; }
    table { font-size: 14px; }
    th, td { padding: 11px 9px; }
}
