/* ── Keyframes ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.15); }
}
@keyframes waveBar {
    0%, 100% { transform: scaleY(0.3); }
    50%       { transform: scaleY(1); }
}
@keyframes shimmer {
    from { background-position: -200% 0; }
    to   { background-position:  200% 0; }
}
@keyframes nowPlayingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(167,139,250,0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(167,139,250,0); }
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: #0d0d14;
    color: #e2e0f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    transition: padding-bottom 0.4s ease;
}
body.player-visible { padding-bottom: 80px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Container ── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
    flex: 1;
    animation: fadeUp 0.35s ease both;
}

/* ── Navbar ── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 60px;
    background: rgba(13,13,20,0.95);
    border-bottom: 1px solid rgba(167,139,250,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #a78bfa;
    letter-spacing: -0.5px;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link {
    padding: 6px 12px;
    border-radius: 8px;
    color: #b8b4d0;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.nav-link:hover { background: rgba(167,139,250,0.1); color: #a78bfa; }
.nav-upload {
    background: rgba(167,139,250,0.15);
    color: #a78bfa;
    font-weight: 600;
}
.nav-upload:hover { background: rgba(167,139,250,0.25); }
.nav-login {
    background: #a78bfa;
    color: #0d0d14;
    font-weight: 600;
    padding: 6px 16px;
}
.nav-login:hover { background: #c4b5fd; color: #0d0d14; }
.nav-logout { color: #6b6688; font-size: 0.85rem; }
.nav-user { display: flex; align-items: center; gap: 4px; }
.nav-avatar-wrap { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 8px; }
.nav-avatar-wrap:hover { background: rgba(167,139,250,0.1); }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.nav-avatar-placeholder {
    width: 30px; height: 30px; border-radius: 50%;
    background: #a78bfa; color: #0d0d14;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
}

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}
.alert-success { background: rgba(52,211,153,0.1); border-color: rgba(52,211,153,0.3); color: #34d399; }
.alert-error { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.3); color: #f87171; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: #a78bfa; color: #0d0d14; }
.btn-primary:hover { background: #c4b5fd; }
.btn-outline { background: transparent; color: #a78bfa; border: 1px solid rgba(167,139,250,0.4); }
.btn-outline:hover { background: rgba(167,139,250,0.1); }
.btn-liked { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid rgba(248,113,113,0.4); }
.btn-liked:hover { background: rgba(248,113,113,0.25); }
.btn-danger { background: rgba(248,113,113,0.1); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }
.btn-full { width: 100%; justify-content: center; padding: 12px; font-size: 1rem; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }

/* ── Forms ── */
.form-page { max-width: 700px; margin: 0 auto; }
.form-page h1 { margin-bottom: 24px; font-size: 1.6rem; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; color: #9490b8; margin-bottom: 6px; font-weight: 500; }
.form-input {
    width: 100%;
    background: #1a1826;
    border: 1px solid rgba(167,139,250,0.2);
    border-radius: 10px;
    color: #e2e0f0;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
}
.form-input:focus { border-color: #a78bfa; }
.form-input option { background: #1a1826; }
.form-row { display: flex; gap: 16px; }
.form-half { flex: 1; }
.form-check { display: flex; align-items: center; }
.checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checkbox-label input { width: 16px; height: 16px; accent-color: #a78bfa; }
.form-hint { font-size: 0.82rem; color: #5c5880; margin-top: 12px; text-align: center; }
.req { color: #f87171; }
.upload-form { background: #13111f; border: 1px solid rgba(167,139,250,0.12); border-radius: 16px; padding: 28px; }

/* File drop */
.file-drop { position: relative; }
.file-input { position: absolute; opacity: 0; width: 0; height: 0; }
.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    border: 2px dashed rgba(167,139,250,0.25);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: #7c78a0;
    font-size: 0.85rem;
}
.file-label:hover { border-color: #a78bfa; background: rgba(167,139,250,0.05); }
.file-icon { font-size: 2rem; }

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 60px 20px 40px;
    animation: fadeUp 0.45s ease both;
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}
.hero p { color: #8e8ab0; font-size: 1.05rem; margin-bottom: 28px; line-height: 1.6; }
.hero .btn { margin: 4px; }

/* ── Section ── */
.section { margin-bottom: 48px; animation: fadeUp 0.4s ease both; }
.section:nth-child(2) { animation-delay: 0.08s; }
.section:nth-child(3) { animation-delay: 0.16s; }
.section-title { font-size: 1.3rem; font-weight: 600; margin-bottom: 20px; color: #d4d0f0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-header h1 { font-size: 1.6rem; }

/* ── Track grid ── */
.tracks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.tracks-grid .track-card {
    animation: fadeUp 0.35s ease both;
}
.tracks-grid .track-card:nth-child(2)  { animation-delay: 0.04s; }
.tracks-grid .track-card:nth-child(3)  { animation-delay: 0.08s; }
.tracks-grid .track-card:nth-child(4)  { animation-delay: 0.12s; }
.tracks-grid .track-card:nth-child(5)  { animation-delay: 0.16s; }
.tracks-grid .track-card:nth-child(6)  { animation-delay: 0.20s; }
.tracks-grid .track-card:nth-child(n+7){ animation-delay: 0.24s; }

.track-card {
    background: #13111f;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(167,139,250,0.1);
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
    display: block;
}
.track-card:hover {
    border-color: rgba(167,139,250,0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(167,139,250,0.15);
}
.track-card.now-playing {
    border-color: rgba(167,139,250,0.6);
    animation: nowPlayingPulse 2s ease infinite;
}
.track-cover { position: relative; aspect-ratio: 1; overflow: hidden; }
.track-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.track-card:hover .track-cover img { transform: scale(1.05); }
.track-cover-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #1e1b32, #2d1b69);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: rgba(167,139,250,0.4);
}
.track-play-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; color: white;
    opacity: 0; transition: opacity 0.2s;
    cursor: pointer;
}
.track-card:hover .track-play-overlay,
.track-card.now-playing .track-play-overlay { opacity: 1; }
.track-card.now-playing .track-play-overlay { font-size: 1.4rem; background: rgba(0,0,0,0.3); }
.track-meta { padding: 12px; }
.track-title { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { color: #8e8ab0; font-size: 0.8rem; margin-top: 2px; }
.track-stats { display: flex; gap: 8px; margin-top: 8px; font-size: 0.75rem; color: #6b6688; }
.track-genre { background: rgba(167,139,250,0.15); color: #a78bfa; border-radius: 4px; padding: 1px 6px; }

/* ── Track list (rows) ── */
.tracks-list { display: flex; flex-direction: column; gap: 4px; }
.track-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #13111f;
    border: 1px solid rgba(167,139,250,0.07);
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.track-row:hover { background: #1a1826; border-color: rgba(167,139,250,0.25); transform: translateX(3px); }
.track-row.now-playing {
    background: rgba(167,139,250,0.07);
    border-color: rgba(167,139,250,0.35);
}
.track-row-cover {
    width: 46px; height: 46px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.track-row-cover img { width: 100%; height: 100%; object-fit: cover; }
.track-row-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #1e1b32, #2d1b69);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: rgba(167,139,250,0.4);
}
.track-row-info { flex: 1; min-width: 0; }
.track-row-title { font-weight: 500; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-row-artist { color: #8e8ab0; font-size: 0.82rem; margin-top: 2px; }
.track-row-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.track-row-dur, .track-row-likes { font-size: 0.8rem; color: #6b6688; }
.track-row-manage { flex-wrap: nowrap; }
.track-row-manage .track-row-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.track-row-num { width: 24px; text-align: center; color: #5c5880; font-size: 0.85rem; flex-shrink: 0; }

/* ── Badge ── */
.badge {
    background: rgba(167,139,250,0.15);
    color: #a78bfa;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-private { background: rgba(248,113,113,0.1); color: #f87171; }

/* ── Track page ── */
.track-page-top {
    display: flex;
    gap: 32px;
    margin-bottom: 40px;
    align-items: flex-start;
}
.track-page-cover {
    width: 240px;
    height: 240px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.track-page-cover img { width: 100%; height: 100%; object-fit: cover; }
.track-page-cover-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #1e1b32, #2d1b69);
    display: flex; align-items: center; justify-content: center;
    font-size: 5rem; color: rgba(167,139,250,0.3);
}
.track-page-info { flex: 1; }
.track-page-meta { display: flex; gap: 8px; margin-bottom: 12px; }
.track-page-title { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.track-page-artist { font-size: 1.1rem; color: #8e8ab0; margin-bottom: 4px; }
.track-page-album { font-size: 0.9rem; color: #6b6688; margin-bottom: 8px; }
.track-page-author { color: #a78bfa; font-size: 0.9rem; display: block; margin-bottom: 16px; }
.track-page-author:hover { text-decoration: underline; }
.track-page-stats { display: flex; gap: 20px; color: #6b6688; font-size: 0.85rem; margin-bottom: 16px; }
.track-page-desc { color: #9490b8; font-size: 0.95rem; line-height: 1.6; margin-bottom: 20px; }
.track-page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(167,139,250,0.12);
    border: 1px solid rgba(167,139,250,0.35);
    color: #a78bfa;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-download:hover {
    background: rgba(167,139,250,0.22);
    border-color: #a78bfa;
    color: #c4b5fd;
}

/* ── Comments ── */
.comments-section { max-width: 720px; }
.comments-section h2 { font-size: 1.2rem; margin-bottom: 20px; }
.comment-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.comment-input { resize: vertical; }
.comments-list { display: flex; flex-direction: column; gap: 12px; }
.comment {
    background: #13111f;
    border-radius: 12px;
    padding: 14px;
    border: 1px solid rgba(167,139,250,0.08);
}
.comment-author { color: #a78bfa; font-size: 0.85rem; font-weight: 600; display: block; margin-bottom: 6px; }
.comment-author:hover { text-decoration: underline; }
.comment-body { color: #d4d0f0; font-size: 0.9rem; line-height: 1.55; }
.comment-time { color: #5c5880; font-size: 0.75rem; margin-top: 6px; }
.empty-hint { color: #5c5880; font-size: 0.9rem; }

/* ── Explore ── */
.explore-header { margin-bottom: 24px; }
.explore-header h1 { font-size: 1.6rem; margin-bottom: 16px; }
.search-form { display: flex; gap: 10px; max-width: 600px; }
.search-input { flex: 1; }
.genre-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.genre-pill {
    padding: 6px 14px;
    border-radius: 20px;
    background: #13111f;
    border: 1px solid rgba(167,139,250,0.15);
    color: #9490b8;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.genre-pill:hover, .genre-pill.active {
    background: rgba(167,139,250,0.15);
    border-color: #a78bfa;
    color: #a78bfa;
}

/* ── Profile ── */
.profile-page {}
.profile-header {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    padding: 28px;
    background: #13111f;
    border-radius: 20px;
    border: 1px solid rgba(167,139,250,0.12);
    margin-bottom: 40px;
}
.profile-avatar {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.profile-avatar-placeholder {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #60a5fa);
    color: #0d0d14;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; font-weight: 700;
    flex-shrink: 0;
}
.profile-info h1 { font-size: 1.6rem; margin-bottom: 8px; }
.profile-bio { color: #9490b8; font-size: 0.9rem; line-height: 1.5; margin-bottom: 12px; }
.profile-stats { display: flex; gap: 20px; color: #6b6688; font-size: 0.85rem; margin-bottom: 16px; }
.profile-info .btn { margin-right: 8px; }

/* ── Playlists ── */
.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.playlist-card {
    background: #13111f;
    border: 1px solid rgba(167,139,250,0.1);
    border-radius: 14px;
    padding: 20px;
    transition: all 0.2s;
    display: block;
}
.playlist-card:hover { border-color: rgba(167,139,250,0.35); transform: translateY(-2px); }
.playlist-icon { font-size: 2.5rem; margin-bottom: 12px; }
.playlist-big-icon {
    width: 120px; height: 120px;
    background: linear-gradient(135deg, #1e1b32, #2d1b69);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem; color: rgba(167,139,250,0.5);
    flex-shrink: 0;
}
.playlist-name { font-weight: 600; font-size: 1rem; margin-bottom: 4px; }
.playlist-author { font-size: 0.82rem; color: #a78bfa; margin-bottom: 4px; }
.playlist-desc { font-size: 0.82rem; color: #7c78a0; }

/* ── Track row animation ── */
.tracks-list .track-row {
    animation: fadeUp 0.3s ease both;
}
.tracks-list .track-row:nth-child(n+2)  { animation-delay: 0.04s; }
.tracks-list .track-row:nth-child(n+4)  { animation-delay: 0.08s; }
.tracks-list .track-row:nth-child(n+7)  { animation-delay: 0.12s; }
.tracks-list .track-row:nth-child(n+10) { animation-delay: 0.16s; }

/* ── Auth ── */
.auth-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 20px;
}
.auth-card {
    background: #13111f;
    border: 1px solid rgba(167,139,250,0.15);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}
.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.auth-logo h1 { font-size: 1.5rem; color: #a78bfa; }
.auth-subtitle { color: #8e8ab0; margin-bottom: 28px; font-size: 0.9rem; }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.auth-hint { font-size: 0.85rem; color: #6b6688; text-align: center; }
.auth-hint a { color: #a78bfa; }
.auth-hint a:hover { text-decoration: underline; }

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b6688;
}
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; color: #9490b8; margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }

/* ── Footer ── */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid rgba(167,139,250,0.1);
    font-size: 0.8rem;
    color: #5c5880;
    margin-top: auto;
}
.footer a { color: #a78bfa; }

/* ── Player ── */
.player {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(10,10,18,0.97);
    border-top: 1px solid rgba(167,139,250,0.2);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    height: 72px;
    z-index: 200;
    backdrop-filter: blur(16px);
    /* Hidden off-screen by default */
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.player.visible {
    transform: translateY(0);
}

/* Vinyl cover wrap */
.player-cover-wrap {
    width: 48px; height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 0 2px rgba(167,139,250,0.3);
    transition: box-shadow 0.3s;
    display: block;
}
.player-cover-wrap:hover { box-shadow: 0 0 0 2px #a78bfa; }

/* Spinning vinyl when playing */
#player-cover-img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    animation: spin 4s linear infinite;
    animation-play-state: paused;
}
#player-cover-img.spinning {
    animation-play-state: running;
}

/* Vinyl dot in center */
.player-cover-wrap::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #1a1826;
    border: 2px solid rgba(167,139,250,0.3);
    pointer-events: none;
    z-index: 1;
}

.player-cover-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #1e1b32, #2d1b69);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: rgba(167,139,250,0.4);
    border-radius: 50%;
}

.player-info { min-width: 120px; max-width: 200px; }
.player-title { font-weight: 600; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { color: #8e8ab0; font-size: 0.76rem; }

.player-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #a78bfa;
    color: #0d0d14;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
}
.player-btn:hover  { background: #c4b5fd; }
.player-btn:active { transform: scale(0.92); }

.player-progress-wrap { display: flex; align-items: center; gap: 8px; flex: 1; }
#cur-time, #dur-time { font-size: 0.75rem; color: #6b6688; width: 36px; flex-shrink: 0; }
#dur-time { text-align: right; }

.player-progress, .player-volume {
    -webkit-appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(167,139,250,0.2);
    outline: none;
    cursor: pointer;
    transition: height 0.2s;
}
.player-progress { flex: 1; }
.player-progress:hover { height: 6px; }
.player-volume { width: 80px; }
.player-progress::-webkit-slider-thumb,
.player-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #a78bfa;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(167,139,250,0.5);
    transition: transform 0.15s;
}
.player-progress:hover::-webkit-slider-thumb { transform: scale(1.3); }

/* Wave bars (animated equalizer) */
.player-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
    flex-shrink: 0;
}
.player-wave span {
    display: block;
    width: 3px;
    height: 4px;
    background: #a78bfa;
    border-radius: 2px;
    transform-origin: bottom;
    transform: scaleY(0.3);
    transition: background 0.2s;
}
.player-wave.active span {
    animation: waveBar 0.7s ease infinite;
}
.player-wave.active span:nth-child(1) { animation-delay: 0s;    }
.player-wave.active span:nth-child(2) { animation-delay: 0.15s; }
.player-wave.active span:nth-child(3) { animation-delay: 0.30s; }
.player-wave.active span:nth-child(4) { animation-delay: 0.10s; }

/* ── Mobile hamburger ── */
.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    flex-shrink: 0;
}
.nav-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #a78bfa;
    border-radius: 2px;
    transition: all 0.25s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav drawer ── */
.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0; right: 0;
    background: rgba(13,13,20,0.98);
    border-bottom: 1px solid rgba(167,139,250,0.15);
    backdrop-filter: blur(16px);
    z-index: 300;
    padding: 12px 16px 20px;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu .m-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 1rem;
    color: #d4d0f0;
    transition: all 0.2s;
    font-weight: 500;
}
.mobile-menu .m-link:hover,
.mobile-menu .m-link:active { background: rgba(167,139,250,0.12); color: #a78bfa; }
.mobile-menu .m-link-upload {
    background: rgba(167,139,250,0.15);
    color: #a78bfa;
    font-weight: 600;
    margin-top: 4px;
}
.mobile-menu .m-link-login {
    background: #a78bfa;
    color: #0d0d14;
    font-weight: 700;
    justify-content: center;
    margin-top: 8px;
}
.mobile-menu .m-divider {
    height: 1px;
    background: rgba(167,139,250,0.1);
    margin: 8px 0;
}
.mobile-menu .m-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(167,139,250,0.07);
    margin-bottom: 4px;
}
.mobile-menu .m-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.mobile-menu .m-user-placeholder {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #a78bfa;
    color: #0d0d14;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem;
}
.mobile-menu .m-user-name { font-weight: 600; color: #e2e0f0; font-size: 0.95rem; }
.mobile-menu .m-logout {
    display: block;
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #f87171;
    background: rgba(248,113,113,0.07);
    text-align: center;
    font-weight: 500;
    margin-top: 4px;
}

@media (max-width: 700px) {
    /* Layout */
    body { padding-bottom: 120px; }
    .container { padding: 16px 14px; }

    /* Navbar */
    .nav-links { display: none; }
    .nav-burger { display: flex; }
    .navbar { padding: 0 14px; }

    /* Hero */
    .hero { padding: 36px 0 24px; }
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 0.95rem; }
    .hero .btn { display: block; margin: 8px 0; text-align: center; padding: 14px; font-size: 1rem; }

    /* Track grid */
    .tracks-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* Track rows */
    .track-row { padding: 10px 12px; gap: 10px; }
    .track-row-right { gap: 6px; }
    .track-row-likes { display: none; }
    .track-row-dur { font-size: 0.78rem; }

    /* Track page */
    .track-page-top { flex-direction: column; gap: 20px; }
    .track-page-cover { width: 100%; height: auto; aspect-ratio: 1; max-width: 280px; margin: 0 auto; }
    .track-page-title { font-size: 1.5rem; }
    .track-page-actions { flex-wrap: wrap; }
    .track-page-actions .btn,
    .track-page-actions .btn-download { flex: 1; justify-content: center; min-width: 0; text-align: center; }

    /* Forms */
    .form-row { flex-direction: column; }
    .upload-form { padding: 18px; }
    .auth-card { padding: 28px 20px; }

    /* Profile */
    .profile-header { flex-direction: column; align-items: center; text-align: center; padding: 20px 16px; }
    .profile-stats { justify-content: center; }

    /* Section titles */
    .section-title { font-size: 1.15rem; }
    .section-header h1 { font-size: 1.35rem; }

    /* Playlists grid */
    .playlists-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .playlist-card { padding: 14px; }

    /* Footer */
    .footer { flex-direction: column; gap: 4px; text-align: center; padding: 12px; }

    /* ── Mobile Player ── */
    body.player-visible { padding-bottom: 110px; }
    .player {
        height: auto;
        flex-wrap: wrap;
        gap: 0;
        padding: 10px 14px 12px;
        row-gap: 6px;
    }
    .player-cover-wrap { width: 42px; height: 42px; }
    .player-info { flex: 1; min-width: 0; max-width: none; }
    .player-btn { width: 36px; height: 36px; }
    .player-progress-wrap { width: 100%; order: 10; gap: 6px; }
    .player-volume { display: none; }
    .player-wave { display: none; }
    #cur-time, #dur-time { font-size: 0.72rem; width: 32px; }

    /* Comments */
    .comments-section { max-width: 100%; }

    /* Explore search */
    .search-form { flex-direction: column; }
    .genre-pills { gap: 6px; }
    .genre-pill { padding: 5px 12px; font-size: 0.8rem; }

    /* Badges in rows */
    .track-row-right .badge { display: none; }
}
