:root {
    color-scheme: dark;
    --bg: #0a0f0c;
    --bg-elev: #101711;
    --panel: rgba(255, 255, 255, 0.055);
    --panel-strong: rgba(255, 255, 255, 0.085);
    --panel-solid: #111913;
    --line: rgba(255, 255, 255, 0.10);
    --line-strong: rgba(255, 255, 255, 0.20);
    --text: #f2f5ed;
    --muted: #a3b0a7;
    --faint: #748177;
    --accent: #d8f36b;
    --accent-soft: rgba(216, 243, 107, 0.13);
    --accent-2: #7fe3b4;
    --accent-ink: #151b08;
    --warm: #f3b45f;
    --danger: #ff8f7a;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --shadow-soft: 0 10px 34px rgba(0, 0, 0, 0.22);
    --radius: 20px;
    --header-h: 74px;
    --wrap: 1180px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f2e9;
    --bg-elev: #fffdf7;
    --panel: rgba(255, 255, 255, 0.72);
    --panel-strong: rgba(255, 255, 255, 0.92);
    --panel-solid: #fffdf7;
    --line: rgba(25, 39, 27, 0.12);
    --line-strong: rgba(25, 39, 27, 0.22);
    --text: #152019;
    --muted: #5d6d62;
    --faint: #7f8d83;
    --accent: #b7d94a;
    --accent-soft: rgba(98, 124, 20, 0.12);
    --accent-2: #2b9b70;
    --accent-ink: #1a2208;
    --warm: #b56f14;
    --danger: #b8432f;
    --shadow: 0 24px 70px rgba(54, 62, 42, 0.16);
    --shadow-soft: 0 10px 34px rgba(54, 62, 42, 0.10);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    padding-bottom: 126px;
    background:
        radial-gradient(1100px 620px at 82% -12%, rgba(216, 243, 107, 0.10), transparent 62%),
        radial-gradient(900px 560px at 4% 18%, rgba(127, 227, 180, 0.08), transparent 60%),
        radial-gradient(700px 500px at 50% 100%, rgba(243, 180, 95, 0.05), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.22;
    background-image: radial-gradient(rgba(255, 255, 255, 0.10) 0.5px, transparent 0.5px);
    background-size: 4px 4px;
    z-index: 0;
}

[data-theme="light"] body::before {
    opacity: 0.18;
    background-image: radial-gradient(rgba(30, 45, 30, 0.10) 0.5px, transparent 0.5px);
}

main,
.site-header,
.site-footer,
.player,
.toasts,
dialog {
    position: relative;
    z-index: 1;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.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;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    transform: translateY(-150%);
    transition: transform 0.2s var(--ease);
}

.skip-link:focus {
    transform: translateY(0);
}

.wrap {
    width: min(var(--wrap), calc(100% - 48px));
    margin-inline: auto;
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--header-h);
    border-bottom: 1px solid var(--line);
    background: rgba(10, 15, 12, 0.72);
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
}

[data-theme="light"] .site-header {
    background: rgba(245, 242, 233, 0.78);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: var(--accent-ink);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 24px rgba(216, 243, 107, 0.16);
    flex: 0 0 auto;
}

.brand-mark .icon {
    width: 23px;
    height: 23px;
    stroke-width: 2;
}

.brand-mark.small {
    width: 30px;
    height: 30px;
    border-radius: 9px;
}

.brand-mark.small .icon {
    width: 17px;
    height: 17px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-text strong {
    font-size: 19px;
    letter-spacing: 0.02em;
}

.brand-text small {
    margin-top: 5px;
    font-size: 8px;
    letter-spacing: 0.28em;
    color: var(--faint);
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn,
.ghost-btn,
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 12px;
    min-height: 42px;
    padding: 0 13px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease);
}

.icon-btn {
    width: 42px;
    padding: 0;
}

.icon-btn:hover,
.ghost-btn:hover {
    border-color: var(--line-strong);
    background: var(--panel-strong);
    transform: translateY(-1px);
}

.primary-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.primary-btn:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.theme-icon-light {
    display: none;
}

[data-theme="light"] .theme-icon-dark {
    display: none;
}

[data-theme="light"] .theme-icon-light {
    display: block;
}

/* ---------- Hero ---------- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    align-items: center;
    gap: 40px;
    min-height: 520px;
    padding-top: 66px;
    padding-bottom: 30px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 22px;
    padding: 7px 12px 7px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 0 0 rgba(127, 227, 180, 0.48);
    animation: pulse 2.4s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(127, 227, 180, 0.45); }
    60% { box-shadow: 0 0 0 8px rgba(127, 227, 180, 0); }
    100% { box-shadow: 0 0 0 0 rgba(127, 227, 180, 0); }
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.9rem, 6.2vw, 5.7rem);
    line-height: 0.97;
    letter-spacing: -0.055em;
    font-weight: 800;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 62%, var(--warm) 115%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lede {
    max-width: 560px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    gap: 34px;
    margin-top: 34px;
}

.hero-stats div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.hero-stats strong {
    font-size: 23px;
    letter-spacing: -0.02em;
    color: var(--text);
}

.hero-stats span {
    font-size: 11px;
    color: var(--faint);
    letter-spacing: 0.08em;
}

.hero-art {
    position: relative;
    width: 100%;
    min-height: 420px;
    display: grid;
    place-items: center;
    isolation: isolate;
}

.hero-art::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(216, 243, 107, 0.18), transparent 66%);
    filter: blur(8px);
    z-index: -1;
}

.vinyl {
    position: relative;
    width: min(330px, 72vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, #0d0d0d 0 17%, transparent 17.4%),
        repeating-radial-gradient(circle at 50% 50%, #151515 0 2px, #0b0b0b 2px 4px);
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 0 60px rgba(255, 255, 255, 0.04);
    animation: spin 36s linear infinite;
}

.vinyl::after {
    content: "";
    position: absolute;
    inset: 6%;
    border-radius: 50%;
    background: conic-gradient(from 210deg, transparent 0 18%, rgba(255, 255, 255, 0.10) 22%, transparent 30% 70%, rgba(216, 243, 107, 0.12) 76%, transparent 84%);
    mix-blend-mode: screen;
}

.vinyl-grooves {
    position: absolute;
    inset: 9%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow:
        0 0 0 16px rgba(255, 255, 255, 0.018),
        0 0 0 17px rgba(255, 255, 255, 0.06),
        0 0 0 38px rgba(255, 255, 255, 0.014),
        0 0 0 39px rgba(255, 255, 255, 0.05);
}

.vinyl-label {
    position: absolute;
    inset: 33%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.32), transparent 45%),
        linear-gradient(145deg, var(--accent), var(--accent-2));
    color: var(--accent-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.vinyl-label span {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.06em;
}

.vinyl-label small {
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.34em;
    margin-left: 0.34em;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.orbit {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed rgba(216, 243, 107, 0.24);
    pointer-events: none;
}

.orbit-a {
    width: 430px;
    height: 430px;
    animation: spin 60s linear infinite reverse;
}

.orbit-b {
    width: 510px;
    height: 510px;
    border-color: rgba(127, 227, 180, 0.16);
    animation: spin 90s linear infinite;
}

.floating-note {
    position: absolute;
    color: var(--accent);
    font-size: 26px;
    opacity: 0.7;
    animation: float 6s ease-in-out infinite;
}

.note-a {
    top: 16%;
    right: 8%;
}

.note-b {
    bottom: 18%;
    left: 7%;
    color: var(--accent-2);
    animation-delay: -2.6s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-14px) rotate(5deg); }
}

/* ---------- Search ---------- */

.search-section {
    padding-top: 12px;
    padding-bottom: 28px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 74px;
    padding: 8px 8px 8px 22px;
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-soft);
}

.search-icon {
    width: 23px;
    height: 23px;
    color: var(--faint);
}

.search-box input {
    flex: 1;
    min-width: 0;
    height: 52px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 17px;
    letter-spacing: -0.01em;
}

.search-box input::placeholder {
    color: var(--faint);
}

.search-box input::-webkit-search-cancel-button {
    filter: invert(0.6);
}

.search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 56px;
    min-width: 138px;
    padding: 0 24px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), #c4e94f);
    color: var(--accent-ink);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
}

.search-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.search-btn:active {
    transform: translateY(0) scale(0.99);
}

.search-btn .icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

.search-btn.is-loading {
    pointer-events: none;
    filter: saturate(0.7);
}

.search-btn.is-loading .icon {
    animation: spin 0.9s linear infinite;
}

.quick-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-left: 4px;
}

.quick-label {
    margin-right: 3px;
    color: var(--faint);
    font-size: 12px;
    letter-spacing: 0.06em;
    white-space: nowrap;
    flex: 0 0 auto;
}

.quick-tag {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    padding: 5px 12px;
    font-size: 12px;
    transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.quick-tag:hover {
    color: var(--text);
    border-color: var(--line-strong);
    background: var(--panel);
}

/* ---------- Filters ---------- */

.filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 10px;
    margin-bottom: 34px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.filter-sources {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.source-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px 6px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--faint);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.18s var(--ease);
    user-select: none;
    cursor: pointer;
}

.source-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.source-chip .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--faint);
    box-shadow: 0 0 0 3px transparent;
}

.source-chip[data-source="incompetech"] .dot { background: #d8f36b; }
.source-chip[data-source="scottbuckley"] .dot { background: #7fe3b4; }
.source-chip[data-source="ccmixter"] .dot { background: #f3b45f; }

.source-chip.is-active {
    color: var(--text);
    border-color: var(--line);
    background: var(--panel-strong);
}

.source-chip.is-active .dot {
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.source-chip:hover {
    color: var(--text);
}

.filter-selects {
    display: flex;
    align-items: center;
    gap: 14px;
}

.select-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--faint);
    font-size: 12px;
    white-space: nowrap;
}

.select-wrap select {
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    background-color: var(--panel-strong);
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    color: var(--text);
    padding: 7px 30px 7px 11px;
    font-size: 12px;
    cursor: pointer;
}

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

.results {
    padding-top: 8px;
    padding-bottom: 40px;
}

.section-kicker {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.24em;
    margin-bottom: 8px;
}

.intro-state {
    padding: 26px 0 10px;
}

.intro-state h2 {
    margin: 0 0 10px;
    font-size: clamp(1.7rem, 3.2vw, 2.5rem);
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.intro-state > p {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.source-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.source-card {
    position: relative;
    padding: 20px 20px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--panel), transparent);
    overflow: hidden;
}

.source-card::after {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    right: -30px;
    top: -35px;
    border-radius: 50%;
    background: var(--accent-soft);
    filter: blur(2px);
}

.source-dot {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-bottom: 13px;
    background: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
}

.source-card:nth-child(2) .source-dot {
    background: var(--accent-2);
}

.source-card:nth-child(3) .source-dot {
    background: var(--warm);
}

.source-card h3 {
    margin: 0 0 5px;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.source-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.source-card small {
    display: block;
    margin-top: 12px;
    color: var(--faint);
    font-size: 11px;
}

.intro-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    color: var(--faint);
    font-size: 12px;
}

.intro-note .icon {
    width: 17px;
    height: 17px;
    color: var(--accent-2);
}

.results-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.results-head h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.results-meta {
    margin: 6px 0 0;
    color: var(--faint);
    font-size: 12px;
}

.source-status {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--faint);
    font-size: 10.5px;
    font-weight: 600;
}

.status-chip .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-2);
}

.status-chip.is-error {
    color: var(--danger);
    border-color: rgba(255, 143, 122, 0.28);
}

.status-chip.is-error .dot {
    background: var(--danger);
}

.hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 18px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--muted);
    font-size: 12px;
}

.hint-error {
    background: rgba(255, 143, 122, 0.08);
    border-color: rgba(255, 143, 122, 0.22);
    color: var(--danger);
}

/* ---------- Track cards ---------- */

.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
    gap: 16px;
}

.track-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
    overflow: hidden;
    transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.track-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-soft);
}

.cover {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #131913;
    isolation: isolate;
}

.cover[data-accent="0"] { --c1: #24351a; --c2: #101a12; --c3: #7f9c35; }
.cover[data-accent="1"] { --c1: #1b332d; --c2: #0e1816; --c3: #4f9d83; }
.cover[data-accent="2"] { --c1: #33281a; --c2: #18110b; --c3: #b9803f; }
.cover[data-accent="3"] { --c1: #28243b; --c2: #12101b; --c3: #8176bd; }
.cover[data-accent="4"] { --c1: #34202a; --c2: #190e14; --c3: #b76d8b; }
.cover[data-accent="5"] { --c1: #1d2c38; --c2: #0c141a; --c3: #5c93ad; }
.cover[data-accent="6"] { --c1: #2b321a; --c2: #14180d; --c3: #9cab4b; }
.cover[data-accent="7"] { --c1: #30241d; --c2: #170f0b; --c3: #b0704f; }
.cover[data-accent="8"] { --c1: #20302a; --c2: #0d1714; --c3: #5f9d7d; }
.cover[data-accent="9"] { --c1: #2e2036; --c2: #150e1a; --c3: #9b6ab3; }
.cover[data-accent="10"] { --c1: #33301c; --c2: #19170c; --c3: #b0a04d; }
.cover[data-accent="11"] { --c1: #1c2e34; --c2: #0d1619; --c3: #4d8e9c; }

.cover-art {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 76% 22%, color-mix(in srgb, var(--c3) 46%, transparent), transparent 42%),
        radial-gradient(circle at 18% 84%, color-mix(in srgb, var(--c3) 22%, transparent), transparent 46%),
        linear-gradient(145deg, var(--c1), var(--c2));
}

.cover-art::before,
.cover-art::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.cover-art::before {
    width: 190px;
    height: 190px;
    right: -56px;
    bottom: -72px;
    box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.025), 0 0 0 36px rgba(255, 255, 255, 0.018);
}

.cover-art::after {
    width: 96px;
    height: 96px;
    left: -34px;
    top: -30px;
    background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.16), transparent 62%);
}

.cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease), opacity 0.3s ease;
}

.track-card:hover .cover img {
    transform: scale(1.04);
}

.cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 38%, rgba(0, 0, 0, 0.58));
    pointer-events: none;
}

.cover-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    z-index: 2;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 7px;
    background: rgba(8, 12, 9, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f2f5ed;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-source {
    text-transform: none;
}

.license {
    flex: 0 0 auto;
}

.license[data-license="BY"] { color: #d8f36b; border-color: rgba(216, 243, 107, 0.35); background: rgba(26, 37, 10, 0.72); }
.license[data-license="BY-NC"] { color: #f3c177; border-color: rgba(243, 193, 119, 0.35); background: rgba(38, 27, 10, 0.72); }
.license[data-license="BY-SA"] { color: #8fd6ff; border-color: rgba(143, 214, 255, 0.32); background: rgba(9, 28, 38, 0.72); }
.license[data-license="BY-ND"] { color: #d4b2ff; border-color: rgba(212, 178, 255, 0.32); background: rgba(27, 16, 40, 0.72); }
.license[data-license="BY-NC-SA"] { color: #f3c177; border-color: rgba(243, 193, 119, 0.35); background: rgba(38, 27, 10, 0.72); }
.license[data-license="BY-NC-ND"] { color: #f3c177; border-color: rgba(243, 193, 119, 0.35); background: rgba(38, 27, 10, 0.72); }
.license[data-license="CC0"] { color: #9df0d0; border-color: rgba(157, 240, 208, 0.32); background: rgba(8, 35, 28, 0.72); }
.license[data-license="OTHER"] { color: #d9e0da; }

.duration {
    position: absolute;
    right: 11px;
    bottom: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(8, 12, 9, 0.66);
    color: #e9eee7;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.duration .icon {
    width: 11px;
    height: 11px;
    stroke-width: 2;
}

.cover-play {
    position: absolute;
    left: 12px;
    bottom: 10px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(12, 16, 12, 0.55);
    color: #fff;
    display: grid;
    place-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.cover-play:hover,
.track-card.is-playing .cover-play {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
    transform: scale(1.05);
}

.cover-play .icon {
    width: 18px;
    height: 18px;
}

.cover-play .pause-icon,
.track-card.is-playing .cover-play .play-icon {
    display: none;
}

.track-card.is-playing .cover-play .pause-icon {
    display: block;
}

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 15px 15px;
    gap: 9px;
}

.card-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: -0.015em;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-artist {
    margin: -3px 0 0;
    color: var(--muted);
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 19px;
}

.card-tag {
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--faint);
    font-size: 9.5px;
    white-space: nowrap;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 3px;
}

.card-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    color: var(--faint);
    font-size: 10px;
}

.card-meta .icon {
    width: 12px;
    height: 12px;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    transition: all 0.18s var(--ease);
}

.mini-btn.icon-only {
    width: 30px;
    padding: 0;
}

.mini-btn .icon {
    width: 14px;
    height: 14px;
}

.mini-btn:hover {
    color: var(--text);
    border-color: var(--line-strong);
    background: var(--panel);
}

.mini-btn.download {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
    padding: 0 11px;
}

.mini-btn.download:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.mini-btn.download.is-downloading {
    position: relative;
    overflow: hidden;
    border-color: var(--line-strong);
    background: var(--panel-strong);
    color: var(--text);
}

.dl-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.16s linear;
}

.mini-btn .spin {
    animation: spin 0.9s linear infinite;
}

/* ---------- Skeleton ---------- */

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--panel) 25%, var(--panel-strong) 37%, var(--panel) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.5s ease infinite;
}

.skeleton-title {
    width: 210px;
    height: 26px;
    margin-bottom: 10px;
}

.skeleton-sub {
    width: 140px;
}

.skeleton-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
}

.skeleton-cover {
    aspect-ratio: 16 / 10;
    background: linear-gradient(90deg, var(--panel) 25%, var(--panel-strong) 37%, var(--panel) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.5s ease infinite;
}

.skeleton-body {
    padding: 15px;
    display: grid;
    gap: 9px;
}

.skeleton-body .skeleton-line:nth-child(1) { width: 76%; }
.skeleton-body .skeleton-line:nth-child(2) { width: 48%; }
.skeleton-body .skeleton-line:nth-child(3) { width: 62%; height: 24px; }

@keyframes shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---------- Empty / error ---------- */

.empty-state {
    padding: 70px 20px 50px;
    text-align: center;
}

.empty-mark {
    width: 74px;
    height: 74px;
    margin: 0 auto 22px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--faint);
}

.empty-mark .icon {
    width: 30px;
    height: 30px;
}

.empty-state h2 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    letter-spacing: -0.03em;
}

.empty-state p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
}

/* ---------- Legal ---------- */

.legal {
    padding-top: 18px;
    padding-bottom: 48px;
}

.legal-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        radial-gradient(600px 200px at 100% 0%, var(--accent-soft), transparent 70%),
        var(--panel);
}

.legal-card > .icon {
    width: 22px;
    height: 22px;
    color: var(--accent);
    margin-top: 2px;
}

.legal-card h2 {
    margin: 0 0 5px;
    font-size: 15px;
}

.legal-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    max-width: 900px;
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 30px 0 40px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 30px;
    color: var(--faint);
    font-size: 11.5px;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
}

.footer-inner p {
    margin: 0;
    max-width: 640px;
}

.footer-meta {
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: var(--faint);
    font-size: 10.5px;
}

/* ---------- Player ---------- */

.player {
    position: fixed;
    z-index: 80;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: min(var(--wrap), calc(100% - 32px));
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgba(14, 20, 15, 0.82);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
    animation: player-in 0.35s var(--ease);
}

[data-theme="light"] .player {
    background: rgba(255, 253, 247, 0.88);
}

@keyframes player-in {
    from { opacity: 0; transform: translate(-50%, 14px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.player-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    min-height: 72px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.player-controls .icon-btn {
    width: 32px;
    height: 32px;
    min-height: 32px;
    border-color: transparent;
    background: transparent;
}

.player-play {
    width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 50%;
    border: 0;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
    transition: transform 0.18s var(--ease);
}

.player-play:hover {
    transform: scale(1.05);
}

.player-play .icon {
    width: 18px;
    height: 18px;
}

.player-play .pause-icon,
.player.is-playing .player-play .play-icon {
    display: none;
}

.player.is-playing .player-play .pause-icon {
    display: block;
}

.player-cover {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    color: var(--accent-ink);
    overflow: hidden;
}

.player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-cover .icon {
    width: 20px;
    height: 20px;
}

.player-info {
    min-width: 90px;
    max-width: 210px;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    flex: 0 1 210px;
}

.player-info strong {
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-info span {
    font-size: 10.5px;
    color: var(--faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-progress {
    flex: 1 1 auto;
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-progress input[type="range"] {
    flex: 1;
    min-width: 60px;
}

.player-time {
    display: inline-flex;
    gap: 6px;
    color: var(--faint);
    font-size: 9.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.player-time span:first-child::after {
    content: "/";
    margin-left: 6px;
    opacity: 0.5;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.player-volume .icon-btn {
    width: 30px;
    height: 30px;
    min-height: 30px;
    border-color: transparent;
    background: transparent;
}

.player-volume input[type="range"] {
    width: 64px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) var(--range-fill, 0%), var(--line-strong) var(--range-fill, 0%));
    cursor: pointer;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--panel-solid);
    background: var(--accent);
    box-shadow: 0 0 0 1px var(--line-strong);
}

input[type="range"]::-moz-range-thumb {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--panel-solid);
    background: var(--accent);
}

.player .icon-btn {
    flex: 0 0 auto;
}

/* ---------- Toasts ---------- */

.toasts {
    position: fixed;
    right: 22px;
    bottom: 104px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--accent);
    border-radius: 11px;
    background: var(--panel-solid);
    color: var(--text);
    box-shadow: var(--shadow-soft);
    font-size: 12px;
    line-height: 1.5;
    animation: toast-in 0.3s var(--ease);
    pointer-events: auto;
}

.toast.is-error {
    border-left-color: var(--danger);
}

.toast .icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
    margin-top: 1px;
}

.toast.is-error .icon {
    color: var(--danger);
}

.toast.is-out {
    animation: toast-out 0.25s var(--ease) forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateY(8px); }
}

/* ---------- Dialogs ---------- */

.modal {
    width: min(560px, calc(100vw - 32px));
    max-height: min(82vh, 720px);
    padding: 22px;
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: var(--panel-solid);
    color: var(--text);
    box-shadow: var(--shadow);
    overflow: auto;
}

.modal::backdrop {
    background: rgba(4, 8, 5, 0.66);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.modal-head h2 {
    margin: 0;
    font-size: 1.4rem;
    letter-spacing: -0.03em;
}

.modal-head .icon-btn {
    border-color: transparent;
    background: transparent;
    min-height: 34px;
    width: 34px;
}

.modal-lede {
    margin: 10px 0 16px;
    color: var(--muted);
    font-size: 12.5px;
}

.attr-text {
    width: 100%;
    resize: vertical;
    min-height: 130px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 12px;
    line-height: 1.7;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 15px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel);
}

.history-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    flex: 0 0 auto;
}

.history-icon .icon {
    width: 16px;
    height: 16px;
}

.history-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.history-text strong {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-text span {
    color: var(--faint);
    font-size: 10px;
}

.history-empty {
    padding: 26px 0;
    text-align: center;
    color: var(--faint);
    font-size: 12px;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 10px;
        padding-top: 46px;
        min-height: 0;
    }

    .hero-art {
        min-height: 330px;
        margin-top: -6px;
    }

    .orbit-a { width: 340px; height: 340px; }
    .orbit-b { width: 400px; height: 400px; }

    .hero-stats {
        gap: 26px;
    }

    .source-cards {
        grid-template-columns: 1fr;
    }

    .source-card {
        padding: 16px 18px;
    }

    .player-volume {
        display: none;
    }
}

@media (max-width: 720px) {
    :root {
        --header-h: 64px;
        --radius: 16px;
    }

    body {
        padding-bottom: 188px;
    }

    .wrap {
        width: calc(100% - 28px);
    }

    .site-header {
        height: var(--header-h);
    }

    .brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 11px;
    }

    .brand-text strong {
        font-size: 17px;
    }

    .header-actions .ghost-btn span {
        display: none;
    }

    .header-actions .ghost-btn {
        width: 42px;
        padding: 0;
    }

    .hero {
        padding-top: 34px;
    }

    .hero h1 {
        font-size: clamp(2.5rem, 12vw, 3.6rem);
    }

    .lede {
        font-size: 14px;
        margin-top: 18px;
    }

    .hero-art {
        min-height: 290px;
    }

    .vinyl {
        width: min(260px, 66vw);
    }

    .orbit-a { width: 300px; height: 300px; }
    .orbit-b { width: 350px; height: 350px; }

    .hero-stats {
        margin-top: 24px;
        gap: 24px;
    }

    .hero-stats strong { font-size: 20px; }

    .search-box {
        min-height: 62px;
        padding: 6px 6px 6px 15px;
        border-radius: 17px;
        gap: 8px;
    }

    .search-icon {
        width: 19px;
        height: 19px;
    }

    .search-box input {
        height: 46px;
        font-size: 14px;
    }

    .search-btn {
        height: 48px;
        min-width: 48px;
        width: 48px;
        padding: 0;
        border-radius: 12px;
    }

    .search-btn span {
        display: none;
    }

    .quick-row {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .quick-row::-webkit-scrollbar {
        display: none;
    }

    .quick-tag {
        flex: 0 0 auto;
    }

    .filters {
        align-items: stretch;
        gap: 10px;
        padding: 10px 12px;
    }

    .filter-sources {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .filter-sources::-webkit-scrollbar {
        display: none;
    }

    .source-chip {
        flex: 0 0 auto;
    }

    .filter-selects {
        width: 100%;
        justify-content: space-between;
    }

    .select-wrap {
        flex: 1;
    }

    .select-wrap select {
        width: 100%;
    }

    .track-grid {
        grid-template-columns: 1fr;
    }

    .cover {
        aspect-ratio: 16 / 9;
    }

    .results-head {
        align-items: flex-start;
    }

    .source-status {
        justify-content: flex-start;
    }

    .legal-card {
        padding: 18px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .player {
        bottom: 10px;
        width: calc(100% - 20px);
        border-radius: 16px;
    }

    .player-inner {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "controls info actions"
            "progress progress progress";
        gap: 6px 10px;
        padding: 9px 10px 10px;
        min-height: 0;
    }

    .player-controls {
        grid-area: controls;
    }

    .player-cover {
        display: none;
    }

    .player-info {
        grid-area: info;
        max-width: none;
        min-width: 0;
    }

    .player-progress {
        grid-area: progress;
        width: 100%;
    }

    .player-inner > #playerDownload {
        grid-area: actions;
    }

    .player-inner > #closePlayer {
        display: none;
    }

    .player-time {
        display: none;
    }

    .toasts {
        right: 12px;
        bottom: 148px;
        width: calc(100vw - 24px);
    }

    .modal {
        padding: 18px;
        border-radius: 18px;
    }
}

@media (max-width: 420px) {
    .hero-art {
        display: none;
    }

    .hero {
        padding-bottom: 6px;
    }

    .hero-stats {
        gap: 20px;
    }

    .hero-stats span {
        font-size: 10px;
    }

    .card-actions .mini-btn.attr {
        width: 30px;
        padding: 0;
    }

    .card-actions .mini-btn.attr span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
