:root {
  --cyan: #00e5ff;
  --amber: #ffab40;
  --green: #69ff47;
  --bg: #050d14;
  --bg2: #0a1929;
  --text: #b0bec5;
  --text-dim: #546e7a;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Courier New', monospace;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 520px;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Header */
.title {
  font-size: 2.2rem;
  letter-spacing: 0.5em;
  color: var(--cyan);
  text-shadow: 0 0 20px var(--cyan), 0 0 40px rgba(0,229,255,0.3);
}
.subtitle {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 0.3rem;
}

/* Visualizer */
.visualizer-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#visualizer {
  position: absolute;
  top: 0; left: 0;
  width: 280px; height: 280px;
}

.status-ring {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 15px var(--cyan), inset 0 0 15px rgba(0,229,255,0.1);
  transition: border-color 0.4s, box-shadow 0.4s;
}

.status-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan), 0 0 24px var(--cyan);
  transition: background 0.4s, box-shadow 0.4s;
  animation: pulse 2s ease-in-out infinite;
}

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

/* States */
body.state-listening .status-ring {
  border-color: var(--cyan);
  box-shadow: 0 0 15px var(--cyan), inset 0 0 15px rgba(0,229,255,0.1);
}
body.state-listening .status-dot {
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan), 0 0 24px var(--cyan);
}

body.state-processing .status-ring {
  border-color: var(--amber);
  box-shadow: 0 0 15px var(--amber), inset 0 0 15px rgba(255,171,64,0.1);
}
body.state-processing .status-dot {
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber), 0 0 24px var(--amber);
  animation: spin-pulse 0.8s linear infinite;
}

body.state-speaking .status-ring {
  border-color: var(--green);
  box-shadow: 0 0 15px var(--green), inset 0 0 15px rgba(105,255,71,0.1);
}
body.state-speaking .status-dot {
  background: var(--green);
  box-shadow: 0 0 12px var(--green), 0 0 24px var(--green);
}

@keyframes spin-pulse {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.3); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Status label */
.status-label {
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan);
  transition: color 0.4s, text-shadow 0.4s;
}
body.state-processing .status-label {
  color: var(--amber);
  text-shadow: 0 0 10px var(--amber);
}
body.state-speaking .status-label {
  color: var(--green);
  text-shadow: 0 0 10px var(--green);
}

/* Transcript */
.transcript-area {
  width: 100%;
  background: var(--bg2);
  border: 1px solid #1e3a4a;
  border-radius: 8px;
  padding: 1rem;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.transcript-row, .response-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.transcript-prefix {
  color: var(--text-dim);
  white-space: nowrap;
  font-size: 0.7rem;
  padding-top: 0.1rem;
}

.response-prefix {
  color: var(--cyan);
  white-space: nowrap;
  font-size: 0.7rem;
  padding-top: 0.1rem;
}

/* Controls */
.btn-reset {
  background: transparent;
  border: 1px solid var(--text-dim);
  color: var(--text-dim);
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-reset:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Error */
.error-msg {
  color: #ff5252;
  font-size: 0.8rem;
  text-align: center;
  background: rgba(255,82,82,0.1);
  border: 1px solid rgba(255,82,82,0.3);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  width: 100%;
}
