/* ─── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #050510;
  --bg-card: #0a0a1a;
  --bg-panel: #080816;
  --bg-input: #0f0f22;
  --border: #1a1a3a;
  --text: #e0e0f0;
  --text-dim: #5a7090;
  --accent: #00f0ff;
  --accent-hover: #33f5ff;
  --accent-dim: rgba(0, 240, 255, 0.10);
  --secondary: #ff00aa;
  --secondary-dim: rgba(255, 0, 170, 0.10);
  --tertiary: #b44aff;
  --data: #00ff88;
  --success: #00ff88;
  --danger: #ff3355;
  --radius: 8px;
  --radius-sm: 4px;
  --header-h: 56px;
  --player-bar-h: 100px;
  --mobile-tab-h: 52px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --glow-accent: 0 0 10px rgba(0, 240, 255, 0.35), 0 0 30px rgba(0, 240, 255, 0.1);
  --glow-secondary: 0 0 10px rgba(255, 0, 170, 0.3), 0 0 30px rgba(255, 0, 170, 0.1);
  --glow-data: 0 0 8px rgba(0, 255, 136, 0.4);
  --gradient-1: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
  --gradient-2: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* Scan lines overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 240, 255, 0.012) 2px,
    rgba(0, 240, 255, 0.012) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--accent); text-decoration: none; }
img { display: block; }
button { cursor: pointer; font-family: inherit; }

.hidden { display: none !important; }

/* ─── FONT AWESOME ICON TUNING ──────────────────────────── */
.btn-icon i,
.btn-toolbar i,
.panel-header-icon,
.mobile-tab i,
.btn-collapse i,
.btn-expand i,
.accordion-arrow i,
.chat-user-menu-item i {
  font-size: inherit;
  line-height: 1;
  vertical-align: middle;
}
.panel-header-icon {
  color: var(--accent);
  margin-right: 2px;
  font-size: 10px;
  opacity: 0.7;
  padding: 5px;
}
.accordion-arrow i {
  font-size: 8px;
  transition: transform 0.2s ease;
}
.accordion-header.collapsed .accordion-arrow i {
  transform: rotate(-90deg);
}
.chat-user-menu-item i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
  opacity: 0.7;
}
.mobile-tab i {
  display: block;
  font-size: 16px;
  margin-bottom: 2px;
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #000;
  box-shadow: var(--glow-accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.5), 0 0 40px rgba(0, 240, 255, 0.2);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); border-color: var(--accent); }

.btn-auth {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 20px;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-auth:hover {
  background: rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.25);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s, text-shadow 0.2s;
}
.btn-icon:hover { color: var(--accent); background: var(--accent-dim); text-shadow: 0 0 8px rgba(0, 240, 255, 0.5); }
.btn-icon.active { color: var(--accent); text-shadow: 0 0 8px rgba(0, 240, 255, 0.5); }

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
}
.btn-approve { background: var(--success); color: #000; box-shadow: var(--glow-data); }
.btn-reject { background: var(--bg-input); color: var(--text-dim); border: 1px solid var(--border); }

.input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 8px rgba(0, 240, 255, 0.25); }
.input::placeholder { color: var(--text-dim); }

/* ─── HEADER ─────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 20px;
  background: rgba(5, 5, 16, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 20px rgba(0, 240, 255, 0.05);
}

.header-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.logo-icon { color: var(--accent); font-size: 24px; text-shadow: 0 0 10px rgba(0, 240, 255, 0.5); }
.logo-short { display: none; }
.auth-short { display: none; }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--accent);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.3);
}
.auth-name {
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ─── HOME VIEW ──────────────────────────────────────────── */
.view {
  min-height: calc(100vh - var(--header-h));
}

/* Room view: fill remaining viewport exactly, no body scroll */
#room-view {
  height: calc(100vh - var(--header-h));
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero {
  text-align: center;
  padding: 60px 20px 40px;
  background: linear-gradient(180deg, rgba(0,240,255,0.03) 0%, transparent 100%);
}
.hero h1 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
}
.hero p {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 500px;
  margin: 0 auto 30px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.join-room-group {
  display: flex;
  gap: 8px;
}
.join-room-group .input { width: 200px; }

.room-directory {
  padding: 30px 20px 20px;
  max-width: 900px;
  margin: 0 auto;
}
.room-directory-inactive {
  padding-top: 10px;
  padding-bottom: 60px;
}
.room-directory h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-status-dot {
  font-size: 8px;
}
.room-status-dot.active {
  color: var(--data);
  animation: pulse-dot 2s ease-in-out infinite;
}
.room-status-dot.inactive {
  color: var(--text-dim);
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.room-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.room-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  padding: 1px;
  background: var(--gradient-1);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.room-card:hover {
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.15), 0 0 24px rgba(0, 212, 255, 0.1);
}
.room-card:hover::before {
  opacity: 1;
}

.room-card-inactive {
  opacity: 0.6;
  border-style: dashed;
}
.room-card-inactive:hover {
  opacity: 1;
}

.room-card-permanent {
  border-color: var(--border);
}
.room-card-permanent::before {
  opacity: 0.4;
}
.room-card-permanent:hover::before {
  opacity: 1;
}

.room-badge-247 {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(120, 50, 180, 0.35);
  color: #c4a0ff;
  border-radius: 4px;
  border: 1px solid rgba(140, 70, 200, 0.3);
  vertical-align: middle;
}

.room-directory-permanent h2 {
  color: var(--accent);
}
.room-directory-permanent h2 i {
  color: var(--accent);
}

.room-inactive-label {
  color: var(--text-dim);
}
.room-inactive-label i {
  font-size: 10px;
  margin-right: 2px;
}

.room-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-bottom: 10px;
}
.room-card-header .room-listener-count {
  width: 100%;
  padding-left: 46px; /* avatar 36px + gap 10px */
}

.room-host-avatar, .room-host-avatar-fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}
.room-host-avatar { object-fit: cover; border: 1px solid var(--border); }
.room-host-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.room-host-name {
  font-weight: 600;
  font-size: 14px;
}
.room-listener-count {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.room-now-playing {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  border-left: 2px solid var(--accent);
}
.room-track-title {
  font-size: 13px;
  font-weight: 500;
  display: block;
}
.room-track-artist {
  font-size: 12px;
  color: var(--text-dim);
}

.empty-state {
  text-align: center;
  padding: 30px;
  color: var(--text-dim);
  font-size: 14px;
  grid-column: 1 / -1;
}

/* ─── ROOM VIEW ──────────────────────────────────────────── */
/* Room title in main header */
.header-room-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  padding-left: 12px;
  margin-left: 12px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* Listener count in header */
.listener-count-header {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  opacity: 0.8;
}

/* ─── ROOM 3-COLUMN LAYOUT ──────────────────────────────── */
.room-layout {
  display: grid;
  grid-template-columns: 360px 1fr 380px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  transition: grid-template-columns 0.3s ease;
}
.room-layout.chat-collapsed {
  grid-template-columns: 0px 1fr 380px;
}
.room-layout.sidebar-collapsed {
  grid-template-columns: 360px 1fr 0px;
}
.room-layout.chat-collapsed.sidebar-collapsed {
  grid-template-columns: 0px 1fr 0px;
}
.room-layout.chat-collapsed .panel-chat,
.room-layout.sidebar-collapsed .panel-sidebar {
  overflow: hidden;
  width: 0;
  padding: 0;
  border: none;
}

.room-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
}
.room-panel:last-child { border-right: none; }

.panel-header {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  font-family: var(--font-mono);
}

/* ─── CHAT PANEL ─────────────────────────────────────────── */
.panel-chat {
  background: var(--bg-panel);
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.015) 1px, transparent 1px);
  background-size: 24px 24px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-message {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.chat-avatar {
  flex-shrink: 0;
  width: 45px;
  height: 45px;
  align-self: flex-start;
  margin-top: 0.35rem;
}
.chat-avatar img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 8px;
}
.chat-avatar-fallback {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

.chat-body {
  flex: 1;
  min-width: 0;
  margin: 0.2rem 0 0.1rem 0;
  border-radius: 0.525rem;
  background: #00000036;
  padding: 0.7rem;
}
.chat-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 0.2rem;
}
.chat-name { font-size: 0.85rem; font-weight: 600; color: var(--accent); cursor: pointer; }
.chat-name:hover { text-decoration: underline; text-shadow: 0 0 6px rgba(0, 240, 255, 0.4); }
.chat-verified {
  color: var(--accent);
  font-size: 0.7rem;
  margin-left: 2px;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}
.chat-audio-badge {
  font-size: 0.7rem;
  margin-left: 3px;
}
.chat-badge-bronze {
  color: #cd7f32;
  text-shadow: 0 0 6px rgba(205, 127, 50, 0.5);
}
.chat-badge-silver {
  color: #c0c0c0;
  text-shadow: 0 0 6px rgba(192, 192, 192, 0.6);
}
.chat-badge-gold {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}
.chat-badge-platinum {
  color: #00f0ff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.7);
}
.chat-time { font-size: 0.7rem; color: var(--text-dim); font-family: var(--font-mono); }
.chat-text { font-size: 1rem; line-height: 1.45; word-break: break-word; }

.chat-gif {
  max-width: 200px;
  max-height: 150px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.chat-input-area {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  flex-shrink: 0;
  min-height: 84px;
}

.chat-input-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 4px;
  transition: border-color 0.2s;
}
.chat-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.15);
}

.chat-input-wrap .chat-input {
  flex: 1;
  border: none;
  background: none;
  padding: 10px 8px;
  min-height: 0;
}
.chat-input-wrap .chat-input:focus {
  outline: none;
  box-shadow: none;
  border: none;
}

.chat-input-addon {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  padding: 8px 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.chat-input-addon:hover {
  color: var(--accent);
}

/* ─── GIF PICKER ─────────────────────────────────────────── */
.gif-picker {
  position: absolute;
  bottom: 64px;
  left: 8px;
  right: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  max-height: 380px;
  display: flex;
  flex-direction: column;
  z-index: 50;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}
.panel-chat { position: relative; }

.gif-picker-header {
  padding: 10px 10px 0;
  flex-shrink: 0;
}
.gif-search-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.gif-search-row .input { flex: 1; }

.gif-trending-tags {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.gif-trending-tags::-webkit-scrollbar { display: none; }

.gif-trending-tag {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.gif-trending-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.gif-trending-tag.active {
  border-color: var(--accent);
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent);
}

.gif-picker-grid {
  columns: 3;
  column-gap: 6px;
  padding: 0 10px 10px;
  overflow-y: auto;
  flex: 1;
}

.gif-item {
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  break-inside: avoid;
  margin-bottom: 6px;
  display: inline-block;
  width: 100%;
}
.gif-item:hover {
  transform: scale(1.03);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}
.gif-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

.gif-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 30px 10px;
}

.gif-loading {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  padding: 20px 10px;
}

/* ─── CENTER PANEL ───────────────────────────────────────── */
.panel-center {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.visualizer-wrap {
  width: 100%;
  flex: 1;
  min-height: 100px;
  overflow: hidden;
  background: rgba(5, 5, 16, 0.6);
  border-bottom: 1px solid rgba(0, 240, 255, 0.08);
  position: relative;
}
.visualizer-wrap canvas {
  width: 100%;
  height: 100%;
}
.visualizer-3d {
  position: absolute;
  inset: 0;
  z-index: 1;
}
/* Desktop: show 3D, hide 2D canvas */
.visualizer-2d {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
}

.btn-viz-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 5;
  background: rgba(5, 5, 16, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  padding: 6px 8px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s, background 0.2s;
}
.btn-viz-overlay:hover {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(5, 5, 16, 0.85);
}

/* ─── STEREO WAVEFORM ────────────────────────────────────── */
.waveform-wrap {
  width: 100%;
  height: 100px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid rgba(0, 240, 255, 0.08);
}
.waveform-wrap canvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}
.waveform-controls {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(5, 5, 16, 0.8);
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  z-index: 5;
}
.btn-waveform {
  font-size: 11px !important;
  padding: 2px 6px !important;
}
.waveform-zoom-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  min-width: 28px;
  text-align: center;
}

/* ─── PLAYER BAR (inline in center panel) ────────────────── */
.player-bar {
  display: flex;
  align-items: center;
  padding: 25px 25px;
  gap: 14px;
  background: rgba(5, 5, 16, 0.95);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  width: 100%;
  position: relative;
}

.player-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  max-width: 300px;
  flex-shrink: 0;
}
.player-bar-artwork-wrap {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.player-bar-artwork {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--bg-input);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  border: 1px solid rgba(0, 240, 255, 0.1);
}
.player-bar-artwork.hidden + .player-bar-artwork-placeholder { display: none; }
.player-bar-info {
  min-width: 0;
  flex: 1;
}

/* Social action buttons (like, repost, follow) */
.social-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.btn-social {
  background: none;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.btn-social:hover {
  color: var(--text);
  border-color: var(--border);
}
.btn-social:active {
  transform: scale(0.9);
}
/* Liked state — magenta heart */
.btn-social.liked {
  color: var(--secondary);
  border-color: rgba(255, 0, 170, 0.3);
  box-shadow: 0 0 8px rgba(255, 0, 170, 0.3);
}
.btn-social.liked:hover {
  color: var(--secondary);
  box-shadow: 0 0 14px rgba(255, 0, 170, 0.5);
}
/* Reposted state — neon green */
.btn-social.reposted {
  color: var(--data);
  border-color: rgba(0, 255, 136, 0.3);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}
.btn-social.reposted:hover {
  color: var(--data);
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.5);
}
/* Following state — cyan */
.btn-social.following {
  color: var(--accent);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}
.btn-social.following:hover {
  color: var(--accent);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.5);
}
/* Loading spinner state */
.btn-social.loading {
  pointer-events: none;
  opacity: 0.5;
}

.np-title {
  font-size: 14px;
  font-weight: 600;
}
.np-title a {
  color: inherit;
  text-decoration: none;
}
.np-title a:hover {
  text-decoration: underline;
  color: var(--accent);
}
.np-artist {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.player-bar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 600px;
  pointer-events: none;
}
.player-bar-center > * {
  pointer-events: auto;
}

/* Controls */
.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.player-controls.controls-locked .btn-icon,
.player-controls.controls-locked .btn-playpause {
  opacity: 0.4;
  cursor: not-allowed;
}
.player-controls.controls-locked .btn-icon:hover,
.player-controls.controls-locked .btn-playpause:hover {
  opacity: 0.6;
}
.btn-playpause {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent) !important;
  color: #000 !important;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-accent);
  transition: box-shadow 0.2s, transform 0.1s;
}
.btn-playpause:hover {
  background: var(--accent-hover) !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.6), 0 0 40px rgba(0, 240, 255, 0.2);
}
.btn-playpause.is-buffering {
  animation: buffering-pulse 1.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes buffering-pulse {
  0%, 100% { box-shadow: var(--glow-accent); opacity: 1; }
  50% { box-shadow: 0 0 24px rgba(0, 240, 255, 0.7), 0 0 48px rgba(0, 240, 255, 0.3); opacity: 0.7; }
}

/* Progress */
.progress-area {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.progress-time {
  font-size: 11px;
  color: var(--text-dim);
  min-width: 36px;
  text-align: center;
  font-family: var(--font-mono);
}
.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.progress-bar:hover { height: 6px; }
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s linear;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.3);
}
.progress-bar.is-buffering {
  overflow: visible;
}
.progress-bar.is-buffering::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: progress-shimmer 1.5s ease-in-out infinite;
  opacity: 0.5;
}
@keyframes progress-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.player-bar-right {
  min-width: 140px;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
}

/* Volume */
.volume-control {
  display: flex;
  align-items: center;
  gap: 4px;
}
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}
.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

/* Search Tabs */
.search-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.search-tab {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}
.search-tab i { margin-right: 4px; font-size: 10px; }
.search-tab:hover { color: var(--text); }
.search-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Search (now in modal) */
.search-results {
  margin-top: 10px;
  flex: 1;
  overflow-y: auto;
}
.search-results-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

/* Collapse / Expand buttons */
.btn-collapse {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 0 4px;
  margin-left: auto;
  transition: color 0.2s;
}
.btn-collapse:hover { color: var(--accent); }

.btn-expand {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 20px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.btn-expand:hover { color: var(--accent); background: var(--bg-input); box-shadow: var(--glow-accent); }
.btn-expand-left {
  left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.btn-expand-right {
  right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.track-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.track-item:hover { background: var(--accent-dim); }

/* Gated / restricted tracks */
.track-item.track-gated { opacity: 0.55; }
.track-item.track-gated:hover { opacity: 0.75; }
.track-artwork-wrap { position: relative; }
.gated-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0,0,0,0.75);
  color: #f59e0b;
  font-size: 9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gated-reason {
  color: #f59e0b;
  font-size: 10px;
  font-weight: 500;
}

.track-artwork-wrap {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-input);
}
.track-artwork {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

.track-info {
  flex: 1;
  min-width: 0;
}
.track-title {
  font-size: 13px;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-artist {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
}

/* Track metadata row (genre badge + duration + BPM) */
.track-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}
.genre-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: var(--font-mono);
  white-space: nowrap;
  line-height: 1.4;
}
.track-duration, .track-bpm {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.track-bpm {
  opacity: 0.7;
}

.track-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
.panel-sidebar {
  background: var(--bg-panel);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.015) 1px, transparent 1px);
  background-size: 24px 24px;
}

.sidebar-section {
  border-bottom: 1px solid var(--border);
}
.sidebar-section[data-panel="listeners"] {
  flex-shrink: 0;
}
.sidebar-section[data-panel="queue"] {
  flex: 1;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-section[data-panel="queue"] .accordion-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.sidebar-section[data-panel="requests"] {
  flex-shrink: 0;
}
.sidebar-section[data-panel="analysis"] {
  flex-shrink: 0;
}

/* ─── ACCORDION ─────────────────────────────────────────── */
.accordion-header {
  cursor: pointer;
  user-select: none;
}
.accordion-header:hover {
  color: var(--accent);
}
.accordion-arrow {
  font-size: 8px;
  transition: transform 0.2s ease;
  margin-left: 4px;
}
.accordion-header.collapsed .accordion-arrow {
  transform: rotate(-90deg);
}
.accordion-body {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  max-height: 800px;
  opacity: 1;
}
.accordion-body.closed {
  max-height: 0 !important;
  opacity: 0;
  overflow: hidden;
}

/* ─── ANALYSIS PANEL ─────────────────────────────────────── */
.analysis-display {
  padding: 12px;
}
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.analysis-cell {
  background: rgba(0, 255, 136, 0.04);
  border: 1px solid rgba(0, 255, 136, 0.1);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
}
.analysis-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}
.analysis-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--data);
  text-shadow: var(--glow-data);
  line-height: 1.2;
}

/* Listeners — avatar grid with hover popups */
.listeners-list {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.listener-item {
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.listener-item:hover {
  transform: scale(1.15);
  z-index: 200;
}

.listener-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.listener-item:hover .listener-avatar {
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}
.listener-item.is-host .listener-avatar {
  border-color: var(--accent);
}

.listener-avatar-fallback {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.listener-item:hover .listener-avatar-fallback {
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}
.listener-item.is-host .listener-avatar-fallback {
  border-color: var(--accent);
}

/* Host crown indicator */
.listener-host-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-panel);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.listener-host-dot i {
  font-size: 6px;
  color: var(--bg);
}

/* Hover popup card — must be above body::after scan lines (z-index 9999) */
.listener-popup {
  display: none;
  position: fixed;
  z-index: 10000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-width: 140px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), var(--glow-accent);
  pointer-events: auto;
  white-space: nowrap;
  text-align: center;
}
/* Invisible bridge area so mouse can travel from avatar to popup */
.listener-popup::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  top: 100%;
}
.listener-popup.below::before {
  top: auto;
  bottom: 100%;
}
.listener-popup::after {
  content: '';
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  border: 6px solid transparent;
  border-top-color: var(--border);
}
.listener-popup.below::after {
  top: auto;
  bottom: calc(100% + 14px);
  transform: translateX(-50%) translateY(100%);
  border-top-color: transparent;
  border-bottom-color: var(--border);
}

.listener-popup-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.listener-popup-handle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.listener-popup-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  text-decoration: none;
  padding: 3px 8px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  pointer-events: auto;
}
.listener-popup-link:hover {
  background: var(--accent);
  color: var(--bg);
}
.host-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Queue toolbar */
.queue-toolbar {
  display: flex;
  gap: 2px;
  margin-left: auto;
}
.btn-toolbar {
  font-size: 13px !important;
  padding: 2px 5px !important;
}

/* Queue */
.queue-list {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border-left: 3px solid transparent;
}
.queue-item:hover { background: var(--accent-dim); }
.queue-active {
  background: var(--accent-dim);
  border-left-color: var(--accent);
  box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.05);
}
.queue-active .queue-track-title { color: var(--accent); text-shadow: 0 0 6px rgba(0, 240, 255, 0.3); }
.queue-active .queue-number { color: var(--accent); }

.queue-drag-handle {
  cursor: grab;
  color: var(--text-dim);
  font-size: 10px;
  padding: 0 2px;
  user-select: none;
  opacity: 0.4;
  transition: opacity 0.15s;
}
.queue-item:hover .queue-drag-handle { opacity: 1; }
.queue-dragging { opacity: 0.4; }
.queue-drag-over {
  border-top: 2px solid var(--accent);
  margin-top: -2px;
}

.queue-number {
  font-size: 11px;
  color: var(--text-dim);
  min-width: 16px;
  text-align: center;
  font-family: var(--font-mono);
}
.queue-track-info { flex: 1; min-width: 0; }
.queue-track-title {
  font-size: 12px;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-track-artist {
  font-size: 10px;
  color: var(--text-dim);
}

/* Requests */
.requests-list {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.request-info { flex: 1; min-width: 0; }
.request-track {
  font-size: 13px;
  font-weight: 500;
  display: block;
}
.request-by {
  font-size: 11px;
  color: var(--text-dim);
}
.request-actions {
  display: flex;
  gap: 4px;
}

/* ─── MOBILE TABS ────────────────────────────────────────── */
.mobile-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-tab-h);
  background: rgba(5, 5, 16, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 100;
}

.mobile-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  padding: 8px 4px;
  transition: color 0.2s;
}
.mobile-tab.active { color: var(--accent); text-shadow: 0 0 8px rgba(0, 240, 255, 0.4); }

/* ─── SEARCH MODAL ──────────────────────────────────────── */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 2, 8, 0.85);
}
.search-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 680px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), var(--glow-accent);
}
.search-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.search-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.search-modal-header .btn-icon {
  font-size: 22px;
}
.search-modal .search-tabs {
  padding: 0 18px;
}
.search-modal .input {
  margin: 0 18px 0;
  width: calc(100% - 36px);
}
.search-modal .search-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px 18px 18px;
  min-height: 0;
}

/* Search filter bar */
.search-filters {
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-select, .filter-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s;
}
.filter-select:focus, .filter-input:focus {
  border-color: var(--accent);
}
.filter-select {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a7090'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 22px;
}
.filter-select option {
  background: var(--bg-card);
  color: var(--text);
}
.filter-input {
  width: 64px;
  text-align: center;
}
.filter-input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}
/* Hide number input spinners */
.filter-input::-webkit-outer-spin-button,
.filter-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.filter-input[type=number] { -moz-appearance: textfield; }
.filter-sep {
  color: var(--text-dim);
  font-size: 11px;
  flex-shrink: 0;
}
.filter-label {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-dim);
}
.btn-ghost i {
  font-size: 9px;
  margin-right: 2px;
}
.filter-spacer {
  flex: 1;
}

/* URL input area */
.url-input-area {
  padding: 12px 18px;
}
.url-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.url-input-row .input {
  flex: 1;
  margin: 0;
  width: auto;
}
.url-input-row .btn {
  flex-shrink: 0;
  padding: 8px 14px;
}
.url-status {
  margin-top: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}
.url-status.error { color: var(--danger); }
.url-status.success { color: var(--success); }

/* Preview indicator on track items */
.track-item.previewing {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
}
.btn-preview.active {
  color: var(--accent) !important;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

/* Search pagination */
.search-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.search-pagination .btn-icon {
  font-size: 14px;
}
.search-pagination .btn-icon:disabled {
  opacity: 0.3;
  cursor: default;
}
.search-page-info {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* ─── CHAT USER CONTEXT MENU ────────────────────────────── */
.chat-user-menu {
  position: fixed;
  z-index: 400;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 0;
  min-width: 160px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), var(--glow-accent);
}
.chat-user-menu-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.chat-user-menu-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}
.chat-user-menu-danger:hover {
  background: rgba(255, 51, 85, 0.1);
  color: var(--danger);
}

/* Muted user indicator */
.chat-message.muted {
  opacity: 0.35;
}
.chat-message.muted .chat-text,
.chat-message.muted .chat-gif {
  display: none;
}
.chat-muted-label {
  font-size: 11px;
  color: var(--secondary);
  margin-left: 6px;
  opacity: 0.8;
}
.btn-unmute {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 10px;
  padding: 1px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-left: 6px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-unmute:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ─── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--accent);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
  pointer-events: none;
  box-shadow: var(--glow-accent);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── SHAKE ANIMATION (spam filter) ──────────────────────── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.shake {
  animation: shake 0.4s ease-in-out;
  border-color: var(--secondary) !important;
}

/* ─── CONFIRM DIALOG ─────────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.2s;
}
.confirm-overlay.show { opacity: 1; }
.confirm-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 0 20px rgba(0,240,255,0.15);
}
.confirm-message {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ─── SCROLLBARS ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── LARGE SCREENS ──────────────────────────────────────── */
@media (min-width: 1600px) {
  .room-layout {
    grid-template-columns: 400px 1fr 420px;
  }
  .room-layout.chat-collapsed { grid-template-columns: 0px 1fr 420px; }
  .room-layout.sidebar-collapsed { grid-template-columns: 400px 1fr 0px; }
  .room-layout.chat-collapsed.sidebar-collapsed { grid-template-columns: 0px 1fr 0px; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  #room-view {
    height: calc(100vh - var(--header-h) - var(--mobile-tab-h));
  }
  .room-layout {
    grid-template-columns: 1fr;
    position: relative;
  }
  .visualizer-2d { position: relative; }

  .logo-full { display: none; }
  .logo-short { display: inline; }
  .logo-text { font-size: 16px; }
  .logo-icon { font-size: 18px; }
  .auth-full { display: none; }
  .auth-short { display: inline; }
  .btn-auth { font-size: 12px; padding: 5px 10px; }

  .panel-chat,
  .panel-sidebar {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: none;
  }

  .panel-center { padding-bottom: calc(var(--mobile-tab-h) + 56px); }
  .panel-chat.mobile-active { display: flex !important; padding-bottom: var(--mobile-tab-h); }
  .panel-sidebar.mobile-active { display: flex !important; padding-bottom: var(--mobile-tab-h); }
  .panel-sidebar.mobile-active { flex-direction: column; }

  .mobile-tabs { display: flex; }

  .player-bar {
    position: fixed;
    bottom: var(--mobile-tab-h);
    left: 0;
    right: 0;
    z-index: 99;
    padding: 6px 10px;
    gap: 8px;
    background: rgba(5, 5, 16, 0.97);
    backdrop-filter: blur(12px);
  }
  .player-bar-center {
    position: static;
    transform: none;
    flex: 1;
    pointer-events: auto;
  }
  .player-bar-right { margin-left: 0; min-width: auto; }
  .player-bar-left { min-width: 80px; max-width: 140px; }
  .player-bar-artwork-wrap { width: 40px; height: 40px; }
  .player-bar-artwork { width: 40px; height: 40px; }
  .social-actions { display: none; }
  .chat-input-area { min-height: 60px; }
  .volume-control { display: none; }

  .room-panel { border-right: none; }

  .hero h1 { font-size: 28px; }
  .hero p { font-size: 14px; }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 300px;
    margin: 0 auto;
  }
  .join-room-group { flex-direction: column; }
  .join-room-group .input { width: 100%; }
}

@media (max-width: 600px) {
  .header { padding: 0 12px; }
  .auth-name { display: none; }
  .header-room-title { max-width: 120px; font-size: 12px; }
  .listener-count-header { font-size: 11px; }
  .room-grid { grid-template-columns: 1fr; }
}

/* ─── FOOTER ────────────────────────────────────────────── */
.site-footer {
  margin-top: 60px;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}
.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.footer-links a:hover {
  color: var(--accent);
}
.footer-credits {
  font-size: 0.7rem;
  color: var(--text-dim);
  opacity: 0.6;
}
