* {
    box-sizing: border-box;
}

:root {
    --bg: #0b1220;
    --bg-soft: #111827;
    --bg-elevated: #172033;
    --bg-hover: #1d2940;
    --bg-active: #22314d;
    --border: #25324a;
    --text: #ffffff;
    --muted: #9fb0c8;
    --green: #3b82f6;
    --green-soft: rgba(59, 130, 246, 0.16);
    --danger: #ef4444;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

button,
input,
select {
    font: inherit;
}

.appShell {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    min-height: 0;
}

.leftRail,
.rightRail {
    background: #0d0d0d;
    border-right: 1px solid var(--border);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
}

.rightRail {
    border-right: 0;
    border-left: 1px solid var(--border);
}

.mainContent {
    padding: 24px;
    overflow-y: auto;
    background: linear-gradient(180deg, #18263f 0%, #0b1220 35%);
    min-height: 0;
}

.settingsPage {
    min-height: 100vh;
    background: linear-gradient(180deg, #18263f 0%, #0b1220 35%);
    padding: 24px;
}

.coverArt,
.miniArt {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.settingsWrap {
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    gap: 18px;
}

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

.settingsHeader h1 {
    margin: 0;
}

.brandCard,
.panelCard,
.heroCard {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.brandCard h1 {
    margin: 0;
    font-size: 28px;
}

.brandCard span {
    color: var(--muted);
    font-size: 14px;
}

.grow {
    flex: 1;
    min-height: 0;
}

.sectionHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.sectionHeader h2,
.sectionHeader h3 {
    margin: 0;
}

.queueHeaderActions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.authButtons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

select,
input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
}

select:focus,
input[type="text"]:focus {
    border-color: var(--green);
}

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

.pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--green-soft);
    color: #9ff2bc;
    font-size: 13px;
    font-weight: bold;
}

.heroCard {
    margin-bottom: 20px;
}

.heroTop h2 {
    margin: 10px 0 6px;
    font-size: 36px;
    line-height: 1.08;
}

.searchBlock {
    margin-top: 18px;
}

.searchLabel {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
}

.searchInputWrap {
    position: relative;
}

.searchInputWrap input {
    padding-right: 130px;
}

.primaryBtn {
    position: absolute;
    top: 6px;
    right: 6px;
    height: calc(100% - 12px);
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: var(--green);
    color: #04130a;
    font-weight: bold;
    cursor: pointer;
}

.primaryBtn:hover {
    background: #1ed760;
}

.searchDropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 30;
    background: #111111;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.searchDropdownHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
}

.iconGhostBtn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.iconGhostBtn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

#searchResultsList {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 380px;
    overflow-y: auto;
}

#searchResultsList li {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

#searchResultsList li:last-child {
    border-bottom: 0;
}

.searchResult {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.searchResultInfo {
    min-width: 0;
}

.searchResultTitle {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.searchResultMeta {
    font-size: 13px;
    margin-top: 4px;
}

.searchResultActions,
.libraryItemActions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.playlistMiniSelect {
    width: auto;
    padding: 6px 8px;
    border-radius: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
}

.nowPlayingGrid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.coverArt {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    font-size: 64px;
}

.miniArt {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    font-size: 28px;
}

.trackMetaGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-content: start;
}

.label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.value {
    font-size: 16px;
    font-weight: bold;
    word-break: break-word;
}

.basicEqGrid {
    display: grid;
    gap: 12px;
}

.eqItem {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
}

.eqHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.eqHeader label {
    font-size: 14px;
    font-weight: bold;
}

.eqHeader span {
    color: var(--muted);
    font-size: 13px;
}

.eqItem input[type="range"] {
    width: 100%;
}

.libraryList {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    min-height: 0;
}

.libraryList li {
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 8px;
    background: transparent;
    border: 1px solid transparent;
}

.libraryList li:hover {
    background: var(--bg-hover);
}

.libraryList li.active {
    background: var(--bg-active);
    border-color: rgba(29, 185, 84, 0.35);
}

.libraryItemTitle {
    font-weight: bold;
}

.libraryItemMeta {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.playlistCreateRow {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 14px;
}

.playlistLayout {
    display: grid;
    gap: 14px;
}

.tinySpace {
    margin-bottom: 8px;
}

.playerBar {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    align-items: center;
    gap: 20px;
    padding: 14px 20px;
    background: #0b0b0b;
    border-top: 1px solid var(--border);
    z-index: 20;
}

.playerLeft,
.playerCenter,
.playerRight {
    display: flex;
    align-items: center;
}

.playerLeft {
    gap: 12px;
}

.playerCenter {
    flex-direction: column;
    gap: 10px;
}

.playerRight {
    justify-content: flex-end;
    gap: 14px;
}

.footerTitle {
    font-weight: bold;
}

.footerTitleRow {
    display: flex;
    align-items: center;
    gap: 10px;
}

.transport {
    display: flex;
    align-items: center;
    gap: 10px;
}

button {
    border: 0;
    cursor: pointer;
    transition: 0.15s ease;
}

.iconBtn,
.secondaryBtn {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

.iconBtn:hover,
.secondaryBtn:hover {
    background: var(--bg-hover);
}

.iconBtn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bigBtn {
    width: 48px;
    height: 48px;
}

.tinyIconBtn {
    width: 32px;
    height: 32px;
}

.secondaryBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: bold;
}

.smallBtn {
    padding: 8px 12px;
    font-size: 13px;
}

.tinyBtn {
    padding: 6px 10px;
    font-size: 12px;
}

.dangerBtn {
    color: #ffd4d4;
    border-color: rgba(239, 68, 68, 0.4);
}

.bottomProgress {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 540px;
}

.progressBar {
    height: 6px;
    background: #3a3a3a;
    border-radius: 999px;
    overflow: hidden;
}

.progressFill {
    height: 100%;
    width: 0%;
    background: var(--green);
    border-radius: 999px;
}

.volumeBox {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
}

.volumeBox input[type="range"] {
    width: 140px;
}

input[type="range"] {
    accent-color: var(--green);
}

.healthBar {
    position: sticky;
    bottom: 88px;
    z-index: 15;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(11, 11, 11, 0.96);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.healthItem {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--muted);
}

.hidden {
    display: none !important;
}

[data-lucide] {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.bigBtn [data-lucide] {
    width: 20px;
    height: 20px;
}

@media (max-width: 1400px) {
    .appShell {
        grid-template-columns: 300px 1fr;
    }

    .rightRail {
        grid-column: 1 / -1;
        border-left: 0;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 980px) {
    .appShell {
        grid-template-columns: 1fr;
    }

    .leftRail,
    .rightRail {
        border-right: 0;
        border-left: 0;
        border-top: 1px solid var(--border);
    }

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

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

    .playerBar {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .playerLeft,
    .playerCenter,
    .playerRight {
        justify-content: center;
    }

    .playerRight {
        flex-wrap: wrap;
    }
}