:root {
    --bg: #0d0d0d;
    --card: #121212;
    --accent: #dc3545;
    --text: #f8f9fa;
    --muted: #adb5bd;
}

body.light-theme {
    --bg: #f5f5f5;
    --card: #ffffff;
    --text: #212529;
    --muted: #6c757d;
}

body {
    background: var(--bg) !important;
    color: var(--text);
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

body.light-theme .bg-dark,
body.light-theme .bg-black,
body.light-theme .card,
body.light-theme .navbar,
body.light-theme .modal-content {
    background: var(--card) !important;
    color: var(--text) !important;
}

body.light-theme .text-light { color: var(--text) !important; }
body.light-theme .text-secondary { color: var(--muted) !important; }
body.light-theme .border-secondary { border-color: #dee2e6 !important; }
body.light-theme .form-control {
    background: #fff !important;
    color: #212529 !important;
    border-color: #ced4da !important;
}

.player-card {
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f) !important;
    border-radius: 1rem !important;
}
body.light-theme .player-card {
    background: linear-gradient(145deg, #fff, #f8f9fa) !important;
}

.art-wrapper img { transition: transform 0.3s ease; }
.art-wrapper img:hover { transform: scale(1.03); }

#btn-play {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}
#btn-play:hover { transform: scale(1.08); }

.form-range::-webkit-slider-thumb { background: var(--accent); }
.form-range::-moz-range-thumb { background: var(--accent); }

.chat-messages {
    height: 320px;
    overflow-y: auto;
    background: #0a0a0a;
    font-size: 0.9rem;
}
body.light-theme .chat-messages { background: #f1f3f5; }

.chat-msg {
    margin-bottom: 0.6rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    background: #1a1a1a;
}
body.light-theme .chat-msg { background: #e9ecef; }

.chat-msg .user {
    font-weight: 600;
    color: #ff6b6b;
    margin-right: 0.4rem;
}
.chat-msg .time {
    font-size: 0.7rem;
    color: #666;
    margin-left: 0.4rem;
}
.chat-msg.own { background: #2a1515; }
body.light-theme .chat-msg.own { background: #ffe3e3; }

#song-history .hist-item {
    min-width: 110px;
    text-align: center;
    font-size: 0.75rem;
}
#song-history img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 0.4rem;
    margin-bottom: 0.25rem;
    background: #222;
}
#song-history .title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    margin: 0 auto;
}

.ad-slot {
    overflow: hidden;
    text-align: center;
}

.chat-messages::-webkit-scrollbar,
#song-history::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.chat-messages::-webkit-scrollbar-thumb,
#song-history::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

@media (max-width: 576px) {
    #song-art { width: 100px !important; height: 100px !important; }
    .player-card .h4 { font-size: 1.1rem; }
}