/* public/css/sonic-lounge.css */
/* This file contains all properly scoped styles for the Sonic Lounge channel. */

#channel-sonic-lounge .channel-content {
    display: flex;
    padding: 0.75rem; /* Changed to 0.75rem to match library inner content padding exactly */
    gap: 0.75rem; /* Re-added gap to separate the two columns */
    height: 100%;
    align-items: stretch; /* Stretch to fill container */
}

.lounge-grid-layout {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 0.75rem; /* Same gap as Library inner content */
}

#lounge-main-display {
    flex-grow: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; 
    border-radius: 0.375rem; /* Re-added radius to match Library */
    border: 1px solid var(--color-border-secondary); /* Added library-style border */
    background-color: var(--color-windows-inner-bg); /* Added background */
    box-shadow: 0 4px 10px rgba(0,0,0,0.5); /* Added matching shadow */
    height: auto; 
}

#lounge-album-art {
    width: 100%;
    height: 100%; 
    position: absolute; 
    top: 0;
    left: 0;
    background-color: #000;
    background-size: cover; 
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0.375rem; 
    box-shadow: none; 
    border: none; 
    z-index: 1; 
}

#lounge-album-art.fit-cover,
#song-art-preview.fit-cover {
    background-size: cover;
    object-fit: cover;
}

#lounge-album-art.fit-contain,
#song-art-preview.fit-contain {
    background-size: contain;
    object-fit: contain;
}

#lounge-album-art.fit-fill,
#song-art-preview.fit-fill {
    background-size: 100% 100%;
    object-fit: fill;
}

#lounge-main-display #live-comments-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform: none; 
    background-color: rgba(0, 0, 0, 0.4); 
    z-index: 3;
    border-radius: 0.375rem;
    padding: 10px; /* Add some padding so content doesn't hit edges */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#lounge-presence-panel {
    flex: 0 0 250px; 
    display: flex;
    flex-direction: column;
    background-color: var(--color-windows-inner-bg);
    border: 1px solid var(--color-border-secondary); /* Match library border */
    box-shadow: 0 4px 10px rgba(0,0,0,0.5); /* Added matching shadow */
    border-radius: 0.375rem; /* Match library radius */
    overflow: hidden;
    height: auto; 
}

.lounge-presence-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #000;
    font-family: var(--font-sections, sans-serif);
    background-color: var(--color-top-windows-bg);
    padding: 0.4rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--color-border-secondary);
    background-image: none;
    text-shadow: none; 
    box-shadow: none;
    flex-shrink: 0;
}

/* HIDE live show banner - moved to header */
#live-show-banner-container {
    display: none !important;
    flex-shrink: 0;
    position: relative;
    width: 100%;
    height: clamp(35px, 6vh, 60px);
    background: var(--color-console-main);
    color: var(--color-text-main);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 0.1vw solid transparent;
    margin: 0.4vh 0;
}

#live-show-banner-container:hover {
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

#live-show-banner-container.is-registering {
    border-color: var(--color-accent-highlight-1);
    animation: banner-attention-flash 3s infinite ease-in-out;
}

@keyframes banner-attention-flash {
    0%, 100% { box-shadow: 0 0 5px rgba(251, 191, 36, 0.2); border-color: rgba(251, 191, 36, 0.3); }
    50% { box-shadow: 0 0 15px rgba(251, 191, 36, 0.6); border-color: var(--color-accent-highlight-1); }
}

.show-banner-registration-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent-highlight-1);
    font-weight: bold;
    font-size: 0.85rem;
    text-align: center;
    padding: 0 10px;
    z-index: 5;
    pointer-events: none !important; /* Force clicks to pass through to the container */
    text-shadow: 0 2px 4px rgba(0,0,0,0.9);
    transition: background 0.3s ease;
}

#live-show-banner-container.is-live .show-banner-registration-overlay {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
}

#live-show-banner-container.is-live.is-connected .show-banner-registration-overlay {
    color: #ef4444; /* Red for Disconnect */
}

.show-banner-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; /* Ensure clicks pass through to the container */
}

.show-banner-overlay-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 1px 5px;
    font-size: 0.7rem;
    font-weight: bold;
    text-shadow: 0 1px 2px #000;
    text-align: center;
    pointer-events: none; /* Ensure clicks pass through */
}

.show-banner-timer, .show-banner-state-text {
    position: absolute;
    bottom: 3px;
    right: 5px;
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    pointer-events: none; /* Ensure clicks pass through */
}

.show-banner-entry-count {
    position: absolute;
    bottom: 3px;
    left: 5px;
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    pointer-events: none; /* Ensure clicks pass through */
}

.show-banner-state-text.live,
.show-banner-timer.live {
    color: #ef4444;
    text-shadow: 0 0 5px #ef4444;
    animation: live-pulse 1.5s infinite;
}

@keyframes live-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

#lounge-live-pins-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

#lounge-live-pins-content::-webkit-scrollbar {
  width: 4px;
}
#lounge-live-pins-content::-webkit-scrollbar-thumb {
  background-color: #6b7280;
  border-radius: 2px;
}

.lounge-user-pin {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.lounge-user-pin:hover {
    background-color: rgba(255,255,255,0.1);
}

.lounge-user-pin .lounge-pin-pfp {
    position: relative;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.lounge-user-pin .lounge-pin-pfp::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 50%;
    border: 2px solid #4b5563;
    transition: all 0.3s ease;
    z-index: 2; 
}

.lounge-user-pin img,
.lounge-chat-message .lounge-pin-pfp img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1; 
}


.lounge-user-pin .lounge-pin-username {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Ticket indicator on user pins */
.lounge-pin-ticket {
    color: #a78bfa;
    font-size: 0.65rem;
    margin-left: 2px;
    animation: ticket-glow 2s infinite;
}

.lounge-current-user-wrapper .lounge-pin-ticket {
    color: #22c55e;
}

@keyframes ticket-glow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Empty state for registered users list */
.lounge-presence-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: #6b7280;
    font-size: 0.85rem;
}

.lounge-presence-empty i {
    font-size: 1.5rem;
    opacity: 0.5;
}

/* --- Global Chat (Lounge) Message Styles - DM-style alignment --- */
.lounge-chat-message {
    display: flex;
    align-items: flex-start; 
    padding: 3px 0; 
    position: relative; 
    border-radius: 4px;
    margin: 0;
}

.lounge-chat-message[data-is-owner="true"] {
    cursor: pointer;
}

.lounge-chat-message:hover {
    background-color: transparent;
}

/* DM-style positioning for global chat */
.lounge-chat-message.wrapper-me {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.lounge-chat-message.wrapper-them {
    flex-direction: row;
    justify-content: flex-start;
}

/* Ensure bubble stays flush - no gap between bubble and container edge */
.lounge-chat-message.wrapper-me .dm-bubble {
    margin-right: 0;
}

.lounge-chat-message.wrapper-them .dm-bubble {
    margin-left: 0;
}

/* --- MODIFICATION START: Reduced chat pin size --- */
.lounge-chat-message .lounge-pin-pfp {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    position: relative;
}
/* --- MODIFICATION END --- */


.lounge-chat-message .lounge-pin-pfp::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 50%;
    border: 2px solid transparent; 
    transition: all 0.3s ease;
    z-index: 2;
}

/* --- MODIFICATION START: New rules for chat text and hover actions --- */
/* DM-style message content */
.lounge-message-content {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.lounge-message-text {
    padding: 0.25rem 0.375rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    line-height: 1.4;
    word-break: break-word;
    display: inline;
    white-space: pre-wrap;
}

/* Old wrapper-user/them classes - keep for compatibility but add DM-style variants */
.lounge-chat-message.wrapper-user {
    justify-content: flex-end;
}

.lounge-chat-message.wrapper-them {
    justify-content: flex-start;
}

/* DM-style bubbles for global chat - now using dm-bubble classes */
.lounge-chat-message .dm-bubble {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    padding: 2px 4px;
    border-radius: 6px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Inline icon inside chat bubble */
.lounge-chat-message .dm-bubble .inline-icon {
    width: 14px;
    height: 14px;
    min-width: 14px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.lounge-chat-message .dm-bubble.bubble-me {
    background: var(--color-active-highlight) !important;
    color: white !important;
    border-bottom-right-radius: 0.25rem !important;
}

.lounge-chat-message .dm-bubble.bubble-them {
    background: #374151 !important;
    color: #e5e7eb !important;
    border-bottom-left-radius: 0.25rem !important;
}

.lounge-chat-message .dm-sender-name {
    display: inline;
    font-size: 0.7rem;
    font-weight: bold;
    margin-bottom: 0;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lounge-chat-message .bubble-me .dm-sender-name {
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
}

.lounge-chat-message .bubble-them .dm-sender-name {
    text-align: left;
    color: var(--color-accent-highlight-1, #fbbf24);
}

.lounge-chat-message .dm-text {
    margin: 0;
    word-break: break-word;
    white-space: pre-wrap;
    font-size: 0.7rem !important;
    line-height: 1.4 !important;
}

/* DM-style actions for global chat - with hover delay to prevent disappearing */
.lounge-chat-message .dm-actions {
    display: flex;
    flex-direction: row;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease 0.1s;
    align-items: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 10;
    padding: 4px;
    margin: -4px;
}

/* Make actions visible when hovering over the message wrapper, not just the bubble */
.lounge-chat-message:hover .dm-actions,
.lounge-chat-message .dm-actions:hover {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
}

.lounge-chat-message .bubble-me .dm-actions {
    right: calc(100% + 8px);
}

.lounge-chat-message .bubble-them .dm-actions {
    left: calc(100% + 8px);
}

.lounge-chat-message .dm-action-btn {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    color: #fff;
    font-size: 0.6rem;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lounge-chat-message .dm-action-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.lounge-chat-message .dm-action-btn.delete:hover {
    color: #ef4444;
}

.lounge-chat-message .dm-action-btn.edit:hover {
    color: #3b82f6;
}

/* System message styling - matches jukebot notification style */
.lounge-chat-message.wrapper-system-no-icon {
    justify-content: center;
    margin: 0.25rem 0;
    width: 100%;
}

.lounge-message-text.bubble-system-no-label {
    background-color: #27272a;
    color: #a7f3d0;
    border-radius: 0.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.65rem;
    font-style: italic;
    text-align: left;
    border-left: 3px solid #22c55e;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
}

.lounge-message-text.bubble-system-no-label .system-notification-content {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
}

.lounge-chat-message.wrapper-system-no-icon .system-notification-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
}

/* Different border colors based on notification type (descendant selector since type class is on child) */
.lounge-message-text.bubble-system-no-label:has(.type-success) {
    border-left-color: #22c55e;
}

.lounge-message-text.bubble-system-no-label:has(.type-alert) {
    border-left-color: #ef4444;
}

.lounge-message-text.bubble-system-no-label:has(.type-info) {
    border-left-color: #22c55e;
}

.lounge-message-text.bubble-system-no-label:has(.type-warning) {
    border-left-color: #fbbf24;
}

/* Ensure AI feed system messages also have proper styling */
#copilot-feed .bubble-system,
.chat-feed .bubble-system {
    background-color: #27272a !important;
    color: #a7f3d0 !important;
    border-radius: 0.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.65rem;
    font-style: italic;
    border-left: 3px solid #22c55e !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#copilot-feed .wrapper-system,
.chat-feed .wrapper-system {
    justify-content: center;
}

.lounge-chat-message.overlay-active .message-overlay {
    opacity: 1;
    pointer-events: auto;
}
/* --- MODIFICATION END --- */


.slot-machine-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 100%;
}

#record-carousel-container:has(.slot-machine-wrapper) {
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: visible;
    padding: 0;
    position: relative;
    height: clamp(90px, 13vh, 135px);
}

.slot-item {
    position: relative;
    width: clamp(70px, 10vw, 110px);
    height: clamp(70px, 10vw, 110px);
    border-radius: clamp(6px, 0.8vw, 10px);
    overflow: hidden;
    flex-shrink: 0;
    background: #111;
    transition: filter 0.4s ease;
}

@keyframes tile-flash {
    0%   { opacity: 1;    transform: scale(1); }
    30%  { opacity: 0.05; transform: scale(0.88); }
    100% { opacity: 1;    transform: scale(1); }
}

.slot-item.flash-in {
    animation: tile-flash 0.18s ease-out forwards;
}

.slot-item.winner-revealed {
    filter: brightness(1.2) grayscale(0) !important;
    transform: scale(1.15) !important;
    z-index: 1000 !important;
    animation: neon-frame-twitch 1.8s steps(1, end) infinite !important;
    opacity: 1 !important;
    overflow: visible !important;
}

@keyframes neon-frame-twitch {
    0%   { box-shadow: 0 0 5px #fff, 0 0 15px #3b82f6, 0 0 35px #3b82f6, 0 0 0 3px #3b82f6; outline: 2px solid #3b82f6; outline-offset: 3px; }
    8%   { box-shadow: none; outline-color: transparent; outline-offset: 3px; }
    9%   { box-shadow: 0 0 5px #fff, 0 0 15px #a855f7, 0 0 35px #a855f7, 0 0 0 3px #a855f7; outline: 2px solid #a855f7; outline-offset: 3px; }
    38%  { box-shadow: 0 0 5px #fff, 0 0 15px #a855f7, 0 0 35px #a855f7, 0 0 0 3px #a855f7; outline: 2px solid #a855f7; outline-offset: 3px; }
    40%  { box-shadow: none; outline-color: transparent; outline-offset: 3px; }
    41%  { box-shadow: 0 0 6px #fff, 0 0 18px #ec4899, 0 0 40px #ec4899, 0 0 0 4px #ec4899; outline: 2px solid #ec4899; outline-offset: 4px; }
    70%  { box-shadow: 0 0 6px #fff, 0 0 18px #ec4899, 0 0 40px #ec4899, 0 0 0 4px #ec4899; outline: 2px solid #ec4899; outline-offset: 4px; }
    71%  { box-shadow: none; outline-color: transparent; outline-offset: 4px; }
    72%  { box-shadow: none; outline-color: transparent; outline-offset: 4px; }
    73%  { box-shadow: 0 0 5px #fff, 0 0 15px #3b82f6, 0 0 35px #3b82f6, 0 0 0 3px #3b82f6; outline: 2px solid #3b82f6; outline-offset: 3px; }
    100% { box-shadow: 0 0 5px #fff, 0 0 15px #3b82f6, 0 0 35px #3b82f6, 0 0 0 3px #3b82f6; outline: 2px solid #3b82f6; outline-offset: 3px; }
}

.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
}

#console-sub-nav {
    display: flex;
    align-items: center;
    padding: 0 clamp(6px, 1vw, 12px);
    gap: clamp(8px, 1.5vw, 16px);
    background: var(--color-console-main);
    border-bottom: 0.1vh solid var(--color-border-main, #374151);
    height: clamp(32px, 5vh, 48px);
}

#console-sub-nav-tabs {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    height: 100%;
}

.console-sub-nav-tab {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: none;
    border: none;
    color: var(--color-text-secondary, #9ca3af);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, border-bottom 0.2s;
    border-bottom: 2px solid transparent;
}

.console-sub-nav-tab.active {
    color: var(--color-active-highlight, #fbbf24);
    border-bottom-color: var(--color-active-highlight, #fbbf24);
}

.dm-icons-container {
    display: flex;
    align-items: center;
    gap: clamp(4px, 0.8vw, 10px);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: clamp(12px, 2vw, 24px);
    border: 0.1vw solid rgba(139, 92, 246, 0.2);
    height: clamp(26px, 4vh, 38px);
    margin-left: auto; /* Push to the right */
}

.dm-icons-carousel {
    display: flex;
    align-items: center;
    position: relative;
    height: clamp(18px, 3vh, 28px);
    width: clamp(60px, 10vw, 100px);
    overflow: hidden;
    gap: clamp(4px, 0.6vw, 8px);
}

.dm-artist-icon {
    width: clamp(18px, 3vw, 28px);
    height: clamp(18px, 3vw, 28px);
    border-radius: 50%;
    border: 0.1vw solid var(--color-bg-main, #000);
    object-fit: cover;
    position: static; /* Removed absolute positioning */
    flex-shrink: 0;
    transition: transform 0.3s ease, z-index 0.3s ease;
    cursor: pointer;
    background: #1f2937;
}

.dm-artist-icon:hover {
    transform: scale(1.1);
    z-index: 10 !important;
}

.dm-artist-icon.active:not(.help-highlight) {
    border-color: var(--color-accent-highlight-1, #fbbf24);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.dm-artist-icon.unread-flash {
    animation: dm-unread-flash 1s ease-in-out infinite;
}

@keyframes dm-unread-flash {
    0%, 100% { border-color: var(--color-bg-main, #000); box-shadow: none; }
    50% { border-color: #fbbf24; box-shadow: 0 0 10px #fbbf24; }
}

.dm-artist-icon[data-index="0"] { left: 0px; z-index: 3; }
.dm-artist-icon[data-index="1"] { left: 14px; z-index: 2; }
.dm-artist-icon[data-index="2"] { left: 28px; z-index: 1; }

.dm-scroll-btn {
    background: none;
    border: none;
    color: var(--color-text-muted, #9ca3af);
    cursor: pointer;
    font-size: 0.65rem;
    padding: 0 2px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1 !important; /* Force visibility */
}

.dm-scroll-btn:hover {
    color: var(--color-accent-highlight-1, #fbbf24);
}

#my-console-header {
    width: 100%;
    flex-shrink: 0;
    display: block !important;
}

#user-banner-container {
    position: relative;
    width: 100% !important;
    height: clamp(45px, 8vh, 80px);
    background-color: transparent;
    display: block !important;
    overflow: hidden;
    flex-shrink: 0;
}

#user-banner-img {
    width: 100% !important;
    height: 100%;
    object-fit: cover;
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#user-banner-name {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-family: var(--font-name, sans-serif);
    color: var(--font-color-subheaders, #d1d5db);
    font-size: clamp(0.9rem, 1.5vw, 1.5rem);
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 12px var(--mood-glow-color, transparent), 0 0 5px var(--mood-glow-color, transparent);
    pointer-events: auto; /* Required for clicking the name button */
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    transition: text-shadow 0.3s ease, color 0.3s ease;
    z-index: 10;
    text-align: center;
    white-space: nowrap;
}

#console-lottery-ticket-btn {
    /* Position and display are now handled by JavaScript and copilot layout */
    font-size: 1.8rem !important;
    color: var(--color-accent-highlight-1, #fbbf24);
    transition: transform 0.2s, opacity 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100;
    white-space: nowrap;
}

.chat-feed.dm-feed-wrapper {
    display: none;
    flex-direction: column;
    height: 100%;
    position: absolute;
    left: 48px;
    width: calc(100% - 48px);
    z-index: 1;
}

.chat-feed.dm-feed-wrapper.active {
    display: flex;
}

/* DM feed with background - override sidebar offset since it has its own layout */
.chat-feed.dm-feed-wrapper:has(.dm-background-layer) {
    left: 0;
    width: 100%;
}

.dm-message-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 3px 0;
    position: relative;
}

.dm-message-wrapper.wrapper-me {
    align-items: flex-end;
}

.dm-message-wrapper.wrapper-them {
    align-items: flex-start;
}

.dm-bubble {
    max-width: 80%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 12px;
    position: relative;
}

.dm-bubble.bubble-me {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 2px;
    margin-left: auto;
}

.dm-bubble.bubble-them {
    background-color: #e9ecef;
    color: black;
    border-bottom-left-radius: 2px;
    margin-right: auto;
}

.dm-actions {
    display: flex;
    flex-direction: row;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease 0.1s;
    align-items: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 10;
    padding: 4px;
    margin: -4px;
}

/* Hover on message wrapper also shows actions */
.dm-message-wrapper:hover .dm-actions,
.dm-bubble:hover .dm-actions,
.dm-actions:hover {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
}

.bubble-me .dm-actions {
    right: calc(100% + 8px);
}

.bubble-them .dm-actions {
    left: calc(100% + 8px);
}

.dm-action-btn {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    color: #fff;
    font-size: 0.6rem;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-action-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.dm-action-btn.delete:hover {
    color: #ef4444;
}

.dm-action-btn.edit:hover {
    color: #3b82f6;
}

.dm-bubble {
    max-width: 100%;
    padding: 3px 5px !important;
    border-radius: 4px !important;
    font-size: 0.7rem !important;
    line-height: 1.2 !important;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    display: inline-block !important;
    white-space: pre-wrap;
    word-break: break-word;
}

.dm-bubble.bubble-me {
    background: var(--color-active-highlight) !important;
    color: white !important;
    border-bottom-right-radius: 0.25rem !important;
}

.dm-bubble.bubble-them {
    background: #374151 !important;
    color: #e5e7eb !important;
    border-bottom-left-radius: 0.25rem !important;
}

.dm-sender-name {
    display: inline;
    font-size: 0.7rem;
    font-weight: bold;
    margin-bottom: 0;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bubble-me .dm-sender-name {
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
}

.bubble-them .dm-sender-name {
    text-align: left;
    color: var(--color-accent-highlight-1, #fbbf24);
}

.dm-text {
    margin: 0;
    word-break: break-word;
    white-space: pre-wrap;
    font-size: 0.7rem !important;
    line-height: 1.4 !important;
}

#copilot-feed, 
#lounge-chat-feed, 
.dm-feed-content,
.chat-feed {
  font-size: 0.7rem !important;
  line-height: 1.4 !important;
}

#copilot-feed *, 
#lounge-chat-feed *, 
.dm-feed-content *,
.chat-feed * {
  font-size: 0.7rem !important;
}

.dm-pagination-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  background: transparent;
  border-top: none;
  margin-top: 0;
  width: 100%;
}

.dm-pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  gap: 10px;
  padding: 2px 0;
}

.dm-page-number {
  font-size: 0.65rem;
  color: var(--color-text-muted, #9ca3af);
  white-space: nowrap;
  margin: 0 10px;
  text-align: center;
}

.dm-pagination-btn {
  background: none;
  border: none;
  color: var(--color-text-muted, #9ca3af);
  cursor: pointer;
  font-size: 0.8rem;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dm-pagination-btn:hover:not(:disabled) {
  color: var(--color-accent-highlight-1, #fbbf24);
}

.dm-pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.dm-return-live-btn {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
  color: var(--color-accent-purple, #8b5cf6);
}

.dm-feed-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dm-feed-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* DM Feed wrapper with background - ensure background shows properly */
.dm-feed-wrapper,
.chat-feed.dm-feed-wrapper {
    position: relative !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-color: transparent !important;
}

/* DM Background Layer - shows partner's profile pic overlaid on chat background */
.dm-background-layer {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    opacity: 0.30;
    pointer-events: none;
    z-index: 0;
}

/* DM Feed content stays above background layers */
.dm-feed-content {
    position: relative;
    z-index: 1;
}

/* DM Artist Pins - small avatar next to messages */
.dm-artist-pin {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    position: relative;
    cursor: pointer;
    margin-right: 4px;
}

.dm-artist-pin::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 50%;
    border: 2px solid #6b7280;
    transition: all 0.3s ease;
    z-index: 2;
}

.dm-artist-pin:hover::before {
    border-color: var(--color-accent-highlight-1, #fbbf24);
}

.dm-artist-pin-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* DM message wrapper with artist pin */
.dm-message-wrapper.wrapper-them {
    flex-direction: row;
    align-items: flex-start;
}

.dm-message-wrapper.wrapper-them .dm-artist-pin {
    order: 1;
}

.dm-message-wrapper.wrapper-them .dm-bubble {
    order: 2;
}

.dm-message-wrapper.wrapper-me .dm-bubble {
    order: 1;
}
/* Account Channel */
#channel-account .account-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    padding: 12px;
    background: transparent;
    height: 100%;
    box-sizing: border-box;
    border: 1px solid var(--color-border-secondary);
    border-radius: 15px;
}

#channel-account .account-section {
    border: 1px solid var(--color-border-secondary);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    background-color: var(--color-tertiary);
    /* Shading handled in _shading.css */
}

#channel-account .account-section-title-banner {
    width: 100%;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-top-windows-bg, var(--color-frame));
    border-bottom: 1px solid var(--color-border-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Bungee Inline', cursive;
    color: var(--color-text-title);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    /* Shading handled in _shading.css */
}

/* Art section rows - fixed layout for alignment */
#channel-account #section-banners .account-section-content {
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: stretch;
    gap: 4px;
    padding: 6px;
    overflow-y: auto;
}

/* Art section - split horizontally into equal halves (Banners top, Backgrounds bottom) */
#channel-account #section-banners {
    display: flex !important;
    flex-direction: column !important;
}

/* Each row container - vertical centering and fixed layout - EQUAL HEIGHT HALVES */
#channel-account #section-banners .art-row {
    flex: 1 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 0 4px !important;
}

/* Upload buttons - fixed width, vertically centered */
#channel-account #section-banners .upload-btn,
#channel-account #section-backgrounds .upload-btn {
    flex-shrink: 0;
    width: 48px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Arrow buttons - positioned 5px from banners */
#channel-account #section-banners .arrow-btn,
#channel-account #section-backgrounds .arrow-btn {
    flex-shrink: 0;
    width: 28px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px; /* 5px gap from banners */
}

/* Stock banner container - exact width for 4 banners (84px each + 3 gaps of 4px = 348px) */
#account-stock-banner-container {
    flex: 0 0 348px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
}

/* Stock background container - fixed width for 6 larger pins (29px * 6 + 5 gaps * 4px = 194px, with arrows = ~270px) */
#account-stock-background-container {
    flex: 0 0 270px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
}

#account-stock-banner-container .account-stock-banner-option {
    height: 28px !important;
    width: auto !important;
    aspect-ratio: 3/1 !important;
    border-radius: 4px !important;
    flex-shrink: 0;
    object-fit: cover;
    transition: transform 0.2s, border-color 0.2s;
}

#account-stock-banner-container .account-stock-banner-option:hover {
    transform: scale(1.05);
}

#account-stock-background-container .account-background-option {
    width: 29px !important;
    height: 29px !important;
    border-radius: 50% !important;
    flex-shrink: 0;
    border: 1px solid #4b5563;
    cursor: pointer;
    object-fit: cover;
}

#account-stock-background-container .account-background-option:hover {
    border-color: var(--color-accent-highlight-1, #fbbf24);
    transform: scale(1.1);
}

/* Preview containers - selected state highlights the preview instead of scroll items */
#account-banner-preview-container.selected {
    border-color: var(--color-accent-highlight-2, #3b82f6) !important;
    box-shadow: 0 0 8px var(--color-accent-highlight-2, rgba(59, 130, 246, 0.6));
}

#account-background-preview-container.selected {
    border-color: var(--color-accent-highlight-2, #3b82f6) !important;
    box-shadow: 0 0 8px var(--color-accent-highlight-2, rgba(59, 130, 246, 0.6));
}

#channel-account .account-section-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 0;
}

#channel-account #section-image-upload {
    grid-column: 1;
    grid-row: 1;
}

#channel-account #section-name {
    grid-column: 2;
    grid-row: 1;
}

#channel-account #section-theme {
    grid-column: 3;
    grid-row: 1;
}

#channel-account #section-banners {
    grid-column: 1 / span 2;
    grid-row: 2;
}

#channel-account #section-socials {
    grid-column: 3;
    grid-row: 2;
}

/* Custom Scrollbar for account sections */
#channel-account .account-section-content::-webkit-scrollbar {
    width: 6px;
}

#channel-account .account-section-content::-webkit-scrollbar-track {
    background: transparent;
}

#channel-account .account-section-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #4b5563);
    border-radius: 3px;
}

#channel-account .account-section-content::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover, #6b7280);
}

/* Hide scrollbar for stock banner container */
#account-stock-banner-container::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

#account-stock-banner-container {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Auto-hide messages (join/leave notifications) */
.auto-hide-message {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.auto-hide-message.hiding {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Leaderboard Section */
#lounge-leaderboard-container {
    padding: 0.5rem;
    border-bottom: 1px solid var(--color-border-secondary);
}

.leaderboard-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.leaderboard-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-main);
    flex-grow: 1;
}

.leaderboard-toggle {
    background: none;
    border: 1px solid var(--color-border-secondary);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: bold;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.leaderboard-toggle:hover {
    border-color: var(--color-accent-highlight-1);
    color: var(--color-accent-highlight-1);
}

.leaderboard-toggle.active {
    background: var(--color-accent-highlight-1);
    border-color: var(--color-accent-highlight-1);
    color: #000;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.leaderboard-loading {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-align: center;
    padding: 0.5rem;
}

.leaderboard-empty {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-align: center;
    padding: 0.5rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.leaderboard-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.leaderboard-rank {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: bold;
    flex-shrink: 0;
}

.leaderboard-rank.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #000;
}

.leaderboard-rank.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #000;
}

.leaderboard-rank.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b8702f);
    color: #fff;
}

.leaderboard-rank.rank-other {
    background: var(--color-border-secondary);
    color: var(--color-text-muted);
}

.leaderboard-pin {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--color-border-secondary);
}

.leaderboard-info {
    flex-grow: 1;
    min-width: 0;
}

.leaderboard-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-points {
    font-size: 0.65rem;
    color: var(--color-accent-highlight-1);
    font-weight: bold;
}

.leaderboard-play-btn {
    background: none;
    border: none;
    color: var(--color-accent-highlight-1);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 0.7rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.leaderboard-play-btn:hover {
    background: var(--color-accent-highlight-1);
    color: #000;
    transform: scale(1.1);
}

.leaderboard-play-btn i {
    margin: 0;
}

/* Hide AI notifications - system messages in lounge chat - with !important to force override */
.hide-ai-notifications .wrapper-system-no-icon,
.hide-ai-notifications .lounge-chat-message.wrapper-system-no-icon,
.hide-ai-notifications .wrapper-system,
.hide-ai-notifications .copilot-message-wrapper.wrapper-system-no-icon,
.hide-ai-notifications .bubble-system-no-label,
.hide-ai-notifications .bubble-system,
.hide-ai-notifications .system-notification-content {
    display: none !important;
}

/* Panel-specific grid layouts */

/* Customize Panel: Theme (30%) | Art section (70%) split horizontally */
#account-customize-panel .account-layout {
    grid-template-columns: 30fr 70fr !important;
    grid-template-rows: 1fr !important;
}

#account-customize-panel #section-theme {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

/* Art section - contains Banners and Backgrounds stacked vertically */
#account-customize-panel #section-banners {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

#account-customize-panel #section-backgrounds {
    display: none !important;
}

/* Profiles Panel: 3 columns in row 1 */
#account-profiles-panel .account-layout {
    grid-template-columns: 1fr 1fr 1fr !important;
    grid-template-rows: 1fr !important;
}

#account-profiles-panel #section-image-upload {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

#account-profiles-panel #section-name {
    grid-column: 2 !important;
    grid-row: 1 !important;
}

#account-profiles-panel #section-socials {
    grid-column: 3 !important;
    grid-row: 1 !important;
}
