* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Tahoma, Arial, Helvetica, sans-serif;
}

body {
    background-color: #383635; /* Desktop backdrop */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

body.full-screen-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    height: 100vh;
    background-color: #383635;
}

body.full-screen-page .steam-window {
    margin: 0;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

body.full-screen-page .container {
    height: 100%;
}

/* Base Steam Window */
.steam-window {
    background: #383635;
    background: linear-gradient(to bottom, #4a4a4a 0%, #383635 15px);
    border: 1px solid #1f1f1f;
    border-top: 1px solid #6b6b6b;
    border-left: 1px solid #5a5a5a;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    width: 98%;
    max-width: 1400px;
    padding: 12px;
    margin: 20px;
}

.steam-window.full-window {
    max-width: none;
}

.container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
    align-items: flex-start;
}

@media (max-width: 768px) {
    body {
        padding: 0;
        align-items: flex-start;
        display: block; /* Avoid center vertically on mobile for better scrolling */
    }

    .steam-window {
        margin: 0;
        width: 100%;
        padding: 8px;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .container {
        gap: 12px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        display: flex;
        flex-direction: column;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
        margin-bottom: 12px;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .streak-counter {
        width: 100%;
        justify-content: center;
    }

    .track-meta {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 15px;
    }

    .progress-wrapper {
        padding: 4px 6px;
        gap: 6px;
    }

    .time-label {
        width: 32px;
        font-size: 10px;
    }

    .track-title {
        font-size: 15px;
        line-height: 1.2;
    }

    /* Reordering sections */
    .player-column, .history-column {
        display: contents;
    }

    #now-playing-card, #empty-state {
        order: 1;
        padding: 8px;
    }

    #members-section {
        order: 2;
        padding: 8px;
    }

    #history-section {
        order: 3;
        padding: 8px;
    }

    #queue-section {
        order: 4;
        padding: 8px;
    }

    .embed-card, .history-section, .empty-state {
        padding: 10px;
        margin-bottom: 0;
    }

    .member-item {
        padding: 4px;
    }

    .member-avatar-container {
        width: 28px;
        height: 28px;
    }

    body.full-screen-page {
        padding: 0;
        height: auto;
        min-height: 100vh;
        display: block;
    }

    body.full-screen-page .steam-window {
        width: 100%;
        height: auto;
        min-height: 100vh;
        max-width: none;
        border: none;
    }

    .leaderboard-container .history-list {
        max-height: none;
    }
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #403e3d;
    border: 1px solid #1f1f1f;
    border-top: 1px solid #5a5a5a;
    border-left: 1px solid #5a5a5a;
    padding: 6px 12px;
    margin-bottom: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.streak-counter {
    background: #1b1b1b;
    border: 1px solid #4a4846;
    padding: 2px 8px;
    font-size: 10px;
    color: #b8b6b4;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.streak-counter i {
    color: #ff9d00;
    text-shadow: 0 0 5px rgba(255, 157, 0, 0.4);
}

#streak-time {
    color: #ffffff;
    font-weight: bold;
}

.header h1 {
    font-size: 14px;
    font-weight: bold;
    color: #e1e1e1;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.header h1 i {
    color: #93b3c8; /* Steam blue tint */
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #909090;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #8bc34a; /* In-game green */
    border: 1px solid #1f1f1f;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
    align-items: start;
}

.player-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid #1f1f1f;
    border-top: 1px solid #1a1a1a;
    border-left: 1px solid #1a1a1a;
    position: relative;
    overflow: hidden;
}

#youtube-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.history-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* Panels (Now Playing & History) */
.embed-card, .history-section, .empty-state {
    background: #262625;
    border: 1px solid #4a4846;
    border-bottom: 1px solid #1f1f1f;
    border-right: 1px solid #1f1f1f;
    padding: 12px;
}

.track-title {
    color: #e1e1e1 !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.track-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.meta-item {
    color: #b8b6b4 !important;
    font-size: 12px;
}

.time-label {
    color: #e1e1e1 !important;
    font-size: 11px;
}

.chat-media {
    max-width: 100%;
    max-height: 200px;
    border: 1px solid #4a4846;
    margin-top: 5px;
    display: block;
    cursor: pointer;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #4a4846;
    padding-bottom: 4px;
    margin-bottom: 12px;
}

.history-section h3, .panel-header h3 {
    font-size: 12px;
    color: #93b3c8;
    text-transform: uppercase;
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-link {
    font-size: 10px;
    color: #93b3c8;
    text-decoration: none;
    text-transform: none;
}

.header-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Track Information */
.now-playing-label {
    font-size: 11px;
    color: #909090;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Removed animated bars, replaced with static square */
.bars {
    display: flex;
    gap: 2px;
}
.bars span {
    width: 4px;
    height: 8px;
    background: #8bc34a;
    border: 1px solid #4e6b28;
}

.track-info-link {
    text-decoration: none;
    color: #e1e1e1;
    display: block;
    margin-bottom: 16px;
}

.track-info-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Member List (Steam Friends style) */
.members-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 100px; /* Ensure it doesn't collapse */
}

/* Scrollbar for members list */
.members-list::-webkit-scrollbar {
    width: 6px;
    background: #1f1f1f;
}
.members-list::-webkit-scrollbar-thumb {
    background: #4a4846;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border: 1px solid transparent;
}

.member-avatar-container {
    position: relative;
    width: 32px;
    height: 32px;
    background: #000;
    padding: 2px;
    border: 1px solid #1f1f1f;
    border-top-color: #5a5a5a;
    border-left-color: #5a5a5a;
}

.member-avatar {
    width: 26px;
    height: 26px;
    object-fit: cover;
}

.member-info {
    display: flex;
    flex-direction: column;
}

.member-name {
    font-size: 11px;
    color: #93b3c8; /* Steam friend blue */
}

.member-status {
    font-size: 10px;
    color: #6a6a6a;
}

.member-bot-badge {
    background: #4a4a4a;
    color: #e1e1e1;
    font-size: 8px;
    padding: 1px 3px;
    border-radius: 2px;
    margin-left: 4px;
    text-transform: uppercase;
}

.track-title {
    font-size: 18px;
    font-weight: normal;
    margin: 10px 0;
}

/* Platform Links & Sync */
.platform-links {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px dashed #4a4846;
}

.platform-label {
    font-size: 10px;
    color: #909090;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.platform-buttons-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.platform-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #383635;
    border: 1px solid #4a4846;
    border-top: 1px solid #5a5a5a;
    border-left: 1px solid #5a5a5a;
    color: #b8b6b4;
    padding: 4px 10px;
    font-size: 10px;
    text-decoration: none;
    transition: all 0.1s;
}

.platform-link-btn:hover {
    background: #4a4846;
    color: #ffffff;
    border-color: #6a6a6a;
}

.platform-link-btn i {
    font-size: 10px;
}

/* VC Chat Section */
.chat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px !important;
    background: #1f1f1f;
    border: 1px solid #1a1a1a;
    min-height: 150px;
    max-height: 400px; /* Enforce height */
    overflow-y: auto !important; /* Enable scroll */
}

/* Custom scrollbar for chat */
.chat-list::-webkit-scrollbar {
    width: 10px;
    background: #1a1a1a;
}
.chat-list::-webkit-scrollbar-thumb {
    background: #4a4846;
    border: 1px solid #5a5a5a;
}


.chat-item {
    display: flex;
    gap: 8px;
    font-size: 11px;
    line-height: 1.3;
}

.chat-author {
    color: #93b3c8;
    font-weight: bold;
    white-space: nowrap;
}

.chat-content {
    color: #b8b6b4;
    word-break: break-word;
}

/* Progress Bar Refinement */
.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #383635;
    padding: 6px 12px;
    border: 1px solid #1f1f1f;
    border-top-color: #4a4846;
    border-left-color: #4a4846;
    margin: 15px 0;
}

.progress-bar-container {
    flex: 1;
    height: 14px;
    background: #1f1f1f;
    border: 1px solid #4a4846;
    border-top-color: #1a1a1a;
    border-left-color: #1a1a1a;
    position: relative;
    padding: 1px;
}

.progress-bar {
    position: absolute;
    top: 1px; left: 1px; bottom: 1px;
    width: 0%;
    background: linear-gradient(to bottom, #5c7047 0%, #3e4b2d 100%);
    border-right: 1px solid #2a331f;
    transition: width 0.5s linear;
}

.time-label {
    font-size: 11px;
    color: #e1e1e1 !important;
    width: 45px;
    text-align: center;
}

/* Player Controls */
.player-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.control-btn {
    background: #403e3d;
    border: 1px solid #1f1f1f;
    border-top: 1px solid #5a5a5a;
    border-left: 1px solid #5a5a5a;
    color: #b8b6b4;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.control-btn:hover {
    background: #4a4a4a;
    color: #ffffff;
    border-color: #6a6a6a;
}

.control-btn:active {
    background: #1f1f1f;
    border: 1px solid #1a1a1a;
    border-bottom: 1px solid #4a4846;
    border-right: 1px solid #4a4846;
    transform: translateY(1px);
}

.control-btn i {
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

#btn-pause.paused i::before {
    content: "\f04b"; /* FontAwesome play icon */
}

/* History List */
.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Increased gap for cards */
    overflow-y: auto;
    max-height: 250px;
    flex: 1;
}

/* Custom classic scrollbar */
.history-list::-webkit-scrollbar {
    width: 12px;
    background: #383635;
    border-left: 1px solid #1f1f1f;
}
.history-list::-webkit-scrollbar-thumb {
    background: #4a4846;
    border: 1px solid #5a5a5a;
    border-bottom-color: #1f1f1f;
    border-right-color: #1f1f1f;
}
.history-list::-webkit-scrollbar-button {
    display: block;
    height: 12px;
    background: #4a4846;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 11px;
    background: #403e3d; /* Classic solid card background */
    border: 1px solid #1f1f1f;
    border-top: 1px solid #5a5a5a;
    border-left: 1px solid #5a5a5a;
    transition: background 0.2s;
}

.history-item:hover {
    background: #4a4a4a; /* Hover highlight for the card */
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.history-title {
    color: #b8b6b4;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-title:hover {
    color: #e1e1e1;
    text-decoration: underline;
}

.history-requester {
    color: #6a6a6a;
    font-size: 10px;
}

.history-duration {
    color: #909090;
    margin-left: 8px;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: #6a6a6a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
}

.empty-state i {
    font-size: 32px;
    color: #403e3d;
}

.empty-state h3 {
    font-size: 14px;
    color: #909090;
    font-weight: normal;
}

.empty-state code {
    background: #1f1f1f;
    border: 1px solid #4a4846;
    padding: 2px 4px;
    color: #b8b6b4;
    font-family: inherit;
}

/* Leaderboard & Likes */
.leaderboard-container {
    width: 100%;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.leaderboard-container .history-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.leaderboard-container .history-list {
    flex: 1;
    max-height: none;
    overflow-y: auto;
}

.like-counter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #ff4757;
    text-shadow: 0 0 5px rgba(255, 71, 87, 0.2);
}

.like-counter i {
    filter: drop-shadow(0 0 2px rgba(255, 71, 87, 0.4));
}

.history-item .like-counter {
    margin-left: auto;
    font-weight: bold;
    background: rgba(0,0,0,0.2);
    padding: 2px 6px;
    border-radius: 4px;
}
