html {
    background-color: rgb(0, 0, 0);
    padding: 0;
    margin: 0;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
}

/* Body Styling */
body {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    margin: 0;
    padding: 0;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header Section */
.header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 20px;
    background-color: rgb(0, 0, 0);
    height: 60px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.header-logo {
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Room menu dropdown (header) */
.room-menu {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(440px, calc(100vw - 220px));
}

.room-menu-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-height: 40px;
  padding: 6px 12px;
  border: 2px solid greenyellow;
  border-radius: 10px;
  background: rgb(40, 35, 35);
  color: greenyellow;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
}

.room-menu-trigger:hover,
.room-menu-trigger.is-open {
  background: rgba(173, 255, 47, 0.1);
}

.room-menu-trigger.is-in-room {
  border-color: rgba(173, 255, 47, 0.85);
}

.room-menu-trigger.has-error {
  border-color: #ff8a80;
}

.room-menu-trigger-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.room-menu-trigger-chev {
  flex-shrink: 0;
  font-size: 11px;
  opacity: 0.85;
  transition: transform 0.15s ease;
}

.room-menu-trigger.is-open .room-menu-trigger-chev {
  transform: rotate(180deg);
}

.room-menu-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  width: 100%;
  min-width: 0;
  max-width: min(480px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 9998;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.65);
  display: none;
  -webkit-overflow-scrolling: touch;
}

.room-menu-panel.is-open {
  display: flex;
}

/* Title Styling */
.title {
    font-family: 'Times New Roman', Times, serif;
    color: greenyellow;
    font-size: 25px;
    margin: 0; /* Remove default margins */
    padding: 0; /* Remove padding */
}

/* Logout Button.... kind of */
.ham { cursor: default; }

/* Notifications icon button */
.notif-btn {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  background: transparent;
  border: 2px solid greenyellow;
  color: greenyellow;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  line-height: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
}

.notif-btn:hover {
  background: rgba(173, 255, 47, 0.12);
}

.notif-icon {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.notif-btn.is-active {
  box-shadow: 0 0 18px rgba(173, 255, 47, 0.25);
}

/* Fill layer default off; turns on when unread */
.notif-btn.has-unread .notif-fill {
  opacity: 1;
}

/* Badge */
.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #000;
  border: 1px solid greenyellow;
  color: greenyellow;
  font-size: 12px;
  display: grid;
  place-items: center;
}

/* Notifications panel (right under header) */
.notifications-panel {
  background-color: rgb(59, 52, 52);
  border: 2px solid greenyellow;
  border-radius: 10px;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;

  /* Smooth expand/collapse */
  max-height: min(40vh, 320px);
  padding: 14px 16px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s ease, transform 0.2s ease;
}

.notifications-panel.is-collapsed {
  max-height: 0px;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-6px);
  border-width: 0;
}

/* Top row */
.notifications-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.notifications-title {
  color: greenyellow;
  font-family: 'Times New Roman', Times, serif;
  font-size: 18px;
}

.notifications-close {
  background: transparent;
  border: 1px solid rgba(173,255,47,0.6);
  color: greenyellow;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.notifications-close:hover {
  background: rgba(173, 255, 47, 0.12);
}

/* Sections */
.notif-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(min(40vh, 320px) - 56px);
  overflow-y: auto;
}

.notif-section-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(173,255,47,0.5);
  border-radius: 10px;
  color: greenyellow;
  padding: 10px 12px;
  cursor: pointer;
}

.notif-section-header:hover {
  background: rgba(0,0,0,0.35);
}

.notif-section.is-collapsed .notif-section-body {
  display: none;
}

.notif-section .chev {
  opacity: 0.9;
}

.notif-section.is-collapsed .chev {
  transform: rotate(-90deg);
  display: inline-block;
}

/* Items */
.notif-section-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.25);
}

.notif-item.is-unread {
  border: 1px solid greenyellow; /* your “unread outline” */
}

.notif-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid greenyellow;
  object-fit: cover;
}

.notif-item-title {
  color: #eaffc4;
}

.notif-item-sub {
  color: rgba(234,255,196,0.75);
  font-size: 12px;
  margin-top: 4px;
}

.notif-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.notif-action {
  background-color: rgb(0, 0, 0);
  border: 1px solid rgba(173,255,47,0.6);
  color: greenyellow;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
}

.notif-action:hover {
  background: rgba(173, 255, 47, 0.12);
}

.notif-action.danger {
  border-color: rgba(255, 80, 80, 0.65);
}

.notif-action.danger:hover {
  background: rgba(255, 80, 80, 0.18);
}

.notif-action.ghost {
  border-color: rgba(173,255,47,0.25);
  color: rgba(173,255,47,0.85);
}


.user-menu { position: relative; display: inline-block; }
.user-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid greenyellow; object-fit: cover;
  cursor: pointer;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: 52px;
  width: 180px;
  background: rgba(0,0,0,0.92);
  border: 1px solid greenyellow;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.55);
  z-index: 9999;
}

.user-dropdown button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: greenyellow;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.user-dropdown button:hover {
  background: rgba(173, 255, 47, 0.12);
}

.user-dropdown .divider {
  height: 1px;
  background: rgba(173,255,47,0.35);
  margin: 8px 0;
}

.user-dropdown .danger:hover {
  background: rgba(255, 80, 80, 0.18);
}

.hidden { display: none; }


.logout {
    background-color: rgb(59, 52, 52);
    border: 1px solid greenyellow;
    color: greenyellow;
    text-decoration: none;
    cursor: pointer;
    padding: 5px 10px; /* Add padding for better button size */
    border-radius: 5px; /* Rounded corners */
    transition: background-color 0.3s ease;
}

/* Hover effect */
.logout:hover {
    background-color: greenyellow;
    color: rgb(59, 52, 52);
}

/* Logout Menu */
.logout-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(59, 52, 52, 0.95);
    color: greenyellow;
    border: 2px solid greenyellow;
    border-radius: 10px;
    padding: 5px;
    text-align: center;
    z-index: 1000; /* Ensures it appears above other elements */
    display: none; /* Hidden by default */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); /* Subtle shadow */
    width: 15vh; /* Reset width to default */
    height: auto; /* Reset height to default */
    cursor: grab; /* Add a grab cursor for dragging */
}

.logout-menu:active {
    cursor: grabbing;
}

.logout-menu p {
    margin: 10px 0;
    font-size: 18px;
    font-weight: bold;
}

.logout-options {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.logout-options button {
    padding: 5px 15px;
    border: 1px solid greenyellow;
    background-color: rgb(59, 52, 52);
    color: greenyellow;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.logout-options button:hover {
    background-color: greenyellow;
    color: rgb(59, 52, 52);
}

.header-logo {
    height: auto;
    max-height: 44px;
    width: auto;
    display: block;
    object-fit: contain;

    filter: drop-shadow(0 0 8px rgba(173, 255, 47, 0.45));
}



/* Main App Container */
.app-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 5px;
    padding: 0 8px 8px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Queue / chat / friends share all remaining vertical space */
.panels-stack {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 5px;
    overflow: hidden;
}

.panels-stack > .queue-container,
.panels-stack > .video-sidebar,
.panels-stack > .friends-sidebar {
    flex: 0.5 1 0;
    min-height: 0;
    overflow: hidden;
    transition: flex 0.3s ease;
}

.panels-stack > .queue-container:not(.expanded),
.panels-stack > .video-sidebar:not(.expanded),
.panels-stack > .friends-sidebar:not(.expanded) {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.panels-stack > .queue-container:not(.expanded):active,
.panels-stack > .video-sidebar:not(.expanded):active,
.panels-stack > .friends-sidebar:not(.expanded):active {
    background-color: rgba(173, 255, 47, 0.06);
}

.panels-stack > .queue-container:not(.expanded) *,
.panels-stack > .video-sidebar:not(.expanded) *,
.panels-stack > .friends-sidebar:not(.expanded) * {
    pointer-events: none;
}

.panels-stack > .expanded {
    flex: 5 1 0;
}

.chat-style {
    list-style-type: none; /* Remove default bullets */
    padding: 0; /* Remove padding from the list */
    margin: 20px; /* Add some space around the list */
    max-width: 600px; /* Set a maximum width for better readability */
    font-family: Arial, sans-serif; /* Use a clean font */
    line-height: 1.5; /* Adjust line spacing */
}

.chat-style li {
    margin-bottom: 15px; /* Add space between each comment */
    padding: 10px; /* Add padding for each comment */
    background-color: #000000; /* Light background for comments */
    border-radius: 10px; /* Rounded corners for each comment */
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

.chat-style li:nth-child(odd) {
    background-color: #394039; /* Alternate background color for odd comments */
    color: greenyellow;
}

.chat-style li:nth-child(even) {
    background-color: #444147; /* Alternate background color for even comments */
    color: greenyellow;
}

/* Song Queue Section */
.queue-container {
    display: flex;
    background-color: rgb(59, 52, 52);
    border: 2px solid greenyellow;
    padding: 12px;
    border-radius: 10px;
    transition: flex 0.3s ease;
    overflow: hidden;
    box-sizing: border-box;
    min-height: 0;
}

.queue-container h2 {
    text-align: center;
    color: greenyellow;
    margin-bottom: 15px;
}

.song-list {
    list-style: none;
    color: greenyellow;
}

.song-list li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.profile-img-online {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid greenyellow;
}
.profile-img-offline {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid red;
}

.song-info {
    font-size: 16px;
}

.video-sidebar {
    display: flex;
    flex-direction: column;
    background-color: rgb(50, 40, 40);
    border: 2px solid greenyellow;
    padding: 12px;
    border-radius: 10px;
    transition: flex 0.3s ease;
    overflow: hidden;
    min-height: 0;
}

.no-bullets {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-content: flex-start;
    list-style-type: none;

}

/* Friends Sidebar */
.friends-sidebar {
    background-color: rgb(50, 40, 40);
    border: 2px solid greenyellow;
    padding: 12px;
    border-radius: 10px;
    transition: flex 0.3s ease;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
/* Friends controls (search + results) — expanded panel only */
.friends-controls {
  display: none;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.friends-sidebar.expanded .friends-controls {
  display: block;
}

/* Collapsed friends strip: avatars only (online = green, offline = red border) */
.friends-sidebar:not(.expanded) > .room-presence-list,
.friends-sidebar:not(.expanded) > .room-presence-divider,
.friends-sidebar:not(.expanded) > .friends-controls {
  display: none !important;
}

.friends-sidebar:not(.expanded) > #friends-list {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
}

.friends-sidebar:not(.expanded) .friend-list-item {
  flex-shrink: 0;
}

.friends-sidebar.expanded #friends-list {
  flex-wrap: wrap;
  overflow-x: hidden;
  overflow-y: visible;
}

.friends-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.friends-search-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid greenyellow;
  background: rgb(35, 28, 28);
  color: white;
  outline: none;
}

.friends-search-btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid greenyellow;
  background: transparent;
  color: greenyellow;
  cursor: pointer;
}

.friends-search-btn:hover {
  background: rgba(173, 255, 47, 0.12);
}

.friends-search-status {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.9;
}

.friends-search-results {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.friends-divider {
  height: 1px;
  background: rgba(173, 255, 47, 0.35);
  margin-top: 12px;
}

/* Search result row */
.friend-result {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid rgba(173, 255, 47, 0.35);
  background: rgba(0, 0, 0, 0.15);
}

.friend-result.is-blocked {
  opacity: 0.7;
  border-color: rgba(255, 80, 80, 0.5);
}

.friend-result img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid greenyellow;
}

.friend-result-main {
  flex: 1;
  min-width: 0;
}

.friend-result-name {
  font-weight: 600;
  color: white;
}

.friend-result-sub {
  font-size: 12px;
  opacity: 0.85;
  color: red;
}

.friend-result-actions {
  display: flex;
  gap: 8px;
}

.friend-action-btn {
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid greenyellow;
  background: transparent;
  color: greenyellow;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.friend-action-btn:hover {
  background: rgba(173, 255, 47, 0.12);
}

.friend-action-btn.danger {
  border-color: rgba(255, 80, 80, 0.9);
  color: rgba(255, 80, 80, 0.95);
}

.friend-action-btn.danger:hover {
  background: rgba(255, 80, 80, 0.12);
}

.friend-list-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 4px;
  vertical-align: top;
}

.friend-invite-btn {
  display: none;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid greenyellow;
  background: transparent;
  color: greenyellow;
  cursor: pointer;
  font-size: 10px;
  white-space: nowrap;
}

.friend-invite-btn:hover {
  background: rgba(173, 255, 47, 0.12);
}

.friends-sidebar.expanded.can-invite .friend-invite-btn {
  display: block;
}


.friends-sidebar.expanded {
    overflow-y: auto; /* Unlock vertical scroll when expanded */
    overflow-x: hidden; /* Lock horizontal scroll when expanded */
}
/* --- Profile page --- */
.profile-page {
  min-height: calc(100vh - 60px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
}

.profile-card {
  width: min(720px, 92vw);
  background: rgba(0,0,0,0.85);
  border: 1px solid rgba(173,255,47,0.5);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.55);
  margin: 12px 0 24px;
}

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

.profile-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 2px solid greenyellow;
  object-fit: cover;
  background: rgba(255,255,255,0.05);
}

.profile-username {
  margin: 0;
  color: greenyellow;
  font-family: 'Times New Roman', Times, serif;
}

.profile-sub {
  margin: 6px 0 0;
  color: rgba(173,255,47,0.75);
  font-size: 13px;
}

.profile-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-label {
  color: greenyellow;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-label input[type="file"],
.profile-label textarea {
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(173,255,47,0.45);
  border-radius: 10px;
  color: #eaffc4;
  padding: 10px;
  outline: none;
}

.profile-actions {
  display: flex;
  gap: 10px;
}

.profile-save,
.profile-cancel {
  background-color: rgb(59, 52, 52);
  border: 1px solid greenyellow;
  color: greenyellow;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
}

.profile-save:hover,
.profile-cancel:hover {
  background-color: greenyellow;
  color: rgb(59, 52, 52);
}

.profile-msg {
  margin: 8px 0 0;
  color: #eaffc4;
  font-size: 13px;
}

.profile-future {
  margin-top: 18px;
  border-top: 1px solid rgba(173,255,47,0.25);
  padding-top: 14px;
  color: rgba(234,255,196,0.85);
}

.profile-future h3 {
  margin: 0 0 8px;
  color: greenyellow;
}

.profile-liked-section {
  margin-top: 18px;
  border-top: 1px solid rgba(173,255,47,0.25);
  padding-top: 14px;
}

.profile-liked-heading {
  margin: 0 0 6px;
  color: greenyellow;
  font-size: 1.05rem;
}

.profile-liked-status {
  margin: 0 0 10px;
  color: rgba(234,255,196,0.75);
  font-size: 13px;
}

.profile-liked-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(360px, 42vh);
  overflow-y: auto;
}

.profile-liked-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(173,255,47,0.2);
  background: rgba(0,0,0,0.35);
}

.profile-liked-artwork {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-liked-info {
  flex: 1;
  min-width: 0;
}

.profile-liked-title {
  color: #eaffc4;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-liked-meta {
  color: rgba(234,255,196,0.7);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-liked-unlike {
  background: transparent;
  border: 1px solid rgba(173,255,47,0.45);
  color: #ff6b9d;
  border-radius: 8px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.profile-liked-unlike:hover {
  background: rgba(255,107,157,0.15);
  border-color: rgba(255,107,157,0.6);
}

.profile-liked-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.profile-liked-heart {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.profile-liked-heart.is-mutual {
  color: #b57dff;
}

.profile-liked-heart.is-theirs-only {
  color: #facc15;
}

.profile-liked-heart-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.profile-liked-heart-btn.is-mutual {
  color: #b57dff;
}

.profile-liked-heart-btn.is-theirs-only {
  color: #facc15;
}

.profile-liked-heart-btn:hover {
  opacity: 0.85;
}

.profile-overlay-liked .profile-liked-heart-btn.is-mutual {
  color: #c084fc;
}

.profile-overlay-liked .profile-liked-heart-btn.is-theirs-only {
  color: #fde047;
}

.profile-liked-legend {
  margin: 0 0 8px;
  font-size: 12px;
  color: rgba(234, 255, 196, 0.75);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-liked-legend.hidden {
  display: none !important;
}

.profile-liked-legend-sep {
  opacity: 0.5;
}

.profile-overlay-liked .profile-liked-heart.is-mutual {
  color: #c084fc;
}

.profile-overlay-liked .profile-liked-heart.is-theirs-only {
  color: #fde047;
}

.profile-overlay-liked {
  margin-top: 12px;
  border-top: 1px solid rgba(0, 255, 120, 0.25);
  padding-top: 12px;
}

.profile-overlay-liked.hidden {
  display: none !important;
}

.profile-overlay-liked .profile-liked-list {
  max-height: min(240px, 32vh);
}

.profile-overlay-card-edit .profile-liked-actions .track-add-btn {
  font-size: 12px;
  padding: 4px 8px;
}
/* =========================
   Profile Overlay (full-screen)
   ========================= */
.profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: block;
}

.profile-overlay.hidden {
  display: none;
}

.profile-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.profile-overlay-card {
  position: relative;
  width: min(92vw, 520px);
  max-height: 84vh;
  margin: 10vh auto 0 auto;
  background: rgba(15, 15, 15, 0.96);
  border: 2px solid rgba(0, 255, 120, 0.65);
  border-radius: 18px;
  padding: 16px 14px 14px;
  overflow: auto;
}

.profile-overlay-card.profile-overlay-card-edit {
  width: min(92vw, 720px);
  max-height: 90vh;
  margin: 5vh auto;
  padding: 18px;
}

.profile-overlay-card-edit .profile-username {
  color: greenyellow;
  font-family: 'Times New Roman', Times, serif;
}

.profile-overlay-card-edit .profile-sub {
  color: rgba(173,255,47,0.75);
}

.profile-overlay-card-edit .profile-label {
  color: greenyellow;
}

.profile-overlay-card-edit .profile-liked-title {
  color: #eaffc4;
}

.profile-overlay-card-edit .profile-liked-meta {
  color: rgba(234,255,196,0.7);
}

.profile-overlay-close {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 34px;
  width: 34px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 120, 0.45);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
}

.profile-overlay-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 42px;
}

.profile-overlay-avatar {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid rgba(0, 255, 120, 0.85);
}

.profile-overlay-username {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.profile-overlay-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Minimal buttons (don’t take over the profile) */
.profile-action-btn {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 120, 0.55);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
}

.profile-action-btn:hover {
  background: rgba(0, 255, 120, 0.12);
}

.profile-action-btn.danger {
  border-color: rgba(255, 80, 80, 0.75);
}

.profile-overlay-bioWrap {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 255, 120, 0.18);
}

.profile-overlay-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}

.profile-overlay-bio {
  font-size: 14px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
  white-space: pre-wrap;
}

/* Room bar (dropdown panel contents) */
.room-bar {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 12px;
  background-color: rgb(40, 35, 35);
  border: 2px solid greenyellow;
  border-radius: 10px;
  box-sizing: border-box;
}

.room-bar-picker {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex: 1 1 100%;
  min-width: 0;
}

.room-picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.room-picker-toggle {
  font-size: 12px;
  padding: 5px 10px;
}

.room-picker-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(173, 255, 47, 0.28);
  border-radius: 8px;
}

.room-picker-body.hidden {
  display: none !important;
}

.room-picker-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.room-picker-label {
  color: greenyellow;
  font-size: 11px;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.room-picker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.room-picker-options {
  padding-top: 2px;
}

.room-bar-input-compact {
  min-width: 100px;
  flex: 1 1 120px;
  max-width: 180px;
  padding: 5px 8px;
  font-size: 12px;
}

.room-bar-select-compact {
  padding: 5px 6px;
  font-size: 12px;
}

.room-bar-active {
  display: flex;
  align-items: center;
  gap: 12px;
  color: greenyellow;
  font-family: 'Times New Roman', Times, serif;
}

.room-bar-label {
  font-size: 16px;
}

.room-bar-code {
  font-size: 13px;
  opacity: 0.85;
}

.room-bar-btn,
.panel-btn {
  background: transparent;
  border: 1px solid rgba(173, 255, 47, 0.7);
  color: greenyellow;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.room-bar-btn:hover,
.panel-btn:hover {
  background: rgba(173, 255, 47, 0.12);
}

.room-bar-btn:disabled,
.panel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.room-bar-input,
.panel-input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(173, 255, 47, 0.5);
  color: greenyellow;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  min-width: 120px;
}

.room-bar-input::placeholder,
.panel-input::placeholder {
  color: rgba(173, 255, 47, 0.45);
}

.panel-input-short {
  min-width: 100px;
  flex: 0 1 140px;
}

.room-bar-error {
  flex: 1 1 100%;
  color: rgba(255, 120, 120, 0.95);
  font-size: 12px;
  min-height: 16px;
}

.room-bar-select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(173, 255, 47, 0.5);
  color: greenyellow;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
}

.room-create-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: greenyellow;
  font-size: 13px;
  cursor: pointer;
}

.room-create-option input[type="checkbox"] {
  accent-color: greenyellow;
}

.room-bar-input-narrow {
  min-width: 56px;
  width: 56px;
  text-align: center;
}

.room-vote-threshold.hidden {
  display: none !important;
}

.room-leave-btn {
  border-color: rgba(255, 120, 120, 0.75);
  color: rgba(255, 140, 140, 0.95);
}

.room-close-btn {
  border-color: rgba(255, 120, 120, 0.75);
  color: rgba(255, 140, 140, 0.95);
}

.room-transfer-panel {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
}

.room-transfer-panel.hidden {
  display: none;
}

.room-transfer-panel .room-bar-select-compact {
  flex: 1 1 140px;
  min-width: 0;
}

.room-discovery-panel {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(28vh, 180px);
  overflow-y: auto;
  padding-top: 4px;
}

.room-discovery-panel.hidden {
  display: none;
}

.room-discovery-heading {
  color: greenyellow;
  font-size: 13px;
  font-family: 'Times New Roman', Times, serif;
  margin-bottom: 4px;
}

.room-discovery-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-discovery-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(173, 255, 47, 0.35);
  border-radius: 8px;
  color: greenyellow;
  font-size: 12px;
}

.room-discovery-item.is-active {
  border-color: greenyellow;
  box-shadow: 0 0 8px rgba(173, 255, 47, 0.2);
}

.room-discovery-item-main {
  flex: 1;
  min-width: 0;
}

.room-discovery-item-title {
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-discovery-item-sub {
  opacity: 0.75;
  font-size: 11px;
}

.room-discovery-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.room-discovery-empty {
  opacity: 0.65;
  font-size: 12px;
  font-style: italic;
  padding: 4px 0;
}

/* Panel controls (queue add / chat send) — visible when section expanded */
.panel-controls {
  display: none;
  flex-wrap: wrap;
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.queue-container.expanded .panel-controls:not(.hidden),
.video-sidebar.expanded .panel-controls:not(.hidden) {
  display: flex;
}

.queue-container {
  flex-direction: column;
}

.chat-compose {
  flex-shrink: 0;
  margin-top: auto;
  flex-direction: column;
  align-items: stretch;
}

.chat-compose-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.chat-compose-row .panel-input {
  flex: 1;
  min-width: 0;
}

.chat-settings-btn {
  background: transparent;
  border: 1px solid rgba(173, 255, 47, 0.55);
  color: greenyellow;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  padding: 0;
}

.chat-settings-btn:hover,
.chat-settings-btn[aria-expanded="true"] {
  background: rgba(173, 255, 47, 0.14);
  border-color: greenyellow;
}

.chat-settings-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(173, 255, 47, 0.28);
  border-radius: 10px;
}

.chat-settings-panel.hidden {
  display: none !important;
}

.chat-settings-heading {
  color: greenyellow;
  font-size: 13px;
  font-weight: 600;
}

.chat-settings-preview,
.profile-chat-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.chat-settings-preview-label {
  font-size: 11px;
  opacity: 0.75;
  flex-shrink: 0;
}

.chat-settings-sub {
  font-size: 11px;
  opacity: 0.8;
}

.chat-pickr-mount {
  width: 100%;
}

.chat-pickr-mount .pickr {
  width: 100%;
}

.chat-pickr-mount .pcr-button {
  width: 100%;
  height: 36px;
  border-radius: 8px;
}

.chat-style-fallback {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.chat-style-color-input {
  width: 42px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.chat-style-opacity-label {
  font-size: 12px;
  color: greenyellow;
}

.chat-style-opacity-value {
  font-size: 12px;
  min-width: 36px;
  text-align: right;
  color: greenyellow;
}

.chat-style {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  margin: 0;
  max-width: none;
  width: 100%;
}

.video-sidebar:not(.expanded) .chat-style {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.chat-message {
  line-height: 1.45;
}

.chat-message-header {
  display: inline;
}

.chat-username {
  font-weight: 600;
}

.chat-separator,
.chat-body {
  color: inherit;
}

.chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  font-size: 12px;
  line-height: 1;
  vertical-align: middle;
}

.chat-badge-host {
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.45));
}

.chat-name-effect-shimmer {
  background: linear-gradient(90deg, currentColor 0%, #ffffff 50%, currentColor 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: chat-name-shimmer 2.5s linear infinite;
}

@keyframes chat-name-shimmer {
  to {
    background-position: 200% center;
  }
}

.chat-style-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.chat-style-label {
  font-size: 11px;
  opacity: 0.85;
  flex-shrink: 0;
}

.chat-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chat-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.chat-color-swatch.is-selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(173, 255, 47, 0.85);
}

.chat-color-swatch:hover {
  transform: scale(1.08);
}

.profile-sub-inline {
  margin: 4px 0 8px;
}

.song-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
}

.queue-empty,
.chat-empty {
  opacity: 0.7;
  font-style: italic;
}

.queue-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.queue-search-row .panel-input {
  flex: 1;
  min-width: 160px;
}

.queue-search-status {
  font-size: 12px;
  opacity: 0.85;
  flex-shrink: 0;
}

.queue-search-status.is-error {
  color: rgba(255, 120, 120, 0.95);
}

.queue-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-height: min(380px, 48vh);
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.queue-search-results.hidden-while-history {
  display: none !important;
}

.panel-controls.history-open {
  overflow-y: auto;
  max-height: min(420px, 52vh);
}

.queue-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}

.queue-search-result:hover,
.queue-search-result:focus {
  background: rgba(173, 255, 47, 0.08);
  border-color: rgba(173, 255, 47, 0.35);
  outline: none;
}

.queue-search-artwork,
.queue-artwork {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(173, 255, 47, 0.5);
}

.queue-search-info,
.queue-item-info {
  flex: 1;
  min-width: 0;
}

.queue-search-title,
.queue-item-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-search-meta,
.queue-item-meta {
  font-size: 12px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-search-section-label {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.9;
  padding: 8px 4px 4px;
  list-style: none;
}

.track-like-btn {
  min-width: 36px;
  padding: 4px 8px;
  line-height: 1;
}

.track-like-btn.is-liked {
  color: #ff6b8a;
  border-color: rgba(255, 107, 138, 0.65);
}

.track-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.track-add-btn {
  font-size: 12px;
  padding: 4px 8px;
}

.room-history-panel {
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 8px;
  border-top: 1px solid rgba(173, 255, 47, 0.2);
  padding-top: 8px;
}

.room-history-panel.hidden {
  display: none !important;
}

.room-history-heading {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.9;
  margin-bottom: 6px;
}

.room-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-history-item,
.queue-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-history-item {
  padding: 6px 4px;
  border-radius: 8px;
}

.room-history-item:hover {
  background: rgba(173, 255, 47, 0.08);
}

.queue-url-fallback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.queue-url-fallback.hidden {
  display: none !important;
}

.panel-btn-ghost {
  background: transparent;
  border: 1px solid rgba(173, 255, 47, 0.45);
}

.song-list li.queue-item {
  gap: 10px;
}

.queue-item-draggable {
  cursor: grab;
}

.queue-item-draggable.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.queue-item.drag-over {
  outline: 2px dashed rgba(173, 255, 47, 0.75);
  outline-offset: 2px;
  background: rgba(173, 255, 47, 0.08);
}

.queue-drag-handle {
  color: rgba(173, 255, 47, 0.65);
  font-size: 14px;
  line-height: 1;
  letter-spacing: -3px;
  padding: 4px 4px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  flex-shrink: 0;
  align-self: center;
}

.queue-drag-handle:active {
  cursor: grabbing;
}

.queue-item-current {
  background: rgba(173, 255, 47, 0.06);
  border-radius: 8px;
  padding: 4px 0;
}

.now-playing-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: rgba(173, 255, 47, 0.05);
  border: 1px solid rgba(173, 255, 47, 0.12);
  min-width: 0;
}

.now-playing-track {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.now-playing-artwork {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
}

.now-playing-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.now-playing-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(173, 255, 47, 0.8);
}

.now-playing-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  color: #fff;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.now-playing-artist {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.now-playing-status {
  font-size: 12px;
  line-height: 1.3;
  color: rgba(173, 255, 47, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.now-playing-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.now-playing-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.now-playing-host-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.now-playing-host-actions.hidden {
  display: none;
}

.now-playing-actions .panel-btn-compact {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1.2;
}

.now-playing-actions .panel-btn-ghost {
  min-width: 0;
  white-space: nowrap;
}

.now-playing-actions .panel-btn-transport-toggle {
  flex: 0 0 28px;
  width: 28px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}

.now-playing-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 0;
}

.now-playing-volume-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  flex-shrink: 0;
}

.now-playing-volume-slider {
  flex: 1;
  min-width: 0;
  accent-color: #adff2f;
  cursor: pointer;
}

.now-playing-volume-value {
  font-size: 12px;
  color: rgba(173, 255, 47, 0.9);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.now-playing-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.now-playing-progress-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  min-width: 36px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.now-playing-progress-time:last-child {
  text-align: right;
}

.now-playing-progress-slider {
  flex: 1;
  min-width: 0;
  accent-color: #adff2f;
  cursor: pointer;
}

.now-playing-progress-slider:disabled {
  cursor: default;
  opacity: 0.85;
}

.queue-skip-votes {
  font-size: 12px;
  color: rgba(173, 255, 47, 0.95);
  margin-top: 4px;
}

.queue-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.queue-reorder-btns {
  display: flex;
  gap: 4px;
}

.queue-reorder-btn,
.queue-vote-skip-btn {
  background: transparent;
  border: 1px solid rgba(173, 255, 47, 0.45);
  color: greenyellow;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  flex-shrink: 0;
}

.queue-reorder-btn:hover,
.queue-vote-skip-btn:hover:not(:disabled) {
  background: rgba(173, 255, 47, 0.12);
}

.queue-vote-skip-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.queue-item-remove {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255, 80, 80, 0.75);
  color: rgba(255, 120, 120, 0.95);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
}

.queue-item-remove:hover {
  background: rgba(255, 80, 80, 0.15);
}

.host-only.hidden {
  display: none !important;
}

.room-presence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 8px 0;
  min-height: 0;
}

.room-presence-list .room-presence-member {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.room-presence-list .room-presence-member:active {
  opacity: 0.85;
}

.room-presence-list.hidden {
  display: none;
}

.room-presence-divider.hidden {
  display: none;
}

#friends-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

.friends-sidebar.expanded #friendsSearchResults {
  max-height: 120px;
  overflow-y: auto;
}

/* ---- Viewport tuning (phones / narrow windows) ---- */
@media (max-width: 768px) {
  .header {
    padding: 6px 12px;
    padding-top: max(6px, env(safe-area-inset-top));
    height: auto;
    min-height: 48px;
    max-height: 56px;
    gap: 8px;
  }

  .header-logo {
    max-height: 34px;
  }

  .room-menu {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }

  .room-menu-trigger {
    min-height: 36px;
    padding: 5px 10px;
    font-size: 12px;
    border-width: 1px;
  }

  .notif-btn,
  .user-avatar {
    width: 36px;
    height: 36px;
  }

  .notif-icon {
    width: 19px;
    height: 19px;
  }

  .app-container {
    padding: 0 6px max(6px, env(safe-area-inset-bottom));
    gap: 4px;
  }

  .panels-stack {
    gap: 4px;
  }

  .queue-container,
  .video-sidebar,
  .friends-sidebar {
    padding: 8px;
    border-width: 1px;
  }

  .room-bar {
    padding: 8px;
    gap: 4px;
    border-width: 1px;
  }

  .room-bar-btn,
  .panel-btn {
    font-size: 11px;
    padding: 6px 10px;
  }

  .room-bar-input,
  .panel-input,
  .friends-search-input {
    font-size: 16px;
    min-width: 0;
  }

  .room-bar-input-compact {
    max-width: none;
    flex: 1 1 auto;
  }

  .profile-img-online,
  .profile-img-offline {
    width: 44px;
    height: 44px;
  }

  .queue-artwork,
  .queue-search-artwork {
    width: 40px;
    height: 40px;
  }

  .song-list li.queue-item {
    flex-wrap: wrap;
  }

  .queue-item-actions {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

  .friend-result {
    flex-wrap: wrap;
  }

  .friend-result-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* ---- Room dropdown (mobile) ---- */
  .room-menu-panel.is-open {
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    top: calc(52px + env(safe-area-inset-top, 0px));
    width: auto;
    max-width: none;
    max-height: min(72dvh, calc(100dvh - 64px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    border-radius: 12px;
  }

  .room-bar,
  .room-bar-picker,
  .room-discovery-panel {
    width: 100%;
    box-sizing: border-box;
  }

  .room-bar-label {
    font-size: 14px;
    word-break: break-word;
  }

  .room-bar-code {
    flex: 1 1 100%;
    font-size: 12px;
  }

  .room-picker-row {
    flex-direction: column;
    align-items: stretch;
  }

  .room-picker-row .room-bar-input-compact,
  .room-picker-row .room-bar-select-compact,
  .room-picker-row .room-bar-btn {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
  }

  .room-picker-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .room-picker-toolbar .room-bar-btn {
    width: 100%;
  }

  .room-bar-active {
    flex-direction: column;
    align-items: stretch;
  }

  .room-bar-active .room-bar-btn {
    width: 100%;
  }

  .room-transfer-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .room-transfer-panel .room-bar-select-compact,
  .room-transfer-panel .room-bar-btn {
    width: 100%;
  }

  .room-discovery-panel {
    max-height: min(40dvh, 320px);
  }

  .room-discovery-item {
    flex-wrap: wrap;
  }

  .room-discovery-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* ---- Profile overlays (mobile) ---- */
  .profile-overlay:not(.hidden) {
    display: flex;
    flex-direction: column;
    padding:
      max(6px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
    box-sizing: border-box;
  }

  .profile-overlay-backdrop {
    position: fixed;
  }

  .profile-overlay-card,
  .profile-overlay-card.profile-overlay-card-edit,
  .room-playlists-card {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    max-height: none;
    height: auto;
    min-height: 0;
    margin: 0;
    border-radius: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  .profile-overlay-card.profile-overlay-card-edit,
  .room-playlists-card {
    display: flex;
    flex-direction: column;
  }

  .profile-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-avatar {
    width: 72px;
    height: 72px;
  }

  .profile-overlay-header {
    align-items: flex-start;
    padding-right: 44px;
  }

  .profile-overlay-avatar {
    width: 56px;
    height: 56px;
  }

  .profile-overlay-username {
    font-size: 16px;
    word-break: break-word;
  }

  .profile-overlay-actions {
    flex-direction: column;
  }

  .profile-overlay-actions .profile-action-btn {
    width: 100%;
    text-align: center;
  }

  .profile-actions {
    flex-direction: column;
  }

  .profile-save,
  .profile-cancel {
    width: 100%;
  }

  .profile-liked-item {
    flex-wrap: wrap;
  }

  .profile-liked-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .profile-liked-list {
    max-height: none;
  }

  .profile-label input[type="file"],
  .profile-label textarea {
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .room-playlists-list {
    min-height: 0;
    flex: 1 1 auto;
  }

  .room-playlist-tracks {
    max-height: none;
  }

  .room-playlist-header {
    flex-wrap: wrap;
    gap: 4px;
  }

  .room-playlist-meta {
    flex: 1 1 100%;
  }

  /* Avatar menu — keep on screen */
  .user-dropdown {
    position: fixed;
    right: max(8px, env(safe-area-inset-right));
    top: calc(52px + env(safe-area-inset-top, 0px));
    width: min(240px, calc(100vw - 16px));
    z-index: 10000;
  }
}

.queue-search-load-more-wrap {
  list-style: none;
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.queue-search-load-more {
  min-width: 120px;
}

.room-playlists-card {
  max-width: min(640px, 96vw);
  max-height: min(85vh, 900px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.room-playlists-card .profile-username {
  color: #adff2f;
}

.room-playlists-card .profile-sub {
  color: rgba(173, 255, 47, 0.88);
}

.room-playlists-card #roomPlaylistsStatus {
  color: rgba(173, 255, 47, 0.9);
}

.room-playlists-card #roomPlaylistsStatus.is-error {
  color: #ff8a8a;
}

.room-playlists-list {
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
}

.room-playlist-section {
  border-bottom: 1px solid rgba(173, 255, 47, 0.25);
}

.room-playlist-section.is-collapsed .room-playlist-body {
  display: none !important;
}

.room-playlist-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  background: transparent;
  border: none;
  color: #adff2f;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.room-playlist-header:hover {
  background: rgba(173, 255, 47, 0.1);
}

.room-playlist-title {
  flex: 1;
  font-weight: 700;
  color: #adff2f;
}

.room-playlist-meta {
  font-size: 12px;
  color: rgba(173, 255, 47, 0.82);
  opacity: 1;
}

.room-playlist-section .chev {
  color: rgba(173, 255, 47, 0.9);
  opacity: 1;
  transition: transform 0.15s ease;
}

.room-playlist-section:not(.is-collapsed) .chev {
  transform: rotate(180deg);
}

.room-playlist-body {
  padding: 0 0 10px 0;
}

.room-playlist-tracks {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-playlists-card .room-playlist-tracks .queue-search-title {
  color: #adff2f;
  font-weight: 600;
}

.room-playlists-card .room-playlist-tracks .queue-search-meta {
  color: rgba(200, 255, 160, 0.92);
  opacity: 1;
}

.room-playlists-card .room-playlist-tracks .room-history-item:hover,
.room-playlists-card .room-playlist-tracks .queue-search-result:hover {
  background: rgba(173, 255, 47, 0.08);
}

.room-playlists-empty,
.room-playlists-loading {
  font-size: 13px;
  color: rgba(173, 255, 47, 0.85);
  opacity: 1;
  margin: 8px 4px;
}





