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

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --border: #1e1e2e;
  --text: #e0e0e0;
  --text-dim: #666;
  --accent: #6c63ff;
  --accent-glow: rgba(108, 99, 255, 0.3);
  --user-msg: #1a1a2e;
  --ai-msg: #0d1117;
  --green: #22c55e;
  --red: #ef4444;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* --- Header --- */

.header {
  width: 100%;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.header h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  transition: background 0.3s;
}

.status-dot.connected {
  background: var(--green);
}

/* --- Transcript --- */

.transcript-area {
  flex: 1;
  width: 100%;
  max-width: 640px;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 85%;
  animation: fadeIn 0.2s ease;
}

.message.user {
  background: var(--user-msg);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message.assistant {
  background: var(--ai-msg);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.message.user .message-label {
  color: var(--accent);
}

.message-text {
  font-size: 14px;
  line-height: 1.5;
}

/* --- Controls --- */

.controls {
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.mic-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 32px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.mic-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Listening state — pulsing ring */
.mic-btn.listening {
  border-color: var(--green);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

/* Thinking state — spinning border */
.mic-btn.thinking {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

/* Speaking state — glow */
.mic-btn.speaking {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(108, 99, 255, 0.15);
  animation: glow 1s ease-in-out infinite alternate;
}

.state-label {
  font-size: 13px;
  color: var(--text-dim);
  min-height: 20px;
}

/* --- Animations --- */

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 0 40px rgba(34, 197, 94, 0.5); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes glow {
  from { box-shadow: 0 0 20px var(--accent-glow); }
  to { box-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(108, 99, 255, 0.15); }
}

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

/* --- Scrollbar --- */

.transcript-area::-webkit-scrollbar {
  width: 4px;
}

.transcript-area::-webkit-scrollbar-track {
  background: transparent;
}

.transcript-area::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* --- Responsive --- */

@media (max-width: 480px) {
  .transcript-area {
    padding: 16px;
  }

  .mic-btn {
    width: 72px;
    height: 72px;
    font-size: 28px;
  }

  .controls {
    padding: 24px 16px 36px;
  }
}
