:root {
    --bg: #f3efe6;
    --surface: #fffaf2;
    --surface-strong: #fff;
    --text: #1f1f1f;
    --muted: #6c685f;
    --border: #ddd4c7;
    --accent: #b94c2f;
    --shadow: 0 18px 48px rgba(67, 40, 20, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(185, 76, 47, 0.12), transparent 26%),
        linear-gradient(180deg, #f8f4ed 0%, #f1ebdf 100%);
}

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

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

button,
input,
textarea {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 15;
    background: rgba(255, 250, 242, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(221, 212, 199, 0.85);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-logo-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #d2873c);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.header-search {
    display: flex;
    gap: 12px;
    flex: 1;
    max-width: 640px;
}

.header-search input,
.header-search button,
.admin-form input,
.admin-form textarea,
.player-progress-wrap input {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 16px;
    background: var(--surface-strong);
}

.header-search input {
    flex: 1;
}

.header-search button,
.btn-primary,
.btn-secondary,
.track-play,
.btn-like,
#player-toggle {
    cursor: pointer;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.header-search button,
.btn-primary,
#player-toggle {
    background: var(--accent);
    color: #fff;
}

.btn-secondary,
.track-play,
.btn-like {
    background: #f0e6d8;
    color: var(--text);
}

.page-main {
    padding: 28px 0 120px;
}

.home-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
}

.sidebar,
.content-panel,
.track-hero,
.artist-hero,
.section-block,
.admin-form,
.site-footer section {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(221, 212, 199, 0.8);
    box-shadow: var(--shadow);
    border-radius: 28px;
}

.sidebar,
.content-panel,
.track-hero,
.section-block,
.admin-page,
.artist-page,
.artist-hero {
    padding: 24px;
}

.sidebar-nav,
.sidebar-artists {
    display: grid;
    gap: 12px;
}

.sidebar-nav a,
.sidebar-artists a,
.sort-links a,
.pagination a {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8f1e6;
}

.lead {
    color: var(--muted);
    line-height: 1.65;
}

.track-list {
    display: grid;
    gap: 14px;
}

.track-card {
    display: grid;
    grid-template-columns: 74px 90px 1fr;
    gap: 16px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid rgba(221, 212, 199, 0.8);
}

.track-cover {
    width: 74px;
    height: 74px;
    border-radius: 16px;
    object-fit: cover;
}

.track-title {
    display: inline-block;
    font-weight: 700;
    margin-bottom: 6px;
}

.track-meta {
    color: var(--muted);
}

.track-hero-grid,
.artist-hero {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
}

.track-artwork img,
.artist-cover img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    object-fit: cover;
}

.track-facts ul {
    margin: 0 0 18px;
    padding-left: 18px;
    line-height: 1.8;
}

.track-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.sort-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.is-active {
    background: var(--accent) !important;
    color: #fff !important;
}

.artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
}

.artist-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 14px;
}

.artist-card img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 18px;
    margin-bottom: 12px;
}

.pagination {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.lyrics-box {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    line-height: 1.8;
}

.site-footer {
    padding: 0 0 110px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.site-footer section {
    padding: 22px;
}

.player-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(220px, 320px) 180px 1fr;
    gap: 18px;
    align-items: center;
    padding: 14px 18px;
    background: rgba(26, 24, 22, 0.96);
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.player-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.player-meta img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 12px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-controls a {
    color: #f5d7c0;
}

.player-progress-wrap {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    gap: 12px;
    align-items: center;
}

.player-progress-wrap input {
    width: 100%;
    padding: 0;
}

.admin-form {
    display: grid;
    gap: 16px;
    padding: 24px;
}

.admin-form label {
    display: grid;
    gap: 8px;
}

.alert {
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 18px;
}

.alert-error {
    background: #ffe4df;
    color: #7f2611;
}

.alert-success {
    background: #e7f6e8;
    color: #215829;
}

.empty-state {
    padding: 20px;
    border-radius: 18px;
    background: #f8f1e6;
    color: var(--muted);
}

@media (max-width: 980px) {
    .home-layout,
    .track-hero-grid,
    .artist-hero,
    .footer-grid,
    .player-bar {
        grid-template-columns: 1fr;
    }

    .header-row,
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 720px) {
    .track-card {
        grid-template-columns: 74px 1fr;
    }

    .track-play {
        grid-column: 2 / 3;
        justify-self: start;
    }
}
