:root {
    --bg-page: #f3f6fb;
    --bg-card: #ffffff;
    --accent: #3178ff;
    --accent-soft: #e5eeff;
    --text-main: #1e293b;
    --text-muted: #6b7280;
    --border-soft: #e5e7eb;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-page);
}

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

button {
    font-family: inherit;
}

.layout {
    min-height: 100vh;
    padding-bottom: 80px; /* будущий плейер снизу */
}

/* HEADER */

.header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(243, 246, 251, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 20px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #4f9bff, #2359d9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.logo span:nth-child(2) { color: #111827; }
.logo span:nth-child(3) { color: var(--accent); }

.top-search {
    position: relative;
    flex: 1;
    max-width: 520px;
}

.top-search__input {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    padding: 10px 40px 10px 16px;
    font-size: 14px;
    outline: none;
    background: #f9fafb;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.top-search__input:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(37,99,235,.1);
}

.top-search__btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    padding: 0;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    transition: color .15s ease;
}

.top-search__btn:hover {
    color: #4b5563;
}

.top-search__btn .icon {
    width: 18px;
    height: 18px;
}

/* GENRE TABS */

.genre-tabs {
    max-width: 1200px;
    margin: 4px auto 0;
    padding: 0 20px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.genre-tab {
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 6px 16px;
    font-size: 14px;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.genre-tab:hover {
    background: rgba(49, 120, 255, 0.08);
}

.genre-tab--active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

/* PAGE LAYOUT */

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 24px;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
    gap: 20px;
}

@media (max-width: 960px) {
    .page {
        grid-template-columns: minmax(0, 1fr);
    }
}

.page-main {
    min-width: 0;
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 16px 0;
    overflow: hidden;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin: 20px 0 12px;
}

.card-header {
    padding: 0 20px 10px;
    border-bottom: 1px solid var(--border-soft);
    font-weight: 600;
    font-size: 14px;
}

.card-body {
    padding: 4px 0;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 16px 18px;
    font-size: 13px;
}

.sidebar-title {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

.sidebar-link {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-link:hover {
    color: var(--accent);
}

.share-text {
    font-size: 13px;
    color: var(--text-muted);
}

.share-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.share-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 14px;
}

/* SONG ROWS */

.song-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 20px;
    font-size: 14px;
    transition: background-color 0.15s;
}

.song-row:nth-child(odd) {
    background: #f9fafb;
}

.song-row:hover {
    background: var(--accent-soft);
}

.icon-button {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.icon-button--play {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.45);
}

.icon-button--play.is-paused {
    background: #1f2937;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.35);
}

.icon-button--download {
    border: 1px solid var(--accent-soft);
    background: #fff;
    color: var(--accent);
}

.icon-button--download:hover {
    background: var(--accent-soft);
}

.song-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.song-artist {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-title {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-duration {
    font-size: 13px;
    color: var(--text-muted);
}

.badge-index {
    font-size: 13px;
    color: var(--accent);
    margin-right: 6px;
    font-weight: 600;
}

/* ERROR / EMPTY */

.message-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 28px 24px;
    text-align: center;
}

.message-title {
    font-size: 20px;
    margin-bottom: 8px;
}

.message-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* FOOTER */

footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px 28px;
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 960px) {
    footer {
        text-align: center;
    }
}

/* MOBILE ADAPTATION */

@media (max-width: 640px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .top-search {
        order: 2;
        width: 100%;
    }

    .page {
        padding-bottom: 90px;
    }

    .song-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .song-row > .icon-button--download {
        display: none;
    }
}

.trending-card {
    padding: 16px 18px;
    margin-top: 18px;
}

.trending-card__title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

.trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trending-list li {
    margin-bottom: 8px;
}

.trending-list li a {
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    transition: color .15s ease;
}

.trending-list li a:hover {
    color: #111827;
}

@media (max-width: 768px) {
    .trending-card {
        margin-top: 16px;
    }
}
