:root {
  --bg-dark: #090c14;
  --bg-card: rgba(16, 21, 34, 0.78);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-card-hover: rgba(24, 31, 50, 0.9);
  
  --primary: #fe2c55;
  --primary-glow: rgba(254, 44, 85, 0.35);
  --primary-hover: #e02449;
  
  --secondary: #25f4ee;
  --secondary-glow: rgba(37, 244, 238, 0.3);
  
  --accent-purple: #9d4edd;
  --accent-purple-glow: rgba(157, 78, 221, 0.3);
  --accent-gold: #ffbe0b;
  --accent-green: #00f5d4;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 12% 18%, rgba(254, 44, 85, 0.09) 0%, transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(37, 244, 238, 0.09) 0%, transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(157, 78, 221, 0.05) 0%, transparent 55%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 1.25rem;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.36);
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text h1 span {
  background: linear-gradient(90deg, #fe2c55, #25f4ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  background: rgba(37, 244, 238, 0.12);
  border: 1px solid rgba(37, 244, 238, 0.35);
  color: var(--secondary);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-save:hover {
  background: rgba(37, 244, 238, 0.22);
  box-shadow: 0 0 15px var(--secondary-glow);
  transform: translateY(-1px);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  transition: var(--transition);
}

.status-badge.connected {
  background: rgba(0, 245, 212, 0.12);
  border-color: rgba(0, 245, 212, 0.3);
  color: var(--accent-green);
}

.status-badge.connected .pulse-dot {
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}

.status-badge.disconnected {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.status-badge.disconnected .pulse-dot {
  background: #f87171;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Main Grid Layout */
.main-content {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  flex: 1;
}

@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

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

/* Cards Base */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  position: relative;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h2 {
  font-size: 1.02rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  background: rgba(37, 244, 238, 0.12);
  color: var(--secondary);
  border-radius: 4px;
  border: 1px solid rgba(37, 244, 238, 0.2);
}

/* Connection Input Group */
.input-group {
  display: flex;
  gap: 0.75rem;
}

.input-group input {
  flex: 1;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-group input::placeholder {
  color: var(--text-dim);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #e01e47);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary.disconnect {
  background: #ef4444;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.btn-outline {
  background: transparent;
  color: var(--secondary);
  border: 1px solid var(--secondary);
}

.btn-outline:hover {
  background: rgba(37, 244, 238, 0.1);
}

.btn-danger-outline {
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
}

.connection-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.quick-title {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.05);
}

.stat-icon.viewers { background: rgba(37, 244, 238, 0.1); }
.stat-icon.likes { background: rgba(254, 44, 85, 0.1); }
.stat-icon.diamonds { background: rgba(255, 190, 11, 0.1); }
.stat-icon.comments { background: rgba(157, 78, 221, 0.1); }

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

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.stat-title {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Accordion Master Container --- */
.accordion-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.accordion-item {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.accordion-item:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.accordion-item.active {
  border-color: rgba(37, 244, 238, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.accordion-header {
  width: 100%;
  padding: 0.9rem 1.15rem;
  background: transparent;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: var(--text-main);
  text-align: left;
  user-select: none;
  transition: background 0.2s;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.acc-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.acc-icon {
  font-size: 1.15rem;
}

.acc-name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.acc-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.acc-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.acc-badge.cyan {
  background: rgba(37, 244, 238, 0.12);
  color: var(--secondary);
  border: 1px solid rgba(37, 244, 238, 0.25);
}

.acc-badge.purple {
  background: rgba(157, 78, 221, 0.15);
  color: #c77dff;
  border: 1px solid rgba(157, 78, 221, 0.25);
}

.chevron-icon {
  display: flex;
  align-items: center;
  color: var(--text-dim);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.active .chevron-icon {
  transform: rotate(180deg);
  color: var(--secondary);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.active .accordion-content {
  max-height: 2500px;
}

.accordion-body {
  padding: 0.25rem 1.15rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Multi-Pitch Manager Styles */
.pitches-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.pitch-item-card {
  background: rgba(10, 14, 25, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
}

.pitch-item-card:hover {
  border-color: rgba(37, 244, 238, 0.25);
  background: rgba(15, 20, 36, 0.85);
}

.pitch-item-card.disabled {
  opacity: 0.55;
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(10, 14, 25, 0.4);
}

.pitch-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.pitch-item-title-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.pitch-item-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.pitch-item-title-input {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text-main);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  width: 100%;
  transition: var(--transition);
}

.pitch-item-title-input:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.pitch-item-title-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(37, 244, 238, 0.4);
  outline: none;
}

.pitch-item-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.pitch-textarea {
  width: 100%;
  min-height: 52px;
  max-height: 140px;
  resize: vertical;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 0.45rem 0.6rem;
  line-height: 1.4;
  transition: var(--transition);
}

.pitch-textarea:focus {
  border-color: var(--secondary);
  outline: none;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 10px var(--secondary-glow);
}

.pitch-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.1rem;
}

.pitch-char-count {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.pitch-actions-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-pitch-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: rgba(37, 244, 238, 0.1);
  color: var(--secondary);
  border: 1px solid rgba(37, 244, 238, 0.28);
  cursor: pointer;
  transition: var(--transition);
}

.btn-pitch-trigger:hover {
  background: rgba(37, 244, 238, 0.22);
  box-shadow: 0 0 12px var(--secondary-glow);
  transform: translateY(-1px);
}

.btn-pitch-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.btn-pitch-delete:hover {
  background: rgba(254, 44, 85, 0.15);
  border-color: rgba(254, 44, 85, 0.3);
  color: var(--primary);
}

/* Switches */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch-sm {
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .25s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
}

.switch-sm .slider:before {
  height: 14px;
  width: 14px;
}

input:checked + .slider {
  background-color: var(--accent-green);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

.switch-sm input:checked + .slider:before {
  transform: translateX(16px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.tts-switch-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tts-status-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-green);
}

/* Engine Tabs */
.engine-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.tab-btn {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.55rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.tab-btn.active {
  background: rgba(37, 244, 238, 0.1);
  border-color: var(--secondary);
  color: var(--text-main);
}

.badge-ai {
  display: block;
  font-size: 0.65rem;
  color: var(--secondary);
  font-weight: 700;
  text-transform: uppercase;
}

/* Form Styles */
.form-group {
  margin-top: 0.75rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.custom-select {
  width: 100%;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.custom-select:focus {
  border-color: var(--secondary);
}

.custom-select option {
  background: #111625;
  color: #fff;
}

.custom-textarea {
  width: 100%;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  line-height: 1.4;
  outline: none;
  resize: vertical;
  transition: var(--transition);
}

.custom-textarea:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px var(--secondary-glow);
}

/* Sliders */
.sliders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.4rem;
}

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

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

.slider-val {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--secondary);
  font-weight: 600;
}

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  height: 5px;
  border-radius: 4px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 8px var(--secondary-glow);
  cursor: pointer;
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.voice-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.voice-actions button {
  flex: 1;
}

/* Checkbox list */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* History Tags */
.stat-badge-sm {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(157, 78, 221, 0.15);
  color: #c77dff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.history-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 110px;
  overflow-y: auto;
  padding: 0.4rem;
  background: rgba(10, 14, 23, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  font-size: 0.73rem;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-tag-chip strong {
  color: var(--secondary);
}

/* Avatar Card */
.avatar-card {
  background: linear-gradient(135deg, rgba(30, 20, 50, 0.7), rgba(15, 25, 45, 0.7));
  border-color: rgba(157, 78, 221, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.5rem;
}

.avatar-display {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

.robot-avatar {
  position: relative;
  width: 84px;
  height: 84px;
  background: #151a2b;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(37, 244, 238, 0.4);
  box-shadow: 0 0 25px rgba(37, 244, 238, 0.2);
  flex-shrink: 0;
  transition: var(--transition);
}

.robot-avatar.speaking {
  border-color: var(--primary);
  box-shadow: 0 0 35px var(--primary-glow);
  animation: robotFloat 1.2s ease-in-out infinite alternate;
}

@keyframes robotFloat {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(-4px) scale(1.03); }
}

.avatar-face {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 6px;
}

.avatar-eye {
  width: 11px;
  height: 11px;
  background: var(--secondary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--secondary);
}

.robot-avatar.speaking .avatar-eye {
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

.avatar-mouth {
  grid-column: span 2;
  width: 18px;
  height: 4px;
  background: #fff;
  border-radius: 2px;
  margin: 0 auto;
  transition: height 0.1s;
}

.robot-avatar.speaking .avatar-mouth {
  animation: mouthTalk 0.2s infinite alternate;
  background: var(--accent-gold);
}

@keyframes mouthTalk {
  0% { height: 3px; border-radius: 2px; }
  100% { height: 12px; border-radius: 6px; }
}

.sound-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  position: absolute;
  bottom: 6px;
}

.sound-wave .bar {
  width: 3px;
  height: 3px;
  background: var(--secondary);
  border-radius: 2px;
}

.robot-avatar.speaking .sound-wave .bar {
  background: var(--primary);
  animation: waveDance 0.4s infinite ease-in-out alternate;
}

.robot-avatar.speaking .sound-wave .bar:nth-child(2) { animation-delay: 0.1s; }
.robot-avatar.speaking .sound-wave .bar:nth-child(3) { animation-delay: 0.2s; }
.robot-avatar.speaking .sound-wave .bar:nth-child(4) { animation-delay: 0.3s; }
.robot-avatar.speaking .sound-wave .bar:nth-child(5) { animation-delay: 0.15s; }
.robot-avatar.speaking .sound-wave .bar:nth-child(6) { animation-delay: 0.25s; }

@keyframes waveDance {
  0% { height: 3px; }
  100% { height: 14px; }
}

.speaking-details {
  flex: 1;
}

.now-speaking-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--secondary);
  background: rgba(37, 244, 238, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.3rem;
}

.robot-avatar.speaking ~ .speaking-details .now-speaking-tag {
  color: var(--primary);
  background: rgba(254, 44, 85, 0.15);
}

.current-speech-text {
  font-size: 0.92rem;
  color: var(--text-main);
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Chat Feed */
.chat-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 480px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.queue-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.btn-clear {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-clear:hover {
  color: var(--text-main);
}

.chat-feed {
  flex: 1;
  overflow-y: auto;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-right: 0.35rem;
}

.chat-feed::-webkit-scrollbar { width: 5px; }
.chat-feed::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); }
.chat-feed::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
.chat-feed::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

.chat-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(14, 18, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.75rem;
  animation: fadeIn 0.25s cubic-bezier(0, 0, 0.2, 1);
  transition: var(--transition);
}

.chat-item:hover {
  background: rgba(20, 26, 42, 0.85);
  border-color: rgba(255, 255, 255, 0.12);
}

.chat-item.gift-item {
  background: linear-gradient(135deg, rgba(255, 190, 11, 0.1), rgba(254, 44, 85, 0.1));
  border-color: rgba(255, 190, 11, 0.3);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e2640;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-content {
  flex: 1;
  min-width: 0;
}

.chat-user-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
  flex-wrap: wrap;
}

.chat-username {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--secondary);
}

.chat-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-weight: 600;
}

.chat-badge.follower {
  background: rgba(37, 244, 238, 0.15);
  color: var(--secondary);
}

.chat-badge.gift-badge {
  background: rgba(255, 190, 11, 0.2);
  color: var(--accent-gold);
}

.chat-time {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: auto;
}

.chat-message {
  font-size: 0.86rem;
  color: var(--text-main);
  word-break: break-word;
  line-height: 1.35;
}

.gift-text {
  font-weight: 600;
  color: var(--accent-gold);
}

.chat-actions {
  display: flex;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.chat-item:hover .chat-actions {
  opacity: 1;
}

.btn-icon-sm {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-main);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-sm:hover {
  background: var(--primary);
  color: #fff;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  gap: 0.75rem;
}

.empty-icon {
  font-size: 2.5rem;
  opacity: 0.6;
}

.empty-state p {
  font-size: 0.88rem;
  max-width: 320px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 0.75rem 0 0.25rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Security Authentication Modal / Lock Screen */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 12, 0.88);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.auth-card {
  background: rgba(16, 21, 36, 0.95);
  border: 1px solid rgba(37, 244, 238, 0.3);
  box-shadow: 0 0 50px rgba(37, 244, 238, 0.15), 0 20px 40px rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 2.25rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.auth-icon-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-icon-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--secondary-glow), transparent 70%);
  animation: pulseGlow 2s infinite alternate;
}

.auth-icon-inner {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, rgba(37, 244, 238, 0.2), rgba(254, 44, 85, 0.2));
  border: 2px solid var(--secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  box-shadow: 0 0 20px var(--secondary-glow);
}

.auth-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: -0.35rem;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  margin-top: 0.5rem;
}

.auth-input-group {
  position: relative;
  width: 100%;
}

.auth-input-group input {
  padding-right: 42px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  font-size: 0.9rem;
}

.btn-toggle-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.btn-toggle-eye:hover {
  opacity: 1;
}

.auth-footer-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.auth-footer-hint code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.07);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  color: var(--secondary);
}

.shake-animation {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

