:root {
    --bg: #0a0a0c;
    --bg-soft: #14141a;
    --bg-card: #1a1a22;
    --border: #2a2a34;
    --text: #f1f1f4;
    --text-dim: #9090a0;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --cyan: #06b6d4;
    --gradient: linear-gradient(135deg, var(--purple), var(--pink));
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, #1b1424 0%, var(--bg) 60%);
    color: var(--text);
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

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

.wrap {
    max-width: 920px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 36px;
}

.brand img {
    width: 32px;
    height: 32px;
}

.hero {
    text-align: center;
    margin-top: 80px;
}

.hero h1 {
    font-size: 42px;
    margin: 0 0 12px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    color: var(--text-dim);
    margin: 0 0 32px;
    font-size: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    background: var(--gradient);
    color: white;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

.btn.secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn.icon {
    padding: 12px;
    border-radius: 50%;
}

.join-form {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    justify-content: center;
}

.join-form input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 13px 18px;
    border-radius: 999px;
    font-size: 14px;
    width: 220px;
}

.room-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.room-id {
    font-size: 13px;
    color: var(--text-dim);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 999px;
}

.listeners {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-dim);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
}

.player-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    gap: 24px;
    align-items: center;
}

.disc {
    width: 110px;
    height: 110px;
    flex-shrink: 0;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #111;
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.25);
    animation: spin 8s linear infinite;
    animation-play-state: paused;
}

.disc.playing {
    animation-play-state: running;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.now-playing {
    flex: 1;
    min-width: 0;
}

.now-playing .title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing .meta {
    color: var(--text-dim);
    font-size: 13px;
    margin: 0 0 14px;
}

.progress {
    height: 6px;
    border-radius: 999px;
    background: var(--bg-soft);
    overflow: hidden;
    cursor: pointer;
}

.progress-bar {
    height: 100%;
    background: var(--gradient);
    width: 0%;
}

.time-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 6px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
}

.controls .play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.controls button.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.controls button.ghost.active {
    border-color: var(--purple);
    color: var(--purple);
}

.search-box {
    margin-top: 32px;
    position: relative;
}

.search-box input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 14px;
}

.search-results {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.result-row, .queue-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
}

.result-row img, .queue-row img {
    width: 56px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-soft);
}

.result-row .info, .queue-row .info {
    flex: 1;
    min-width: 0;
}

.result-row .info .t, .queue-row .info .t {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-row .info .c, .queue-row .info .c {
    font-size: 12px;
    color: var(--text-dim);
}

.add-btn {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

.queue-section {
    margin-top: 36px;
}

.queue-section h3 {
    font-size: 14px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-pill {
    font-size: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text-dim);
}

.status-pill.ready {
    color: var(--cyan);
}

.status-pill.failed {
    color: var(--pink);
}

.remove-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 18px;
}

.empty-state {
    text-align: center;
    color: var(--text-dim);
    padding: 30px 0;
    font-size: 14px;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

@media (max-width: 600px) {
    .player-card {
        flex-direction: column;
        text-align: center;
    }

    .controls {
        justify-content: center;
    }
}
