:root {
  --bg: #0b0d12;
  --card-bg: #12151c;
  --border: #232735;
  --text: #e7e9ee;
  --text-dim: #8a90a2;
  --accent: #6c8cff;
  --accent-soft: rgba(108, 140, 255, 0.18);
  --green: #35d68b;
  --amber: #ffb547;
  --red: #ff5c6c;
  --grey: #3a3f4d;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 0%, #171b26 0%, var(--bg) 55%);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mic-emoji {
  font-size: 22px;
}

.header h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.2px;
}

.orb-wrapper {
  padding: 18px 0 4px;
}

.orb {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, #1c2130, #0e1017);
  border: 1px solid var(--border);
  position: relative;
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.orb-core {
  width: 46%;
  height: 46%;
  border-radius: 50%;
  background: var(--grey);
  transition: background 0.35s ease, transform 0.35s ease;
}

.orb.state-listening {
  border-color: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft), 0 0 40px var(--accent-soft);
  animation: pulse-listen 1.8s ease-in-out infinite;
}
.orb.state-listening .orb-core {
  background: var(--accent);
}

.orb.state-thinking {
  border-color: var(--amber);
  animation: spin 1.1s linear infinite;
}
.orb.state-thinking .orb-core {
  background: var(--amber);
  transform: scale(0.7);
}

.orb.state-speaking {
  border-color: var(--green);
  animation: pulse-speak 0.85s ease-in-out infinite;
}
.orb.state-speaking .orb-core {
  background: var(--green);
}

.orb.state-disconnected .orb-core {
  background: var(--grey);
}

@keyframes pulse-listen {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes pulse-speak {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

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

.status-block {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 15px;
}

.status-label {
  color: var(--text-dim);
}

.status-text {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.main-button {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #0b0d12;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.05s ease;
}

.main-button:hover {
  filter: brightness(1.08);
}

.main-button:active {
  transform: scale(0.985);
}

.main-button.connecting {
  background: var(--amber);
  cursor: progress;
}

.main-button.connected {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
}

.main-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.meta-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

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

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grey);
  flex-shrink: 0;
  transition: background 0.25s ease;
}

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

.dot.warn {
  background: var(--amber);
}

.dot.err {
  background: var(--red);
}

.error-box {
  width: 100%;
  font-size: 13px;
  color: var(--red);
  background: rgba(255, 92, 108, 0.1);
  border: 1px solid rgba(255, 92, 108, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}

.hidden {
  display: none;
}
