@import url('https://fonts.googleapis.com/css2?family=Shadows+Into+Light&display=swap');@import url('https://fonts.googleapis.com/css2?family=Shadows+Into+Light&display=swap');:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
}
/* Mobile Listeners Drawer - Native App Style */

.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.mobile-drawer {
  width: 100%;
  max-height: 85vh;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(40px);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-bottom: none;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  position: relative;
}

/* Pull indicator */
.drawer-header::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
}

.drawer-title svg {
  color: #a855f7;
}

.drawer-title h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.drawer-close-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.12);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-listeners-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.mobile-listener-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 14px;
  min-height: 64px;
  transition: all 0.2s ease;
}

.mobile-listener-item:active {
  transform: scale(0.98);
  background: rgba(139, 92, 246, 0.12);
}

.mobile-listener-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.listener-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.listener-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.listener-name {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listener-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mobile-listener-item .listener-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.mobile-listener-item .listener-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.6);
  width: 44px;
  height: 44px;
}

.mobile-listener-item .listener-action-btn:active {
  transform: scale(0.95);
}

.mobile-listener-item .revoke-dj-btn {
  color: #ef4444;
}

.mobile-listener-item .revoke-dj-btn:active {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.mobile-listener-item .grant-dj-btn {
  color: #22c55e;
}

.mobile-listener-item .grant-dj-btn:active {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

.mobile-listener-item .kick-btn {
  color: #ef4444;
}

.mobile-listener-item .kick-btn:active {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.mobile-room-share {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-room-share h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
}

.mobile-room-share p {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

.mobile-share-code {
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 1.75rem;
  background: rgba(139, 92, 246, 0.15);
  padding: 1.25rem;
  border-radius: 14px;
  text-align: center;
  margin-bottom: 1rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
  letter-spacing: 6px;
  font-weight: 700;
  color: #e9d5ff;
}

.share-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.share-btn,
.share-buttons .copy-btn {
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.share-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.share-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.share-buttons .copy-btn {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}

.share-buttons .copy-btn.copied {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}

.share-buttons .copy-btn:active {
  transform: scale(0.98);
}

/* Scrollbar styling */
.drawer-content::-webkit-scrollbar {
  width: 4px;
}

.drawer-content::-webkit-scrollbar-track {
  background: transparent;
}

.drawer-content::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 2px;
}

.drawer-content::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.5);
}/* Confirm Banner - Matches room-warning design */

.confirm-banner {
  position: fixed;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 90vw);
  padding: 1rem 1.5rem;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  z-index: 100;
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Default variant - purple */
.confirm-banner-default {
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #e9d5ff;
}

/* Warning variant - orange */
.confirm-banner-warning {
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fef3c7;
}

/* Danger variant - red */
.confirm-banner-danger {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fecaca;
}

/* Success variant - green */
.confirm-banner-success {
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #bbf7d0;
}

.confirm-banner-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.confirm-banner-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.confirm-banner-content {
  padding-right: 2rem;
  line-height: 1.5;
}

.confirm-banner-content strong {
  font-weight: 700;
}

.confirm-banner-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.confirm-banner-btn {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.cancel-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

/* Confirm button variants */
.confirm-btn-default {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.confirm-btn-default:hover {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  transform: translateY(-1px);
}

.confirm-btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.confirm-btn-warning:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.confirm-btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.confirm-btn-danger:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.confirm-btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.confirm-btn-success:hover {
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .confirm-banner {
    top: 90px;
    padding: 0.875rem 1rem;
    gap: 0.875rem;
  }

  .confirm-banner-close {
    top: 0.875rem;
    right: 0.875rem;
    width: 26px;
    height: 26px;
  }

  .confirm-banner-content {
    font-size: 0.95rem;
    padding-right: 1.75rem;
  }

  .confirm-banner-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .confirm-banner-btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
}


@font-face {
  font-family: 'Musical Tone';
  src: url('/fonts/MusicalTone.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
  background: #000000;
  overflow-x: hidden;
  color: #ffffff;
}

.app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  width: 100vw;
  background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #000000 100%);
  position: relative;
  overflow: hidden;
}

.app > * {
  position: relative;
  z-index: 1;
}

/* Wallpaper background with dark overlay - DIRECT APPROACH */

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* =================
   HEADER / NAV BAR
   ================= */

.app-header {
  position: relative;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2.5rem;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-width: 0;
}

.header-room-block {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1 1 auto;
  min-width: 0;
}

.header-menu-wrapper {
  position: relative;
  display: none;
}

.header-menu-toggle {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.header-menu-toggle:hover,
.header-menu-toggle.active {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.6);
  color: #ffffff;
}

.header-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 240px;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(8, 8, 15, 0.98);
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 130;
}

.header-menu-user {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.header-menu-user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.header-menu-user-badges .username-badge {
  flex: 1 1 100%;
  justify-content: flex-start;
}

.header-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.header-menu-dropdown .leave-room-btn,
.header-menu-dropdown .logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.header-menu-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 90;
}

.hamburger-icon {
  position: relative;
  width: 18px;
  height: 14px;
  display: block;
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
  background: #ffffff;
  height: 2px;
  border-radius: 999px;
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger-icon {
  margin: auto;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px;
}

.hamburger-icon::before {
  top: -5px;
}

.hamburger-icon::after {
  top: 5px;
}

.header-menu-toggle.active .hamburger-icon {
  transform: rotate(45deg);
}

.header-menu-toggle.active .hamburger-icon::before {
  transform: rotate(-90deg) translateX(-5px);
}

.header-menu-toggle.active .hamburger-icon::after {
  opacity: 0;
}

.app-header h1 {
  font-family: 'Shadows Into Light', 'Musical Tone', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.08em;
}

.room-info {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.room-code {
  font-family: 'SF Mono', 'Monaco', monospace;
  background: rgba(139, 92, 246, 0.15);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
  letter-spacing: 2px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 1;
}

.refresh-room-id-btn {
  background: transparent;
  border: none;
  padding: 0.25rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.2s ease;
  margin-left: 0.25rem;
}

.refresh-room-id-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  transform: rotate(90deg);
}

.refresh-room-id-btn:active {
  transform: rotate(180deg) scale(0.95);
}

.refresh-room-id-btn:focus {
  outline: none;
}

.host-badge {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.host-badge-small {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: 0.5rem;
}

.dj-badge {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.dj-badge.revoked {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  box-shadow: 0 4px 15px rgba(75, 85, 99, 0.3);
  color: rgba(255, 255, 255, 0.8);
}

.dj-badge-small {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: 0.5rem;
}

.dj-badge-small.revoked {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  box-shadow: 0 4px 15px rgba(75, 85, 99, 0.3);
  color: rgba(255, 255, 255, 0.8);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

/* =================
   BUTTONS
   ================= */

button {
  padding: 0.65rem 1.3rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
}

button:focus,
button:focus-visible {
  outline: none;
  box-shadow: none;
}

button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: white;
}

button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.logout-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  width: auto;
  min-width: auto;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.leave-room-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.leave-room-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

/* =================
   MAIN CONTENT AREA
   ================= */

.app-content {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  height: 100%;
  overflow: hidden;
}

/* =================
   SIDEBAR
   ================= */

.sidebar {
  background: rgba(8, 8, 8, 0.6);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-right: 1px solid rgba(139, 92, 246, 0.12);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
}

.listeners-panel h3, .room-share h3 {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.7);
}

.listeners-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.listener-item {
  padding: 0.75rem;
  background: rgba(139, 92, 246, 0.06);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(139, 92, 246, 0.15);
  transition: all 0.2s ease;
  gap: 0.5rem;
}

.listener-item:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.25);
}

.listener-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.listener-info > span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listener-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.listener-action-btn {
  background: transparent;
  border: none;
  padding: 0.35rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.5);
}

.listener-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.listener-action-btn:focus {
  outline: none;
}

.revoke-dj-btn {
  color: #ef4444;
}

.revoke-dj-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.grant-dj-btn {
  color: #22c55e;
}

.grant-dj-btn:hover {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.kick-btn {
  color: #ef4444;
}

.kick-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.room-share {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.share-code {
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 1.5rem;
  background: rgba(139, 92, 246, 0.15);
  padding: 1.25rem;
  border-radius: 10px;
  text-align: center;
  margin: 1rem 0;
  border: 1px solid rgba(139, 92, 246, 0.3);
  letter-spacing: 4px;
  font-weight: 700;
}

.copy-btn {
  width: 100%;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  padding: 0.75rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  outline: none;
}

.copy-btn.copied {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}

.copy-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.6);
  color: #e9d5ff;
}

.copy-btn:focus {
  outline: none;
}

/* =================
   MAIN CONTENT
   ================= */

.main-content {
  background: rgba(5, 5, 5, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2rem;
  overflow-y: auto;
  position: relative;
}

/* =================
   SCROLLBARS
   ================= */

.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
.list::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.sidebar::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track,
.list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb,
.list::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover,
.list::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.5);
}

/* =================
   PLAYER FOOTER
   ================= */

.player-footer {
  position: relative;
  z-index: 100;
  background: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-top: 1px solid rgba(139, 92, 246, 0.15);
  padding: 0.75rem 2rem;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.7);
}

.music-player {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 1800px;
  margin: 0 auto;
}

.track-info {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-width: 220px;
  flex: 0 0 auto;
}

.album-art {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.track-details {
  flex: 1;
  min-width: 0;
}

.track-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

/* Username Modal Styles */

.username-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.username-modal {
  background-color: #1a1a1a;
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid #333;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.username-modal h2 {
  margin-top: 0;
  color: #e0e0e0;
}

.username-modal p {
  color: #aaa;
  margin-bottom: 1.5rem;
}

.username-input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1.5rem;
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #ffffff;
  font-size: 1rem;
}

.username-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.username-modal-buttons button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.username-modal-buttons button:first-child {
  background-color: #28a745;
  color: white;
}

.username-modal-buttons button:first-child:hover:not(:disabled) {
  background-color: #218838;
}

.username-modal-buttons button:first-child:disabled {
  background-color: #555;
  cursor: not-allowed;
}

.username-modal-buttons button:last-child {
  background-color: #6c757d;
  color: white;
}

.username-modal-buttons button:last-child:hover {
  background-color: #545b62;
}

.play-pause-btn {
  background: transparent;
  border: none;
  color: #d6ccff;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s ease, transform 0.2s ease;
  outline: none;
}

.play-pause-btn:hover {
  color: #ffffff;
  transform: scale(1.05);
}

.play-pause-btn:focus {
  outline: none;
}

.player-control-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.player-control-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.player-control-btn:not(:disabled):hover {
  color: #fff;
  transform: scale(1.05);
}

.shuffle-toggle.active {
  color: #22c55e;
}

.time-display {
  font-family: 'SF Mono', 'Monaco', monospace;
  min-width: 38px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.65);
  flex-shrink: 0;
}

.seek-slider {
  flex: 1;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 150px;
  flex: 0 0 auto;
}

.volume-slider {
  width: 100px;
}

@media (min-width: 769px) {
  .music-player {
    width: 100%;
  }

  .music-player > .track-info {
    flex: 0 0 320px;
    width: 320px;
    max-width: 320px;
  }

  .music-player > .playback-controls {
    flex: 1 1 auto;
    justify-content: center;
  }

  .music-player > .volume-control {
    flex: 0 0 220px;
    width: 220px;
    min-width: 220px;
    justify-content: flex-end;
  }
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(to right, #8b5cf6 0%, #8b5cf6 var(--range-progress, 0%), rgba(139, 92, 246, 0.15) var(--range-progress, 0%), rgba(139, 92, 246, 0.15) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  position: relative;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
  border: 2px solid #0f0f0f;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
  cursor: pointer;
  border: 2px solid #0f0f0f;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
}

input[type="range"]::-moz-range-progress {
  background: #8b5cf6;
  height: 6px;
  border-radius: 999px;
}

input[type="range"]::-moz-range-track {
  background: rgba(139, 92, 246, 0.15);
  height: 6px;
  border-radius: 999px;
  border: none;
}

.album-art-container {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.album-art-large {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
}

.album-art-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  color: white;
  text-align: left;
}

.listening-to {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.track-title-large {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist-large {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =================
   AUTH SCREEN
   ================= */

.plex-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #000000 100%);
  color: #fff;
  position: relative;
}

.plex-auth::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 30% 40%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
  animation: float 30s ease-in-out infinite;
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 10;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  padding: 3rem;
  border-radius: 16px;
  max-width: 450px;
  text-align: center;
  border: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.auth-card h2 {
  margin-bottom: 1rem;
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
}

.auth-card p {
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
}

.auth-button {
  background: rgba(139, 92, 246, 0.2);
  color: #e9d5ff;
  padding: 1rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  width: 100%;
  border: 1.5px solid rgba(139, 92, 246, 0.5);
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.auth-button:hover {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.7);
  color: white;
}

.auth-status {
  text-align: center;
}

.spinner {
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-top: 3px solid #8b5cf6;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 1.5rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.auth-hint {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 0.75rem 0;
}

.error-message {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  color: #ef4444;
  font-size: 0.9rem;
}

/* =================
   ROOM MANAGER
   ================= */

.room-manager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
  position: relative;
  z-index: 10;
}

.room-menu, .room-card {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  padding: 3rem;
  border-radius: 16px;
  max-width: 450px;
  width: 100%;
  text-align: center;
  border: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.room-menu h2, .room-card h2 {
  margin-bottom: 1rem;
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
}

.room-menu p, .room-card p {
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.65);
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.create-room-btn, .join-room-btn, .action-button {
  padding: 1.1rem;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
}

.create-room-btn {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.create-room-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.6);
  color: #ddd6fe;
}

.join-room-btn {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #a78bfa;
}

.join-room-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}

.action-button {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.action-button:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.6);
  color: #ddd6fe;
}

.back-button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.65);
}

.room-code-input {
  width: 100%;
  padding: 1rem;
  font-size: 1.3rem;
  text-align: center;
  text-transform: uppercase;
  font-family: 'SF Mono', 'Monaco', monospace;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: white;
  border-radius: 10px;
  margin-bottom: 1rem;
  letter-spacing: 4px;
  font-weight: 700;
}

.room-code-input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.25);
}

/* =================
   LIBRARY BROWSER
   ================= */

.library-browser {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1.5rem;
}

.search-bar {
  margin-bottom: 0;
}

.search-bar form {
  display: flex;
  gap: 0.75rem;
}

.search-bar input {
  flex: 1;
  padding: 0.75rem 1.25rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: white;
  border-radius: 10px;
  font-size: 0.9rem;
}

.search-bar input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.search-bar button {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
}

.browse-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 1.5rem;
}

.library-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.library-selector label {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.library-selector select {
  padding: 0.6rem 1rem;
  background: rgba(139, 92, 246, 0.08);
  color: white;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.library-selector select:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.4);
}

.browser-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  flex: 1;
  overflow: hidden;
}

.column {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.column h3 {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.list {
  flex: 1;
  overflow-y: auto;
  background: rgba(139, 92, 246, 0.03);
  border-radius: 10px;
  padding: 0.5rem;
  border: 1px solid rgba(139, 92, 246, 0.08);
}

.list-item {
  padding: 0.85rem;
  margin-bottom: 0.4rem;
  background: rgba(139, 92, 246, 0.05);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(139, 92, 246, 0.08);
}

.list-item:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
  transform: translateX(3px);
}

.list-item.selected {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.item-thumb {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(139, 92, 246, 0.15);
  flex-shrink: 0;
}

.item-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.item-year {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.2rem;
}

.track-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.track-number {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  min-width: 28px;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.track-title {
  flex: 1;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-duration {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
  font-family: 'SF Mono', 'Monaco', monospace;
  flex-shrink: 0;
}

.track-thumb {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.search-results .track-list {
  background: rgba(139, 92, 246, 0.03);
  border-radius: 10px;
  padding: 0.5rem;
  border: 1px solid rgba(139, 92, 246, 0.08);
}

.search-results .track-item {
  padding: 0.85rem;
  margin-bottom: 0.4rem;
  background: rgba(139, 92, 246, 0.05);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 0.85rem;
  align-items: center;
  transition: all 0.2s ease;
  border: 1px solid rgba(139, 92, 246, 0.08);
}

.search-results .track-item:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
  transform: translateX(3px);
}

.search-results .track-info {
  flex: 1;
  min-width: 0;
}

.listener-view {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  padding: 0;
  position: relative;
  overflow: hidden;
}

/* Album Art Container with Blurred Background */

.album-art-container-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-art-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(40px) brightness(0.4);
  transform: scale(1.1);
  z-index: 0;
}

.album-art-edge-fade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    linear-gradient(to right, rgba(5, 5, 5, 0.4) 0%, rgba(5, 5, 5, 0.3) 5%, transparent 25%),
    linear-gradient(to left, rgba(5, 5, 5, 0.4) 0%, rgba(5, 5, 5, 0.3) 5%, transparent 25%),
    linear-gradient(to bottom, rgba(5, 5, 5, 0.4) 0%, rgba(5, 5, 5, 0.3) 5%, transparent 25%),
    linear-gradient(to top, rgba(5, 5, 5, 0.4) 0%, rgba(5, 5, 5, 0.3) 5%, transparent 25%);
  z-index: 1;
  pointer-events: none;
}

/* Album Art Main Display */

.album-art-main-display {
  position: relative;
  width: min(50vw, 50vh);
  height: min(50vw, 50vh);
  max-width: 500px;
  max-height: 500px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.8),
    0 0 80px rgba(139, 92, 246, 0.3);
  border: 2px solid rgba(139, 92, 246, 0.3);
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.album-art-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-art-info-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.8) 50%,
    transparent 100%
  );
  color: white;
  text-align: left;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.track-title-main {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
}

.track-artist-main {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Placeholder when no track is playing */

.album-art-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  background: rgba(139, 92, 246, 0.08);
  border: 2px dashed rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  padding: 3rem;
}

.placeholder-icon {
  font-size: 6rem;
  opacity: 0.3;
  filter: grayscale(100%);
}

.placeholder-text {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

.loading {
  text-align: center;
  padding: 3rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 1rem;
}

/* =================
   RESPONSIVE
   ================= */

@media (max-width: 1400px) {
  .browser-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .browser-columns {
    grid-template-columns: 1fr;
  }

  .app-content {
    grid-template-columns: 250px 1fr;
  }
}

@media (max-width: 768px) {
  .app-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(139, 92, 246, 0.12);
    padding: 1rem;
  }

  .app-header {
    padding: 1rem 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .header-menu-wrapper {
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
    flex-shrink: 0;
  }

  .player-footer {
    padding: 1rem 1.5rem;
  }

  .music-player {
    flex-direction: column;
    gap: 1rem;
  }

  .track-info {
    width: 100%;
  }

  .playback-controls {
    width: 100%;
  }
}

/* =================
   MUSIC LIBRARY
   ================= */

.music-library {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1.5rem;
}

.library-header {
  display: flex;
  justify-content: flex-end;
}

.library-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
}

.search-input {
  padding: 0.75rem 1rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  color: white;
  font-size: 0.9rem;
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 360px;
}

.search-input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.sort-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  flex: 0 0 auto;
}

.sort-buttons button {
  padding: 0.5rem 1rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
}

.sort-buttons button:focus {
  outline: none;
}

.sort-buttons button.active {
  background: rgba(139, 92, 246, 0.2);
  color: #e9d5ff;
  border-color: rgba(139, 92, 246, 0.5);
}

@media (max-width: 768px) {
  .library-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input {
    flex: unset;
    min-width: 0;
    width: 100%;
  }

  .sort-buttons {
    width: 100%;
    justify-content: space-between;
  }
}

.track-list {
  flex: 1;
  overflow-y: auto;
  background: rgba(139, 92, 246, 0.03);
  border-radius: 10px;
  padding: 0.5rem;
  border: 1px solid rgba(139, 92, 246, 0.08);
}

.track-item {
  padding: 0.85rem;
  margin-bottom: 0.4rem;
  background: rgba(139, 92, 246, 0.05);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  border: 1px solid rgba(139, 92, 246, 0.08);
  gap: 0.75rem;
}

.track-item .track-info {
  flex: 1;
  min-width: 0;
}

.track-album-art {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.track-item:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
  transform: translateX(3px);
}

.track-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist-name {
  color: #8b5cf6;
  font-weight: 500;
}

.separator {
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.3);
}

.album-name {
  color: rgba(255, 255, 255, 0.6);
}

.album-year {
  color: rgba(255, 255, 255, 0.4);
}

.track-owner,
.track-owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #ddd6fe;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.track-details .track-owner-badge {
  margin-top: 0.4rem;
  align-self: flex-start;
}

.track-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-left: auto;
}

.track-duration {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  font-family: 'SF Mono', 'Monaco', monospace;
  flex-shrink: 0;
}

.add-to-queue-btn,
.remove-from-queue-btn {
  border: none;
  background: transparent;
  color: #8b5cf6;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.add-to-queue-btn svg,
.remove-from-queue-btn svg {
  display: block;
}

.add-to-queue-btn:hover:not(:disabled) {
  color: #c084fc;
  transform: scale(1.05);
}

.add-to-queue-btn:disabled {
  cursor: default;
}

.add-to-queue-btn.in-queue {
  color: #22c55e;
}

.remove-from-queue-btn {
  color: #ef4444;
}

.remove-from-queue-btn:hover {
  color: #f87171;
  transform: scale(1.05);
}

/* Queue View */

.queue-view {
  padding: 1rem;
}

.queue-view h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.queue-item {
  padding: 0.85rem;
  background: rgba(139, 92, 246, 0.05);
  border-radius: 8px;
  cursor: move;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(139, 92, 246, 0.08);
}

.queue-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
}

@media (min-width: 769px) {
  .queue-item-thumb {
    display: block;
  }
}

.queue-item:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
  transform: translateX(3px);
}

.queue-item:active {
  cursor: grabbing;
  opacity: 0.7;
}

.queue-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.2);
  color: #a855f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.no-results {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.55);
}

.error {
  text-align: center;
  padding: 2rem;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
}

/* =================
   HOMEPAGE
   ================= */

.homepage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  background:
    linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)),
    url('/assets/1.png') center/cover no-repeat fixed;
  color: #fff;
  position: relative;
}

.global-header {
  position: absolute;
  top: 2rem;
  left: 2rem;
  right: 2rem;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.room-warning {
  position: fixed;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 90vw);
  padding: 1rem 1.5rem;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: #fecaca;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  z-index: 60;
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.room-warning .action-button {
  align-self: stretch;
}

/* Room warning variants */

.room-warning[data-variant="warning"] {
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fef3c7;
}

.room-warning[data-variant="success"] {
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #bbf7d0;
}

@media (max-width: 768px) {
  .room-warning {
    top: 90px;
    padding: 0.75rem 1rem;
  }
}

.site-footer {
  margin: 2rem auto 1.5rem;
  width: min(720px, 90vw);
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.site-footer a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  align-items: center;
}

.site-footer-note,
.site-footer-contact {
  font-size: 0.85rem;
}

.legal-page {
  min-height: 100vh;
  width: 100vw;
  padding: 4rem 1.5rem 2rem;
  background:
    linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)),
    url('/assets/1.png') center/cover no-repeat fixed;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
}

.legal-page::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.legal-page {
  scrollbar-width: none;
}

.legal-card {
  width: min(900px, 100%);
  background: rgba(9, 9, 9, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 2.5rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(40px);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.legal-card h1 {
  font-size: 2.3rem;
  margin-bottom: 0.25rem;
}

.legal-updated {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
}

.legal-card section h2 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
  color: #c4b5fd;
}

.legal-card section p,
.legal-card section ul {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.legal-card ul {
  padding-left: 1.2rem;
}

.legal-card a {
  color: #a855f7;
}

.legal-back-link {
  margin-top: 0.5rem;
}

.legal-back-link a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 600;
}

.legal-back-link a:hover {
  text-decoration: underline;
}

.header-left,
.header-right {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.set-username-btn {
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.set-username-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.homepage-content {
  position: relative;
  z-index: 10;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  padding: 4rem;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.homepage-content h1 {
  font-family: 'Shadows Into Light', 'Musical Tone', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 4.3rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #ffffff;
  letter-spacing: 0.08em;
}

.tagline {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 3rem;
}

.homepage-buttons {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.button-explainer {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  margin: -0.75rem 0 0 0;
  text-align: center;
  line-height: 1.4;
}

.button-explainer.host-explainer {
  margin-top: -0.75rem;
}

.button-explainer.guest-explainer {
  margin-top: -0.5rem;
}

.plex-signin-btn {
  background: rgba(139, 92, 246, 0.2);
  color: #e9d5ff;
  padding: 1.25rem 2.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  border: 1.5px solid rgba(139, 92, 246, 0.5);
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  letter-spacing: 0.02em;
}

.plex-signin-btn:hover {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.7);
  color: white;
}

.homepage .join-room-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  padding: 1.25rem 2.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  letter-spacing: 0.02em;
}

.homepage .join-room-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.username-badge {
  padding: 0.5rem 1rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 12px;
  color: #c4b5fd;
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.username-badge:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.5);
  color: #ddd6fe;
}

.brand-title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.brand-title-hero {
  margin-bottom: 1rem;
}

.brand-logo {
  display: block;
  height: auto;
  width: auto;
}

.brand-logo-hero {
  max-height: 90px;
}

.brand-logo-nav {
  max-height: 44px;
}

@media (max-width: 768px) {
  .brand-logo-hero {
    max-height: 64px;
  }

  .brand-logo-nav {
    max-height: 36px;
  }
}

/* =================
   SIGN IN PAGE
   ================= */

.signin-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #000000 100%);
  color: #fff;
  position: relative;
}

.signin-page::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 30% 40%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
  animation: float 30s ease-in-out infinite;
  pointer-events: none;
}

.signin-card {
  position: relative;
  z-index: 10;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  padding: 3rem;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  border: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.signin-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.signin-header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
}

/* =================
   JOIN ROOM PAGE
   ================= */

.join-room-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  background:
    linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)),
    url('/assets/1.png') center/cover no-repeat fixed;
  color: #fff;
  position: relative;
}

.join-room-card {
  position: relative;
  z-index: 10;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  padding: 3rem;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.join-room-back-btn {
  position: static;
}

.join-room-card h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
}

.join-room-description {
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 2rem;
  text-align: center;
}

.current-nickname-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.current-nickname-banner strong {
  color: #bbf7d0;
}

.change-nickname-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.85);
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.change-nickname-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 0.9rem;
}

.nickname-input, .room-code-input {
  width: 100%;
  padding: 1rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  color: white;
  font-size: 1rem;
}

.nickname-input:focus, .room-code-input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.nickname-input::placeholder, .room-code-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.back-button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.65);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ================
   RESPONSIVE LAYOUT
   ================ */

@media (max-width: 1024px) {
  .app {
    height: auto;
    min-height: 100vh;
  }

  .app-content {
    grid-template-columns: 260px 1fr;
    padding: 2rem;
    gap: 1.25rem;
  }

  .homepage-content,
  .join-room-card,
  .signin-card {
    padding: 3rem;
  }
}

@media (max-width: 768px) {
  .app {
    grid-template-rows: auto auto 1fr auto;
  }

  .app-header {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .header-left,
  .header-right {
    width: auto;
    flex: 1 1 auto;
    gap: 0.5rem;
    align-items: center;
    min-width: 0;
  }

  .header-left {
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .header-room-block {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
  }

  .room-info {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
  }

  .header-right {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .user-info {
    width: auto;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .app-content {
    grid-template-columns: 1fr;
    padding: 1.25rem;
    gap: 1.25rem;
  }

  .homepage,
  .join-room-page {
    padding-top: 5.5rem;
  }

  .sidebar {
    width: 100%;
    order: -1;
  }

  .main-content {
    padding: 1.25rem;
    min-height: 60vh;
  }

  .homepage-content,
  .join-room-card,
  .signin-card {
    width: 95%;
    padding: 2.25rem;
    margin-top: 0.5rem;
  }

  .homepage-content h1 {
    font-size: 3.5rem;
  }

  .player-footer {
    padding: 1rem;
  }

  .music-player {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .playback-controls,
  .volume-control {
    width: 100%;
    justify-content: space-between;
  }

  .listener-view {
    min-height: 380px;
  }

  .album-art-main-display {
    width: min(70vw, 70vh);
    height: min(70vw, 70vh);
  }
}

@media (max-width: 520px) {
  body {
    overflow-y: auto;
  }

  .app-header {
    padding: 0.75rem 1rem;
  }

  .room-info {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.3rem;
  }

  .room-code {
    font-size: 0.85rem;
    letter-spacing: 1px;
  }

  .homepage-content,
  .join-room-card,
  .signin-card {
    padding: 1.5rem;
    border-radius: 14px;
  }

  .homepage-content h1 {
    font-size: 3rem;
  }

  .homepage-buttons {
    gap: 1rem;
  }

  .user-info {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .current-nickname-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .music-player {
    gap: 0.75rem;
  }

  .track-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .playback-controls {
    width: 100%;
    align-items: stretch;
    gap: 0.5rem;
  }

  .volume-control {
    width: 100%;
    justify-content: space-between;
    min-width: unset;
  }

  .listener-view {
    padding: 1rem 0.5rem;
  }

  .global-header {
    top: 1rem;
    left: 1rem;
    right: 1rem;
  }

  .join-room-card {
    margin-top: 1rem;
  }
}



/* ================================================================
   MOBILE-ONLY LAYOUT - COMPLETE REDESIGN
   This is a SEPARATE UI structure, NOT adjustments to desktop
   ================================================================ */
@font-face {
  font-family: 'Musical Tone';
  src: url('/fonts/MusicalTone.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@media (max-width: 768px) {
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
  background: #000000;
  overflow-x: hidden;
  color: #ffffff;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
}

html,
body,
#root {
  width: 100%;
  min-height: 100vh;
}

#root {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 520px;
}

/* Marquee animation for long text (iPod style) */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(0);
  }
  80% {
    transform: translateX(calc(-100% + 200px));
  }
  100% {
    transform: translateX(calc(-100% + 200px));
  }
}
  /* ================================================================
     RESET DESKTOP LAYOUT - START FRESH
     ================================================================ */

  .app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: -webkit-fill-available;
    overflow: hidden;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  /* ================================================================
     MOBILE HEADER - COMPACT TOP BAR
     ================================================================ */

  .app-header {
    flex-shrink: 0;
    z-index: 200;
    padding: 0.75rem 1rem;
    padding-top: calc(env(safe-area-inset-top) + 0.75rem);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  .brand-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }

  .brand-logo {
    display: block;
    height: auto;
    width: auto;
    max-width: min(160px, 60vw);
  }

  .brand-logo-hero {
    max-height: 64px;
  }

  .brand-logo-nav {
    max-height: 38px;
  }

  .app-header h1 {
    font-size: 1.5rem;
    margin: 0;
  }

  .header-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
  }

  .header-room-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
  }

  .header-right {
    display: none;
  }

  .header-menu-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    z-index: 250;
  }

  .header-menu-toggle {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
  }

  .header-menu-toggle svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
    stroke: currentColor;
  }

  .header-menu-toggle:active {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.6);
  }

  .header-menu-toggle.active {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.6);
  }

  .header-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: min(320px, calc(100vw - 2rem));
    padding: 1rem;
    border-radius: 14px;
    background: rgba(8, 8, 15, 0.98);
    border: 1px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 220;
    pointer-events: auto;
  }

  .header-menu-user {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-menu-user-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
  }

  .header-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-menu-dropdown .leave-room-btn,
  .header-menu-dropdown .logout-btn {
    width: 100%;
    justify-content: center;
    pointer-events: auto;
    cursor: pointer;
  }

  .header-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 215;
    pointer-events: auto;
  }

  .room-info {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.75rem;
  }

  .room-code {
    font-family: 'SF Mono', 'Monaco', monospace;
    background: rgba(139, 92, 246, 0.15);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
    letter-spacing: 1px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 1;
  }

  .refresh-room-id-btn {
    background: transparent;
    border: none;
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
    margin-left: 0.25rem;
  }

  .refresh-room-id-btn:active {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    transform: rotate(180deg) scale(0.95);
  }

  .host-badge {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  }

  .username-badge {
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 12px;
    color: #c4b5fd;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
  }

  .username-badge:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    color: #ddd6fe;
  }

  .logout-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.3rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
  }

  .logout-btn:active {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
  }

  .leave-room-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 0.65rem 1.3rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
  }

  .leave-room-btn:active {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
  }

  .user-info {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }

  /* ================================================================
     HIDE DESKTOP SIDEBAR COMPLETELY
     ================================================================ */

  .sidebar {
    display: none;
  }

  /* ================================================================
     APP CONTENT - REMOVE DESKTOP GRID
     ================================================================ */

  .app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    margin: 0 auto;
    background: #000000;
    min-height: 0;
    width: 100%;
    max-width: 520px;
  }

  /* ================================================================
     MAIN CONTENT - FULL SCREEN CONTAINER
     ================================================================ */

  .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    margin: 0 auto;
    background: #000000;
    min-height: 0;
    width: 100%;
    max-width: 520px;
  }

  /* ================================================================
     MUSIC LIBRARY - FULL SCREEN LAYOUT
     ================================================================ */

  .music-library {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 520px;
    min-height: 0;
    background: #000000;
    position: relative;
  }

  .library-header {
    flex-shrink: 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 10;
  }

  .library-header h2 {
    font-size: 1.25rem;
    margin: 0 0 0.75rem 0;
    padding: 0;
  }

  .library-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0;
    margin: 0;
  }

  .search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #ffffff;
  }

  .sort-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0;
    margin: 0;
  }

  .sort-buttons button {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #ffffff;
    white-space: nowrap;
    min-height: 40px;
  }

  .sort-buttons button.active {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
  }

  /* ================================================================
     TRACK LIST - FULL WIDTH, NO CONTAINER
     ================================================================ */

  .track-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    margin: 0;
    background: #000000;
    width: 100%;
    min-height: 0;
    position: relative;
  }

  .track-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    background: transparent;
    margin: 0;
    gap: 0.75rem;
    transition: none;
    -webkit-tap-highlight-color: transparent;
  }

  .track-item:hover,
  .track-item:active,
  .track-item:focus {
    background: transparent;
    transform: none;
  }

  .track-item * {
    transition: none;
    -webkit-tap-highlight-color: transparent;
  }

  .track-album-art,
  .queue-item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(139, 92, 246, 0.15);
    background: rgba(139, 92, 246, 0.05);
  }

  .track-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
  }

  .track-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .track-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
  }

  .track-meta .artist-name,
  .track-meta .album-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .track-meta .separator {
    flex-shrink: 0;
  }

  .track-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
  }

  .track-duration {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'SF Mono', monospace;
  }

  .add-to-queue-btn,
  .remove-from-queue-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #8b5cf6;
    flex-shrink: 0;
  }

  .add-to-queue-btn:active,
  .remove-from-queue-btn:active {
    transform: scale(0.95);
  }

  .add-to-queue-btn.in-queue {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
  }

  /* ================================================================
     QUEUE VIEW - FULL SCREEN
     ================================================================ */

  .queue-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1rem;
    background: #000000;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  .queue-view h3 {
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    padding: 0;
  }

  .queue-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    margin: 0;
    gap: 0;
  }

  .queue-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    background: rgba(139, 92, 246, 0.03);
    margin: 0;
    gap: 0.75rem;
    transition: none;
  }

  .queue-item:hover,
  .queue-item:active,
  .queue-item:focus {
    background: rgba(139, 92, 246, 0.03);
  }

  .queue-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
  }

  .queue-item .track-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  /* ================================================================
     MOBILE PLAYER - FIXED BOTTOM BAR
     ================================================================ */

  .player-footer {
    flex-shrink: 0;
    z-index: 150;
    padding: 0.75rem 1rem;
    padding-bottom: calc(env(safe-area-inset-bottom) + 3.5rem);
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 2px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.9);
    transition: transform 0.25s ease, opacity 0.25s ease;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  .player-footer.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
  }

  /* Add padding to content so player doesn't overlap */
  .track-list,
  .queue-list {
    padding-bottom: 100px;
  }

  .music-player {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }

  .music-player .track-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }

  .album-art {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
  }

  .track-details {
    flex: 1;
    min-width: 0;
  }

  .music-player .track-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }

  .music-player .track-title::-webkit-scrollbar {
    display: none;
  }

  .music-player .track-artist {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }

  .music-player .track-artist::-webkit-scrollbar {
    display: none;
  }

  /* Hide all playback controls on mobile */
  .playback-controls {
    display: none;
  }

  .volume-control {
    display: none;
  }

  /* ================================================================
     LISTENER VIEW - MOBILE
     ================================================================ */

  .listener-view {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #000000;
    overflow: hidden;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  .album-art-main-display {
    width: 85%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .album-art-main {
    width: 100%;
    height: 100%;
    max-height: 500px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.4),
                0 0 80px rgba(139, 92, 246, 0.2);
    object-fit: cover;
    display: block;
  }

  /* Force square aspect ratio when aspect-ratio isn't supported */
  @supports not (aspect-ratio: 1 / 1) {
    .album-art-main-display {
      display: block;
      position: relative;
    }

    .album-art-main-display::before {
      content: "";
      display: block;
      width: 100%;
      padding-top: 100%;
    }

    .album-art-main {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
    }
  }

  .album-art-placeholder {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.05);
    border: 2px dashed rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    flex-shrink: 0;
  }

  .placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
  }

  .placeholder-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
  }

  /* ================================================================
     MOBILE FLOATING ACTION BUTTONS
     ================================================================ */

  .mobile-play-pause-fab {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 192px);
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    border: none;
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 145;
    cursor: pointer;
  }

  .mobile-play-pause-fab:active {
    transform: scale(0.92);
  }

  .mobile-play-pause-fab:disabled {
    opacity: 0.4;
    background: rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
  }

  .mobile-listeners-fab {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 120px);
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    border: none;
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 140;
  }

  .mobile-listeners-fab:active {
    transform: scale(0.92);
  }

  .mobile-shuffle-fab {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 120px);
    right: 5.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 139;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  }

  .mobile-shuffle-fab.active {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border-color: rgba(34, 197, 94, 0.6);
  }

  .listeners-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    border: 2px solid #000000;
  }

  /* ================================================================
     MOBILE LISTENERS DRAWER
     ================================================================ */

  .mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 300;
    display: flex;
    align-items: flex-end;
  }

  .mobile-drawer {
    width: 100%;
    max-height: 80vh;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 1.5rem;
    padding-bottom: calc(env(safe-area-inset-bottom) + 1.5rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .drawer-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto 1.5rem auto;
  }

  .drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
  }

  .drawer-header h3 {
    font-size: 1.25rem;
    margin: 0;
  }

  .drawer-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
  }

  .drawer-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .listeners-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .listener-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .host-badge-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 4px;
  }

  .room-share {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .room-share h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
  }


  .share-code {
    font-family: 'SF Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    letter-spacing: 4px;
    margin-bottom: 1rem;
  }

  .copy-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
  }

  .copy-btn.copied {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  }

  /* ================================================================
     NO RESULTS / LOADING STATES
     ================================================================ */

  .no-results,
  .loading,
  .error {
    padding: 3rem 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
  }

  /* ================================================================
     LIBRARY BROWSER (if it exists)
     ================================================================ */

  .library-browser {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    margin: 0;
  }

  .browse-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .columns {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .column {
    flex-shrink: 0;
    border-bottom: 2px solid rgba(139, 92, 246, 0.1);
  }

  .column h3 {
    padding: 1rem;
    background: rgba(139, 92, 246, 0.05);
    margin: 0;
    font-size: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .list {
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .list-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    cursor: pointer;
    transition: none;
  }

  .list-item:hover,
  .list-item:active,
  .list-item:focus {
    background: transparent;
  }

  .list-item.selected {
    background: rgba(139, 92, 246, 0.15);
    border-left: 3px solid rgba(139, 92, 246, 0.8);
  }

  /* ================================================================
     HOME PAGE / AUTH PAGES - MOBILE
     ================================================================ */

  .home-container,
  .signin-container,
  .join-room-container {
    padding: 2rem 1.5rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  .hero-section p {
    font-size: 1rem;
  }

  .action-button,
  .secondary-button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
  }

  .form-group input {
    font-size: 1rem;
    padding: 0.9rem 1rem;
  }

  /* ================================================================
     MOBILE-FIRST HOMEPAGE & JOIN ROOM - CLEAN BORDERLESS DESIGN
     ================================================================ */
  
  .homepage {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    height: 100vh;
    height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    background: #000000;
    padding: 0;
    margin: 0;
    position: relative;
  }

  .global-header {
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    box-shadow: none;
    flex-shrink: 0;
  }
  
  .global-header .header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .global-header .header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .homepage-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 4rem 1.5rem 0 1.5rem;
    text-align: center;
    max-width: none;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    min-height: auto;
    flex: 0 0 auto;
    gap: 1.25rem;
  }

  .homepage-buttons {
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0;
  }

  /* iOS Safari specific - remove extra space */
  @supports (-webkit-touch-callout: none) {
    .homepage-content {
      min-height: auto;
      padding-bottom: 0;
    }
  }
  
  .homepage-content h1 {
    font-size: 3.5rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin: 0 0 1rem 0;
    color: #ffffff;
  }
  
  .tagline {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 3rem 0;
    font-weight: 400;
    line-height: 1.5;
  }
  
  .homepage-buttons {
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .plex-signin-btn,
  .join-room-btn {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    box-shadow: none;
  }
  
  .plex-signin-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    color: #ffffff;
  }
  
  .plex-signin-btn:active {
    transform: scale(0.98);
  }
  
  .plex-signin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  
  .join-room-btn {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(139, 92, 246, 0.3);
  }
  
  .join-room-btn:active {
    transform: scale(0.98);
    background: rgba(139, 92, 246, 0.05);
  }
  
  /* Join Room Page - Clean Borderless Design */
  .join-room-page {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    background: #000000;
    padding: 0;
    align-items: center;
    gap: 1rem;
  }
  
  .join-room-page .global-header {
    padding: 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-top: max(1rem, env(safe-area-inset-top));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  
  .join-room-page .global-header .header-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
  }
  
  .join-room-page .global-header .header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    flex: 1;
  }
  
  .join-room-page .global-header .user-info {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }
  
  .join-room-header {
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  
  .back-btn,
  .back-button {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: #8b5cf6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .join-room-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 7rem 1.5rem 2rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background: transparent;
    border: none;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    text-align: center;
    gap: 1.5rem;
    align-items: stretch;
  }

  .join-room-card form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .join-room-card form .form-group {
    margin-bottom: 0;
  }

  .join-room-card .form-group,
  .join-room-card .action-button,
  .join-room-card .current-nickname-banner {
    width: 100%;
  }

  .join-room-card .error-message {
    width: 100%;
  }
  
  .join-room-card .form-group {
    text-align: left;
  }
  
  .join-room-card h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #ffffff;
    line-height: 1.2;
    width: 100%;
  }
  
  .join-room-card p,
  .join-room-description {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.5;
    text-align: center;
  }

  .current-nickname-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
  }

  .current-nickname-banner strong {
    color: #bbf7d0;
  }
  
  .join-room-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.5rem 2.5rem;
    background: transparent;
    border: none;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
    align-items: center;
    gap: 2rem;
  }

  .join-room-content .brand-title {
    width: 100%;
    justify-content: center;
  }
  
  .join-room-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #ffffff;
    line-height: 1.2;
  }
  
  .join-room-content p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 2rem 0;
    line-height: 1.5;
  }
  
  .form-group {
    margin-bottom: 1.5rem;
  }
  
  .form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
  }
  
  .form-group input {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    color: #ffffff;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
    box-shadow: none;
  }
  
  .form-group input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.08);
  }
  
  .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
  }
  
  .action-button {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    color: #ffffff;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: none;
  }
  
  .action-button:active {
    transform: scale(0.98);
  }
  
  .action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  
  .error-message {
    padding: 1rem 1.25rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 12px;
    color: #fca5a5;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .room-warning {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 5rem);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: calc(520px - 2rem);
    padding: 1rem 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: #fca5a5;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.95rem;
    animation: slideDown 0.3s ease-out;
  }

  .room-warning[data-variant="warning"] {
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.15);
    color: #fde68a;
  }

  .room-warning[data-variant="success"] {
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.15);
    color: #bbf7d0;
  }

  .room-warning .action-button,
  .room-warning button {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  }

  .room-warning .action-button:active,
  .room-warning button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateX(-50%) translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
  }

  /* Reduce footer spacing on mobile */
  .site-footer {
    margin: 1.5rem 0 0;
    padding: 1rem 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
  }

  .site-footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
  }

  .site-footer a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
  }

  .site-footer a:hover {
    text-decoration: underline;
  }

  .site-footer-note,
  .site-footer-contact {
    font-size: 0.75rem;
    line-height: 1.3;
  }
}
