:root {
  --bg: #05080d;
  --cyan: #4de2ff;
  --cyan-dim: #1a4a5c;
  --orange: #ff8a3d;
  --text: #d8f4ff;
  --text-dim: #6b8a99;
  --panel: rgba(20, 35, 45, 0.55);
  --border: rgba(77, 226, 255, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(ellipse at center, #0a1620 0%, #05080d 70%);
  color: var(--text);
  font-family: "Segoe UI", "Consolas", monospace;
  overflow: hidden;
}

.hud {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.25rem;
  gap: 1rem;
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hud-header h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(77, 226, 255, 0.6);
}

.hud-header h1 span {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.9rem;
}

.status-pill {
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  border: 1px solid currentColor;
}

.status-idle { color: var(--text-dim); }
.status-listening { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }
.status-processing { color: var(--orange); text-shadow: 0 0 8px var(--orange); }
.status-speaking { color: #7dffb0; text-shadow: 0 0 8px #7dffb0; }

.hud-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 0;
}

.reactor-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.reactor {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--cyan-dim);
}

.ring-outer {
  width: 200px;
  height: 200px;
  border-color: var(--cyan);
  opacity: 0.5;
  animation: spin 12s linear infinite;
}

.ring-mid {
  width: 140px;
  height: 140px;
  border-color: var(--cyan);
  opacity: 0.35;
  animation: spin 8s linear infinite reverse;
}

.core {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, #eafcff 0%, var(--cyan) 45%, transparent 75%);
  box-shadow: 0 0 30px 10px rgba(77, 226, 255, 0.55);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
}

.reactor.state-listening .core {
  background: radial-gradient(circle, #eafcff 0%, var(--cyan) 40%, transparent 75%);
  animation: pulse 0.9s ease-in-out infinite;
}
.reactor.state-listening .ring-outer,
.reactor.state-listening .ring-mid { animation-duration: 3s, 2s; border-color: var(--cyan); }

.reactor.state-processing .core {
  background: radial-gradient(circle, #fff2e0 0%, var(--orange) 40%, transparent 75%);
  box-shadow: 0 0 30px 10px rgba(255, 138, 61, 0.55);
  animation: pulse 0.6s ease-in-out infinite;
}
.reactor.state-processing .ring-outer,
.reactor.state-processing .ring-mid { border-color: var(--orange); }

.reactor.state-speaking .core {
  background: radial-gradient(circle, #e3fff0 0%, #7dffb0 40%, transparent 75%);
  box-shadow: 0 0 30px 10px rgba(125, 255, 176, 0.55);
  animation: pulse 1.2s ease-in-out infinite;
}
.reactor.state-speaking .ring-outer,
.reactor.state-speaking .ring-mid { border-color: #7dffb0; }

.transcript-wrap {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.transcript-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  backdrop-filter: blur(6px);
}

.transcript-box.michu {
  border-color: rgba(255, 138, 61, 0.3);
}

.transcript-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.transcript-text {
  margin: 0;
  min-height: 1.4em;
  line-height: 1.5;
  font-size: 0.95rem;
}

.hud-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.talk-btn {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan);
  padding: 0.7rem 1.8rem;
  border-radius: 999px;
  font-family: inherit;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.talk-btn:hover { background: rgba(77, 226, 255, 0.12); box-shadow: 0 0 14px rgba(77, 226, 255, 0.4); }
.talk-btn.active { background: rgba(77, 226, 255, 0.2); box-shadow: 0 0 20px rgba(77, 226, 255, 0.6); }
.talk-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.talk-icon { color: #ff5050; }
.talk-btn.active .talk-icon { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
}
.health-dot.ok { background: #7dffb0; box-shadow: 0 0 8px #7dffb0; }
.health-dot.bad { background: #ff5050; box-shadow: 0 0 8px #ff5050; }

@media (max-width: 480px) {
  .reactor, .ring-outer { width: 150px; height: 150px; }
  .ring-mid { width: 105px; height: 105px; }
  .hud-header h1 { font-size: 1.1rem; }
}
