:root {
  --bg-primary: #0a0b10;
  --bg-card: rgba(18, 20, 32, 0.85);
  --border-neon: rgba(139, 92, 246, 0.3);
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-red: #ef4444;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.08) 0%, transparent 60%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.arena-container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

/* Header */
.arena-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  font-size: 28px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.4);
}

.title-wrap h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title-wrap p {
  font-size: 13px;
  color: var(--text-muted);
}

.streamer-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Audio Activator Overlay / Banner */
.audio-banner {
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid var(--accent-pink);
  border-radius: 16px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s ease;
}

.audio-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.3);
}

.audio-btn {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

/* Main Visualizer Stage */
.stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.stage-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
}

.visualizer-container {
  width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.wave-bar {
  width: 8px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(to top, var(--accent-cyan), var(--accent-purple));
  transition: height 0.15s ease;
}

.speaking .wave-bar {
  animation: wave-anim 0.8s ease-in-out infinite alternate;
}

@keyframes wave-anim {
  0% { height: 10px; opacity: 0.4; }
  100% { height: 75px; opacity: 1; }
}

/* Dynamic delays for waveform */
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.25s; }
.wave-bar:nth-child(4) { animation-delay: 0.4s; }
.wave-bar:nth-child(5) { animation-delay: 0.15s; }
.wave-bar:nth-child(6) { animation-delay: 0.3s; }
.wave-bar:nth-child(7) { animation-delay: 0.5s; }
.wave-bar:nth-child(8) { animation-delay: 0.2s; }
.wave-bar:nth-child(9) { animation-delay: 0.35s; }
.wave-bar:nth-child(10) { animation-delay: 0.05s; }
.wave-bar:nth-child(11) { animation-delay: 0.45s; }
.wave-bar:nth-child(12) { animation-delay: 0.25s; }

/* Current Speech Display */
.speech-display {
  text-align: center;
  max-width: 850px;
  width: 100%;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.category-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.current-phrase {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 450px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.audio-controls label {
  font-size: 13px;
  color: var(--text-muted);
}

.audio-controls input[type="range"] {
  flex: 1;
  accent-color: var(--accent-pink);
  cursor: pointer;
}

/* History Feed */
.history-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(25, 28, 44, 0.9);
}

.history-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.history-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.history-time {
  font-size: 12px;
  color: var(--text-muted);
}

/* Test Button */
.test-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s;
}

.test-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
