:root {
    --bg: #0b0b0d;
    --surface: #16161a;
    --surface-raised: #1e1e23;
    --fg: #f5f5f7;
    --muted: #9a9aa2;
    --border: #2a2a30;
    --accent: #1ed760;
    --accent-fg: #05170a;
    --danger: #ff6b6b;
    --radius: 14px;
    --radius-sm: 8px;
    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: radial-gradient(circle at top, #17171c 0%, var(--bg) 55%);
    color: var(--fg);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

button, input {
    font-family: inherit;
}

a {
    color: inherit;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: 1.05rem;
}

.brand-mark {
    color: var(--accent);
    font-size: 0.8rem;
}

/* ---------------- Auth screen ---------------- */

.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1.25rem;
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem 2rem;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.auth-card .brand {
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 0.6rem;
}

.auth-tagline {
    color: var(--muted);
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0 0 1.75rem;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.auth-tab {
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-tab.active {
    background: var(--fg);
    color: #0b0b0d;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.field input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.85rem;
    color: var(--fg);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.field input:focus {
    border-color: var(--accent);
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.2rem;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.1s ease, opacity 0.15s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-fg);
}

.btn-primary:hover {
    opacity: 0.92;
}

.btn-block {
    width: 100%;
    margin-top: 0.25rem;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    border-color: var(--muted);
}

.btn-spotify {
    background: var(--accent);
    color: var(--accent-fg);
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
}

.btn-spotify[disabled] {
    background: var(--surface-raised);
    color: var(--muted);
    cursor: default;
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin: -0.4rem 0 0;
}

.auth-footnote {
    text-align: center;
    color: var(--muted);
    font-size: 0.78rem;
    margin: 1.5rem 0 0;
}

/* ---------------- Dashboard ---------------- */

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 2rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(11, 11, 13, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.me-name {
    color: var(--muted);
    font-size: 0.88rem;
}

.layout {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 1.5rem;
    max-width: 78rem;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 880px) {
    .layout {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.panel-sub {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0.4rem 0 1.25rem;
    line-height: 1.5;
}

/* Track list */

.track-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.track-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.55rem;
    border-radius: var(--radius-sm);
    transition: background 0.12s ease;
}

.track-row:hover {
    background: var(--surface-raised);
}

.track-row img {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-raised);
}

.track-meta {
    min-width: 0;
}

.track-title {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-index {
    color: var(--muted);
    font-size: 0.8rem;
    width: 1.3rem;
    text-align: right;
    flex-shrink: 0;
}

/* Post form */

.post-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.post-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.post-form input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    color: var(--fg);
    font-size: 0.9rem;
    outline: none;
}

.post-form input:focus {
    border-color: var(--accent);
}

.post-form .btn {
    align-self: flex-start;
}

/* Feed list */

.feed-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 56rem;
    overflow-y: auto;
}

.feed-item {
    display: flex;
    gap: 0.85rem;
}

.feed-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--surface-raised);
}

.feed-body {
    flex: 1;
    min-width: 0;
}

.feed-line {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.feed-line strong {
    color: var(--fg);
    font-weight: 600;
}

.feed-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem;
}

.feed-card img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.feed-note {
    font-size: 0.85rem;
    color: var(--fg);
    margin: 0.5rem 0 0;
    line-height: 1.4;
}

.feed-time {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

.empty-state {
    color: var(--muted);
    font-size: 0.88rem;
    padding: 1.5rem 0;
    text-align: center;
}
