/* ============================================================
   Hieu-Jarvis — Dark Sci-Fi Arc Reactor Theme
   ============================================================ */

:root {
  --bg-black: #0a0a0a;
  --neon-cyan: #00e5ff;
  --neon-gold: #ffcc33;
  --neon-red: #ff3b3b;
  --text-dim: #7c8b93;
  --text-bright: #e8f6ff;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-black);
  color: var(--text-bright);
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ---------- HUD ---------- */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top));
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  z-index: 10;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-label {
  color: var(--text-dim);
  margin-right: 2px;
}

#latencyText, #charsLeftText, #connText {
  color: var(--neon-cyan);
  font-variant-numeric: tabular-nums;
}

.hud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-red);
  box-shadow: 0 0 6px var(--neon-red);
  transition: all 0.3s ease;
}

.hud-dot.connected {
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
}

/* ---------- Reactor Stage (trung tâm) ---------- */
.reactor-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#reactorCanvas {
  width: min(70vw, 340px);
  height: min(70vw, 340px);
  z-index: 2;
  transition: filter 0.25s ease;
}

.reactor-glow {
  position: absolute;
  width: min(70vw, 340px);
  height: min(70vw, 340px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.35) 0%, rgba(0, 229, 255, 0) 70%);
  filter: blur(20px);
  z-index: 1;
  transition: background 0.4s ease, transform 0.15s ease;
  pointer-events: none;
}

.reactor-glow.listening {
  background: radial-gradient(circle, rgba(0, 229, 255, 0.55) 0%, rgba(0, 229, 255, 0) 70%);
}

.reactor-glow.speaking {
  background: radial-gradient(circle, rgba(255, 204, 51, 0.55) 0%, rgba(255, 204, 51, 0) 70%);
}

.reactor-glow.idle {
  background: radial-gradient(circle, rgba(124, 139, 147, 0.25) 0%, rgba(124, 139, 147, 0) 70%);
}

.status-label {
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  z-index: 3;
  white-space: nowrap;
}

/* ---------- Transcript ---------- */
.transcript-bar {
  padding: 12px 22px 100px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  z-index: 10;
}

.transcript-line {
  font-size: 15px;
  color: var(--text-bright);
  opacity: 0.9;
  min-height: 20px;
}

.transcript-line.bot {
  color: var(--neon-gold);
  font-weight: 500;
}

/* ---------- Start Button ---------- */
.start-btn {
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.4);
  background: rgba(0, 229, 255, 0.08);
  color: var(--neon-cyan);
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
  z-index: 20;
}

.start-btn:active {
  transform: translateX(-50%) scale(0.96);
}

.start-btn.active {
  border-color: rgba(255, 59, 59, 0.5);
  background: rgba(255, 59, 59, 0.1);
  color: var(--neon-red);
}
