:root {
    --bg: #0d0f13;
    --panel: #13161d;
    --panel-2: #1a1e27;
    --card: #181c24;
    --card-hover: #222733;
    --text: #f7f8fb;
    --muted: #9da6b6;
    --accent: #b01010;
    --accent-2: #e03a3a;
    --line: rgba(255,255,255,.08);
    --shadow: 0 18px 50px rgba(0,0,0,.35);
    --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { padding-bottom: 104px; overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: calc(100vh - 104px); display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: calc(100vh - 104px); padding: 24px 18px; border-right: 1px solid var(--line); background: linear-gradient(180deg, #11141a 0%, #0f1116 100%); display: flex; flex-direction: column; gap: 28px; z-index: 20; }
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px; }
.brand-mark { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; font-size: 22px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 30px rgba(176,16,16,.25); }
.brand strong { display: block; font-size: 18px; }
.brand span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.nav { display: grid; gap: 6px; }
.nav-item { border: 0; background: transparent; border-radius: 12px; padding: 12px 14px; text-align: left; display: flex; gap: 12px; align-items: center; color: var(--muted); cursor: pointer; }
.nav-item:hover, .nav-item.active { background: rgba(176,16,16,.13); color: #fff; }
.nav-item.active { box-shadow: inset 3px 0 0 var(--accent-2); }
.sidebar-note { margin-top: auto; border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 14px; padding: 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.sidebar-note strong { color: var(--text); display: block; margin-bottom: 6px; }
.sidebar-note code { color: #ffd1d1; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; backdrop-filter: blur(18px); background: rgba(13,15,19,.84); border-bottom: 1px solid var(--line); padding: 16px 24px; display: flex; gap: 12px; align-items: center; }
.search-wrap { flex: 1; max-width: 720px; margin: 0 auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; display: flex; align-items: center; gap: 10px; padding: 0 16px; }
.search-wrap:focus-within { border-color: rgba(224,58,58,.6); box-shadow: 0 0 0 3px rgba(176,16,16,.12); }
.search-wrap input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; padding: 11px 0; }
.search-wrap input::placeholder { color: #7d8696; }
.icon-btn { border: 0; background: transparent; border-radius: 999px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover, .icon-btn.active { color: #fff; background: rgba(255,255,255,.08); }
.content { padding: 30px 30px 48px; max-width: 1500px; margin: 0 auto; }
.hero { border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(circle at 80% 10%, rgba(224,58,58,.22), transparent 35%), linear-gradient(135deg, #171b24, #111318); padding: 34px; box-shadow: var(--shadow); margin-bottom: 30px; }
.hero small { color: #ffb8b8; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.hero h1 { font-size: clamp(30px, 5vw, 58px); margin: 10px 0 8px; line-height: 1; }
.hero p { margin: 0; color: var(--muted); max-width: 700px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.stat { background: rgba(255,255,255,.05); border: 1px solid var(--line); padding: 10px 14px; border-radius: 12px; }
.stat strong { display: block; font-size: 18px; }
.stat span { color: var(--muted); font-size: 12px; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 28px 0 14px; }
.section-header h2 { margin: 0; font-size: 22px; }
.section-header span { color: var(--muted); font-size: 13px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.music-card { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: .18s ease; min-width: 0; }
.music-card:hover { transform: translateY(-3px); background: var(--card-hover); box-shadow: 0 16px 36px rgba(0,0,0,.23); }
.cover { aspect-ratio: 1; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #321011, #141820); font-size: 42px; margin-bottom: 12px; }
.cover img, .cover-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.music-card strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-card span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.track-list { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(255,255,255,.02); }
.track-row { display: grid; grid-template-columns: 42px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 62px; gap: 14px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.track-row:last-child { border-bottom: 0; }
.track-row:hover, .track-row.playing { background: rgba(176,16,16,.10); }
.track-index { color: var(--muted); text-align: center; }
.track-main, .track-cell { min-width: 0; }
.track-main strong, .track-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-main strong { display: block; }
.track-main span, .track-cell { color: var(--muted); font-size: 13px; }
.row-fav { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.row-fav.active { color: #ff7777; }
.empty, .loading-card { border: 1px dashed rgba(255,255,255,.16); border-radius: 18px; padding: 36px; text-align: center; color: var(--muted); }
.player { position: fixed; left: 0; right: 0; bottom: 0; height: 104px; background: rgba(17,19,24,.97); backdrop-filter: blur(18px); border-top: 1px solid var(--line); z-index: 50; padding: 12px 18px; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.5fr) minmax(160px, .7fr); align-items: center; gap: 22px; }
.now-playing { display: flex; gap: 12px; align-items: center; min-width: 0; }
.cover-sm { flex: 0 0 58px; width: 58px; height: 58px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #321011, #141820); font-size: 22px; }
.now-meta { min-width: 0; }
.now-meta strong, .now-meta span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-meta span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.favorite-btn.active { color: #ff7777; }
.transport { min-width: 0; }
.transport-buttons { display: flex; justify-content: center; align-items: center; gap: 7px; margin-bottom: 6px; }
.play-btn { width: 44px; height: 44px; border: 0; border-radius: 999px; background: #fff; color: #111; cursor: pointer; font-weight: 800; }
.play-btn:hover { transform: scale(1.04); }
.timeline { display: grid; grid-template-columns: 42px 1fr 42px; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
input[type="range"] { width: 100%; accent-color: var(--accent-2); cursor: pointer; }
.volume { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.volume input { max-width: 150px; }
.mobile-only { display: none; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
    body { padding-bottom: 154px; }
    .app-shell { grid-template-columns: 1fr; min-height: calc(100vh - 154px); }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 154px; width: 270px; height: auto; transform: translateX(-110%); transition: .2s ease; box-shadow: var(--shadow); }
    .sidebar.open { transform: translateX(0); }
    .mobile-only { display: grid; }
    .content { padding: 22px 16px 36px; }
    .topbar { padding: 12px 14px; }
    .player { height: 154px; grid-template-columns: 1fr auto; grid-template-rows: 64px 62px; gap: 8px 12px; padding: 10px 12px; }
    .transport { grid-column: 1 / -1; grid-row: 2; }
    .volume { grid-column: 2; grid-row: 1; }
    .volume input { display: none; }
    .track-row { grid-template-columns: 36px minmax(0,1fr) 46px; }
    .track-cell.album, .track-cell.artist { display: none; }
}
@media (max-width: 560px) {
    .hero { padding: 24px 20px; }
    .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
    .music-card { padding: 10px; }
    .now-playing { min-width: 0; }
    .cover-sm { flex-basis: 48px; width: 48px; height: 48px; }
    .favorite-btn { display: none; }
}

.playlist-create-side { border: 1px solid var(--line); background: rgba(176,16,16,.10); color: #fff; border-radius: 12px; padding: 11px 14px; cursor: pointer; text-align: left; }
.playlist-create-side:hover { background: rgba(176,16,16,.20); }
.track-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.row-playlist, .row-remove, .row-order { border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; min-width: 30px; height: 30px; }
.row-playlist:hover, .row-remove:hover, .row-order:hover { color: #fff; background: rgba(255,255,255,.08); }
.row-remove:hover { color: #ff8b8b; }
.playlist-card { position: relative; }
.playlist-card .cover { background: radial-gradient(circle at 30% 20%, rgba(224,58,58,.32), transparent 42%), linear-gradient(135deg, #2b1217, #171a22); }
.playlist-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.primary-btn, .secondary-btn, .danger-btn { border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; cursor: pointer; }
.primary-btn { background: var(--accent-2); border-color: transparent; color: #fff; }
.secondary-btn { background: rgba(255,255,255,.05); color: #fff; }
.danger-btn { background: rgba(176,16,16,.12); color: #ffb0b0; }
.primary-btn:hover, .secondary-btn:hover, .danger-btn:hover { filter: brightness(1.12); }
.full-width { width: 100%; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.72); display: grid; place-items: center; padding: 18px; }
.modal-backdrop[hidden] { display: none; }
.modal-card { width: min(520px, 100%); max-height: min(680px, 90vh); overflow: auto; background: #171a20; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.modal-header small { color: var(--muted); }
.modal-header h3 { margin: 3px 0 0; }
.playlist-picker { display: grid; gap: 8px; margin-bottom: 14px; }
.playlist-pick { border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; text-align: left; }
.playlist-pick:hover { background: rgba(176,16,16,.10); }
.playlist-pick span { color: var(--muted); font-size: 12px; }
.toast { position: fixed; right: 20px; bottom: 124px; z-index: 120; background: #22262f; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow); }
@media (max-width: 900px) { .toast { bottom: 174px; right: 12px; left: 12px; text-align: center; } }
.track-row { grid-template-columns: 42px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 150px; }
@media (max-width: 900px) { .track-row { grid-template-columns: 36px minmax(0,1fr) 150px; } }
@media (max-width: 560px) { .track-row { grid-template-columns: 32px minmax(0,1fr) 92px; gap: 8px; padding-left: 8px; padding-right: 8px; } .row-order { display: none; } }
