:root {
    color-scheme: dark;
    --bg: #09060f;
    --surface: rgba(255, 255, 255, 0.055);
    --surface-strong: rgba(255, 255, 255, 0.09);
    --line: rgba(255, 255, 255, 0.11);
    --text: #f8f5fb;
    --muted: #aaa3b4;
    --pink: #f23dd1;
    --violet: #7b61ff;
    --cyan: #39d4e7;
    --orange: #ff8a32;
    --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 15% -5%, rgba(242, 61, 209, 0.21), transparent 32rem),
        radial-gradient(circle at 92% 18%, rgba(57, 212, 231, 0.11), transparent 30rem),
        var(--bg);
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }
.site-header, main, footer { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.site-header {
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}
.header-left { display: flex; align-items: center; gap: 24px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 800; letter-spacing: .16em; }
.brand b { color: var(--pink); }
.brand-mark { width: 30px; height: 26px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.brand-mark i { width: 3px; border-radius: 4px; background: linear-gradient(var(--pink), var(--cyan)); }
.brand-mark i:nth-child(1), .brand-mark i:nth-child(5) { height: 9px; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(4) { height: 18px; }
.brand-mark i:nth-child(3) { height: 26px; }
.app-promo { display: flex; align-items: center; gap: 10px; padding-left: 22px; border-left: 1px solid var(--line); transition: opacity .2s ease, transform .2s ease; }
.app-promo:hover, .app-promo:focus-visible { opacity: .9; transform: translateY(-1px); }
.app-promo img { width: 42px; height: 42px; border-radius: 10px; box-shadow: 0 7px 22px rgba(61, 113, 255, .26); }
.app-promo > span { display: grid; gap: 2px; }
.app-promo small { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .04em; }
.app-promo strong { font-size: 12px; }
.app-promo > b { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 11px; white-space: nowrap; }
.live-pill { padding: 8px 12px; border: 1px solid var(--line); border-radius: 100px; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.live-pill i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #4fe38a; box-shadow: 0 0 12px #4fe38a; }

.hero { padding: 100px 0 86px; max-width: 850px; }
.eyebrow { margin: 0 0 15px; color: var(--cyan); font-size: 12px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(52px, 8vw, 96px); line-height: .88; letter-spacing: -.065em; }
h1 span { color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .45); }
.hero-copy { max-width: 620px; margin: 35px 0 0; color: var(--muted); font-size: clamp(17px, 2vw, 22px); line-height: 1.55; }

.leaderboard { padding-bottom: 90px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
h2 { margin: 0; font-size: clamp(34px, 5vw, 60px); letter-spacing: -.045em; }
.search { display: flex; width: min(100%, 610px); padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.search input { min-width: 0; flex: 1; padding: 11px 13px; border: 0; outline: 0; color: var(--text); background: transparent; font: inherit; }
.search select { max-width: 125px; padding: 10px 28px 10px 11px; border: 0; border-left: 1px solid var(--line); outline: 0; color: var(--muted); background: transparent; font: inherit; font-size: 13px; }
.search button { padding: 10px 17px; border: 0; border-radius: 11px; color: white; background: linear-gradient(135deg, var(--violet), var(--pink)); font-weight: 700; cursor: pointer; }
.search-notice, .active-filter { margin: -10px 0 20px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: var(--surface); font-size: 13px; }
.search-notice { border-color: rgba(255, 138, 50, .35); color: #ffc28f; }
.active-filter { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.active-filter a { color: var(--cyan); font-weight: 700; white-space: nowrap; }
.ranking-list { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: rgba(16, 12, 22, .72); backdrop-filter: blur(24px); }
.ranking-row { min-height: 104px; display: grid; grid-template-columns: 62px minmax(190px, 1.4fr) minmax(330px, 2fr) 105px 24px; align-items: center; gap: 18px; padding: 16px 24px; border-bottom: 1px solid var(--line); transition: background .2s ease, transform .2s ease; }
.ranking-row:last-child { border-bottom: 0; }
.ranking-row:hover { background: var(--surface-strong); }
.rank { color: #777080; font-size: 22px; font-variant-numeric: tabular-nums; }
.song-copy { display: grid; gap: 7px; min-width: 0; }
.song-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.song-main .song-copy { flex: 1; }
.artwork-link { flex: 0 0 64px; width: 64px; height: 64px; overflow: hidden; border-radius: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .32); }
.artwork-link img, .detail-artwork img { width: 100%; height: 100%; display: block; object-fit: cover; }
.song-title:hover { color: var(--pink); }
.apple-link { width: fit-content; color: var(--pink); font-size: 11px; font-weight: 700; }
.apple-link:hover { color: var(--cyan); }
.song-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.song-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 14px; }
.metrics { display: grid; grid-template-columns: .7fr 1fr 1.5fr; gap: 12px; color: #777080; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.metrics span { display: grid; gap: 5px; }
.metrics b { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.score { display: flex; align-items: baseline; justify-content: end; }
.score strong { font-size: 35px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.score small { color: var(--muted); }
.arrow { color: var(--pink); font-size: 20px; }
.empty-state { padding: 48px; text-align: center; color: var(--muted); }

.detail-hero { padding: 72px 0 100px; }
.back-link { display: inline-block; margin-bottom: 55px; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 60px; }
.detail-grid h1 { max-width: 800px; font-size: clamp(48px, 8vw, 100px); line-height: .94; }
.detail-title-row { display: flex; align-items: center; gap: 28px; }
.detail-artwork { flex: 0 0 150px; width: 150px; height: 150px; overflow: hidden; border-radius: 25px; box-shadow: 0 20px 55px rgba(0, 0, 0, .42); }
.detail-apple-link { margin-top: 12px; font-size: 14px; }
.artist { margin: 20px 0 0; color: var(--muted); font-size: 25px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 35px; }
.detail-meta span { padding: 10px 14px; border: 1px solid var(--line); border-radius: 100px; color: var(--muted); background: var(--surface); }
.hero-score { width: 210px; aspect-ratio: 1; display: grid; place-content: center; text-align: center; border: 1px solid rgba(242, 61, 209, .35); border-radius: 50%; background: radial-gradient(circle, rgba(242, 61, 209, .22), rgba(123, 97, 255, .04) 65%, transparent 66%); box-shadow: 0 0 70px rgba(242, 61, 209, .16); }
.hero-score strong { font-size: 67px; line-height: 1; letter-spacing: -.06em; }
.hero-score span { color: var(--muted); }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 70px; }
.category-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.category-card > div:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.category-card span { color: var(--muted); }
.category-card strong { font-size: 23px; }
.category-card small { margin-left: 3px; color: #777080; font-size: 12px; }
.category-track { height: 5px; margin-top: 16px; overflow: hidden; border-radius: 10px; background: rgba(255, 255, 255, .08); }
.category-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--pink), var(--orange)); }
.last-analysis { margin-top: 24px; color: #777080; text-align: right; font-size: 13px; }

footer { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: #777080; font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { transition: color .2s ease, text-shadow .2s ease; }
footer a:hover, footer a:focus-visible { color: var(--text); text-shadow: 0 0 14px rgba(255, 255, 255, .16); }
.legal { max-width: 820px; padding: 72px 0 100px; }
.legal h1 { margin-bottom: 34px; font-size: clamp(48px, 8vw, 86px); line-height: .95; }
.legal h2 { margin: 42px 0 14px; font-size: 25px; letter-spacing: -.025em; }
.legal p, .legal li { color: var(--muted); font-size: 16px; line-height: 1.7; }
.legal ul { padding-left: 22px; }
.legal a { color: var(--cyan); }
.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; }

@media (max-width: 820px) {
    .site-header, main, footer { width: min(calc(100% - 24px), var(--max)); }
    .site-header { height: 72px; }
    .header-left { width: 100%; justify-content: space-between; gap: 12px; }
    .app-promo { margin-left: auto; padding-left: 12px; }
    .app-promo > span { display: none; }
    .live-pill { display: none; }
    .hero { padding: 68px 4px 62px; }
    .section-heading { align-items: stretch; flex-direction: column; }
    .search { width: 100%; }
    .ranking-row { grid-template-columns: 40px 1fr auto; gap: 12px; min-height: 104px; padding: 15px 14px; }
    .metrics { grid-column: 2 / 4; grid-row: 2; grid-template-columns: repeat(3, 1fr); }
    .score { grid-column: 3; grid-row: 1; }
    .score strong { font-size: 29px; }
    .arrow { display: none; }
    .detail-hero { padding-top: 38px; }
    .back-link { margin-bottom: 40px; }
    .detail-grid { grid-template-columns: 1fr; gap: 40px; }
    .detail-title-row { align-items: flex-start; }
    .hero-score { width: 160px; }
    .hero-score strong { font-size: 52px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); margin-top: 50px; }
}

@media (max-width: 520px) {
    .brand { font-size: 13px; }
    .brand-mark { display: none; }
    .app-promo img { width: 36px; height: 36px; border-radius: 9px; }
    .app-promo > b { padding: 7px 8px; font-size: 10px; }
    .hero h1 { font-size: 50px; }
    .search { display: grid; grid-template-columns: 1fr auto; }
    .search input { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
    .search select { max-width: none; border-left: 0; }
    .active-filter { align-items: flex-start; flex-direction: column; }
    .ranking-list { border-radius: 18px; }
    .ranking-row { grid-template-columns: 34px 1fr auto; }
    .metrics { grid-template-columns: 1fr 1fr; }
    .metrics span:last-child { grid-column: 1 / -1; }
    .score small { display: none; }
    .artwork-link { flex-basis: 56px; width: 56px; height: 56px; border-radius: 11px; }
    .detail-title-row { gap: 16px; }
    .detail-artwork { flex-basis: 92px; width: 92px; height: 92px; border-radius: 18px; }
    .detail-meta { gap: 8px; }
    .detail-meta span { font-size: 12px; }
    .category-grid { grid-template-columns: 1fr; }
    .last-analysis { text-align: left; line-height: 1.5; }
    footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}
